diff --git a/.buildkite/ftr_oblt_serverless_configs.yml b/.buildkite/ftr_oblt_serverless_configs.yml index 8fe505ff0e93e..e49655999ec59 100644 --- a/.buildkite/ftr_oblt_serverless_configs.yml +++ b/.buildkite/ftr_oblt_serverless_configs.yml @@ -27,4 +27,4 @@ enabled: - x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts - x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts # serverless config files that run deployment-agnostic tests - - x-pack/test/api_integration/deployment_agnostic/oblt.serverless.config.ts + - x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts diff --git a/.buildkite/ftr_oblt_stateful_configs.yml b/.buildkite/ftr_oblt_stateful_configs.yml index 55f3c1b603fca..1d6d834b74279 100644 --- a/.buildkite/ftr_oblt_stateful_configs.yml +++ b/.buildkite/ftr_oblt_stateful_configs.yml @@ -25,6 +25,7 @@ defaultQueue: 'n2-4-spot' enabled: - x-pack/test/alerting_api_integration/observability/config.ts - x-pack/test/api_integration/apis/logs_ui/config.ts + - x-pack/test/api_integration/apis/logs_shared/config.ts - x-pack/test/api_integration/apis/metrics_ui/config.ts - x-pack/test/api_integration/apis/osquery/config.ts - x-pack/test/api_integration/apis/synthetics/config.ts @@ -49,3 +50,5 @@ enabled: - x-pack/test/observability_ai_assistant_functional/enterprise/config.ts - x-pack/test/profiling_api_integration/cloud/config.ts - x-pack/test/functional/apps/apm/config.ts + # stateful configs that run deployment-agnostic tests + - x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts diff --git a/.buildkite/ftr_platform_stateful_configs.yml b/.buildkite/ftr_platform_stateful_configs.yml index a984afc263170..fc46fa24f257f 100644 --- a/.buildkite/ftr_platform_stateful_configs.yml +++ b/.buildkite/ftr_platform_stateful_configs.yml @@ -272,6 +272,7 @@ enabled: - x-pack/test/functional/config.firefox.js - x-pack/test/functional/config.upgrade_assistant.ts - x-pack/test/functional_cloud/config.ts + - x-pack/test/functional_solution_sidenav/config.ts - x-pack/test/kubernetes_security/basic/config.ts - x-pack/test/licensing_plugin/config.public.ts - x-pack/test/licensing_plugin/config.ts @@ -361,4 +362,4 @@ enabled: - x-pack/performance/journeys_e2e/infra_hosts_view.ts - x-pack/test/custom_branding/config.ts # stateful config files that run deployment-agnostic tests - - x-pack/test/api_integration/deployment_agnostic/stateful.config.ts + - x-pack/test/api_integration/deployment_agnostic/configs/stateful/platform.stateful.config.ts diff --git a/.buildkite/ftr_search_serverless_configs.yml b/.buildkite/ftr_search_serverless_configs.yml index 9a5ce6798dbae..7112888f1afce 100644 --- a/.buildkite/ftr_search_serverless_configs.yml +++ b/.buildkite/ftr_search_serverless_configs.yml @@ -17,4 +17,4 @@ enabled: - x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts - x-pack/test_serverless/functional/test_suites/search/common_configs/config.group6.ts # serverless config files that run deployment-agnostic tests - - x-pack/test/api_integration/deployment_agnostic/search.serverless.config.ts + - x-pack/test/api_integration/deployment_agnostic/configs/serverless/search.serverless.config.ts diff --git a/.buildkite/ftr_security_serverless_configs.yml b/.buildkite/ftr_security_serverless_configs.yml index 4c3b037ce9f8a..cf1b374e68c60 100644 --- a/.buildkite/ftr_security_serverless_configs.yml +++ b/.buildkite/ftr_security_serverless_configs.yml @@ -35,6 +35,7 @@ enabled: - x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.basic.ts - x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.essentials.ts - x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.agentless.ts + - x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.agentless_api.ts - x-pack/test_serverless/functional/test_suites/security/config.saved_objects_management.ts - x-pack/test_serverless/functional/test_suites/security/config.context_awareness.ts - x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts @@ -64,6 +65,7 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts + - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/basic_license_essentials_tier/configs/serverless.config.ts @@ -98,4 +100,4 @@ enabled: - x-pack/test/security_solution_endpoint/configs/serverless.endpoint.config.ts - x-pack/test/security_solution_endpoint/configs/serverless.integrations.config.ts # serverless config files that run deployment-agnostic tests - - x-pack/test/api_integration/deployment_agnostic/security.serverless.config.ts + - x-pack/test/api_integration/deployment_agnostic/configs/serverless/security.serverless.config.ts diff --git a/.buildkite/ftr_security_stateful_configs.yml b/.buildkite/ftr_security_stateful_configs.yml index 148d78583a613..a72f5287d189b 100644 --- a/.buildkite/ftr_security_stateful_configs.yml +++ b/.buildkite/ftr_security_stateful_configs.yml @@ -47,6 +47,7 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts + - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/basic_license_essentials_tier/configs/ess.config.ts diff --git a/.buildkite/package-lock.json b/.buildkite/package-lock.json index 437e56299cb6c..8d10b3c2b7bc1 100644 --- a/.buildkite/package-lock.json +++ b/.buildkite/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@octokit/rest": "^18.10.0", - "axios": "^1.6.3", + "axios": "^1.7.4", "globby": "^11.1.0", "js-yaml": "^4.1.0", "minimatch": "^5.0.1", @@ -351,11 +351,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1011,11 +1011,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -1946,11 +1946,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "requires": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -2416,11 +2416,11 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, diff --git a/.buildkite/package.json b/.buildkite/package.json index efd66f1c17a09..158a55c777e6a 100644 --- a/.buildkite/package.json +++ b/.buildkite/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@octokit/rest": "^18.10.0", - "axios": "^1.6.3", + "axios": "^1.7.4", "globby": "^11.1.0", "js-yaml": "^4.1.0", "minimatch": "^5.0.1", diff --git a/.buildkite/pipeline-resource-definitions/kibana-codeql.yml b/.buildkite/pipeline-resource-definitions/kibana-codeql.yml new file mode 100644 index 0000000000000..3da2c9137c4e0 --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/kibana-codeql.yml @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: bk-kibana-codeql + description: Run CodeQL + links: + - title: Pipeline link + url: https://buildkite.com/elastic/kibana-codeql +spec: + type: buildkite-pipeline + owner: group:kibana-operations + system: buildkite + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana / codeql + description: Run CodeQL + spec: + env: + SLACK_NOTIFICATIONS_CHANNEL: "#kibana-operations-alerts" + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "false" + repository: elastic/kibana + branch_configuration: main + default_branch: main + pipeline_file: ".buildkite/pipelines/codeql/codeql.yml" + provider_settings: + trigger_mode: none + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY diff --git a/.buildkite/pipeline-resource-definitions/locations.yml b/.buildkite/pipeline-resource-definitions/locations.yml index 45a155d21280e..5144982a0627d 100644 --- a/.buildkite/pipeline-resource-definitions/locations.yml +++ b/.buildkite/pipeline-resource-definitions/locations.yml @@ -44,3 +44,4 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-pointer-compression.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-codeql.yml diff --git a/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts b/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts index 1173cddeb15aa..8080c8f7d1d70 100755 --- a/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts +++ b/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts @@ -36,6 +36,7 @@ async function main() { const preamble = locationFileLines.slice(0, 1); + // eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml const locationObj = jsYaml.load( locationFileLines.slice(1).join('\n') ) as BackstageLocationResource; @@ -43,6 +44,7 @@ async function main() { (fileName) => `${resourceDefinitionsBaseUrl}/${fileName}` ); + // eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml const locationYaml = jsYaml.dump(locationObj, { lineWidth: 400 }); fs.writeFileSync(locationFile, `${preamble.join('\n')}\n${locationYaml}`); diff --git a/.buildkite/pipeline-utils/agent_images.ts b/.buildkite/pipeline-utils/agent_images.ts index d139f7953e00f..85aa4bd6fb33c 100644 --- a/.buildkite/pipeline-utils/agent_images.ts +++ b/.buildkite/pipeline-utils/agent_images.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml import { dump } from 'js-yaml'; import { BuildkiteClient, BuildkiteCommandStep } from './buildkite'; diff --git a/.buildkite/pipeline-utils/buildkite/client.test.ts b/.buildkite/pipeline-utils/buildkite/client.test.ts index ef70a0b3a4620..97b14815f6937 100644 --- a/.buildkite/pipeline-utils/buildkite/client.test.ts +++ b/.buildkite/pipeline-utils/buildkite/client.test.ts @@ -24,9 +24,7 @@ describe('BuildkiteClient', () => { id: 'id-1', retried_in_job_id: 'id-2', state: 'failed', - agent: { - meta_data: ['spot=true'], - }, + agent_query_rules: ['preemptible=true'], retried: true, exit_status: -1, type: 'script', @@ -35,9 +33,7 @@ describe('BuildkiteClient', () => { const retry: Job = { id: 'id-2', state: 'passed', - agent: { - meta_data: ['spot=true'], - }, + agent_query_rules: ['preemptible=true'], type: 'script', } as Job; @@ -58,9 +54,7 @@ describe('BuildkiteClient', () => { id: 'id-1', retried_in_job_id: 'id-2', state: 'failed', - agent: { - meta_data: ['spot=true'], - }, + agent_query_rules: ['preemptible=true'], retried: true, exit_status: 1, type: 'script', @@ -69,9 +63,7 @@ describe('BuildkiteClient', () => { const retry: Job = { id: 'id-2', state: 'passed', - agent: { - meta_data: ['spot=true'], - }, + agent_query_rules: ['preemptible=true'], type: 'script', } as Job; diff --git a/.buildkite/pipeline-utils/buildkite/client.ts b/.buildkite/pipeline-utils/buildkite/client.ts index c58c3cb7e42e3..45f09817dba8e 100644 --- a/.buildkite/pipeline-utils/buildkite/client.ts +++ b/.buildkite/pipeline-utils/buildkite/client.ts @@ -8,7 +8,10 @@ import axios, { AxiosInstance } from 'axios'; import { execSync, ExecSyncOptions } from 'child_process'; + +// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml import { dump } from 'js-yaml'; + import { parseLinkHeader } from './parse_link_header'; import { Artifact } from './types/artifact'; import { Build, BuildStatus } from './types/build'; @@ -282,7 +285,7 @@ export class BuildkiteClient { hasRetries = true; const isPreemptionFailure = job.state === 'failed' && - job.agent?.meta_data?.some((el) => ['spot=true', 'gcp:preemptible=true'].includes(el)) && + job.agent_query_rules?.includes('preemptible=true') && job.exit_status === -1; if (!isPreemptionFailure) { diff --git a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts index af77cd3138c46..5aa5655014dab 100644 --- a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts +++ b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts @@ -10,6 +10,8 @@ import * as Fs from 'fs'; import * as globby from 'globby'; import minimatch from 'minimatch'; + +// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml import { load as loadYaml } from 'js-yaml'; import { BuildkiteClient, BuildkiteStep } from '../buildkite'; diff --git a/.buildkite/pipelines/codeql/codeql.yml b/.buildkite/pipelines/codeql/codeql.yml new file mode 100644 index 0000000000000..52fc4f910713a --- /dev/null +++ b/.buildkite/pipelines/codeql/codeql.yml @@ -0,0 +1,2 @@ +steps: + - command: echo "Placeholder" diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index 4eb15c16970ef..e37e99c9c4df1 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -37,7 +37,7 @@ steps: image: family/kibana-ubuntu-2004 imageProject: elastic-images-prod provider: gcp - machineType: n2-standard-2 + machineType: n2-highcpu-8 preemptible: true key: quick_checks timeout_in_minutes: 60 @@ -589,6 +589,11 @@ steps: preemptible: true artifact_paths: "target/plugin_so_types_snapshot.json" + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '-1' + limit: 3 - wait: ~ continue_on_failure: true diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index e5da8ce788e5b..2f2e0a739a304 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -23,7 +23,7 @@ steps: - command: .buildkite/scripts/steps/quick_checks.sh label: 'Quick Checks' agents: - machineType: n2-standard-2 + machineType: n2-highcpu-8 preemptible: true key: quick_checks timeout_in_minutes: 60 diff --git a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml index 96ef648a352df..3d9363279507f 100644 --- a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml +++ b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml @@ -14,13 +14,13 @@ steps: RETRY_TESTS_ON_FAIL: "true" message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" - # TODO: Uncomment this code when the integration is ready. - # - label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script" - # trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate - # build: - # env: - # ENVIRONMENT: ${ENVIRONMENT} - # message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" + - label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script" + trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate + soft_fail: true + build: + env: + ENVIRONMENT: ${ENVIRONMENT} + message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" - label: ":ship: Fleet serverless smoke tests for ${ENVIRONMENT}" trigger: fleet-smoke-tests # https://buildkite.com/elastic/fleet-smoke-tests diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml index b9ff060e706e7..72af06600ada7 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml @@ -2,7 +2,7 @@ steps: - group: "Cypress MKI - Defend Workflows" key: cypress_test_defend_workflows steps: - - label: "Running cypress:dw:qa:serverless:run" + - label: "Cypress - DW - Running cypress:dw:qa:serverless:run" command: .buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh cypress:dw:qa:serverless:run key: test_defend_workflows agents: @@ -14,7 +14,7 @@ steps: localSsdInterface: nvme machineType: n2-standard-4 timeout_in_minutes: 300 - parallelism: 6 + parallelism: 5 retry: automatic: - exit_status: "*" @@ -91,7 +91,7 @@ steps: # - exit_status: "1" # limit: 1 - - label: "Running edr_workflows:policy_response:qa:serverless" + - label: "API - DW - Running edr_workflows:policy_response:qa:serverless" command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh edr_workflows:policy_response:qa:serverless key: edr_workflows:policy_response:qa:serverless agents: @@ -108,7 +108,7 @@ steps: - exit_status: "1" limit: 1 - - label: "Running edr_workflows:resolver:qa:serverless" + - label: "API - DW - Running edr_workflows:resolver:qa:serverless" command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh edr_workflows:resolver:qa:serverless key: edr_workflows:resolver:qa:serverless agents: @@ -125,7 +125,7 @@ steps: - exit_status: "1" limit: 1 - - label: "Running edr_workflows:response_actions:qa:serverless" + - label: "API - DW - Running edr_workflows:response_actions:qa:serverless" command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh edr_workflows:response_actions:qa:serverless key: edr_workflows:response_actions:qa:serverless agents: @@ -141,3 +141,24 @@ steps: automatic: - exit_status: "1" limit: 1 + + - group: "Osquery MKI - Defend Workflows" + key: cypress_test_osquery_defend_workflows + steps: + - label: "Osquery - Cypress - DW - Running cypress:qa:serverless:run" + command: .buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows_osquery.sh cypress:qa:serverless:run + key: test_osquery_defend_workflows + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + enableNestedVirtualization: true + localSsds: 1 + localSsdInterface: nvme + machineType: n2-standard-4 + timeout_in_minutes: 300 + parallelism: 3 + retry: + automatic: + - exit_status: "*" + limit: 1 diff --git a/.buildkite/scripts/common/util.sh b/.buildkite/scripts/common/util.sh index d50fafad6967b..dce418180c107 100755 --- a/.buildkite/scripts/common/util.sh +++ b/.buildkite/scripts/common/util.sh @@ -12,7 +12,7 @@ is_pr_with_label() { IFS=',' read -ra labels <<< "${GITHUB_PR_LABELS:-}" - for label in "${labels[@]}" + for label in "${labels[@]:-}" do if [ "$label" == "$match" ]; then return diff --git a/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows_osquery.sh b/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows_osquery.sh new file mode 100755 index 0000000000000..5dd9ef114b48d --- /dev/null +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows_osquery.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +if [ -z "$1" ] + then + echo "No target script from the package.json file, is supplied" + exit 1 +fi + + +source .buildkite/scripts/common/util.sh +.buildkite/scripts/bootstrap.sh + +export JOB=kibana-defend-workflows-osquery-serverless-cypress + +buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" + +source .buildkite/scripts/pipelines/security_solution_quality_gate/prepare_vault_entries.sh + +cd x-pack/plugins/osquery +set +e + +export BK_ANALYTICS_API_KEY=$(vault_get security-solution-quality-gate serverless-cypress-defend-workflows) + +echo "--- Running the tests for target $1" +BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY yarn $1; status=$?; yarn junit:merge || :; exit $status diff --git a/.buildkite/scripts/steps/artifacts/docker_image.sh b/.buildkite/scripts/steps/artifacts/docker_image.sh index 77790bf3d5a8a..a148bdb805f6f 100755 --- a/.buildkite/scripts/steps/artifacts/docker_image.sh +++ b/.buildkite/scripts/steps/artifacts/docker_image.sh @@ -118,6 +118,12 @@ echo "--- Trigger image tag update" if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]] && [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" ]]; then cat << EOF | buildkite-agent pipeline upload steps: + - label: "Trigger cve-slo-status pipeline for $KIBANA_IMAGE" + trigger: cve-slo-status + build: + env: + CONTAINER: "$KIBANA_IMAGE" + soft_fail: true - label: ":argo: Update kibana image tag for kibana-controller using gpctl" branches: main trigger: gpctl-promote-with-e2e-tests diff --git a/.buildkite/scripts/steps/capture_oas_snapshot.sh b/.buildkite/scripts/steps/capture_oas_snapshot.sh index 9768ff50c8fa5..fadd7276b47cc 100755 --- a/.buildkite/scripts/steps/capture_oas_snapshot.sh +++ b/.buildkite/scripts/steps/capture_oas_snapshot.sh @@ -5,7 +5,7 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Capture OAS snapshot -cmd="node scripts/capture_oas_snapshot --include-path /api/status" +cmd="node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules" if is_pr && ! is_auto_commit_disabled; then cmd="$cmd --update" fi diff --git a/.buildkite/scripts/steps/checks/event_log.sh b/.buildkite/scripts/steps/checks/event_log.sh index dc9c01902c010..930908bb2d0ec 100755 --- a/.buildkite/scripts/steps/checks/event_log.sh +++ b/.buildkite/scripts/steps/checks/event_log.sh @@ -8,7 +8,25 @@ echo --- Check Event Log Schema # event log schema is pinned to a specific version of ECS ECS_STABLE_VERSION=1.8 -git clone --depth 1 -b $ECS_STABLE_VERSION https://github.com/elastic/ecs.git ../ecs + +# we can potentially skip this check on a local env, if ../ecs is present, and modified by the developer +if [[ "${CI:-false}" =~ ^(0|false)$ ]] && [[ -d '../ecs' ]]; then + LOCAL_ECS_BRANCH=$(git -C ../ecs branch --show-current) + if [[ "$LOCAL_ECS_BRANCH" != "$ECS_STABLE_VERSION" ]]; then + echo "Skipping event log schema check because ECS schema is not on $ECS_STABLE_VERSION." + exit 0 + fi + + TOUCHED_FILES=$(git -C ../ecs status --porcelain) + if [[ -n "$TOUCHED_FILES" ]]; then + echo "Skipping event log schema check because ECS schema files have been modified." + exit 0 + fi + + echo "../ecs is already cloned and @ $ECS_STABLE_VERSION" +else + git clone --depth 1 -b $ECS_STABLE_VERSION https://github.com/elastic/ecs.git ../ecs +fi node x-pack/plugins/event_log/scripts/create_schemas.js diff --git a/.buildkite/scripts/steps/checks/native_modules.sh b/.buildkite/scripts/steps/checks/native_modules.sh new file mode 100755 index 0000000000000..e7f585de97d15 --- /dev/null +++ b/.buildkite/scripts/steps/checks/native_modules.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source .buildkite/scripts/common/util.sh + +echo --- Check Production Native Node Modules +node scripts/check_prod_native_modules diff --git a/.buildkite/scripts/steps/checks/quick_checks.txt b/.buildkite/scripts/steps/checks/quick_checks.txt new file mode 100644 index 0000000000000..e0196950b4a75 --- /dev/null +++ b/.buildkite/scripts/steps/checks/quick_checks.txt @@ -0,0 +1,20 @@ +.buildkite/scripts/steps/checks/precommit_hook.sh +.buildkite/scripts/steps/checks/ts_projects.sh +.buildkite/scripts/steps/checks/packages.sh +.buildkite/scripts/steps/checks/bazel_packages.sh +.buildkite/scripts/steps/checks/verify_notice.sh +.buildkite/scripts/steps/checks/plugin_list_docs.sh +.buildkite/scripts/steps/checks/event_log.sh +.buildkite/scripts/steps/checks/telemetry.sh +.buildkite/scripts/steps/checks/jest_configs.sh +.buildkite/scripts/steps/checks/bundle_limits.sh +.buildkite/scripts/steps/checks/i18n.sh +.buildkite/scripts/steps/checks/file_casing.sh +.buildkite/scripts/steps/checks/licenses.sh +.buildkite/scripts/steps/checks/test_projects.sh +.buildkite/scripts/steps/checks/test_hardening.sh +.buildkite/scripts/steps/checks/ftr_configs.sh +.buildkite/scripts/steps/checks/yarn_deduplicate.sh +.buildkite/scripts/steps/checks/prettier_topology.sh +.buildkite/scripts/steps/checks/renovate.sh +.buildkite/scripts/steps/checks/native_modules.sh diff --git a/.buildkite/scripts/steps/quick_checks.sh b/.buildkite/scripts/steps/quick_checks.sh index eb14209f97f5a..1b1613d42dc8d 100755 --- a/.buildkite/scripts/steps/quick_checks.sh +++ b/.buildkite/scripts/steps/quick_checks.sh @@ -2,25 +2,9 @@ set -euo pipefail -export DISABLE_BOOTSTRAP_VALIDATION=false -.buildkite/scripts/bootstrap.sh +if [[ "${CI:-}" =~ ^(1|true)$ ]]; then + export DISABLE_BOOTSTRAP_VALIDATION=false + .buildkite/scripts/bootstrap.sh +fi -.buildkite/scripts/steps/checks/precommit_hook.sh -.buildkite/scripts/steps/checks/ts_projects.sh -.buildkite/scripts/steps/checks/packages.sh -.buildkite/scripts/steps/checks/bazel_packages.sh -.buildkite/scripts/steps/checks/verify_notice.sh -.buildkite/scripts/steps/checks/plugin_list_docs.sh -.buildkite/scripts/steps/checks/event_log.sh -.buildkite/scripts/steps/checks/telemetry.sh -.buildkite/scripts/steps/checks/jest_configs.sh -.buildkite/scripts/steps/checks/bundle_limits.sh -.buildkite/scripts/steps/checks/i18n.sh -.buildkite/scripts/steps/checks/file_casing.sh -.buildkite/scripts/steps/checks/licenses.sh -.buildkite/scripts/steps/checks/test_projects.sh -.buildkite/scripts/steps/checks/test_hardening.sh -.buildkite/scripts/steps/checks/ftr_configs.sh -.buildkite/scripts/steps/checks/yarn_deduplicate.sh -.buildkite/scripts/steps/checks/prettier_topology.sh -.buildkite/scripts/steps/checks/renovate.sh +node scripts/quick_checks --file .buildkite/scripts/steps/checks/quick_checks.txt diff --git a/.devcontainer/.env.template b/.devcontainer/.env.template new file mode 100644 index 0000000000000..3ca02c49bfa9c --- /dev/null +++ b/.devcontainer/.env.template @@ -0,0 +1,4 @@ +# /bin/bash or /bin/zsh (oh-my-zsh is installed by default as well) +SHELL=/bin/bash +# Switch to 1 to enable FIPS environment, any other value to disable +FIPS=0 diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000..539e23a4a3a31 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,69 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 + +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 +ENV HOME=/home/vscode +ENV NVM_DIR=${HOME}/nvm +ENV NVM_VERSION=v0.39.1 +ENV KBN_DIR=/workspaces/kibana +ENV OPENSSL_PATH=${HOME}/openssl +# Only specific versions are FIPS certified. +ENV OPENSSL_VERSION='3.0.8' + +RUN apt-get update && apt-get install -y curl git zsh locales docker.io perl make gcc xvfb + +RUN locale-gen en_US.UTF-8 + +# Oh My Zsh setup +RUN if [ ! -d "$HOME/.oh-my-zsh" ]; then \ + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ + fi && \ + ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom} && \ + if [ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]; then \ + git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions; \ + fi && \ + sed -i 's/plugins=(git)/plugins=(git ssh-agent npm docker zsh-autosuggestions)/' /home/vscode/.zshrc + +# Docker-in-Docker setup +RUN usermod -aG docker vscode + +# FIPS setup +# https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md +# https://www.openssl.org/docs/man3.0/man7/fips_module.html +WORKDIR ${HOME} + +RUN set -e ; \ + mkdir -p "${OPENSSL_PATH}"; \ + curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" ; \ + curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz.sha256" ; \ + echo "$(cat openssl-${OPENSSL_VERSION}.tar.gz.sha256) openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c ; \ + tar -zxf "openssl-${OPENSSL_VERSION}.tar.gz" ; \ + rm -rf openssl-${OPENSSL_VERSION}.tar* ; \ + cd "${OPENSSL_PATH}-${OPENSSL_VERSION}" ; \ + ./Configure --prefix="${OPENSSL_PATH}" --openssldir="${OPENSSL_PATH}/ssl" --libdir="${OPENSSL_PATH}/lib" shared -Wl,-rpath,${OPENSSL_PATH}/lib enable-fips; \ + make -j $(nproc) > /dev/null ; \ + make install > /dev/null ; \ + rm -rf "${OPENSSL_PATH}-${OPENSSL_VERSION}" ; \ + chown -R 1000:1000 "${OPENSSL_PATH}"; + +WORKDIR ${KBN_DIR} + +# Node and NVM setup +COPY .node-version /tmp/ +RUN mkdir -p $NVM_DIR && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | bash && \ + . "$NVM_DIR/nvm.sh" && \ + NODE_VERSION=$(cat /tmp/.node-version) && \ + nvm install ${NODE_VERSION} && \ + nvm use ${NODE_VERSION} && \ + nvm alias default ${NODE_VERSION} && \ + npm install -g yarn && \ + echo "source $NVM_DIR/nvm.sh" >> ${HOME}/.bashrc && \ + echo "source $NVM_DIR/nvm.sh" >> ${HOME}/.zshrc && \ + chown -R 1000:1000 "${HOME}/.npm" + +# Reload the env everytime a new shell is opened incase the .env file changed. +RUN echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.bashrc && \ + echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.zshrc + +# This is for documentation. Ports are exposed via devcontainer.json +EXPOSE 9200 5601 9229 9230 9231 diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000000000..835ce0f756499 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1 @@ +See the [dev docs](https://github.com/elastic/kibana/blob/main/dev_docs/getting_started/setting_up_a_development_env.mdx#using-the-kibana-dev-container-optional) for information on using the Kibana Dev Container. \ No newline at end of file diff --git a/.devcontainer/config/nodejs.cnf b/.devcontainer/config/nodejs.cnf new file mode 100644 index 0000000000000..eef11d640e198 --- /dev/null +++ b/.devcontainer/config/nodejs.cnf @@ -0,0 +1,28 @@ +########################################################################## +## ## +## This OpenSSL config is only loaded when running Kibana in FIPS mode. ## +## ## +## See: ## +## https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md ## +## https://www.openssl.org/docs/man3.0/man7/fips_module.html ## +## ## +########################################################################## + +nodejs_conf = nodejs_init +.include /home/vscode/openssl/ssl/fipsmodule.cnf + +[nodejs_init] +providers = provider_sect +alg_section = algorithm_sect + +[provider_sect] +default = default_sect +# The fips section name should match the section name inside the +# included fipsmodule.cnf. +fips = fips_sect + +[default_sect] +activate = 1 + +[algorithm_sect] +default_properties = fips=yes \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..f5fea9e37c5d3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,41 @@ +{ + "name": "Kibana", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "ms-azuretools.vscode-docker", + "editorconfig.editorconfig", + "timonwong.shellcheck", + "eamodio.gitlens", + "github.vscode-pull-request-github" + ] + } + }, + "forwardPorts": [ + 9200, + 5601, + 9229, + 9230, + 9231 + ], + "postStartCommand": "/workspaces/kibana/.devcontainer/scripts/post_start.sh", + "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest", + "dockerDashComposeVersion": "latest" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/kreemer/features/chrometesting:1": { + "version": "stable" + } + } +} diff --git a/.devcontainer/scripts/env.sh b/.devcontainer/scripts/env.sh new file mode 100755 index 0000000000000..77c2000663e5f --- /dev/null +++ b/.devcontainer/scripts/env.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +ENV_PATH="${KBN_DIR}/.devcontainer/.env" +KBN_CONFIG_FILE="${KBN_DIR}/config/kibana.dev.yml" + +setup_fips() { + if [ ! -f "$KBN_CONFIG_FILE" ]; then + touch "$KBN_CONFIG_FILE" + fi + + if [ -n "$FIPS" ] && [ "$FIPS" = "1" ]; then + sed -i '/xpack.security.experimental.fipsMode.enabled:/ {s/.*/xpack.security.experimental.fipsMode.enabled: true/; t}; $a\xpack.security.experimental.fipsMode.enabled: true' "$KBN_CONFIG_FILE" + + # Patch node_modules so we can start Kibana in dev mode + sed -i 's/hashType = hashType || '\''md5'\'';/hashType = hashType || '\''sha1'\'';/g' "${KBN_DIR}/node_modules/file-loader/node_modules/loader-utils/lib/getHashDigest.js" + sed -i 's/const hash = createHash("md4");/const hash = createHash("sha1");/g' "${KBN_DIR}/node_modules/webpack/lib/ModuleFilenameHelpers.js" + sed -i 's/contentHash: createHash("md4")/contentHash: createHash("sha1")/g' "${KBN_DIR}/node_modules/webpack/lib/SourceMapDevToolPlugin.js" + + export OPENSSL_MODULES="$OPENSSL_PATH/lib/ossl-modules" + export NODE_OPTIONS="--enable-fips --openssl-config=$KBN_DIR/.devcontainer/config/nodejs.cnf" + echo "FIPS mode enabled" + echo "If manually bootstrapping in FIPS mode use: NODE_OPTIONS='' yarn kbn bootstrap" + else + sed -i '/xpack.security.experimental.fipsMode.enabled:/ {s/.*/xpack.security.experimental.fipsMode.enabled: false/; t}; $a\xpack.security.experimental.fipsMode.enabled: false' "$KBN_CONFIG_FILE" + fi +} + +setup_shell() { + if [ -n "$SHELL" ] && [ -x "$SHELL" ]; then + current_shell=$(ps -p $$ -o comm=) + desired_shell=$(basename "$SHELL") + + if [ "$current_shell" != "$desired_shell" ]; then + sudo chsh -s "$SHELL" vscode + exec "$SHELL" + fi + else + echo "Shell is not set or not executable, using bash" + fi +} + +if [ -f "$ENV_PATH" ]; then + source "$ENV_PATH" + setup_fips + setup_shell +else + echo ".env file not found, using default values" +fi diff --git a/.devcontainer/scripts/post_start.sh b/.devcontainer/scripts/post_start.sh new file mode 100755 index 0000000000000..78490bb73d513 --- /dev/null +++ b/.devcontainer/scripts/post_start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# If FIPS mode is enabled, there can be issues installing some dependencies due to invalid algorithms. +# So override the NODE_OPTIONS environment variable to disable FIPS mode. +NODE_OPTIONS='' yarn kbn bootstrap + +Xvfb :99 -screen 0 1920x1080x24 & +export DISPLAY=:99 diff --git a/.eslintrc.js b/.eslintrc.js index 2b8c6c819bb3e..811676f049158 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -928,7 +928,10 @@ module.exports = { }, }, { - files: ['x-pack/plugins/observability_solution/**/*.{ts,tsx}'], + files: [ + 'x-pack/plugins/observability_solution/**/*.{ts,tsx}', + 'x-pack/packages/observability/**/*.{ts,tsx}', + ], rules: { 'react-hooks/exhaustive-deps': [ 'error', @@ -944,6 +947,7 @@ module.exports = { 'x-pack/plugins/aiops/**/*.tsx', 'x-pack/plugins/observability_solution/**/*.tsx', 'src/plugins/ai_assistant_management/**/*.tsx', + 'x-pack/packages/observability/**/*.{ts,tsx}', ], rules: { '@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error', @@ -1365,6 +1369,25 @@ module.exports = { 'react/jsx-fragments': 'error', }, }, + { + files: [ + 'test/{accessibility,*functional*,*api_integration*}/apps/**/*.{js,ts}', + 'x-pack/test/{accessibility,*functional*,*api_integration*}/apps/**/*.{js,ts}', + 'x-pack/test_serverless/{functional,api_integration}/test_suites/**/*.{js,ts}', + ], + extends: ['plugin:mocha/recommended'], + plugins: ['mocha'], + env: { + mocha: true, + }, + rules: { + 'mocha/no-mocha-arrows': 'off', + 'mocha/no-exports': 'off', + 'mocha/no-setup-in-describe': 'off', + 'mocha/no-nested-tests': 'off', + 'mocha/no-skipped-tests': 'off', + }, + }, { files: ['x-pack/plugins/lists/public/**/!(*.test).{js,mjs,ts,tsx}'], plugins: ['react-perf'], diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fcdfaf1fe4ef8..cbffef0027017 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -68,11 +68,13 @@ packages/kbn-capture-oas-snapshot-cli @elastic/kibana-core x-pack/test/cases_api_integration/common/plugins/cases @elastic/response-ops packages/kbn-cases-components @elastic/response-ops x-pack/plugins/cases @elastic/response-ops +packages/kbn-cbor @elastic/kibana-operations packages/kbn-cell-actions @elastic/security-threat-hunting-explore src/plugins/chart_expressions/common @elastic/kibana-visualizations packages/kbn-chart-icons @elastic/kibana-visualizations src/plugins/charts @elastic/kibana-visualizations packages/kbn-check-mappings-update-cli @elastic/kibana-core +packages/kbn-check-prod-native-modules-cli @elastic/kibana-operations packages/kbn-ci-stats-core @elastic/kibana-operations packages/kbn-ci-stats-performance-metrics @elastic/kibana-operations packages/kbn-ci-stats-reporter @elastic/kibana-operations @@ -87,6 +89,8 @@ x-pack/plugins/cloud_integrations/cloud_full_story @elastic/kibana-core x-pack/test/cloud_integration/plugins/saml_provider @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_links @elastic/kibana-core x-pack/plugins/cloud @elastic/kibana-core +x-pack/packages/kbn-cloud-security-posture @elastic/kibana-cloud-security-posture +x-pack/packages/kbn-cloud-security-posture-common @elastic/kibana-cloud-security-posture x-pack/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture packages/shared-ux/code_editor/impl @elastic/appex-sharedux packages/shared-ux/code_editor/mocks @elastic/appex-sharedux @@ -97,6 +101,8 @@ packages/kbn-config-mocks @elastic/kibana-core packages/kbn-config-schema @elastic/kibana-core src/plugins/console @elastic/kibana-management packages/content-management/content_editor @elastic/appex-sharedux +packages/content-management/content_insights/content_insights_public @elastic/appex-sharedux +packages/content-management/content_insights/content_insights_server @elastic/appex-sharedux examples/content_management_examples @elastic/appex-sharedux packages/content-management/favorites/favorites_public @elastic/appex-sharedux packages/content-management/favorites/favorites_server @elastic/appex-sharedux @@ -395,6 +401,7 @@ x-pack/plugins/encrypted_saved_objects @elastic/kibana-security x-pack/plugins/enterprise_search @elastic/search-kibana x-pack/plugins/observability_solution/entities_data_access @elastic/obs-entities x-pack/packages/kbn-entities-schema @elastic/obs-entities +x-pack/test/api_integration/apis/entity_manager/fixture_plugin @elastic/obs-entities x-pack/plugins/observability_solution/entity_manager @elastic/obs-entities examples/error_boundary @elastic/appex-sharedux packages/kbn-es @elastic/kibana-operations @@ -418,6 +425,7 @@ src/plugins/esql_datagrid @elastic/kibana-esql packages/kbn-esql-utils @elastic/kibana-esql packages/kbn-esql-validation-autocomplete @elastic/kibana-esql examples/esql_validation_example @elastic/kibana-esql +test/plugin_functional/plugins/eui_provider_dev_warning @elastic/appex-sharedux packages/kbn-event-annotation-common @elastic/kibana-visualizations packages/kbn-event-annotation-components @elastic/kibana-visualizations src/plugins/event_annotation_listing @elastic/kibana-visualizations @@ -477,6 +485,8 @@ x-pack/plugins/global_search @elastic/appex-sharedux x-pack/plugins/global_search_providers @elastic/appex-sharedux x-pack/test/plugin_functional/plugins/global_search_test @elastic/kibana-core x-pack/plugins/graph @elastic/kibana-visualizations +examples/grid_example @elastic/kibana-presentation +packages/kbn-grid-layout @elastic/kibana-presentation x-pack/plugins/grokdebugger @elastic/kibana-management packages/kbn-grouping @elastic/response-ops packages/kbn-guided-onboarding @elastic/appex-sharedux @@ -484,6 +494,7 @@ examples/guided_onboarding_example @elastic/appex-sharedux src/plugins/guided_onboarding @elastic/appex-sharedux packages/kbn-handlebars @elastic/kibana-security packages/kbn-hapi-mocks @elastic/kibana-core +test/plugin_functional/plugins/hardening @elastic/kibana-security packages/kbn-health-gateway-server @elastic/kibana-core examples/hello_world @elastic/kibana-core src/plugins/home @elastic/kibana-core @@ -501,7 +512,7 @@ x-pack/packages/index-management @elastic/kibana-management x-pack/plugins/index_management @elastic/kibana-management test/plugin_functional/plugins/index_patterns @elastic/kibana-data-discovery x-pack/packages/ml/inference_integration_flyout @elastic/ml-ui -x-pack/plugins/inference @elastic/kibana-core +x-pack/plugins/inference @elastic/appex-ai-infra x-pack/packages/kbn-infra-forge @elastic/obs-ux-management-team x-pack/plugins/observability_solution/infra @elastic/obs-ux-logs-team @elastic/obs-ux-infra_services-team x-pack/plugins/ingest_pipelines @elastic/kibana-management @@ -513,6 +524,7 @@ test/interactive_setup_api_integration/plugins/test_endpoints @elastic/kibana-se packages/kbn-interpreter @elastic/kibana-visualizations x-pack/plugins/observability_solution/investigate_app @elastic/obs-ux-management-team x-pack/plugins/observability_solution/investigate @elastic/obs-ux-management-team +packages/kbn-investigation-shared @elastic/obs-ux-management-team packages/kbn-io-ts-utils @elastic/obs-knowledge-team packages/kbn-ipynb @elastic/search-kibana packages/kbn-jest-serializers @elastic/kibana-operations @@ -617,6 +629,7 @@ test/common/plugins/newsfeed @elastic/kibana-core src/plugins/no_data_page @elastic/appex-sharedux x-pack/plugins/notifications @elastic/appex-sharedux packages/kbn-object-versioning @elastic/appex-sharedux +packages/kbn-object-versioning-utils @elastic/appex-sharedux x-pack/plugins/observability_solution/observability_ai_assistant_app @elastic/obs-ai-assistant x-pack/plugins/observability_solution/observability_ai_assistant_management @elastic/obs-ai-assistant x-pack/plugins/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant @@ -630,6 +643,7 @@ x-pack/plugins/observability_solution/observability_onboarding/e2e @elastic/obs- x-pack/plugins/observability_solution/observability_onboarding @elastic/obs-ux-logs-team @elastic/obs-ux-onboarding-team x-pack/plugins/observability_solution/observability @elastic/obs-ux-management-team x-pack/plugins/observability_solution/observability_shared @elastic/observability-ui +x-pack/packages/observability/observability_utils @elastic/observability-ui x-pack/test/security_api_integration/plugins/oidc_provider @elastic/kibana-security test/common/plugins/otel_metrics @elastic/obs-ux-infra_services-team packages/kbn-openapi-bundler @elastic/security-detection-rule-management @@ -724,13 +738,16 @@ examples/screenshot_mode_example @elastic/appex-sharedux src/plugins/screenshot_mode @elastic/appex-sharedux x-pack/examples/screenshotting_example @elastic/appex-sharedux x-pack/plugins/screenshotting @elastic/kibana-reporting-services +packages/kbn-screenshotting-server @elastic/appex-sharedux packages/kbn-search-api-panels @elastic/search-kibana +x-pack/plugins/search_assistant @elastic/search-kibana packages/kbn-search-connectors @elastic/search-kibana x-pack/plugins/search_connectors @elastic/search-kibana packages/kbn-search-errors @elastic/kibana-data-discovery examples/search_examples @elastic/kibana-data-discovery x-pack/plugins/search_homepage @elastic/search-kibana packages/kbn-search-index-documents @elastic/search-kibana +x-pack/plugins/search_indices @elastic/search-kibana x-pack/plugins/search_inference_endpoints @elastic/search-kibana x-pack/plugins/search_notebooks @elastic/search-kibana x-pack/plugins/search_playground @elastic/search-kibana @@ -739,12 +756,15 @@ packages/kbn-search-types @elastic/kibana-data-discovery x-pack/plugins/searchprofiler @elastic/kibana-management x-pack/test/security_api_integration/packages/helpers @elastic/kibana-security x-pack/packages/security/api_key_management @elastic/kibana-security +x-pack/packages/security/authorization_core @elastic/kibana-security x-pack/packages/security/form_components @elastic/kibana-security packages/kbn-security-hardening @elastic/kibana-security x-pack/plugins/security @elastic/kibana-security x-pack/packages/security/plugin_types_common @elastic/kibana-security x-pack/packages/security/plugin_types_public @elastic/kibana-security x-pack/packages/security/plugin_types_server @elastic/kibana-security +x-pack/packages/security/role_management_model @elastic/kibana-security +x-pack/packages/security-solution/common @elastic/security-threat-hunting-investigations x-pack/packages/security-solution/distribution_bar @elastic/kibana-cloud-security-posture x-pack/plugins/security_solution_ess @elastic/security-solution x-pack/packages/security-solution/features @elastic/security-threat-hunting-explore @@ -756,6 +776,7 @@ x-pack/packages/security-solution/side_nav @elastic/security-threat-hunting-expl x-pack/packages/security-solution/storybook/config @elastic/security-threat-hunting-explore x-pack/packages/security-solution/upselling @elastic/security-threat-hunting-explore x-pack/test/security_functional/plugins/test_endpoints @elastic/kibana-security +x-pack/packages/security/ui_components @elastic/kibana-security packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine x-pack/packages/security-solution/data_table @elastic/security-threat-hunting-investigations packages/kbn-securitysolution-ecs @elastic/security-threat-hunting-explore @@ -844,6 +865,7 @@ packages/shared-ux/router/types @elastic/appex-sharedux packages/shared-ux/storybook/config @elastic/appex-sharedux packages/shared-ux/storybook/mock @elastic/appex-sharedux packages/shared-ux/modal/tabbed @elastic/appex-sharedux +packages/shared-ux/table_persist @elastic/appex-sharedux packages/kbn-shared-ux-utility @elastic/appex-sharedux x-pack/plugins/observability_solution/slo @elastic/obs-ux-management-team x-pack/packages/kbn-slo-schema @elastic/obs-ux-management-team @@ -913,7 +935,7 @@ test/plugin_functional/plugins/ui_settings_plugin @elastic/kibana-core packages/kbn-ui-shared-deps-npm @elastic/kibana-operations packages/kbn-ui-shared-deps-src @elastic/kibana-operations packages/kbn-ui-theme @elastic/kibana-operations -packages/kbn-unified-data-table @elastic/kibana-data-discovery +packages/kbn-unified-data-table @elastic/kibana-data-discovery @elastic/security-threat-hunting-investigations packages/kbn-unified-doc-viewer @elastic/kibana-data-discovery examples/unified_doc_viewer @elastic/kibana-core src/plugins/unified_doc_viewer @elastic/kibana-data-discovery @@ -1018,6 +1040,7 @@ packages/kbn-zod-helpers @elastic/security-detection-rule-management /x-pack/test_serverless/functional/test_suites/common/examples/search_examples @elastic/kibana-data-discovery /x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples @elastic/kibana-data-discovery /x-pack/test_serverless/functional/test_suites/common/management/data_views @elastic/kibana-data-discovery +src/plugins/discover/public/context_awareness/profile_providers/security @elastic/kibana-data-discovery @elastic/security-threat-hunting-investigations # Visualizations /src/plugins/visualize/ @elastic/kibana-visualizations @@ -1135,7 +1158,9 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant /x-pack/test_serverless/**/test_suites/observability/custom_threshold_rule/ @elastic/obs-ux-management-team /x-pack/test_serverless/**/test_suites/observability/slos/ @elastic/obs-ux-management-team /x-pack/test_serverless/api_integration/test_suites/observability/es_query_rule @elastic/obs-ux-management-team -/x-pack/test_serverless/api_integration/test_suites/observability/burn_rate_rule @elastic/obs-ux-management-team +/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/burn_rate_rule @elastic/obs-ux-management-team +/x-pack/test/api_integration/deployment_agnostic/services/alerting_api @elastic/obs-ux-management-team +/x-pack/test/api_integration/deployment_agnostic/services/slo_api @elastic/obs-ux-management-team /x-pack/test_serverless/**/test_suites/observability/infra/ @elastic/obs-ux-infra_services-team # Elastic Stack Monitoring @@ -1144,7 +1169,6 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant /x-pack/test/api_integration/apis/monitoring_collection @elastic/stack-monitoring # Fleet -/fleet_packages.json @elastic/fleet /x-pack/test/fleet_api_integration @elastic/fleet /x-pack/test/fleet_cypress @elastic/fleet /x-pack/test/fleet_functional @elastic/fleet @@ -1260,6 +1284,7 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant /kbn_pm/ @elastic/kibana-operations /x-pack/dev-tools @elastic/kibana-operations /catalog-info.yaml @elastic/kibana-operations @elastic/kibana-tech-leads +/.devcontainer/ @elastic/kibana-operations # Appex QA /src/dev/code_coverage @elastic/appex-qa @@ -1296,7 +1321,6 @@ x-pack/test/**/deployment_agnostic/ @elastic/appex-qa #temporarily to monitor te /x-pack/test_serverless/**/test_suites/common/saved_objects_management/ @elastic/kibana-core /x-pack/test_serverless/api_integration/test_suites/common/core/ @elastic/kibana-core /x-pack/test_serverless/api_integration/test_suites/**/telemetry/ @elastic/kibana-core -/x-pack/plugins/inference @elastic/kibana-core @elastic/obs-ai-assistant @elastic/security-generative-ai #CC# /src/core/server/csp/ @elastic/kibana-core #CC# /src/plugins/saved_objects/ @elastic/kibana-core #CC# /x-pack/plugins/cloud/ @elastic/kibana-core @@ -1305,6 +1329,9 @@ x-pack/test/**/deployment_agnostic/ @elastic/appex-qa #temporarily to monitor te #CC# /src/plugins/newsfeed @elastic/kibana-core #CC# /x-pack/plugins/global_search_providers/ @elastic/kibana-core +# AppEx AI Infra +/x-pack/plugins/inference @elastic/appex-ai-infra @elastic/obs-ai-assistant @elastic/security-generative-ai + # AppEx Platform Services Security x-pack/test_serverless/api_integration/test_suites/common/security_response_headers.ts @elastic/kibana-security @@ -1332,7 +1359,9 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib /packages/kbn-std/src/parse_next_url.ts @elastic/kibana-core @elastic/kibana-security /test/interactive_setup_api_integration/ @elastic/kibana-security /test/interactive_setup_functional/ @elastic/kibana-security +/test/plugin_functional/plugins/hardening @elastic/kibana-security /test/plugin_functional/test_suites/core_plugins/rendering.ts @elastic/kibana-security +/test/plugin_functional/test_suites/hardening @elastic/kibana-security /x-pack/test/accessibility/apps/group1/login_page.ts @elastic/kibana-security /x-pack/test/accessibility/apps/group1/roles.ts @elastic/kibana-security /x-pack/test/accessibility/apps/group1/spaces.ts @elastic/kibana-security @@ -1382,6 +1411,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib /x-pack/plugins/enterprise_search/public/applications/shared/doc_links @elastic/platform-docs /x-pack/test_serverless/api_integration/test_suites/search/serverless_search @elastic/search-kibana /x-pack/test_serverless/functional/test_suites/search/ @elastic/search-kibana +x-pack/test/api_integration/apis/management/index_management/inference_endpoints.ts @elastic/search-kibana # Management Experience - Deployment Management /x-pack/test_serverless/**/test_suites/common/index_management/ @elastic/kibana-management @@ -1528,18 +1558,18 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ ## Generative AI owner connectors # OpenAI -/x-pack/plugins/stack_connectors/public/connector_types/openai @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/server/connector_types/openai @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/common/openai @elastic/security-generative-ai @elastic/obs-ai-assistant +/x-pack/plugins/stack_connectors/public/connector_types/openai @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/server/connector_types/openai @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/common/openai @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra # Bedrock -/x-pack/plugins/stack_connectors/public/connector_types/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/server/connector_types/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/common/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant +/x-pack/plugins/stack_connectors/public/connector_types/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/server/connector_types/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/common/bedrock @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra # Gemini -/x-pack/plugins/stack_connectors/public/connector_types/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/server/connector_types/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant -/x-pack/plugins/stack_connectors/common/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant +/x-pack/plugins/stack_connectors/public/connector_types/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/server/connector_types/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra +/x-pack/plugins/stack_connectors/common/gemini @elastic/security-generative-ai @elastic/obs-ai-assistant @elastic/appex-ai-infra ## Defend Workflows owner connectors /x-pack/plugins/stack_connectors/public/connector_types/sentinelone @elastic/security-defend-workflows @@ -1742,6 +1772,8 @@ x-pack/plugins/observability_solution/observability_shared/public/components/pro # Shared UX packages/react @elastic/appex-sharedux +test/functional/page_objects/solution_navigation.ts @elastic/appex-sharedux +/x-pack/test_serverless/functional/page_objects/svl_common_navigation.ts @elastic/appex-sharedux # OpenAPI spec files /x-pack/plugins/fleet/common/openapi @elastic/platform-docs diff --git a/.github/workflows/add-fleet-issues-to-ingest-project.yml b/.github/workflows/add-fleet-issues-to-ingest-project.yml index 239c05c7028d4..ca04c0e6fa6d7 100644 --- a/.github/workflows/add-fleet-issues-to-ingest-project.yml +++ b/.github/workflows/add-fleet-issues-to-ingest-project.yml @@ -15,7 +15,7 @@ jobs: add_to_ingest_project: runs-on: ubuntu-latest steps: - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: add_to_project if: ${{ github.event.label.name == env.FLEET_LABEL }} with: @@ -32,7 +32,7 @@ jobs: content_id: ${{ github.event.issue.node_id }} env: GITHUB_TOKEN: ${{ secrets.FLEET_PROJECT_TOKEN }} - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: set_fleet_ui_area if: github.event.label.name == env.FLEET_LABEL with: diff --git a/.github/workflows/add-to-apm-project.yml b/.github/workflows/add-to-apm-project.yml index 8b55449060028..f3d0792ed6cd1 100644 --- a/.github/workflows/add-to-apm-project.yml +++ b/.github/workflows/add-to-apm-project.yml @@ -9,7 +9,7 @@ jobs: if: | github.event.label.name == 'Team:apm' steps: - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: add_to_project with: query: | @@ -27,7 +27,7 @@ jobs: env: PROJECT_ID: "PVT_kwDOAGc3Zs0VSg" GITHUB_TOKEN: ${{ secrets.APM_TECH_KIBANA_USER_TOKEN }} - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: label_team with: query: | diff --git a/.github/workflows/auto-approve-bundled-package-updates.yml b/.github/workflows/auto-approve-bundled-package-updates.yml new file mode 100644 index 0000000000000..5cf8655f37f73 --- /dev/null +++ b/.github/workflows/auto-approve-bundled-package-updates.yml @@ -0,0 +1,18 @@ +on: + pull_request: + types: + - opened + paths: + - 'fleet_packages.json' + +jobs: + approve: + name: Auto-approve bundled package updates + runs-on: ubuntu-latest + if: | + startsWith(github.event.pull_request.head.ref, 'update-bundled-packages') && + github.event.pull_request.user.login == 'elasticmachine' + permissions: + pull-requests: write + steps: + - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 903c5a6ec36f9..0000000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,32 +0,0 @@ -on: - pull_request_target: - branches: ['main'] - types: ['labeled', 'closed'] - -env: - NODE_ENV: kibana-github-action - -jobs: - backport: - name: Backport PR - runs-on: ubuntu-latest - if: | - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'auto-backport') - && ( - (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') - || (github.event.action == 'closed') - ) - steps: - - name: Backport Action - uses: sorenlouv/backport-github-action@v8.9.7 - with: - github_token: ${{secrets.KIBANAMACHINE_TOKEN}} - - - name: Info log - if: ${{ success() }} - run: cat /home/runner/.backport/backport.info.log - - - name: Debug log - if: ${{ failure() }} - run: cat /home/runner/.backport/backport.debug.log diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 66f99a95a3b2c..051cdc35b6507 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,7 +27,7 @@ jobs: ref: ${{ matrix.branch }} - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/codeql-config.yml @@ -42,7 +42,7 @@ jobs: # yarn kbn bootstrap --no-validate --no-vscode - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3 # env: # NODE_OPTIONS: "--max-old-space-size=6144" with: diff --git a/.github/workflows/fix-version-gaps.yml b/.github/workflows/fix-version-gaps.yml deleted file mode 100644 index 1e89ec2553457..0000000000000 --- a/.github/workflows/fix-version-gaps.yml +++ /dev/null @@ -1,41 +0,0 @@ -on: - pull_request: - branches: - - main - types: - - closed - -jobs: - gaps: - name: Fix Version Label Gaps - # This fix also runs as part of the backport action (because backport depends on the labels) - # So we only need to trigger it for merged PRs that also won't be auto-backported - if: | - github.event.pull_request.merged == true - && !contains(github.event.pull_request.labels.*.name, 'auto-backport') - && !( - contains(github.event.pull_request.labels.*.name, 'backport:prev-minor') - || contains(github.event.pull_request.labels.*.name, 'backport:prev-major') - || contains(github.event.pull_request.labels.*.name, 'backport:all-open') - || contains(github.event.pull_request.labels.*.name, 'backport:auto-version') - ) - && !( - (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') - || (github.event.action == 'closed') - ) - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - repository: 'elastic/kibana-github-actions' - ref: main - path: ./actions - - - name: Install Actions - run: npm ci --omit=dev --prefix ./actions - - - name: Run Fix Gaps - uses: ./actions/fix-version-gaps - with: - github_token: ${{secrets.KIBANAMACHINE_TOKEN}} diff --git a/.github/workflows/label-qa-fixed-in.yml b/.github/workflows/label-qa-fixed-in.yml index 99803c2c4e880..247d2b26f1fb5 100644 --- a/.github/workflows/label-qa-fixed-in.yml +++ b/.github/workflows/label-qa-fixed-in.yml @@ -22,7 +22,7 @@ jobs: issue_ids: ${{ steps.issues_to_label.outputs.value }} label_ids: ${{ steps.label_ids.outputs.value }} steps: - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: closing_issues with: query: | @@ -46,7 +46,7 @@ jobs: prnumber: ${{ github.event.number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: sergeysova/jq-action@v2 + - uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58 # v2.3.0 id: issues_to_label with: # Map to the issues' node id @@ -54,7 +54,7 @@ jobs: multiline: true env: CLOSING_ISSUES: ${{ steps.closing_issues.outputs.data }} - - uses: sergeysova/jq-action@v2 + - uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58 # v2.3.0 id: label_ids with: # Get list of version labels on pull request and map to label's node id, append 'QA:Ready For Testing' id ("MDU6TGFiZWwyNTQ1NjcwOTI4") @@ -78,7 +78,7 @@ jobs: name: Label issue ${{ matrix.issueId }} with ${{ matrix.labelId }} steps: - - uses: octokit/graphql-action@v2.x + - uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2 id: add_labels_to_closed_issue with: query: | diff --git a/.github/workflows/launchdarkly-code-references.yml b/.github/workflows/launchdarkly-code-references.yml index 3f6c4b1ead69f..eb32608d74928 100644 --- a/.github/workflows/launchdarkly-code-references.yml +++ b/.github/workflows/launchdarkly-code-references.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 11 # This value must be set if the lookback configuration option is not disabled for find-code-references. Read more: https://github.com/launchdarkly/ld-find-code-refs#searching-for-unused-flags-extinctions - name: LaunchDarkly Code References - uses: launchdarkly/find-code-references@v2.12.0 + uses: launchdarkly/find-code-references@ba05c32c4bddd0374bd3f5ecabcbb8e2118e8aa8 # v2.12.0 with: accessToken: ${{ secrets.LD_ACCESS_TOKEN }} projKey: ${{ secrets.LD_PROJECT_KEY }} diff --git a/.github/workflows/on-merge.yml b/.github/workflows/on-merge.yml index 421e4825d1a6a..20596bf155910 100644 --- a/.github/workflows/on-merge.yml +++ b/.github/workflows/on-merge.yml @@ -10,14 +10,15 @@ jobs: runs-on: ubuntu-latest if: | github.event.pull_request.merged == true - && !contains(github.event.pull_request.labels.*.name, 'auto-backport') && ( ( github.event.action == 'labeled' && ( github.event.label.name == 'backport:prev-minor' || github.event.label.name == 'backport:prev-major' + || github.event.label.name == 'backport:current-major' || github.event.label.name == 'backport:all-open' - || github.event.label.name == 'backport:auto-version' + || github.event.label.name == 'backport:version' + || github.event.label.name == 'auto-backport' ) ) || (github.event.action == 'closed') diff --git a/.gitignore b/.gitignore index cb94ba7ef2d3f..c5c048f10d7d4 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,14 @@ x-pack/test/security_api_integration/plugins/audit_log/audit.log # ignore FTR temp directory .ftr role_users.json + + +.devcontainer/.env + +# Ignore temporary files in oas_docs +oas_docs/output/kibana.serverless.tmp1.yaml +oas_docs/output/kibana.serverless.tmp2.yaml +oas_docs/output/kibana.tmp1.yaml +oas_docs/output/kibana.tmp2.yaml +oas_docs/output/kibana.new.yaml +oas_docs/output/kibana.serverless.new.yaml diff --git a/.i18nrc.json b/.i18nrc.json index 59e33320eeea1..7707bfdcde172 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -33,6 +33,7 @@ "presentationPanel": "src/plugins/presentation_panel", "embeddableExamples": "examples/embeddable_examples", "esQuery": "packages/kbn-es-query/src", + "kbnGridLayout": "packages/kbn-grid-layout", "esUi": "src/plugins/es_ui_shared", "expandableFlyout": "packages/kbn-expandable-flyout", "expressionError": "src/plugins/expression_error", diff --git a/NOTICE.txt b/NOTICE.txt index ed8b96176e920..3cee52c089cb4 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -279,7 +279,7 @@ THE SOFTWARE. --- This code is part of the Services provided by FullStory, Inc. For license information, please refer to https://www.fullstory.com/legal/terms-and-conditions/ Portions of this code are licensed under the following license: - For license information please see fs.js.LICENSE.txt + For license information please see https://edge.fullstory.com/s/fs.js.LEGAL.txt --- This product bundles bootstrap@3.3.6 which is available under a diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index 5def04077bc26..51049c59a926f 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -317,7 +317,9 @@ "label": "addComment", "description": [], "signature": [ - "({ incidentId, comment, }: { incidentId: string; comment: string; }) => Promise" + "({ incidentId, comment, }: { incidentId: string; comment: string; }, connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise" ], "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", "deprecated": false, @@ -328,7 +330,7 @@ "id": "def-server.CaseConnector.addComment.$1", "type": "Object", "tags": [], - "label": "{\n incidentId,\n comment,\n }", + "label": "{\n incidentId,\n comment,\n }", "description": [], "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", "deprecated": false, @@ -357,6 +359,21 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "actions", + "id": "def-server.CaseConnector.addComment.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -369,7 +386,9 @@ "label": "createIncident", "description": [], "signature": [ - "(incident: Incident) => Promise<", + "(incident: Incident, connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise<", "ExternalServiceIncidentResponse", ">" ], @@ -391,6 +410,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "actions", + "id": "def-server.CaseConnector.createIncident.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -403,7 +437,9 @@ "label": "updateIncident", "description": [], "signature": [ - "({ incidentId, incident, }: { incidentId: string; incident: Incident; }) => Promise<", + "({ incidentId, incident, }: { incidentId: string; incident: Incident; }, connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise<", "ExternalServiceIncidentResponse", ">" ], @@ -416,7 +452,7 @@ "id": "def-server.CaseConnector.updateIncident.$1", "type": "Object", "tags": [], - "label": "{\n incidentId,\n incident,\n }", + "label": "{\n incidentId,\n incident,\n }", "description": [], "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", "deprecated": false, @@ -448,6 +484,21 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "actions", + "id": "def-server.CaseConnector.updateIncident.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -460,7 +511,9 @@ "label": "getIncident", "description": [], "signature": [ - "({ id }: { id: string; }) => Promise" + "({ id }: { id: string; }, connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise" ], "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", "deprecated": false, @@ -489,6 +542,21 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "actions", + "id": "def-server.CaseConnector.getIncident.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -501,7 +569,9 @@ "label": "pushToService", "description": [], "signature": [ - "(params: { incident: { externalId: string | null; } & Incident; comments: { commentId: string; comment: string; }[]; }) => Promise<", + "(params: { incident: { externalId: string | null; } & Incident; comments: { commentId: string; comment: string; }[]; }, connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise<", "PushToServiceResponse", ">" ], @@ -549,6 +619,21 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "actions", + "id": "def-server.CaseConnector.pushToService.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/case.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -764,7 +849,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -800,6 +885,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -858,6 +969,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1452,7 +1565,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1478,7 +1593,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1724,6 +1839,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -2084,7 +2201,9 @@ "signature": [ "({ url, data, method, responseSchema, headers, timeout, ...config }: ", "SubActionRequestParams", - ") => Promise<", + ", connectorUsageCollector: ", + "ConnectorUsageCollector", + ") => Promise<", "AxiosResponse", ">" ], @@ -2097,7 +2216,7 @@ "id": "def-server.SubActionConnector.request.$1", "type": "CompoundType", "tags": [], - "label": "{\n url,\n data,\n method = 'get',\n responseSchema,\n headers,\n timeout,\n ...config\n }", + "label": "{\n url,\n data,\n method = 'get',\n responseSchema,\n headers,\n timeout,\n ...config\n }", "description": [], "signature": [ "SubActionRequestParams", @@ -2107,6 +2226,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "actions", + "id": "def-server.SubActionConnector.request.$2", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] @@ -3109,6 +3243,20 @@ "path": "x-pack/plugins/actions/server/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "actions", + "id": "def-server.ActionTypeExecutorOptions.connectorUsageCollector", + "type": "Object", + "tags": [], + "label": "connectorUsageCollector", + "description": [], + "signature": [ + "ConnectorUsageCollector" + ], + "path": "x-pack/plugins/actions/server/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 4469afa2e8508..b8cbb98efa0c9 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.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 | |-------------------|-----------|------------------------|-----------------| -| 307 | 0 | 301 | 32 | +| 314 | 0 | 308 | 33 | ## Client diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 3902e52ecbae4..ba8f818c9b672 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/ai_assistant_management_selection.mdx b/api_docs/ai_assistant_management_selection.mdx index 28730ac0fb9d3..bb5e1729f30a5 100644 --- a/api_docs/ai_assistant_management_selection.mdx +++ b/api_docs/ai_assistant_management_selection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementSelection title: "aiAssistantManagementSelection" image: https://source.unsplash.com/400x175/?github description: API docs for the aiAssistantManagementSelection plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementSelection'] --- import aiAssistantManagementSelectionObj from './ai_assistant_management_selection.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index ef7c9b68cf194..592da097ffa0c 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: 2024-08-14 +date: 2024-08-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 3b4c372f8ea63..b847d4bf6cbfd 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -3286,7 +3286,7 @@ "label": "monitoring", "description": [], "signature": [ - "Readonly<{} & { run: Readonly<{} & { history: Readonly<{ outcome?: Readonly<{ warning?: \"execute\" | \"validate\" | \"unknown\" | \"license\" | \"timeout\" | \"read\" | \"decrypt\" | \"disabled\" | \"maxExecutableActions\" | \"maxAlerts\" | \"maxQueuedActions\" | null | undefined; outcomeOrder?: number | undefined; outcomeMsg?: string[] | null | undefined; } & { outcome: \"warning\" | \"succeeded\" | \"failed\"; alertsCount: Readonly<{ recovered?: number | null | undefined; active?: number | null | undefined; new?: number | null | undefined; ignored?: number | null | undefined; } & {}>; }> | undefined; duration?: number | undefined; } & { timestamp: number; success: boolean; }>[]; calculated_metrics: Readonly<{ p50?: number | undefined; p95?: number | undefined; p99?: number | undefined; } & { success_ratio: number; }>; last_run: Readonly<{} & { timestamp: string; metrics: Readonly<{ duration?: number | undefined; total_search_duration_ms?: number | null | undefined; total_indexing_duration_ms?: number | null | undefined; total_alerts_detected?: number | null | undefined; total_alerts_created?: number | null | undefined; gap_duration_s?: number | null | undefined; } & {}>; }>; }>; }> | undefined" + "Readonly<{} & { run: Readonly<{} & { history: Readonly<{ outcome?: Readonly<{ warning?: \"execute\" | \"validate\" | \"unknown\" | \"license\" | \"ruleExecution\" | \"timeout\" | \"read\" | \"decrypt\" | \"disabled\" | \"maxExecutableActions\" | \"maxAlerts\" | \"maxQueuedActions\" | null | undefined; outcomeOrder?: number | undefined; outcomeMsg?: string[] | null | undefined; } & { outcome: \"warning\" | \"succeeded\" | \"failed\"; alertsCount: Readonly<{ recovered?: number | null | undefined; active?: number | null | undefined; new?: number | null | undefined; ignored?: number | null | undefined; } & {}>; }> | undefined; duration?: number | undefined; } & { timestamp: number; success: boolean; }>[]; calculated_metrics: Readonly<{ p50?: number | undefined; p95?: number | undefined; p99?: number | undefined; } & { success_ratio: number; }>; last_run: Readonly<{} & { timestamp: string; metrics: Readonly<{ duration?: number | undefined; total_search_duration_ms?: number | null | undefined; total_indexing_duration_ms?: number | null | undefined; total_alerts_detected?: number | null | undefined; total_alerts_created?: number | null | undefined; gap_duration_s?: number | null | undefined; } & {}>; }>; }>; }> | undefined" ], "path": "x-pack/plugins/alerting/server/application/rule/types/rule.ts", "deprecated": false, @@ -3342,7 +3342,7 @@ "label": "lastRun", "description": [], "signature": [ - "Readonly<{ warning?: \"execute\" | \"validate\" | \"unknown\" | \"license\" | \"timeout\" | \"read\" | \"decrypt\" | \"disabled\" | \"maxExecutableActions\" | \"maxAlerts\" | \"maxQueuedActions\" | null | undefined; outcomeOrder?: number | undefined; outcomeMsg?: string[] | null | undefined; } & { outcome: \"warning\" | \"succeeded\" | \"failed\"; alertsCount: Readonly<{ recovered?: number | null | undefined; active?: number | null | undefined; new?: number | null | undefined; ignored?: number | null | undefined; } & {}>; }> | null | undefined" + "Readonly<{ warning?: \"execute\" | \"validate\" | \"unknown\" | \"license\" | \"ruleExecution\" | \"timeout\" | \"read\" | \"decrypt\" | \"disabled\" | \"maxExecutableActions\" | \"maxAlerts\" | \"maxQueuedActions\" | null | undefined; outcomeOrder?: number | undefined; outcomeMsg?: string[] | null | undefined; } & { outcome: \"warning\" | \"succeeded\" | \"failed\"; alertsCount: Readonly<{ recovered?: number | null | undefined; active?: number | null | undefined; new?: number | null | undefined; ignored?: number | null | undefined; } & {}>; }> | null | undefined" ], "path": "x-pack/plugins/alerting/server/application/rule/types/rule.ts", "deprecated": false, @@ -3710,26 +3710,6 @@ "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "alerting", - "id": "def-server.RuleExecutorServices.searchSourceClient", - "type": "Object", - "tags": [], - "label": "searchSourceClient", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchStartSearchSource", - "text": "ISearchStartSearchSource" - } - ], - "path": "x-pack/plugins/alerting/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "alerting", "id": "def-server.RuleExecutorServices.savedObjectsClient", @@ -3826,14 +3806,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" }, - { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.ts" - }, - { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule.ts" - }, { "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts" @@ -3930,344 +3902,66 @@ }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorServices.dataViews", + "id": "def-server.RuleExecutorServices.ruleResultService", "type": "Object", "tags": [], - "label": "dataViews", + "label": "ruleResultService", "description": [], "signature": [ - "{ create: (spec: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ", skipFetchFields?: boolean, displayErrors?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ">; get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ">; delete: (indexPatternId: string) => Promise; find: (search: string, size?: number) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - "[]>; getCanSave: () => Promise; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; findLazy: (search: string, size?: number) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - "[]>; getIdsWithTitle: (refresh?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewListItem", - "text": "DataViewListItem" - }, - "[]>; getAllDataViewLazy: (refresh?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - "[]>; clearCache: () => void; clearInstanceCache: (id?: string | undefined) => void; getCache: () => Promise<", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObject", - "text": "SavedObject" - }, - "<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSavedObjectAttrs", - "text": "DataViewSavedObjectAttrs" - }, - ">[] | null | undefined>; getDefault: (displayErrors?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserDataView: () => Promise; getMetaFields: () => Promise; getShortDotsEnable: () => Promise; getFieldsForWildcard: (options: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ") => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]>; getFieldsForIndexPattern: (indexPattern: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ", options?: Omit<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ", \"allowNoIndex\"> | undefined) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]>; refreshFields: (dataView: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ", displayErrors?: boolean, forceRefresh?: boolean) => Promise; fieldArrayToMap: (fields: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[], fieldAttrs?: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined) => ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewFieldMap", - "text": "DataViewFieldMap" - }, - "; savedObjectToSpec: (savedObject: ", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObject", - "text": "SavedObject" - }, - "<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewAttributes", - "text": "DataViewAttributes" - }, - ">) => ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - "; getDataViewLazy: (id: string) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - ">; getDataViewLazyFromCache: (id: string) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - " | undefined>; createDataViewLazy: (spec: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ") => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - ">; createAndSaveDataViewLazy: (spec: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ", overwrite?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - ">; createAndSave: (spec: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ", overwrite?: boolean, skipFetchFields?: boolean, displayErrors?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ">; createSavedObject: (dataView: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.AbstractDataView", - "text": "AbstractDataView" - }, - ", overwrite?: boolean) => Promise; updateSavedObject: (indexPattern: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.AbstractDataView", - "text": "AbstractDataView" - }, - ", saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean) => Promise; defaultDataViewExists: () => Promise; getDefaultDataViewLazy: () => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - " | null>; getDefaultDataView: (options?: { displayErrors?: boolean | undefined; refreshFields?: boolean | undefined; }) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | null>; toDataView: (dataViewLazy: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - ") => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ">; toDataViewLazy: (dataView: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ") => Promise<", + "PublicLastRunSetters", + " | undefined" + ], + "path": "x-pack/plugins/alerting/server/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "alerting", + "id": "def-server.RuleExecutorServices.getDataViews", + "type": "Function", + "tags": [], + "label": "getDataViews", + "description": [], + "signature": [ + "() => Promise<", { "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" + "section": "def-common.DataViewsContract", + "text": "DataViewsContract" }, - ">; }" + ">" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "alerting", - "id": "def-server.RuleExecutorServices.ruleResultService", - "type": "Object", + "id": "def-server.RuleExecutorServices.getSearchSourceClient", + "type": "Function", "tags": [], - "label": "ruleResultService", + "label": "getSearchSourceClient", "description": [], "signature": [ - "PublicLastRunSetters", - " | undefined" + "() => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchStartSearchSource", + "text": "ISearchStartSearchSource" + }, + ">" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -4398,7 +4092,7 @@ "label": "schemas", "description": [], "signature": [ - "{ params?: { type: \"zod\"; schema: Zod.ZodObject | Zod.ZodIntersection; } | { type: \"config-schema\"; schema: ", + "{ params?: { type: \"zod\"; schema: any; } | { type: \"config-schema\"; schema: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -5342,7 +5036,7 @@ }, ">; getAlertState: (params: ", "GetAlertStateParams", - ") => Promise | undefined; alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; previousStartedAt?: string | null | undefined; summaryActions?: Record> | undefined; } & {}>>; getAlertSummary: (params: ", + ") => Promise | undefined; alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; previousStartedAt?: string | null | undefined; summaryActions?: Record> | undefined; } & {}>>; getAlertSummary: (params: ", "GetAlertSummaryParams", ") => Promise<", { @@ -8827,6 +8521,20 @@ "path": "packages/kbn-alerting-types/rule_types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.Rule.flapping", + "type": "Object", + "tags": [], + "label": "flapping", + "description": [], + "signature": [ + "{ lookBackWindow: number; statusChangeThreshold: number; } | undefined" + ], + "path": "packages/kbn-alerting-types/rule_types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -9714,6 +9422,42 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleSpecificFlappingProperties", + "type": "Interface", + "tags": [], + "label": "RuleSpecificFlappingProperties", + "description": [], + "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "alerting", + "id": "def-common.RuleSpecificFlappingProperties.lookBackWindow", + "type": "number", + "tags": [], + "label": "lookBackWindow", + "description": [], + "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleSpecificFlappingProperties.statusChangeThreshold", + "type": "number", + "tags": [], + "label": "statusChangeThreshold", + "description": [], + "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "alerting", "id": "def-common.RulesSettings", @@ -10963,7 +10707,7 @@ "label": "LatestAlertInstanceMetaSchema", "description": [], "signature": [ - "{ readonly uuid?: string | undefined; readonly lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; readonly flappingHistory?: boolean[] | undefined; readonly flapping?: boolean | undefined; readonly maintenanceWindowIds?: string[] | undefined; readonly pendingRecoveredCount?: number | undefined; readonly activeCount?: number | undefined; }" + "{ readonly flapping?: boolean | undefined; readonly uuid?: string | undefined; readonly lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; readonly flappingHistory?: boolean[] | undefined; readonly maintenanceWindowIds?: string[] | undefined; readonly pendingRecoveredCount?: number | undefined; readonly activeCount?: number | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -11008,7 +10752,7 @@ "label": "LatestRawAlertInstanceSchema", "description": [], "signature": [ - "{ readonly meta?: Readonly<{ uuid?: string | undefined; lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; readonly state?: Record | undefined; }" + "{ readonly meta?: Readonly<{ flapping?: boolean | undefined; uuid?: string | undefined; lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; readonly state?: Record | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -11023,7 +10767,7 @@ "label": "LatestTaskStateSchema", "description": [], "signature": [ - "{ readonly alertTypeState?: Record | undefined; readonly alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly previousStartedAt?: string | null | undefined; readonly summaryActions?: Record> | undefined; }" + "{ readonly alertTypeState?: Record | undefined; readonly alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly previousStartedAt?: string | null | undefined; readonly summaryActions?: Record> | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -11378,7 +11122,7 @@ "signature": [ "20" ], - "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "path": "packages/kbn-alerting-types/rule_flapping.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11408,7 +11152,7 @@ "signature": [ "20" ], - "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "path": "packages/kbn-alerting-types/rule_flapping.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11423,7 +11167,7 @@ "signature": [ "2" ], - "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "path": "packages/kbn-alerting-types/rule_flapping.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11453,7 +11197,7 @@ "signature": [ "2" ], - "path": "x-pack/plugins/alerting/common/rules_settings.ts", + "path": "packages/kbn-alerting-types/rule_flapping.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 994f67e3baca6..2563c97cb6dcb 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.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 | |-------------------|-----------|------------------------|-----------------| -| 871 | 1 | 839 | 52 | +| 875 | 1 | 843 | 52 | ## Client diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index c2616561d2e20..f0872225f3ce0 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.devdocs.json b/api_docs/apm_data_access.devdocs.json index 7334b593ed85f..e6d336d1074ee 100644 --- a/api_docs/apm_data_access.devdocs.json +++ b/api_docs/apm_data_access.devdocs.json @@ -437,6 +437,78 @@ ], "functions": [], "interfaces": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPrivilegesCheck", + "type": "Interface", + "tags": [], + "label": "ApmDataAccessPrivilegesCheck", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/lib/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPrivilegesCheck.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/lib/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPrivilegesCheck.security", + "type": "Object", + "tags": [], + "label": "security", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.SecurityPluginStart", + "text": "SecurityPluginStart" + }, + " | undefined" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/lib/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPrivilegesCheck.getApmIndices", + "type": "Function", + "tags": [], + "label": "getApmIndices", + "description": [], + "signature": [ + "() => Promise>" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/lib/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "apmDataAccess", "id": "def-server.ApmDataAccessServicesParams", @@ -628,7 +700,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -664,6 +736,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -722,6 +820,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1316,7 +1416,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1342,7 +1444,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1588,6 +1690,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -1879,6 +1983,200 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams", + "type": "Interface", + "tags": [], + "label": "GetDocumentTypeParams", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams.start", + "type": "number", + "tags": [], + "label": "start", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams.end", + "type": "number", + "tags": [], + "label": "end", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams.documentSources", + "type": "Array", + "tags": [], + "label": "documentSources", + "description": [], + "signature": [ + "(", + { + "pluginId": "apmDataAccess", + "scope": "common", + "docId": "kibApmDataAccessPluginApi", + "section": "def-common.ApmDataSource", + "text": "ApmDataSource" + }, + " & { hasDocs: boolean; hasDurationSummaryField: boolean; })[]" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams.documentTypes", + "type": "Array", + "tags": [], + "label": "documentTypes", + "description": [], + "signature": [ + { + "pluginId": "apmDataAccess", + "scope": "common", + "docId": "kibApmDataAccessPluginApi", + "section": "def-common.ApmDocumentType", + "text": "ApmDocumentType" + }, + "[]" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.GetDocumentTypeParams.numBuckets", + "type": "number", + "tags": [], + "label": "numBuckets", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_document_type_config/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest", + "type": "Interface", + "tags": [], + "label": "HostNamesRequest", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.query", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "QueryDslQueryContainer", + " | undefined" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.kuery", + "type": "string", + "tags": [], + "label": "kuery", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.start", + "type": "number", + "tags": [], + "label": "start", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.end", + "type": "number", + "tags": [], + "label": "end", + "description": [], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.size", + "type": "number", + "tags": [], + "label": "size", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "apmDataAccess", + "id": "def-server.HostNamesRequest.documentSources", + "type": "Array", + "tags": [], + "label": "documentSources", + "description": [], + "signature": [ + "(", + { + "pluginId": "apmDataAccess", + "scope": "common", + "docId": "kibApmDataAccessPluginApi", + "section": "def-common.ApmDataSource", + "text": "ApmDataSource" + }, + " & { hasDocs: boolean; hasDurationSummaryField: boolean; })[]" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/services/get_host_names/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [], @@ -1923,8 +2221,30 @@ "text": "ApmDataSource" }, " & { hasDocs: boolean; hasDurationSummaryField: boolean; })[]>; getHostNames: ({ start, end, size, query, documentSources }: ", - "HostNamesRequest", - ") => Promise; }" + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.HostNamesRequest", + "text": "HostNamesRequest" + }, + ") => Promise; getDocumentTypeConfig: ({ start, end, numBuckets, documentTypes, documentSources, }: ", + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.GetDocumentTypeParams", + "text": "GetDocumentTypeParams" + }, + ") => { preferredSource: { source: ", + { + "pluginId": "apmDataAccess", + "scope": "common", + "docId": "kibApmDataAccessPluginApi", + "section": "def-common.ApmDataSourceWithSummary", + "text": "ApmDataSourceWithSummary" + }, + "; bucketSizeInSeconds: number; }; documentTypeConfig: DocumentTypeConfigOf; }; }" ], "path": "x-pack/plugins/observability_solution/apm_data_access/server/types.ts", "deprecated": false, @@ -2102,8 +2422,30 @@ "text": "ApmDataSource" }, " & { hasDocs: boolean; hasDurationSummaryField: boolean; })[]>; getHostNames: ({ start, end, size, query, documentSources }: ", - "HostNamesRequest", - ") => Promise; }" + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.HostNamesRequest", + "text": "HostNamesRequest" + }, + ") => Promise; getDocumentTypeConfig: ({ start, end, numBuckets, documentTypes, documentSources, }: ", + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.GetDocumentTypeParams", + "text": "GetDocumentTypeParams" + }, + ") => { preferredSource: { source: ", + { + "pluginId": "apmDataAccess", + "scope": "common", + "docId": "kibApmDataAccessPluginApi", + "section": "def-common.ApmDataSourceWithSummary", + "text": "ApmDataSourceWithSummary" + }, + "; bucketSizeInSeconds: number; }; documentTypeConfig: DocumentTypeConfigOf; }; }" ], "path": "x-pack/plugins/observability_solution/apm_data_access/server/types.ts", "deprecated": false, @@ -2146,7 +2488,56 @@ "path": "x-pack/plugins/observability_solution/apm_data_access/server/types.ts", "deprecated": false, "trackAdoption": false, - "children": [], + "children": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPluginStart.hasPrivileges", + "type": "Function", + "tags": [], + "label": "hasPrivileges", + "description": [], + "signature": [ + "(params: Pick<", + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.ApmDataAccessPrivilegesCheck", + "text": "ApmDataAccessPrivilegesCheck" + }, + ", \"request\">) => Promise" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "apmDataAccess", + "id": "def-server.ApmDataAccessPluginStart.hasPrivileges.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Pick<", + { + "pluginId": "apmDataAccess", + "scope": "server", + "docId": "kibApmDataAccessPluginApi", + "section": "def-server.ApmDataAccessPrivilegesCheck", + "text": "ApmDataAccessPrivilegesCheck" + }, + ", \"request\">" + ], + "path": "x-pack/plugins/observability_solution/apm_data_access/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "lifecycle": "start", "initialIsOpen": true } diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index 3364fd5aceb7b..2854ca2bbdaf0 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 74 | 0 | 74 | 1 | +| 93 | 0 | 93 | 0 | ## Server diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index cf9cfbc61ab0c..e7c6e707f8e45 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: 2024-08-14 +date: 2024-08-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 d1080dcd63eaf..619365af1643d 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: 2024-08-14 +date: 2024-08-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 1bdb61ee19099..1ab3eddd7b991 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: 2024-08-14 +date: 2024-08-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 1e07dc2997919..7fa08935f7142 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index 352a691873da8..ad5f7038d72fe 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -609,7 +609,8 @@ "Chart", ">, syncOptions: ", "ActiveCursorSyncOption", - ") => (cursor: any) => void" + ") => ", + "PointerUpdateListener" ], "path": "src/plugins/charts/public/services/active_cursor/use_active_cursor.ts", "deprecated": false, diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 913da46da385d..e36836b67f4b3 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: 2024-08-14 +date: 2024-08-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 ac7bc60b14c8c..633628f928786 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index 11dac530992bc..9b167e45282a1 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: 2024-08-14 +date: 2024-08-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 7a1fbd6d6ed53..52f333202a58e 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: 2024-08-14 +date: 2024-08-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 cd7880b96c778..32b7228146223 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: 2024-08-14 +date: 2024-08-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 2f3d003ebb208..8ece2af4ae732 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: 2024-08-14 +date: 2024-08-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 5cbf9631fc557..b110b5f0b93ea 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: 2024-08-14 +date: 2024-08-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 865fee25ddf29..9285ce9d55573 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.devdocs.json b/api_docs/controls.devdocs.json index 1c04186ae091e..fa81eb3778122 100644 --- a/api_docs/controls.devdocs.json +++ b/api_docs/controls.devdocs.json @@ -645,7 +645,7 @@ "section": "def-common.ControlGroupInput", "text": "ControlGroupInput" }, - ">, \"id\" | \"controlStyle\" | \"ignoreParentSettings\" | \"panels\" | \"chainingSystem\" | \"showApplySelections\">" + ">, \"id\" | \"chainingSystem\" | \"ignoreParentSettings\" | \"controlStyle\" | \"panels\" | \"showApplySelections\">" ], "path": "src/plugins/controls/public/control_group/embeddable/control_group_container.tsx", "deprecated": false, @@ -5276,41 +5276,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "controls", - "id": "def-public.ControlGroupRuntimeState.defaultControlGrow", - "type": "CompoundType", - "tags": [], - "label": "defaultControlGrow", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/controls/public/react_controls/control_group/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "controls", - "id": "def-public.ControlGroupRuntimeState.defaultControlWidth", - "type": "CompoundType", - "tags": [], - "label": "defaultControlWidth", - "description": [], - "signature": [ - { - "pluginId": "controls", - "scope": "common", - "docId": "kibControlsPluginApi", - "section": "def-common.ControlWidth", - "text": "ControlWidth" - }, - " | undefined" - ], - "path": "src/plugins/controls/public/react_controls/control_group/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "controls", "id": "def-public.ControlGroupRuntimeState.labelPosition", @@ -6572,18 +6537,6 @@ "text": "PublishesUnsavedChanges" }, ", \"unsavedChanges\"> & ", - "PublishesControlDisplaySettings", - " & { labelPosition: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" - }, - "<", - "ControlStyle", - ">; } & ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6655,7 +6608,17 @@ "section": "def-common.ControlInputTransform", "text": "ControlInputTransform" }, - " | undefined; } | undefined) => void; }" + " | undefined; } | undefined) => void; labelPosition: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "<", + "ControlStyle", + ">; }" ], "path": "src/plugins/controls/public/react_controls/control_group/types.ts", "deprecated": false, @@ -6919,9 +6882,7 @@ "section": "def-public.PublishesUnsavedChanges", "text": "PublishesUnsavedChanges" }, - " & ", - "PublishesControlDisplaySettings", - " & Partial<", + " & Partial<", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6989,7 +6950,31 @@ }, "<", "DefaultControlState", - ">; setDataLoading: (loading: boolean) => void; setBlockingError: (error: Error | undefined) => void; } & Omit<", + ">; setDataLoading: (loading: boolean) => void; setBlockingError: (error: Error | undefined) => void; grow: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "; width: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "<", + { + "pluginId": "controls", + "scope": "common", + "docId": "kibControlsPluginApi", + "section": "def-common.ControlWidth", + "text": "ControlWidth" + }, + " | undefined>; } & Omit<", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -7421,6 +7406,335 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder", + "type": "Object", + "tags": [], + "label": "controlGroupStateBuilder", + "description": [], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addDataControlFromField", + "type": "Function", + "tags": [], + "label": "addDataControlFromField", + "description": [], + "signature": [ + "(controlGroupState: Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">, controlState: ", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.DefaultDataControlState", + "text": "DefaultDataControlState" + }, + ", controlId?: string | undefined) => Promise" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addDataControlFromField.$1", + "type": "Object", + "tags": [], + "label": "controlGroupState", + "description": [], + "signature": [ + "Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addDataControlFromField.$2", + "type": "Object", + "tags": [], + "label": "controlState", + "description": [], + "signature": [ + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.DefaultDataControlState", + "text": "DefaultDataControlState" + } + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addDataControlFromField.$3", + "type": "string", + "tags": [], + "label": "controlId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addOptionsListControl", + "type": "Function", + "tags": [], + "label": "addOptionsListControl", + "description": [], + "signature": [ + "(controlGroupState: Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">, controlState: ", + "OptionsListControlState", + ", controlId?: string | undefined) => void" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addOptionsListControl.$1", + "type": "Object", + "tags": [], + "label": "controlGroupState", + "description": [], + "signature": [ + "Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addOptionsListControl.$2", + "type": "Object", + "tags": [], + "label": "controlState", + "description": [], + "signature": [ + "OptionsListControlState" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addOptionsListControl.$3", + "type": "string", + "tags": [], + "label": "controlId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addRangeSliderControl", + "type": "Function", + "tags": [], + "label": "addRangeSliderControl", + "description": [], + "signature": [ + "(controlGroupState: Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">, controlState: ", + "RangesliderControlState", + ", controlId?: string | undefined) => void" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addRangeSliderControl.$1", + "type": "Object", + "tags": [], + "label": "controlGroupState", + "description": [], + "signature": [ + "Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addRangeSliderControl.$2", + "type": "Object", + "tags": [], + "label": "controlState", + "description": [], + "signature": [ + "RangesliderControlState" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addRangeSliderControl.$3", + "type": "string", + "tags": [], + "label": "controlId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addTimeSliderControl", + "type": "Function", + "tags": [], + "label": "addTimeSliderControl", + "description": [], + "signature": [ + "(controlGroupState: Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">, controlId?: string | undefined) => void" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addTimeSliderControl.$1", + "type": "Object", + "tags": [], + "label": "controlGroupState", + "description": [], + "signature": [ + "Partial<", + { + "pluginId": "controls", + "scope": "public", + "docId": "kibControlsPluginApi", + "section": "def-public.ControlGroupRuntimeState", + "text": "ControlGroupRuntimeState" + }, + ">" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "controls", + "id": "def-public.controlGroupStateBuilder.addTimeSliderControl.$2", + "type": "string", + "tags": [], + "label": "controlId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/controls/public/react_controls/control_group/control_group_state_builder.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false } ] }, @@ -7556,11 +7870,7 @@ "section": "def-common.ControlsPanels", "text": "ControlsPanels" }, - "; controlStyle: ", - "ControlStyle", - "; ignoreParentSettings?: ", - "ParentIgnoreSettings", - " | undefined; chainingSystem: ", + "; chainingSystem: ", { "pluginId": "controls", "scope": "common", @@ -7568,6 +7878,10 @@ "section": "def-common.ControlGroupChainingSystem", "text": "ControlGroupChainingSystem" }, + "; ignoreParentSettings?: ", + "ParentIgnoreSettings", + " | undefined; controlStyle: ", + "ControlStyle", "; showApplySelections?: boolean | undefined; } | undefined" ], "path": "src/plugins/controls/common/control_group/control_group_persistence.ts", @@ -8691,25 +9005,25 @@ "label": "PersistableControlGroupInput", "description": [], "signature": [ - "{ controlStyle: ", - "ControlStyle", - "; ignoreParentSettings?: ", - "ParentIgnoreSettings", - " | undefined; panels: ", + "{ chainingSystem: ", { "pluginId": "controls", "scope": "common", "docId": "kibControlsPluginApi", - "section": "def-common.ControlsPanels", - "text": "ControlsPanels" + "section": "def-common.ControlGroupChainingSystem", + "text": "ControlGroupChainingSystem" }, - "; chainingSystem: ", + "; ignoreParentSettings?: ", + "ParentIgnoreSettings", + " | undefined; controlStyle: ", + "ControlStyle", + "; panels: ", { "pluginId": "controls", "scope": "common", "docId": "kibControlsPluginApi", - "section": "def-common.ControlGroupChainingSystem", - "text": "ControlGroupChainingSystem" + "section": "def-common.ControlsPanels", + "text": "ControlsPanels" }, "; showApplySelections?: boolean | undefined; }" ], @@ -8728,7 +9042,7 @@ "\nOnly parts of the Control Group Input should be persisted" ], "signature": [ - "(\"controlStyle\" | \"ignoreParentSettings\" | \"panels\" | \"chainingSystem\" | \"showApplySelections\")[]" + "(\"chainingSystem\" | \"ignoreParentSettings\" | \"controlStyle\" | \"panels\" | \"showApplySelections\")[]" ], "path": "src/plugins/controls/common/control_group/types.ts", "deprecated": false, diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 9ed4d84ac7ed7..c27608737678d 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kib | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 380 | 0 | 371 | 27 | +| 394 | 0 | 385 | 28 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 6c37cab99adea..95c3d19fd414b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.devdocs.json b/api_docs/dashboard.devdocs.json index 3a5a539dc0807..805e3041563a0 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -1721,17 +1721,17 @@ "(id: string, references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]) => ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -1765,9 +1765,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -2356,9 +2356,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 1b781897b7a2b..b0ad103707038 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: 2024-08-14 +date: 2024-08-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 a5de868b7733d..832f73db04e10 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: 2024-08-14 +date: 2024-08-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 5af00566bd450..21c6295f9e49e 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -2690,7 +2690,7 @@ "section": "def-public.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; enableUiSettingsValidations: boolean; }>>" + "; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; query: Readonly<{} & { timefilter: Readonly<{} & { minRefreshInterval: number; }>; }>; enableUiSettingsValidations: boolean; }>>" ], "path": "src/plugins/data/public/plugin.ts", "deprecated": false, @@ -11983,7 +11983,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; enableUiSettingsValidations: boolean; }>>" + "; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; query: Readonly<{} & { timefilter: Readonly<{} & { minRefreshInterval: number; }>; }>; enableUiSettingsValidations: boolean; }>>" ], "path": "src/plugins/data/server/plugin.ts", "deprecated": false, @@ -16070,7 +16070,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -16106,6 +16106,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -16164,6 +16190,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -16758,7 +16786,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -16784,7 +16814,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -17030,6 +17060,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 2722cc2f0be5b..cdb9131d3e7c2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_quality.mdx b/api_docs/data_quality.mdx index d31fb3025796f..75a79d6bd9475 100644 --- a/api_docs/data_quality.mdx +++ b/api_docs/data_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataQuality title: "dataQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the dataQuality plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataQuality'] --- import dataQualityObj from './data_quality.devdocs.json'; diff --git a/api_docs/data_query.devdocs.json b/api_docs/data_query.devdocs.json index fcb1d445f23ae..eec375eb64279 100644 --- a/api_docs/data_query.devdocs.json +++ b/api_docs/data_query.devdocs.json @@ -3430,7 +3430,7 @@ "section": "def-common.RefreshInterval", "text": "RefreshInterval" }, - "; setRefreshInterval: (refreshInterval: Partial<", + "; getMinRefreshInterval: () => number; setRefreshInterval: (refreshInterval: Partial<", { "pluginId": "data", "scope": "common", @@ -3834,7 +3834,7 @@ "section": "def-common.RefreshInterval", "text": "RefreshInterval" }, - "; setRefreshInterval: (refreshInterval: Partial<", + "; getMinRefreshInterval: () => number; setRefreshInterval: (refreshInterval: Partial<", { "pluginId": "data", "scope": "common", diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 43d20508552ba..55c89861e67d1 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index 0d2eb09086dc9..7baaa41c1bfd6 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -1342,7 +1342,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{} & { search: Readonly<{} & { aggs: Readonly<{} & { shardDelay: Readonly<{} & { enabled: boolean; }>; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; enableUiSettingsValidations: boolean; }>" + "Readonly<{} & { search: Readonly<{} & { aggs: Readonly<{} & { shardDelay: Readonly<{} & { enabled: boolean; }>; }>; asyncSearch: Readonly<{ pollInterval?: number | undefined; } & { waitForCompletion: moment.Duration; keepAlive: moment.Duration; batchedReduceSize: number; }>; sessions: Readonly<{} & { enabled: boolean; management: Readonly<{} & { refreshInterval: moment.Duration; maxSessions: number; refreshTimeout: moment.Duration; expiresSoonWarning: moment.Duration; }>; notTouchedTimeout: moment.Duration; maxUpdateRetries: number; defaultExpiration: moment.Duration; }>; }>; query: Readonly<{} & { timefilter: Readonly<{} & { minRefreshInterval: number; }>; }>; enableUiSettingsValidations: boolean; }>" ], "path": "src/plugins/data/server/search/session/session_service.ts", "deprecated": false, diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 50938b3857002..388dfd43a359c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 3d2a1f8171a4a..b5527231113c7 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: 2024-08-14 +date: 2024-08-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 7f47158264a19..d8b1353e1060b 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: 2024-08-14 +date: 2024-08-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 46c6de156af56..b3ca7699fce6b 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: 2024-08-14 +date: 2024-08-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 64fbde62fb821..f003397257a1f 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -12788,7 +12788,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -12824,6 +12824,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -12882,6 +12908,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -13476,7 +13504,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -13502,7 +13532,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -13748,6 +13778,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -14028,7 +14060,7 @@ }, { "plugin": "@kbn/unified-field-list", - "path": "packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts" + "path": "packages/kbn-unified-field-list/src/services/field_stats/load_field_stats.ts" }, { "plugin": "@kbn/unified-field-list", @@ -14036,7 +14068,7 @@ }, { "plugin": "@kbn/unified-field-list", - "path": "packages/kbn-unified-field-list/src/services/field_stats/load_field_stats.ts" + "path": "packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts" }, { "plugin": "lens", @@ -14186,14 +14218,14 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, - { - "plugin": "@kbn/ml-data-view-utils", - "path": "x-pack/packages/ml/data_view_utils/actions/data_view_handler.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, + { + "plugin": "@kbn/ml-data-view-utils", + "path": "x-pack/packages/ml/data_view_utils/actions/data_view_handler.ts" + }, { "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/public/applications/analytics/utils/find_or_create_data_view.ts" diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 9fa05ec9eadd0..d9d3ead614386 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: 2024-08-14 +date: 2024-08-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 03b29b8db8626..2b966b1f67d3c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.devdocs.json b/api_docs/dataset_quality.devdocs.json index 4e12827e79f3f..abb0b1320eb0c 100644 --- a/api_docs/dataset_quality.devdocs.json +++ b/api_docs/dataset_quality.devdocs.json @@ -94,7 +94,62 @@ "DatasetQualityPublicState", "> | undefined; }" ], - "path": "x-pack/plugins/observability_solution/dataset_quality/public/controller/create_controller.ts", + "path": "x-pack/plugins/observability_solution/dataset_quality/public/controller/dataset_quality/create_controller.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "datasetQuality", + "id": "def-public.DatasetQualityPluginStart.DatasetQualityDetails", + "type": "CompoundType", + "tags": [], + "label": "DatasetQualityDetails", + "description": [], + "signature": [ + "React.ComponentClass<", + "DatasetQualityDetailsProps", + ", any> | React.FunctionComponent<", + "DatasetQualityDetailsProps", + ">" + ], + "path": "x-pack/plugins/observability_solution/dataset_quality/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "datasetQuality", + "id": "def-public.DatasetQualityPluginStart.createDatasetQualityDetailsController", + "type": "Function", + "tags": [], + "label": "createDatasetQualityDetailsController", + "description": [], + "signature": [ + "({ initialState, }: { initialState: ", + "DatasetQualityDetailsPublicStateUpdate", + "; }) => Promise<", + "DatasetQualityDetailsController", + ">" + ], + "path": "x-pack/plugins/observability_solution/dataset_quality/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "datasetQuality", + "id": "def-public.DatasetQualityPluginStart.createDatasetQualityDetailsController.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "{ initialState: ", + "DatasetQualityDetailsPublicStateUpdate", + "; }" + ], + "path": "x-pack/plugins/observability_solution/dataset_quality/public/controller/dataset_quality_details/create_controller.ts", "deprecated": false, "trackAdoption": false } @@ -115,7 +170,41 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "datasetQuality", + "id": "def-common.indexNameToDataStreamParts", + "type": "Function", + "tags": [], + "label": "indexNameToDataStreamParts", + "description": [], + "signature": [ + "(dataStreamName: string) => { type: \"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\"; dataset: string; namespace: string; }" + ], + "path": "x-pack/plugins/observability_solution/dataset_quality/common/utils/dataset_name.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "datasetQuality", + "id": "def-common.indexNameToDataStreamParts.$1", + "type": "string", + "tags": [], + "label": "dataStreamName", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/observability_solution/dataset_quality/common/utils/dataset_name.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "datasetQuality", @@ -151,15 +240,9 @@ "DatasetQualityRouteHandlerResources", " & { params: { path: { integration: string; }; }; }) => Promise<{ dashboards: { id: string; title: string; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", - "; \"GET /internal/dataset_quality/integrations\": { endpoint: \"GET /internal/dataset_quality/integrations\"; params?: ", - "TypeC", - "<{ query: ", - "PartialC", - "<{ type: ", - "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>; }> | undefined; handler: ({}: ", + "; \"GET /internal/dataset_quality/integrations\": { endpoint: \"GET /internal/dataset_quality/integrations\"; params?: undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", + ") => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ src: string; } & { path?: string | undefined; size?: string | undefined; title?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\"; params?: ", "TypeC", @@ -169,7 +252,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; }>; } & ", + " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; datasetUserPrivileges?: ({ canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }) | undefined; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/details\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/details\"; params?: ", "TypeC", @@ -203,9 +286,13 @@ "DatasetQualityRouteHandlerResources", " & { params: { path: { dataStream: string; }; query: { start: number; end: number; }; }; }) => Promise<{ degradedFields: { name: string; count: number; lastOccurrence: number | null; timeSeries: { x: number; y: number; }[]; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", - "; \"GET /internal/dataset_quality/data_streams/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/non_aggregatable\"; params?: ", + "; \"GET /internal/dataset_quality/data_streams/{dataStream}/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/non_aggregatable\"; params?: ", "TypeC", - "<{ query: ", + "<{ path: ", + "TypeC", + "<{ dataStream: ", + "StringC", + "; }>; query: ", "IntersectionC", "<[", "TypeC", @@ -214,16 +301,34 @@ "; end: ", "Type", "; }>, ", - "PartialC", + "TypeC", "<{ type: ", "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>]>; }> | undefined; handler: ({}: ", + "DatasetQualityRouteHandlerResources", + " & { params: { path: { dataStream: string; }; query: { start: number; end: number; } & { type: \"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\"; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", + "DatasetQualityRouteCreateOptions", + "; \"GET /internal/dataset_quality/data_streams/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/non_aggregatable\"; params?: ", + "TypeC", + "<{ query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ types: ", + "Type", + "<(\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], unknown>; }>, ", "PartialC", "<{ dataStream: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { start: number; end: number; } & { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { dataStream?: string | undefined; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", + " & { params: { query: { start: number; end: number; } & { types: (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[]; } & { dataStream?: string | undefined; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/degraded_docs\": { endpoint: \"GET /internal/dataset_quality/data_streams/degraded_docs\"; params?: ", "TypeC", @@ -236,7 +341,7 @@ "; end: ", "Type", "; }>, ", - "PartialC", + "TypeC", "<{ type: ", "KeyofC", "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", @@ -245,23 +350,23 @@ "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { start: number; end: number; } & { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ degradedDocs: { dataset: string; count: number; docsCount: number; percentage: number; }[]; }>; } & ", + " & { params: { query: { start: number; end: number; } & { type: \"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\"; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ degradedDocs: { dataset: string; count: number; docsCount: number; percentage: number; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/stats\": { endpoint: \"GET /internal/dataset_quality/data_streams/stats\"; params?: ", "TypeC", "<{ query: ", "IntersectionC", "<[", - "PartialC", - "<{ type: ", - "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", + "TypeC", + "<{ types: ", + "Type", + "<(\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], unknown>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ datasetUserPrivileges: { canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }; dataStreamsStats: ({ name: string; userPrivileges: { canMonitor: boolean; }; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; totalDocs?: number | null | undefined; })[]; }>; } & ", + " & { params: { query: { types: (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[]; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ datasetUserPrivileges: { canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }; dataStreamsStats: ({ name: string; userPrivileges: { canMonitor: boolean; }; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; totalDocs?: number | null | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; }[TEndpoint] extends { endpoint: any; params?: infer TRouteParamsRT extends ", { @@ -312,15 +417,9 @@ "DatasetQualityRouteHandlerResources", " & { params: { path: { integration: string; }; }; }) => Promise<{ dashboards: { id: string; title: string; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", - "; \"GET /internal/dataset_quality/integrations\": { endpoint: \"GET /internal/dataset_quality/integrations\"; params?: ", - "TypeC", - "<{ query: ", - "PartialC", - "<{ type: ", - "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>; }> | undefined; handler: ({}: ", + "; \"GET /internal/dataset_quality/integrations\": { endpoint: \"GET /internal/dataset_quality/integrations\"; params?: undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", + ") => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ src: string; } & { path?: string | undefined; size?: string | undefined; title?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\"; params?: ", "TypeC", @@ -330,7 +429,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; }>; } & ", + " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; datasetUserPrivileges?: ({ canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }) | undefined; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/details\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/details\"; params?: ", "TypeC", @@ -364,9 +463,13 @@ "DatasetQualityRouteHandlerResources", " & { params: { path: { dataStream: string; }; query: { start: number; end: number; }; }; }) => Promise<{ degradedFields: { name: string; count: number; lastOccurrence: number | null; timeSeries: { x: number; y: number; }[]; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", - "; \"GET /internal/dataset_quality/data_streams/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/non_aggregatable\"; params?: ", + "; \"GET /internal/dataset_quality/data_streams/{dataStream}/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/non_aggregatable\"; params?: ", "TypeC", - "<{ query: ", + "<{ path: ", + "TypeC", + "<{ dataStream: ", + "StringC", + "; }>; query: ", "IntersectionC", "<[", "TypeC", @@ -375,16 +478,34 @@ "; end: ", "Type", "; }>, ", - "PartialC", + "TypeC", "<{ type: ", "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>]>; }> | undefined; handler: ({}: ", + "DatasetQualityRouteHandlerResources", + " & { params: { path: { dataStream: string; }; query: { start: number; end: number; } & { type: \"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\"; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", + "DatasetQualityRouteCreateOptions", + "; \"GET /internal/dataset_quality/data_streams/non_aggregatable\": { endpoint: \"GET /internal/dataset_quality/data_streams/non_aggregatable\"; params?: ", + "TypeC", + "<{ query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ types: ", + "Type", + "<(\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], unknown>; }>, ", "PartialC", "<{ dataStream: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { start: number; end: number; } & { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { dataStream?: string | undefined; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", + " & { params: { query: { start: number; end: number; } & { types: (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[]; } & { dataStream?: string | undefined; }; }; }) => Promise<{ aggregatable: boolean; datasets: string[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/degraded_docs\": { endpoint: \"GET /internal/dataset_quality/data_streams/degraded_docs\"; params?: ", "TypeC", @@ -397,7 +518,7 @@ "; end: ", "Type", "; }>, ", - "PartialC", + "TypeC", "<{ type: ", "KeyofC", "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", @@ -406,23 +527,23 @@ "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { start: number; end: number; } & { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ degradedDocs: { dataset: string; count: number; docsCount: number; percentage: number; }[]; }>; } & ", + " & { params: { query: { start: number; end: number; } & { type: \"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\"; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ degradedDocs: { dataset: string; count: number; docsCount: number; percentage: number; }[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/stats\": { endpoint: \"GET /internal/dataset_quality/data_streams/stats\"; params?: ", "TypeC", "<{ query: ", "IntersectionC", "<[", - "PartialC", - "<{ type: ", - "KeyofC", - "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", + "TypeC", + "<{ types: ", + "Type", + "<(\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[], unknown>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ datasetUserPrivileges: { canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }; dataStreamsStats: ({ name: string; userPrivileges: { canMonitor: boolean; }; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; totalDocs?: number | null | undefined; })[]; }>; } & ", + " & { params: { query: { types: (\"profiling\" | \"metrics\" | \"synthetics\" | \"traces\" | \"logs\")[]; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ datasetUserPrivileges: { canMonitor: boolean; } & { canRead: boolean; canViewIntegrations: boolean; }; dataStreamsStats: ({ name: string; userPrivileges: { canMonitor: boolean; }; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; totalDocs?: number | null | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; }[TEndpoint] extends { endpoint: any; params?: any; handler: ({}: any) => Promise; } & ", { diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index d8b1f0d27e875..a004742ecdb4f 100644 --- a/api_docs/dataset_quality.mdx +++ b/api_docs/dataset_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/datasetQuality title: "datasetQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the datasetQuality plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'datasetQuality'] --- import datasetQualityObj from './dataset_quality.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 10 | 5 | +| 15 | 0 | 15 | 8 | ## Client @@ -36,6 +36,9 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux ## Common +### Functions + + ### Interfaces diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 7e748eaead0cf..042e262eebdfb 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -22,7 +22,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | actions, savedObjectsTagging, ml, enterpriseSearch | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjects, visualizations, aiops, dataVisualizer, ml, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation, @kbn/core-saved-objects-browser-mocks | - | | | @kbn/core, savedObjects, embeddable, visualizations, canvas, graph, ml | - | -| | @kbn/core-saved-objects-base-server-internal, @kbn/core-saved-objects-migration-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-ui-settings-server-internal, @kbn/core-usage-data-server-internal, spaces, taskManager, actions, @kbn/core-saved-objects-migration-server-mocks, share, dataViews, data, alerting, lens, cases, savedSearch, canvas, fleet, cloudSecurityPosture, ml, logsShared, graph, lists, maps, visualizations, infra, apmDataAccess, securitySolution, apm, slo, synthetics, uptime, dashboard, eventAnnotation, links, savedObjectsManagement, @kbn/core-test-helpers-so-type-serializer, @kbn/core-saved-objects-api-server-internal | - | +| | @kbn/core-saved-objects-base-server-internal, @kbn/core-saved-objects-migration-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-ui-settings-server-internal, @kbn/core-usage-data-server-internal, taskManager, spaces, actions, @kbn/core-saved-objects-migration-server-mocks, share, dataViews, data, alerting, lens, cases, savedSearch, canvas, fleet, cloudSecurityPosture, ml, logsShared, graph, lists, maps, visualizations, infra, apmDataAccess, securitySolution, apm, slo, synthetics, uptime, dashboard, eventAnnotation, links, savedObjectsManagement, @kbn/core-test-helpers-so-type-serializer, @kbn/core-saved-objects-api-server-internal | - | | | stackAlerts, alerting, securitySolution, inputControlVis | - | | | graph, stackAlerts, inputControlVis, securitySolution, savedObjects | - | | | dashboard, dataVisualizer, stackAlerts, expressionPartitionVis | - | @@ -30,7 +30,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | triggersActionsUi | - | | | triggersActionsUi | - | | | @kbn/core, visualizations, triggersActionsUi | - | -| | ruleRegistry, securitySolution, synthetics, slo | - | +| | ruleRegistry, securitySolution, slo | - | | | security, actions, alerting, ruleRegistry, files, cases, fleet, securitySolution | - | | | securitySolution, cloudChat, observabilityOnboarding | - | | | alerting, securitySolution | - | @@ -51,7 +51,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, @kbn/core, actions, @kbn/alerting-types, alerting, savedSearch, canvas, enterpriseSearch, securitySolution, taskManager, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | | | @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, savedSearch, canvas, savedObjectsTagging, graph, lists, maps, visualizations, securitySolution, dashboard, @kbn/core-test-helpers-so-type-serializer | - | -| | security, securitySolution, cloudLinks, observabilityAIAssistantApp, cases | - | +| | security, securitySolution, cloudLinks, cases | - | | | security, cases, searchPlayground, securitySolution | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | @@ -67,10 +67,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | @kbn/monaco, securitySolution | - | | | cloudSecurityPosture, securitySolution | - | -| | fleet, exploratoryView, osquery, synthetics | - | -| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, enterpriseSearch, serverlessSearch, transform, upgradeAssistant, apm, entityManager, synthetics, security | - | | | cloudChat | - | | | @kbn/core-elasticsearch-server-internal, @kbn/core-plugins-server-internal, enterpriseSearch, observabilityOnboarding, console | - | +| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, enterpriseSearch, serverlessSearch, transform, upgradeAssistant, apm, entityManager, synthetics, security | - | | | actions, alerting | - | | | monitoring | - | | | @kbn/core-saved-objects-api-browser, @kbn/core, savedObjects, savedObjectsManagement, visualizations, savedObjectsTagging, eventAnnotation, lens, maps, graph, dashboard, savedObjectsTaggingOss, kibanaUtils, expressions, data, embeddable, uiActionsEnhanced, controls, canvas, dashboardEnhanced, globalSearchProviders | - | @@ -107,6 +106,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-saved-objects-api-server-internal | - | | | @kbn/core-saved-objects-api-server-internal, canvas | - | | | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-migration-server-internal, spaces, data, savedSearch, cloudSecurityPosture, visualizations, dashboard, @kbn/core-test-helpers-so-type-serializer | - | +| | fleet, exploratoryView, osquery, synthetics | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement | - | @@ -165,6 +165,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core | - | | | @kbn/core-plugins-server-internal | - | | | encryptedSavedObjects | - | +| | @kbn/esql-validation-autocomplete | - | | | reporting | - | | | @kbn/reporting-export-types-csv, reporting | - | | | @kbn/reporting-export-types-csv, reporting | - | @@ -176,10 +177,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | spaces, security, actions, alerting, aiops, remoteClusters, ml, graph, indexLifecycleManagement, mapsEms, osquery, securitySolution, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | 8.8.0 | | | fleet, apm, security, securitySolution | 8.8.0 | | | fleet, apm, security, securitySolution | 8.8.0 | -| | spaces, security, alerting, cases | 8.8.0 | +| | spaces, @kbn/security-authorization-core, security, alerting, cases, @kbn/security-role-management-model | 8.8.0 | | | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, fleet, security, kibanaOverview, @kbn/core | 8.8.0 | | | embeddable, presentationUtil, lens, dashboard, discover, graph, links | 8.8.0 | -| | security | 8.8.0 | +| | security, @kbn/security-role-management-model | 8.8.0 | | | apm | 8.8.0 | | | mapsEms | 8.8.0 | | | savedObjectsTaggingOss | 8.8.0 | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 79cc9134de216..ff486f398a86f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -339,6 +339,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/esql-validation-autocomplete + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [helpers.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts#:~:text=quoted), [variables.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-esql-validation-autocomplete/src/shared/variables.ts#:~:text=quoted) | - | + + + ## @kbn/lens-embeddable-utils | Deprecated API | Reference location(s) | Remove By | @@ -420,6 +428,23 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/security-authorization-core + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures)+ 20 more | 8.8.0 | + + + +## @kbn/security-role-management-model + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [kibana_privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts#:~:text=getKibanaFeatures), [kibana_privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts#:~:text=getKibanaFeatures) | 8.8.0 | +| | [kibana_privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts#:~:text=getElasticsearchFeatures) | 8.8.0 | + + + ## @kbn/securitysolution-data-table | Deprecated API | Reference location(s) | Remove By | @@ -452,7 +477,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts#:~:text=title), [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/services/field_stats/load_field_stats.ts#:~:text=title) | - | +| | [load_field_stats.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/services/field_stats/load_field_stats.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts#:~:text=title), [use_existing_fields.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts#:~:text=title) | - | @@ -953,7 +978,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [register_embeddable_widget.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx#:~:text=getEmbeddableFactory) | - | +| | [register_embeddable_item.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx#:~:text=getEmbeddableFactory) | - | @@ -1125,14 +1150,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] -## observabilityAIAssistantApp - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [use_current_user.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_current_user.ts#:~:text=authc) | - | - - - ## observabilityOnboarding | Deprecated API | Reference location(s) | Remove By | @@ -1325,7 +1342,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ This is relied on by the reporting feature, and should be removed once reporting migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/issues/19914 | -| | [app_authorization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.ts#:~:text=getKibanaFeatures), [privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.ts#:~:text=getKibanaFeatures), [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getKibanaFeatures), [app_authorization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures)+ 24 more | 8.8.0 | +| | [app_authorization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.ts#:~:text=getKibanaFeatures), [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getKibanaFeatures), [app_authorization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.test.ts#:~:text=getKibanaFeatures) | 8.8.0 | | | [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getElasticsearchFeatures) | 8.8.0 | | | [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | 8.8.0 | | | [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/plugin.tsx#:~:text=license%24) | 8.8.0 | @@ -1357,8 +1374,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | | | [api.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts#:~:text=options) | - | | | [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [validators.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts#:~:text=title) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | | | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | @@ -1367,7 +1384,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 76 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 74 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject) | - | @@ -1460,7 +1477,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [message_utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.ts#:~:text=alertFactory), [tls_rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule.ts#:~:text=alertFactory) | - | | | [stderr_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx#:~:text=indexPatternId) | - | | | [synthetics_private_location.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts#:~:text=policy_id) | - | | | [synthetics_private_location.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts#:~:text=policy_id) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 1767ab186d53f..ff84592761b61 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -87,8 +87,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ This is relied on by the reporting feature, and should be removed once reporting migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/issues/19914 | -| security | | [app_authorization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.ts#:~:text=getKibanaFeatures), [privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.ts#:~:text=getKibanaFeatures), [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getKibanaFeatures), [app_authorization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts#:~:text=getKibanaFeatures)+ 27 more | 8.8.0 | -| security | | [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getElasticsearchFeatures) | 8.8.0 | +| security | | [app_authorization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.ts#:~:text=getKibanaFeatures), [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getKibanaFeatures), [app_authorization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/app_authorization.test.ts#:~:text=getKibanaFeatures), [on_post_auth_interceptor.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.ts#:~:text=getKibanaFeatures), [spaces_usage_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts#:~:text=getKibanaFeatures), [on_post_auth_interceptor.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts#:~:text=getKibanaFeatures), [privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures), [privileges.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts#:~:text=getKibanaFeatures)+ 28 more | 8.8.0 | +| security | | [authorization_service.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/authorization/authorization_service.tsx#:~:text=getElasticsearchFeatures), [kibana_privileges.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts#:~:text=getElasticsearchFeatures) | 8.8.0 | | security | | [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | 8.8.0 | | security | | [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/plugin.tsx#:~:text=license%24) | 8.8.0 | | security | | [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | 8.8.0 | diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index f6bf395ae0f34..416e31787c74c 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: 2024-08-14 +date: 2024-08-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 ed0d600efff04..b55e78eeafff9 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -511,6 +511,29 @@ "path": "src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "discover", + "id": "def-public.DiscoverAppState.density", + "type": "CompoundType", + "tags": [], + "label": "density", + "description": [ + "\nDensity of table" + ], + "signature": [ + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.DataGridDensity", + "text": "DataGridDensity" + }, + " | undefined" + ], + "path": "src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 5669ab1d8aebc..071e5e688a0f2 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: 2024-08-14 +date: 2024-08-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 | |-------------------|-----------|------------------------|-----------------| -| 149 | 0 | 102 | 26 | +| 150 | 0 | 102 | 26 | ## Client diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 4253d0232c85f..c7c4032f0512e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/discover_shared.mdx b/api_docs/discover_shared.mdx index 0f95045f9a597..7c573ebb8fdd1 100644 --- a/api_docs/discover_shared.mdx +++ b/api_docs/discover_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverShared title: "discoverShared" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverShared plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverShared'] --- import discoverSharedObj from './discover_shared.devdocs.json'; diff --git a/api_docs/ecs_data_quality_dashboard.mdx b/api_docs/ecs_data_quality_dashboard.mdx index 447643e07670f..37297441ca339 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ecsDataQualityDashboard'] --- import ecsDataQualityDashboardObj from './ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/elastic_assistant.devdocs.json b/api_docs/elastic_assistant.devdocs.json index 0943f010a0d08..2ea883a26f65b 100644 --- a/api_docs/elastic_assistant.devdocs.json +++ b/api_docs/elastic_assistant.devdocs.json @@ -381,7 +381,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -417,6 +417,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -475,6 +501,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1069,7 +1097,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1095,7 +1125,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1341,6 +1371,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index 434019e1b7251..f417b757a472f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.devdocs.json'; diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 2f366ce07e0ae..c0aa77ca3f341 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -8980,7 +8980,7 @@ "section": "def-public.PresentationPanelProps", "text": "PresentationPanelProps" }, - ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideHeader\" | \"hideInspector\"> | undefined; hidePanelChrome?: boolean | undefined; onAnyStateChange?: ((state: ", + ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\"> | undefined; hidePanelChrome?: boolean | undefined; onAnyStateChange?: ((state: ", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -9094,7 +9094,7 @@ "section": "def-public.PresentationPanelProps", "text": "PresentationPanelProps" }, - ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideHeader\" | \"hideInspector\"> | undefined" + ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\"> | undefined" ], "path": "src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx", "deprecated": false, @@ -14281,9 +14281,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -14874,7 +14874,7 @@ }, { "plugin": "investigateApp", - "path": "x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx" + "path": "x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx" }, { "plugin": "dashboard", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 384d0b43d5421..8d2e058404ec9 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: 2024-08-14 +date: 2024-08-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 bdd40b0f1f7ab..af76b2b9f51f3 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: 2024-08-14 +date: 2024-08-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 5cedbfc206f65..48fe25d07357c 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: 2024-08-14 +date: 2024-08-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 b257354955e3d..c672c9411cf31 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/entities_data_access.mdx b/api_docs/entities_data_access.mdx index d7e0a6263c7a5..47bd2cdb4f29b 100644 --- a/api_docs/entities_data_access.mdx +++ b/api_docs/entities_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entitiesDataAccess title: "entitiesDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the entitiesDataAccess plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entitiesDataAccess'] --- import entitiesDataAccessObj from './entities_data_access.devdocs.json'; diff --git a/api_docs/entity_manager.mdx b/api_docs/entity_manager.mdx index dcbe4bae12c0d..789c49a7b6b78 100644 --- a/api_docs/entity_manager.mdx +++ b/api_docs/entity_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entityManager title: "entityManager" image: https://source.unsplash.com/400x175/?github description: API docs for the entityManager plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entityManager'] --- import entityManagerObj from './entity_manager.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index adffb55eaff37..06657f643de68 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/esql.mdx b/api_docs/esql.mdx index 6926658855697..bd671f5ca74f8 100644 --- a/api_docs/esql.mdx +++ b/api_docs/esql.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esql title: "esql" image: https://source.unsplash.com/400x175/?github description: API docs for the esql plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esql'] --- import esqlObj from './esql.devdocs.json'; diff --git a/api_docs/esql_data_grid.mdx b/api_docs/esql_data_grid.mdx index 53ebfc4ae29f1..123fa10f8aad9 100644 --- a/api_docs/esql_data_grid.mdx +++ b/api_docs/esql_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esqlDataGrid title: "esqlDataGrid" image: https://source.unsplash.com/400x175/?github description: API docs for the esqlDataGrid plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esqlDataGrid'] --- import esqlDataGridObj from './esql_data_grid.devdocs.json'; diff --git a/api_docs/event_annotation.devdocs.json b/api_docs/event_annotation.devdocs.json index 008a69c12c41d..b82e76cd7f98c 100644 --- a/api_docs/event_annotation.devdocs.json +++ b/api_docs/event_annotation.devdocs.json @@ -584,9 +584,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", @@ -1102,9 +1102,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ContentManagementCrudTypes", + "section": "def-server.ContentManagementCrudTypes", "text": "ContentManagementCrudTypes" }, "<\"event-annotation-group\", ", diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 4aa5aab4d538a..711d4025d5653 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: 2024-08-14 +date: 2024-08-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 2d3df4b949804..cffa4a7a37623 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.devdocs.json b/api_docs/event_log.devdocs.json index b90ea6139d7d3..5233179e19fd1 100644 --- a/api_docs/event_log.devdocs.json +++ b/api_docs/event_log.devdocs.json @@ -1450,7 +1450,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; uuid?: string | undefined; flapping?: boolean | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; code?: string | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" + "(Readonly<{ log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; usage?: Readonly<{ request_body_bytes?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; type_id?: string | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; flapping?: boolean | undefined; uuid?: string | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; space_ids?: string[] | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; code?: string | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false, @@ -1470,7 +1470,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; uuid?: string | undefined; flapping?: boolean | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; code?: string | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; usage?: Readonly<{ request_body_bytes?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; type_id?: string | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; flapping?: boolean | undefined; uuid?: string | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; space_ids?: string[] | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; code?: string | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -1485,7 +1485,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; uuid?: string | undefined; flapping?: boolean | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; code?: string | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}> | undefined" + "Readonly<{ log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; error?: Readonly<{ id?: string | undefined; type?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; message?: string | undefined; tags?: string[] | undefined; rule?: Readonly<{ id?: string | undefined; version?: string | undefined; name?: string | undefined; license?: string | undefined; description?: string | undefined; uuid?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; kibana?: Readonly<{ task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; action?: Readonly<{ id?: string | undefined; name?: string | undefined; execution?: Readonly<{ source?: string | undefined; uuid?: string | undefined; gen_ai?: Readonly<{ usage?: Readonly<{ prompt_tokens?: string | number | undefined; completion_tokens?: string | number | undefined; total_tokens?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; usage?: Readonly<{ request_body_bytes?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; type_id?: string | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ outcome?: string | undefined; status?: string | undefined; summary?: Readonly<{ recovered?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; new?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; ongoing?: Readonly<{ count?: string | number | undefined; } & {}> | undefined; } & {}> | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; revision?: string | number | undefined; execution?: Readonly<{ uuid?: string | undefined; status?: string | undefined; metrics?: Readonly<{ total_search_duration_ms?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_delayed_alerts?: string | number | undefined; number_of_searches?: string | number | undefined; es_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; persist_alerts_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; backfill?: Readonly<{ id?: string | undefined; start?: string | undefined; interval?: string | undefined; } & {}> | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; flapping?: boolean | undefined; uuid?: string | undefined; maintenance_window_ids?: string[] | undefined; } & {}> | undefined; space_ids?: string[] | undefined; server_uuid?: string | undefined; saved_objects?: Readonly<{ id?: string | undefined; type?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; space_agnostic?: boolean | undefined; } & {}>[] | undefined; } & {}> | undefined; event?: Readonly<{ id?: string | undefined; type?: string[] | undefined; reason?: string | undefined; action?: string | undefined; start?: string | undefined; end?: string | undefined; outcome?: string | undefined; duration?: string | number | undefined; severity?: string | number | undefined; category?: string[] | undefined; timezone?: string | undefined; risk_score?: number | undefined; code?: string | undefined; url?: string | undefined; created?: string | undefined; dataset?: string | undefined; provider?: string | undefined; hash?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; reference?: string | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; user?: Readonly<{ id?: string | undefined; name?: string | undefined; } & {}> | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 78f84fc0c6710..1534b3b3f1730 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: 2024-08-14 +date: 2024-08-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 f68b3e9956140..cb40d975cd3b1 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: 2024-08-14 +date: 2024-08-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 f82eaf68f5ff0..914fed24aff6a 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: 2024-08-14 +date: 2024-08-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 72b23787c3540..0d2419e1eecad 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: 2024-08-14 +date: 2024-08-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 d169d5f0fe288..b3db561e3d18a 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: 2024-08-14 +date: 2024-08-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 475949de9d619..5c1c5e907a715 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: 2024-08-14 +date: 2024-08-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 3997fd35d6466..29d3b842af38e 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: 2024-08-14 +date: 2024-08-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 924596f823b2a..41ad0e8fc6bfd 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: 2024-08-14 +date: 2024-08-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 ddeedf5126ac5..5eed957cca3e1 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: 2024-08-14 +date: 2024-08-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 ba0f2ae59177a..04a1f127f3057 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: 2024-08-14 +date: 2024-08-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 f8ee49181b7fc..e501402fd044b 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: 2024-08-14 +date: 2024-08-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 24c67acb3a07e..0013e9322c03b 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: 2024-08-14 +date: 2024-08-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 805de1dcdd195..5b534beca1c59 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: 2024-08-14 +date: 2024-08-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 243328c151d67..86858a80556e7 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 98528c5658027..092bb02509863 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 3eaeb9b360dad..512fc82b621d1 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.devdocs.json b/api_docs/features.devdocs.json index e6c5019a037fb..6b01f79e4bb96 100644 --- a/api_docs/features.devdocs.json +++ b/api_docs/features.devdocs.json @@ -2104,12 +2104,12 @@ "path": "x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/app_authorization.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts" }, { "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.ts" + "path": "x-pack/plugins/security/server/authorization/app_authorization.ts" }, { "plugin": "security", @@ -2128,128 +2128,132 @@ "path": "x-pack/plugins/security/server/authorization/app_authorization.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "spaces", + "path": "x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-role-management-model", + "path": "x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-role-management-model", + "path": "x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/privileges/privileges.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "spaces", - "path": "x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/__fixtures__/kibana_privileges.ts" + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" + }, + { + "plugin": "@kbn/security-authorization-core", + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts" } ], "children": [], @@ -2285,6 +2289,10 @@ { "plugin": "security", "path": "x-pack/plugins/security/server/authorization/authorization_service.tsx" + }, + { + "plugin": "@kbn/security-role-management-model", + "path": "x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts" } ], "children": [], diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 08c9556b096bf..117718a0bb747 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: 2024-08-14 +date: 2024-08-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 db574772206aa..034cbdbcafa5d 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/fields_metadata.devdocs.json b/api_docs/fields_metadata.devdocs.json index b328d61dc2d34..fb8dbbf87b1f8 100644 --- a/api_docs/fields_metadata.devdocs.json +++ b/api_docs/fields_metadata.devdocs.json @@ -336,7 +336,7 @@ "label": "pick", "description": [], "signature": [ - "(props: (\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"beta\" | \"required\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]) => { name?: string | undefined; } & { allowed_values?: ({ description: string; name: string; } & { expected_event_types?: string[] | undefined; beta?: string | undefined; })[] | undefined; beta?: string | undefined; dashed_name?: string | undefined; description?: string | undefined; doc_values?: boolean | undefined; example?: unknown; expected_values?: string[] | undefined; flat_name?: string | undefined; format?: string | undefined; ignore_above?: number | undefined; index?: boolean | undefined; input_format?: string | undefined; level?: string | undefined; multi_fields?: { flat_name: string; name: string; type: string; }[] | undefined; normalize?: string[] | undefined; object_type?: string | undefined; original_fieldset?: string | undefined; output_format?: string | undefined; output_precision?: number | undefined; pattern?: string | undefined; required?: boolean | undefined; scaling_factor?: number | undefined; short?: string | undefined; source?: \"unknown\" | \"ecs\" | \"integration\" | \"metadata\" | undefined; type?: string | undefined; documentation_url?: string | undefined; }" + "(props: (\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"required\" | \"beta\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]) => { name?: string | undefined; } & { allowed_values?: ({ description: string; name: string; } & { expected_event_types?: string[] | undefined; beta?: string | undefined; })[] | undefined; beta?: string | undefined; dashed_name?: string | undefined; description?: string | undefined; doc_values?: boolean | undefined; example?: unknown; expected_values?: string[] | undefined; flat_name?: string | undefined; format?: string | undefined; ignore_above?: number | undefined; index?: boolean | undefined; input_format?: string | undefined; level?: string | undefined; multi_fields?: { flat_name: string; name: string; type: string; }[] | undefined; normalize?: string[] | undefined; object_type?: string | undefined; original_fieldset?: string | undefined; output_format?: string | undefined; output_precision?: number | undefined; pattern?: string | undefined; required?: boolean | undefined; scaling_factor?: number | undefined; short?: string | undefined; source?: \"unknown\" | \"ecs\" | \"integration\" | \"metadata\" | undefined; type?: string | undefined; documentation_url?: string | undefined; }" ], "path": "x-pack/plugins/fields_metadata/common/fields_metadata/models/field_metadata.ts", "deprecated": false, @@ -350,7 +350,7 @@ "label": "props", "description": [], "signature": [ - "(\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"beta\" | \"required\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]" + "(\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"required\" | \"beta\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]" ], "path": "x-pack/plugins/fields_metadata/common/fields_metadata/models/field_metadata.ts", "deprecated": false, @@ -454,7 +454,7 @@ "label": "pick", "description": [], "signature": [ - "(attributes: (\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"beta\" | \"required\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]) => Record" + "(attributes: (\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"required\" | \"beta\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]) => Record" ], "path": "x-pack/plugins/fields_metadata/common/fields_metadata/models/fields_metadata_dictionary.ts", "deprecated": false, @@ -468,7 +468,7 @@ "label": "attributes", "description": [], "signature": [ - "(\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"beta\" | \"required\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]" + "(\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"required\" | \"beta\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\")[]" ], "path": "x-pack/plugins/fields_metadata/common/fields_metadata/models/fields_metadata_dictionary.ts", "deprecated": false, @@ -605,7 +605,7 @@ "label": "FieldAttribute", "description": [], "signature": [ - "\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"beta\" | \"required\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\"" + "\"source\" | \"type\" | \"normalize\" | \"short\" | \"format\" | \"name\" | \"index\" | \"description\" | \"pattern\" | \"doc_values\" | \"ignore_above\" | \"required\" | \"beta\" | \"level\" | \"allowed_values\" | \"dashed_name\" | \"example\" | \"expected_values\" | \"flat_name\" | \"input_format\" | \"multi_fields\" | \"object_type\" | \"original_fieldset\" | \"output_format\" | \"output_precision\" | \"scaling_factor\" | \"documentation_url\"" ], "path": "x-pack/plugins/fields_metadata/common/fields_metadata/types.ts", "deprecated": false, diff --git a/api_docs/fields_metadata.mdx b/api_docs/fields_metadata.mdx index 4ae8167b5294f..e1e39ab378317 100644 --- a/api_docs/fields_metadata.mdx +++ b/api_docs/fields_metadata.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldsMetadata title: "fieldsMetadata" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldsMetadata plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldsMetadata'] --- import fieldsMetadataObj from './fields_metadata.devdocs.json'; diff --git a/api_docs/file_upload.devdocs.json b/api_docs/file_upload.devdocs.json index ec813208b95dd..791269ecab683 100644 --- a/api_docs/file_upload.devdocs.json +++ b/api_docs/file_upload.devdocs.json @@ -981,6 +981,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "fileUpload", + "id": "def-common.FindFileStructureResponse.document_type", + "type": "string", + "tags": [], + "label": "document_type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/file_upload/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "fileUpload", "id": "def-common.FindFileStructureResponse.field_stats", @@ -1295,6 +1309,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "fileUpload", + "id": "def-common.FindFileStructureResponse.ingest_pipeline", + "type": "Object", + "tags": [], + "label": "ingest_pipeline", + "description": [], + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.IngestPipeline", + "text": "IngestPipeline" + } + ], + "path": "x-pack/plugins/file_upload/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "fileUpload", "id": "def-common.FindFileStructureResponse.quote", @@ -1517,6 +1551,34 @@ "path": "x-pack/plugins/file_upload/common/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "fileUpload", + "id": "def-common.IngestPipeline.isManaged", + "type": "CompoundType", + "tags": [], + "label": "isManaged", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/file_upload/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "fileUpload", + "id": "def-common.IngestPipeline.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/file_upload/common/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index d8fddfcfb3567..c347050e5ab7b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 84 | 0 | 84 | 8 | +| 88 | 0 | 88 | 8 | ## Client diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index f3cc7d80e6a15..c63a73b61a66c 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -981,7 +981,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -1017,6 +1017,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -1075,6 +1101,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1669,7 +1697,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1695,7 +1725,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1941,6 +1971,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/files.mdx b/api_docs/files.mdx index bbf1f5456821c..1859456f51b3e 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: 2024-08-14 +date: 2024-08-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 e7efa01e0b597..f41ed80b4634c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index 26e0c62d97f40..9583242b66d73 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -1491,14 +1491,14 @@ { "parentPluginId": "fleet", "id": "def-public.NewPackagePolicy.policy_id", - "type": "string", + "type": "CompoundType", "tags": [ "deprecated" ], "label": "policy_id", "description": [], "signature": [ - "string | undefined" + "string | null | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/package_policy.ts", "deprecated": true, @@ -1552,6 +1552,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" + }, { "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" @@ -2922,7 +2926,7 @@ "The updated Integration Policy to be merged back and included in the API call" ], "signature": [ - "{ id?: string | number | undefined; name?: string | undefined; description?: string | undefined; namespace?: string | undefined; enabled?: boolean | undefined; is_managed?: boolean | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | null | undefined; package?: ", + "{ id?: string | number | undefined; name?: string | undefined; description?: string | undefined; namespace?: string | undefined; enabled?: boolean | undefined; is_managed?: boolean | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | null | undefined; package?: ", { "pluginId": "fleet", "scope": "common", @@ -6322,7 +6326,15 @@ "section": "def-server.SavedObjectsClientContract", "text": "SavedObjectsClientContract" }, - ", id: string, options?: { standalone: boolean; } | undefined) => Promise<", + ", id: string, options?: { standalone?: boolean | undefined; agentPolicy?: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.AgentPolicy", + "text": "AgentPolicy" + }, + " | undefined; } | undefined) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -6376,7 +6388,15 @@ "label": "options", "description": [], "signature": [ - "{ standalone: boolean; } | undefined" + "{ standalone?: boolean | undefined; agentPolicy?: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.AgentPolicy", + "text": "AgentPolicy" + }, + " | undefined; } | undefined" ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -6542,9 +6562,9 @@ "section": "def-server.SavedObjectsClientContract", "text": "SavedObjectsClientContract" }, - ", { perPage, kuery }?: ", + ", { perPage, kuery, spaceId }?: ", "FetchAllAgentPolicyIdsOptions", - ") => AsyncIterable" + ") => Promise>" ], "path": "x-pack/plugins/fleet/server/services/index.ts", "deprecated": false, @@ -6574,12 +6594,20 @@ { "parentPluginId": "fleet", "id": "def-server.AgentPolicyServiceInterface.fetchAllAgentPolicyIds.$2", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "__1", "description": [], "signature": [ - "{ perPage?: number | undefined; kuery?: string | undefined; }" + "Pick<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + }, + ", \"perPage\" | \"kuery\"> & { spaceId?: string | undefined; }" ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -6605,7 +6633,7 @@ }, ", { perPage, kuery, sortOrder, sortField, fields, }?: ", "FetchAllAgentPoliciesOptions", - ") => AsyncIterable<", + ") => Promise" + "[]>>" ], "path": "x-pack/plugins/fleet/server/services/index.ts", "deprecated": false, @@ -11809,7 +11837,7 @@ }, ", options?: ", "PackagePolicyClientFetchAllItemIdsOptions", - " | undefined) => AsyncIterable" + " | undefined) => Promise>" ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -11875,7 +11903,7 @@ }, ", options?: ", "PackagePolicyClientFetchAllItemsOptions", - " | undefined) => AsyncIterable<", + " | undefined) => Promise" + "[]>>" ], "path": "x-pack/plugins/fleet/server/services/package_policy_service.ts", "deprecated": false, @@ -12331,7 +12359,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -12367,6 +12395,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -12425,6 +12479,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -13019,7 +13075,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -13045,7 +13103,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -13291,6 +13349,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -13702,7 +13762,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -13738,6 +13798,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -13796,6 +13882,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -14390,7 +14478,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -14416,7 +14506,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -14662,6 +14752,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -15086,7 +15178,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -15122,6 +15214,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -15180,6 +15298,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -15774,7 +15894,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -15800,7 +15922,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -16046,6 +16168,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -16239,7 +16363,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>, soClient: ", + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>, soClient: ", { "pluginId": "@kbn/core-saved-objects-api-server", "scope": "server", @@ -16295,7 +16419,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>" + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>" ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", "deprecated": false, @@ -16467,7 +16591,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -16503,6 +16627,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -16561,6 +16711,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -17155,7 +17307,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -17181,7 +17335,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -17427,6 +17581,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -17851,7 +18007,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -17887,6 +18043,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -17945,6 +18127,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -18539,7 +18723,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -18565,7 +18751,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -18811,6 +18997,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -19817,13 +20005,13 @@ }, { "parentPluginId": "fleet", - "id": "def-common.AgentPolicy.space_id", - "type": "string", + "id": "def-common.AgentPolicy.space_ids", + "type": "Array", "tags": [], - "label": "space_id", + "label": "space_ids", "description": [], "signature": [ - "string | undefined" + "string[] | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false, @@ -23194,6 +23382,20 @@ "path": "x-pack/plugins/fleet/common/types/rest_spec/common.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.ListWithKuery.fields", + "type": "Array", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/rest_spec/common.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -23245,6 +23447,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "fleet", + "id": "def-common.NewAgentPolicy.space_ids", + "type": "Array", + "tags": [], + "label": "space_ids", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "fleet", "id": "def-common.NewAgentPolicy.description", @@ -23635,14 +23851,14 @@ { "parentPluginId": "fleet", "id": "def-common.NewPackagePolicy.policy_id", - "type": "string", + "type": "CompoundType", "tags": [ "deprecated" ], "label": "policy_id", "description": [], "signature": [ - "string | undefined" + "string | null | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/package_policy.ts", "deprecated": true, @@ -23696,6 +23912,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" + }, { "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" @@ -24206,13 +24426,13 @@ }, { "parentPluginId": "fleet", - "id": "def-common.PackagePolicy.spaceId", - "type": "string", + "id": "def-common.PackagePolicy.spaceIds", + "type": "Array", "tags": [], - "label": "spaceId", + "label": "spaceIds", "description": [], "signature": [ - "string | undefined" + "string[] | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/package_policy.ts", "deprecated": false, @@ -26455,7 +26675,7 @@ "label": "AGENT_POLICY_SAVED_OBJECT_TYPE", "description": [], "signature": [ - "\"ingest-agent-policies\"" + "\"fleet-agent-policies\"" ], "path": "x-pack/plugins/fleet/common/constants/agent_policy.ts", "deprecated": false, @@ -27481,6 +27701,36 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [], + "label": "LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"ingest-agent-policies\"" + ], + "path": "x-pack/plugins/fleet/common/constants/agent_policy.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [], + "label": "LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"ingest-package-policies\"" + ], + "path": "x-pack/plugins/fleet/common/constants/package_policy.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.MESSAGE_SIGNING_KEYS_SAVED_OBJECT_TYPE", @@ -27581,21 +27831,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "fleet", - "id": "def-common.PACKAGE_POLICY_SAVED_OBJECT_TYPE", - "type": "string", - "tags": [], - "label": "PACKAGE_POLICY_SAVED_OBJECT_TYPE", - "description": [], - "signature": [ - "\"ingest-package-policies\"" - ], - "path": "x-pack/plugins/fleet/common/constants/package_policy.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "fleet", "id": "def-common.PackageInfo", @@ -27760,7 +27995,7 @@ "label": "PackageSpecCategory", "description": [], "signature": [ - "\"monitoring\" | \"security\" | \"connector\" | \"observability\" | \"custom\" | \"infrastructure\" | \"cloud\" | \"enterprise_search\" | \"advanced_analytics_ueba\" | \"analytics_engine\" | \"application_observability\" | \"app_search\" | \"auditd\" | \"authentication\" | \"aws\" | \"azure\" | \"big_data\" | \"cdn_security\" | \"config_management\" | \"connector_client\" | \"containers\" | \"crawler\" | \"credential_management\" | \"crm\" | \"custom_logs\" | \"database_security\" | \"datastore\" | \"dns_security\" | \"edr_xdr\" | \"cloudsecurity_cdr\" | \"elasticsearch_sdk\" | \"elastic_stack\" | \"email_security\" | \"firewall_security\" | \"google_cloud\" | \"iam\" | \"ids_ips\" | \"java_observability\" | \"kubernetes\" | \"language_client\" | \"languages\" | \"load_balancer\" | \"message_queue\" | \"native_search\" | \"network\" | \"network_security\" | \"notification\" | \"os_system\" | \"process_manager\" | \"productivity\" | \"productivity_security\" | \"proxy_security\" | \"sdk_search\" | \"stream_processing\" | \"support\" | \"threat_intel\" | \"ticketing\" | \"version_control\" | \"virtualization\" | \"vpn_security\" | \"vulnerability_management\" | \"web\" | \"web_application_firewall\" | \"websphere\" | \"workplace_search_content_source\" | \"workplace_search\"" + "\"connector\" | \"monitoring\" | \"security\" | \"observability\" | \"custom\" | \"infrastructure\" | \"cloud\" | \"enterprise_search\" | \"advanced_analytics_ueba\" | \"analytics_engine\" | \"application_observability\" | \"app_search\" | \"auditd\" | \"authentication\" | \"aws\" | \"azure\" | \"big_data\" | \"cdn_security\" | \"config_management\" | \"connector_client\" | \"containers\" | \"crawler\" | \"credential_management\" | \"crm\" | \"custom_logs\" | \"database_security\" | \"datastore\" | \"dns_security\" | \"edr_xdr\" | \"cloudsecurity_cdr\" | \"elasticsearch_sdk\" | \"elastic_stack\" | \"email_security\" | \"firewall_security\" | \"google_cloud\" | \"iam\" | \"ids_ips\" | \"java_observability\" | \"kubernetes\" | \"language_client\" | \"languages\" | \"load_balancer\" | \"message_queue\" | \"native_search\" | \"network\" | \"network_security\" | \"notification\" | \"os_system\" | \"process_manager\" | \"productivity\" | \"productivity_security\" | \"proxy_security\" | \"sdk_search\" | \"stream_processing\" | \"support\" | \"threat_intel\" | \"ticketing\" | \"version_control\" | \"virtualization\" | \"vpn_security\" | \"vulnerability_management\" | \"web\" | \"web_application_firewall\" | \"websphere\" | \"workplace_search_content_source\" | \"workplace_search\"" ], "path": "x-pack/plugins/fleet/common/types/models/package_spec.ts", "deprecated": false, @@ -27798,7 +28033,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }[]" + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }[]" ], "path": "x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts", "deprecated": false, @@ -27882,7 +28117,7 @@ "label": "RegistrySearchResult", "description": [], "signature": [ - "{ type?: \"input\" | \"integration\" | undefined; version: string; name: string; title: string; description: string; path: string; internal?: boolean | undefined; download: string; icons?: (", + "{ type?: \"input\" | \"integration\" | undefined; version: string; name: string; title: string; description: string; internal?: boolean | undefined; path: string; download: string; icons?: (", { "pluginId": "fleet", "scope": "common", @@ -29502,6 +29737,17 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "fleet", + "id": "def-common.APP_API_ROUTES.AGENT_POLICIES_SPACES", + "type": "string", + "tags": [], + "label": "AGENT_POLICIES_SPACES", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "fleet", "id": "def-common.APP_API_ROUTES.GENERATE_SERVICE_TOKEN_PATTERN_DEPRECATED", @@ -29576,6 +29822,22 @@ "trackAdoption": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-common.appRoutesService.getAgentPoliciesSpacesPath", + "type": "Function", + "tags": [], + "label": "getAgentPoliciesSpacesPath", + "description": [], + "signature": [ + "() => string" + ], + "path": "x-pack/plugins/fleet/common/services/routes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 5b87506863f5f..c0bb90cf8793b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) for questi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1357 | 5 | 1234 | 74 | +| 1362 | 5 | 1239 | 74 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 969241c90eeac..605a3827d95f4 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: 2024-08-14 +date: 2024-08-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 0f5d29c7fcf99..32bda919f72b6 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: 2024-08-14 +date: 2024-08-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 2eb5aeea15cf6..6183d6c23ce1d 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: 2024-08-14 +date: 2024-08-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 3db08e9aaab26..2aeefa4708285 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: 2024-08-14 +date: 2024-08-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 b1ae10d14a129..f0806320100da 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.devdocs.json b/api_docs/index_management.devdocs.json index f0b2487774725..062bb86a24a7f 100644 --- a/api_docs/index_management.devdocs.json +++ b/api_docs/index_management.devdocs.json @@ -2405,6 +2405,145 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule", + "type": "Interface", + "tags": [], + "label": "IndexModule", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.number_of_shards", + "type": "CompoundType", + "tags": [], + "label": "number_of_shards", + "description": [], + "signature": [ + "string | number" + ], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.codec", + "type": "string", + "tags": [], + "label": "codec", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.routing_partition_size", + "type": "number", + "tags": [], + "label": "routing_partition_size", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.refresh_interval", + "type": "string", + "tags": [], + "label": "refresh_interval", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.load_fixed_bitset_filters_eagerly", + "type": "boolean", + "tags": [], + "label": "load_fixed_bitset_filters_eagerly", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.shard", + "type": "Object", + "tags": [], + "label": "shard", + "description": [], + "signature": [ + "{ check_on_startup: boolean | \"checksum\"; }" + ], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.number_of_replicas", + "type": "number", + "tags": [], + "label": "number_of_replicas", + "description": [], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.auto_expand_replicas", + "type": "CompoundType", + "tags": [], + "label": "auto_expand_replicas", + "description": [], + "signature": [ + "string | false" + ], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.lifecycle", + "type": "Object", + "tags": [], + "label": "lifecycle", + "description": [], + "signature": [ + "LifecycleModule" + ], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "indexManagement", + "id": "def-common.IndexModule.routing", + "type": "Object", + "tags": [], + "label": "routing", + "description": [], + "signature": [ + "{ allocation: { enable: \"none\" | \"all\" | \"primaries\" | \"new_primaries\"; }; rebalance: { enable: \"none\" | \"all\" | \"primaries\" | \"replicas\"; }; }" + ], + "path": "x-pack/plugins/index_management/common/types/indices.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "indexManagement", "id": "def-common.IndexSettings", @@ -2424,7 +2563,15 @@ "label": "index", "description": [], "signature": [ - "Partial | undefined" + "Partial<", + { + "pluginId": "indexManagement", + "scope": "common", + "docId": "kibIndexManagementPluginApi", + "section": "def-common.IndexModule", + "text": "IndexModule" + }, + "> | undefined" ], "path": "x-pack/plugins/index_management/common/types/indices.ts", "deprecated": false, diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 64cf1e62d4b1c..251b67a03df88 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kiban | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 227 | 0 | 222 | 1 | +| 238 | 0 | 233 | 1 | ## Client diff --git a/api_docs/inference.mdx b/api_docs/inference.mdx index b22fd063c90d3..76e50a67fabed 100644 --- a/api_docs/inference.mdx +++ b/api_docs/inference.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/inference title: "inference" image: https://source.unsplash.com/400x175/?github description: API docs for the inference plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inference'] --- import inferenceObj from './inference.devdocs.json'; -Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) for questions regarding this plugin. +Contact [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/infra.devdocs.json b/api_docs/infra.devdocs.json index 29f2b00c3936e..60b2506aad099 100644 --- a/api_docs/infra.devdocs.json +++ b/api_docs/infra.devdocs.json @@ -472,6 +472,22 @@ "path": "x-pack/plugins/observability_solution/infra/server/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "infra", + "id": "def-server.InfraRequestHandlerContext.getMetricsIndices", + "type": "Function", + "tags": [], + "label": "getMetricsIndices", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/plugins/observability_solution/infra/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 92ef577ade8a9..9999901b9f6c3 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 37 | 0 | 34 | 6 | +| 38 | 0 | 35 | 6 | ## Client diff --git a/api_docs/ingest_pipelines.mdx b/api_docs/ingest_pipelines.mdx index ff80df769a641..5e95bca75db21 100644 --- a/api_docs/ingest_pipelines.mdx +++ b/api_docs/ingest_pipelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ingestPipelines title: "ingestPipelines" image: https://source.unsplash.com/400x175/?github description: API docs for the ingestPipelines plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ingestPipelines'] --- import ingestPipelinesObj from './ingest_pipelines.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 17c37334896f6..d2b30a4b8aa61 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/integration_assistant.devdocs.json b/api_docs/integration_assistant.devdocs.json index 9b7d0934031ff..3fafbef540dff 100644 --- a/api_docs/integration_assistant.devdocs.json +++ b/api_docs/integration_assistant.devdocs.json @@ -164,6 +164,48 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "integrationAssistant", + "id": "def-common.ANALYZE_LOGS_PATH", + "type": "string", + "tags": [], + "label": "ANALYZE_LOGS_PATH", + "description": [], + "path": "x-pack/plugins/integration_assistant/common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "integrationAssistant", + "id": "def-common.AnalyzeLogsRequestBody", + "type": "Type", + "tags": [], + "label": "AnalyzeLogsRequestBody", + "description": [], + "signature": [ + "{ connectorId: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" + ], + "path": "x-pack/plugins/integration_assistant/common/api/analyze_logs/analyze_logs_route.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "integrationAssistant", + "id": "def-common.AnalyzeLogsResponse", + "type": "Type", + "tags": [], + "label": "AnalyzeLogsResponse", + "description": [], + "signature": [ + "{ results: { samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; }" + ], + "path": "x-pack/plugins/integration_assistant/common/api/analyze_logs/analyze_logs_route.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "integrationAssistant", "id": "def-common.BuildIntegrationRequestBody", @@ -188,7 +230,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }; }" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }; }" ], "path": "x-pack/plugins/integration_assistant/common/api/build_integration/build_integration.ts", "deprecated": false, @@ -353,7 +395,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }" ], "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", "deprecated": false, @@ -497,7 +539,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }" ], "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", "deprecated": false, @@ -667,9 +709,56 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "integrationAssistant", + "id": "def-common.SamplesFormat", + "type": "Type", + "tags": [], + "label": "SamplesFormat", + "description": [ + "\nFormat of the provided log samples." + ], + "signature": [ + "{ name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }" + ], + "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [ + { + "parentPluginId": "integrationAssistant", + "id": "def-common.AnalyzeLogsRequestBody", + "type": "Object", + "tags": [], + "label": "AnalyzeLogsRequestBody", + "description": [], + "signature": [ + "Zod.ZodObject<{ logSamples: Zod.ZodArray; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" + ], + "path": "x-pack/plugins/integration_assistant/common/api/analyze_logs/analyze_logs_route.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "integrationAssistant", + "id": "def-common.AnalyzeLogsResponse", + "type": "Object", + "tags": [], + "label": "AnalyzeLogsResponse", + "description": [], + "signature": [ + "Zod.ZodObject<{ results: Zod.ZodObject<{ samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\"]>; multiline: Zod.ZodOptional; json_path: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; parsedSamples: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }, { samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; }, { results: { samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; }>" + ], + "path": "x-pack/plugins/integration_assistant/common/api/analyze_logs/analyze_logs_route.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "integrationAssistant", "id": "def-common.BuildIntegrationRequestBody", @@ -742,7 +831,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\"]>; multiline: Zod.ZodOptional; json_path: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -758,7 +847,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -774,7 +863,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }>, \"many\">; logo: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }>, \"many\">; logo: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -790,7 +879,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -806,7 +895,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -822,7 +911,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }; }, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }; }, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -838,7 +927,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/build_integration/build_integration.ts", "deprecated": false, @@ -1297,7 +1386,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\"]>; multiline: Zod.ZodOptional; json_path: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1313,7 +1402,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1329,7 +1418,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", "deprecated": false, @@ -1627,7 +1716,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\"]>; multiline: Zod.ZodOptional; json_path: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1643,7 +1732,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1659,7 +1748,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }>, \"many\">; logo: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }>, \"many\">; logo: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1675,7 +1764,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http-endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1691,7 +1780,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; }[]; logo?: string | undefined; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">[]; samplesFormat: { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }; }[]; logo?: string | undefined; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", "deprecated": false, @@ -2030,6 +2119,21 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "integrationAssistant", + "id": "def-common.SamplesFormat", + "type": "Object", + "tags": [], + "label": "SamplesFormat", + "description": [], + "signature": [ + "Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\"]>; multiline: Zod.ZodOptional; json_path: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\"; multiline?: boolean | undefined; json_path?: string[] | undefined; }>" + ], + "path": "x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ] } diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx index 100c3cc2d1d50..682bd1b467bee 100644 --- a/api_docs/integration_assistant.mdx +++ b/api_docs/integration_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/integrationAssistant title: "integrationAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the integrationAssistant plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'integrationAssistant'] --- import integrationAssistantObj from './integration_assistant.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-scalability](https://github.com/orgs/elastic/teams/se | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 47 | 0 | 40 | 3 | +| 54 | 0 | 46 | 3 | ## Client diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 15fe7a0a1a008..ca7d19c11c2d4 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/investigate.devdocs.json b/api_docs/investigate.devdocs.json index 9fa79e2fc3c7b..6027d5241e210 100644 --- a/api_docs/investigate.devdocs.json +++ b/api_docs/investigate.devdocs.json @@ -3,140 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "investigate", - "id": "def-public.createEsqlWidget", - "type": "Function", - "tags": [], - "label": "createEsqlWidget", - "description": [], - "signature": [ - ", PredefinedKeys>>(widgetCreate: T) => Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetCreate", - "text": "InvestigateWidgetCreate" - }, - "<", - { - "pluginId": "investigate", - "scope": "public", - "docId": "kibInvestigatePluginApi", - "section": "def-public.EsqlWidgetParameters", - "text": "EsqlWidgetParameters" - }, - ">, PredefinedKeys> & Omit & { parameters: T[\"parameters\"] & ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - ">; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/create_esql_widget.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.createEsqlWidget.$1", - "type": "Uncategorized", - "tags": [], - "label": "widgetCreate", - "description": [], - "signature": [ - "T" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.createWidgetFactory", - "type": "Function", - "tags": [], - "label": "createWidgetFactory", - "description": [], - "signature": [ - "(type: string, defaults: Pick>, AllowedDefaultKeys> | undefined) => ", - "WidgetFactory", - "" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.createWidgetFactory.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-public.createWidgetFactory.$2", - "type": "Object", - "tags": [], - "label": "defaults", - "description": [], - "signature": [ - "Pick>, AllowedDefaultKeys> | undefined" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "investigate", "id": "def-public.getEsFilterFromGlobalParameters", @@ -426,1444 +292,441 @@ "interfaces": [ { "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters", + "id": "def-public.GlobalWidgetParameters", "type": "Interface", "tags": [], - "label": "EsqlWidgetParameters", + "label": "GlobalWidgetParameters", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters.esql", - "type": "string", - "tags": [], - "label": "esql", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters.suggestion", + "id": "def-public.GlobalWidgetParameters.timeRange", "type": "Object", "tags": [], - "label": "suggestion", + "label": "timeRange", "description": [], "signature": [ - "Suggestion | undefined" + "{ from: string; to: string; }" ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", "deprecated": false, "trackAdoption": false } ], "initialIsOpen": false - }, + } + ], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicSetup", + "type": "Interface", + "tags": [], + "label": "InvestigatePublicSetup", + "description": [], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicSetup.registerItemDefinition", + "type": "Function", + "tags": [], + "label": "registerItemDefinition", + "description": [], + "signature": [ + "(itemDefinition: ", + "ItemDefinition", + ") => void" + ], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicSetup.registerItemDefinition.$1", + "type": "Object", + "tags": [], + "label": "itemDefinition", + "description": [], + "signature": [ + "ItemDefinition", + "" + ], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicStart", + "type": "Interface", + "tags": [], + "label": "InvestigatePublicStart", + "description": [], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicStart.getItemDefinitions", + "type": "Function", + "tags": [], + "label": "getItemDefinitions", + "description": [], + "signature": [ + "() => ", + "ItemDefinition", + "<{}, {}>[]" + ], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicStart.getItemDefinitionByType", + "type": "Function", + "tags": [], + "label": "getItemDefinitionByType", + "description": [], + "signature": [ + "(type: string) => ", + "ItemDefinition", + "<{}, {}> | undefined" + ], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "investigate", + "id": "def-public.InvestigatePublicStart.getItemDefinitionByType.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "investigate", + "id": "def-server.InvestigateServerSetup", + "type": "Interface", + "tags": [], + "label": "InvestigateServerSetup", + "description": [], + "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "investigate", + "id": "def-server.InvestigateServerStart", + "type": "Interface", + "tags": [], + "label": "InvestigateServerStart", + "description": [], + "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], + "functions": [ { "parentPluginId": "investigate", - "id": "def-public.GlobalWidgetParameters", - "type": "Interface", + "id": "def-common.mergePlainObjects", + "type": "Function", "tags": [], - "label": "GlobalWidgetParameters", + "label": "mergePlainObjects", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "signature": [ + "(t1: T1) => T1" + ], + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "investigate", - "id": "def-public.GlobalWidgetParameters.timeRange", - "type": "Object", + "id": "def-common.mergePlainObjects.$1", + "type": "Uncategorized", "tags": [], - "label": "timeRange", + "label": "t1", "description": [], "signature": [ - "{ from: string; to: string; }" + "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget", - "type": "Interface", + "id": "def-common.mergePlainObjects", + "type": "Function", "tags": [], - "label": "InvestigateWidget", + "label": "mergePlainObjects", "description": [], "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "" + "(t1: T1, t2: T2) => [T2] extends Mergable[] ? DeepOverwrite : T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.created", - "type": "number", - "tags": [], - "label": "created", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.last_updated", - "type": "number", - "tags": [], - "label": "last_updated", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.user", - "type": "Object", + "id": "def-common.mergePlainObjects.$1", + "type": "Uncategorized", "tags": [], - "label": "user", + "label": "t1", "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } + "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.parameters", - "type": "CompoundType", + "id": "def-common.mergePlainObjects.$2", + "type": "Uncategorized", "tags": [], - "label": "parameters", + "label": "t2", "description": [], "signature": [ - "GlobalWidgetParameters", - " & TParameters" + "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false - }, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "investigate", + "id": "def-common.mergePlainObjects", + "type": "Function", + "tags": [], + "label": "mergePlainObjects", + "description": [], + "signature": [ + "(t1: T1, t2: T2, t3: T3) => [T2, T3] extends Mergable[] ? DeepOverwrite | DeepOverwrite : T1" + ], + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.data", + "id": "def-common.mergePlainObjects.$1", "type": "Uncategorized", "tags": [], - "label": "data", + "label": "t1", "description": [], "signature": [ - "TData" + "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.description", - "type": "string", + "id": "def-common.mergePlainObjects.$2", + "type": "Uncategorized", "tags": [], - "label": "description", + "label": "t2", "description": [], "signature": [ - "string | undefined" + "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.columns", - "type": "Enum", + "id": "def-common.mergePlainObjects.$3", + "type": "Uncategorized", "tags": [], - "label": "columns", + "label": "t3", "description": [], "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetColumnSpan", - "text": "InvestigateWidgetColumnSpan" - } + "T3" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.rows", - "type": "number", - "tags": [], - "label": "rows", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "investigate", - "id": "def-public.Investigation", - "type": "Interface", + "id": "def-common.mergePlainObjects", + "type": "Function", "tags": [], - "label": "Investigation", + "label": "mergePlainObjects", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "signature": [ + "(t1: T1, t2: T2, t3: T4) => [T2, T3, T4] extends Mergable[] ? DeepOverwrite | DeepOverwrite | DeepOverwrite : T1" + ], + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "investigate", - "id": "def-public.Investigation.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.user", - "type": "Object", - "tags": [], - "label": "user", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.items", - "type": "Array", + "id": "def-common.mergePlainObjects.$1", + "type": "Uncategorized", "tags": [], - "label": "items", + "label": "t1", "description": [], "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>[]" + "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "investigate", - "id": "def-public.Investigation.notes", - "type": "Array", + "id": "def-common.mergePlainObjects.$2", + "type": "Uncategorized", "tags": [], - "label": "notes", + "label": "t2", "description": [], "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigationNote", - "text": "InvestigationNote" - }, - "[]" + "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "investigate", - "id": "def-public.Investigation.parameters", - "type": "Object", + "id": "def-common.mergePlainObjects.$3", + "type": "Uncategorized", "tags": [], - "label": "parameters", + "label": "t3", "description": [], "signature": [ - "GlobalWidgetParameters" + "T4" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "investigate", - "id": "def-public.WidgetRenderAPI", - "type": "Interface", + "id": "def-common.mergePlainObjects", + "type": "Function", "tags": [], - "label": "WidgetRenderAPI", + "label": "mergePlainObjects", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "signature": [ + "(sources: Record[]) => any" + ], + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "investigate", - "id": "def-public.WidgetRenderAPI.onDelete", - "type": "Function", - "tags": [], - "label": "onDelete", - "description": [], - "signature": [ - "() => void" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "investigate", - "id": "def-public.WidgetRenderAPI.onWidgetAdd", - "type": "Function", + "id": "def-common.mergePlainObjects.$1", + "type": "Array", "tags": [], - "label": "onWidgetAdd", + "label": "sources", "description": [], "signature": [ - "(create: ", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetCreate", - "text": "InvestigateWidgetCreate" - }, - "<{}>) => Promise" + "Record[]" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.WidgetRenderAPI.onWidgetAdd.$1", - "type": "CompoundType", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\" | \"columns\" | \"description\" | \"rows\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - ">; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false } ], - "enums": [ - { - "parentPluginId": "investigate", - "id": "def-public.ChromeOption", - "type": "Enum", - "tags": [], - "label": "ChromeOption", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidgetColumnSpan", - "type": "Enum", - "tags": [], - "label": "InvestigateWidgetColumnSpan", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ], - "misc": [ - { - "parentPluginId": "investigate", - "id": "def-public.ESQL_WIDGET_NAME", - "type": "string", - "tags": [], - "label": "ESQL_WIDGET_NAME", - "description": [], - "signature": [ - "\"esql\"" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/constants.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidgetCreate", - "type": "Type", - "tags": [], - "label": "InvestigateWidgetCreate", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\" | \"columns\" | \"description\" | \"rows\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - "> & TParameters; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.OnWidgetAdd", - "type": "Type", - "tags": [], - "label": "OnWidgetAdd", - "description": [], - "signature": [ - "(create: ", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetCreate", - "text": "InvestigateWidgetCreate" - }, - "<{}>) => Promise" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.OnWidgetAdd.$1", - "type": "CompoundType", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\" | \"columns\" | \"description\" | \"rows\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - ">; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], - "objects": [], - "setup": { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicSetup", - "type": "Interface", - "tags": [], - "label": "InvestigatePublicSetup", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicSetup.register", - "type": "Function", - "tags": [], - "label": "register", - "description": [], - "signature": [ - "(callback: (registerWidget: ", - "RegisterWidget", - ") => Promise) => void" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicSetup.register.$1", - "type": "Function", - "tags": [], - "label": "callback", - "description": [], - "signature": [ - "(registerWidget: ", - "RegisterWidget", - ") => Promise" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "lifecycle": "setup", - "initialIsOpen": true - }, - "start": { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart", - "type": "Interface", - "tags": [], - "label": "InvestigatePublicStart", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.getWidgetDefinitions", - "type": "Function", - "tags": [], - "label": "getWidgetDefinitions", - "description": [], - "signature": [ - "() => ", - "WidgetDefinition", - "[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation", - "type": "Function", - "tags": [], - "label": "useInvestigation", - "description": [], - "signature": [ - "({}: { user: ", - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - }, - "; from: string; to: string; }) => ", - "UseInvestigationApi" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1", - "type": "Object", - "tags": [], - "label": "{}", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1.user", - "type": "Object", - "tags": [], - "label": "user", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1.from", - "type": "string", - "tags": [], - "label": "from", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1.to", - "type": "string", - "tags": [], - "label": "to", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigateWidget", - "type": "Function", - "tags": [], - "label": "useInvestigateWidget", - "description": [], - "signature": [ - "() => ", - "UseInvestigateWidgetApi", - "<{}, {}> | undefined" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], "interfaces": [], "enums": [], "misc": [], - "objects": [], - "setup": { - "parentPluginId": "investigate", - "id": "def-server.InvestigateServerSetup", - "type": "Interface", - "tags": [], - "label": "InvestigateServerSetup", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "lifecycle": "setup", - "initialIsOpen": true - }, - "start": { - "parentPluginId": "investigate", - "id": "def-server.InvestigateServerStart", - "type": "Interface", - "tags": [], - "label": "InvestigateServerStart", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects", - "type": "Function", - "tags": [], - "label": "mergePlainObjects", - "description": [], - "signature": [ - "(t1: T1) => T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$1", - "type": "Uncategorized", - "tags": [], - "label": "t1", - "description": [], - "signature": [ - "T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects", - "type": "Function", - "tags": [], - "label": "mergePlainObjects", - "description": [], - "signature": [ - "(t1: T1, t2: T2) => [T2] extends Mergable[] ? DeepOverwrite : T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$1", - "type": "Uncategorized", - "tags": [], - "label": "t1", - "description": [], - "signature": [ - "T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$2", - "type": "Uncategorized", - "tags": [], - "label": "t2", - "description": [], - "signature": [ - "T2" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects", - "type": "Function", - "tags": [], - "label": "mergePlainObjects", - "description": [], - "signature": [ - "(t1: T1, t2: T2, t3: T3) => [T2, T3] extends Mergable[] ? DeepOverwrite | DeepOverwrite : T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$1", - "type": "Uncategorized", - "tags": [], - "label": "t1", - "description": [], - "signature": [ - "T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$2", - "type": "Uncategorized", - "tags": [], - "label": "t2", - "description": [], - "signature": [ - "T2" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$3", - "type": "Uncategorized", - "tags": [], - "label": "t3", - "description": [], - "signature": [ - "T3" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects", - "type": "Function", - "tags": [], - "label": "mergePlainObjects", - "description": [], - "signature": [ - "(t1: T1, t2: T2, t3: T4) => [T2, T3, T4] extends Mergable[] ? DeepOverwrite | DeepOverwrite | DeepOverwrite : T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$1", - "type": "Uncategorized", - "tags": [], - "label": "t1", - "description": [], - "signature": [ - "T1" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$2", - "type": "Uncategorized", - "tags": [], - "label": "t2", - "description": [], - "signature": [ - "T2" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$3", - "type": "Uncategorized", - "tags": [], - "label": "t3", - "description": [], - "signature": [ - "T4" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects", - "type": "Function", - "tags": [], - "label": "mergePlainObjects", - "description": [], - "signature": [ - "(sources: Record[]) => any" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.mergePlainObjects.$1", - "type": "Array", - "tags": [], - "label": "sources", - "description": [], - "signature": [ - "Record[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget", - "type": "Interface", - "tags": [], - "label": "InvestigateWidget", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.created", - "type": "number", - "tags": [], - "label": "created", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.last_updated", - "type": "number", - "tags": [], - "label": "last_updated", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.user", - "type": "Object", - "tags": [], - "label": "user", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.parameters", - "type": "CompoundType", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters", - " & TParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.data", - "type": "Uncategorized", - "tags": [], - "label": "data", - "description": [], - "signature": [ - "TData" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.description", - "type": "string", - "tags": [], - "label": "description", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.columns", - "type": "Enum", - "tags": [], - "label": "columns", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetColumnSpan", - "text": "InvestigateWidgetColumnSpan" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.rows", - "type": "number", - "tags": [], - "label": "rows", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation", - "type": "Interface", - "tags": [], - "label": "Investigation", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.user", - "type": "Object", - "tags": [], - "label": "user", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.items", - "type": "Array", - "tags": [], - "label": "items", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.notes", - "type": "Array", - "tags": [], - "label": "notes", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigationNote", - "text": "InvestigationNote" - }, - "[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.parameters", - "type": "Object", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote", - "type": "Interface", - "tags": [], - "label": "InvestigationNote", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.createdBy", - "type": "Object", - "tags": [], - "label": "createdBy", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.content", - "type": "string", - "tags": [], - "label": "content", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], - "enums": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidgetColumnSpan", - "type": "Enum", - "tags": [], - "label": "InvestigateWidgetColumnSpan", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ], - "misc": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidgetCreate", - "type": "Type", - "tags": [], - "label": "InvestigateWidgetCreate", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\" | \"columns\" | \"description\" | \"rows\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - "> & TParameters; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/investigate.mdx b/api_docs/investigate.mdx index 011097d14e40c..b70e93645437e 100644 --- a/api_docs/investigate.mdx +++ b/api_docs/investigate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigate title: "investigate" image: https://source.unsplash.com/400x175/?github description: API docs for the investigate plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigate'] --- import investigateObj from './investigate.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 112 | 0 | 112 | 6 | +| 43 | 0 | 43 | 4 | ## Client @@ -37,12 +37,6 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ ### Interfaces -### Enums - - -### Consts, variables and types - - ## Server ### Setup @@ -56,12 +50,3 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ ### Functions -### Interfaces - - -### Enums - - -### Consts, variables and types - - diff --git a/api_docs/investigate_app.devdocs.json b/api_docs/investigate_app.devdocs.json index d8b91a87450ee..425c031088c32 100644 --- a/api_docs/investigate_app.devdocs.json +++ b/api_docs/investigate_app.devdocs.json @@ -50,27 +50,119 @@ "label": "InvestigateAppServerRouteRepository", "description": [], "signature": [ - "{ \"GET /api/observability/investigations/{id} 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{id} 2023-10-31\"; params?: ", + "{ \"GET /api/observability/investigations/{investigationId}/items 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId}/items 2023-10-31\"; params?: ", "TypeC", "<{ path: ", "TypeC", - "<{ id: ", + "<{ investigationId: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; }; }) => Promise<({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]>; } & ", + "InvestigateAppRouteCreateOptions", + "; \"DELETE /api/observability/investigations/{investigationId}/items/{itemId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId}/items/{itemId} 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; itemId: ", "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { id: string; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; parameters: { timeRange: { from: number; to: number; }; }; }>; } & ", + " & { params: { path: { investigationId: string; itemId: string; }; }; }) => Promise; } & ", + "InvestigateAppRouteCreateOptions", + "; \"POST /api/observability/investigations/{investigationId}/items 2023-10-31\": { endpoint: \"POST /api/observability/investigations/{investigationId}/items 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; body: { title: string; type: string; params: { [x: string]: any; }; }; }; }) => Promise<{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }>; } & ", + "InvestigateAppRouteCreateOptions", + "; \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; noteId: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; noteId: string; }; }; }) => Promise; } & ", + "InvestigateAppRouteCreateOptions", + "; \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }[]>; } & ", + "InvestigateAppRouteCreateOptions", + "; \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ content: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; body: { content: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }>; } & ", + "InvestigateAppRouteCreateOptions", + "; \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; }; }) => Promise; } & ", + "InvestigateAppRouteCreateOptions", + "; \"GET /api/observability/investigations/{investigationId} 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId} 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; \"GET /api/observability/investigations 2023-10-31\": { endpoint: \"GET /api/observability/investigations 2023-10-31\"; params?: ", "PartialC", "<{ query: ", "PartialC", - "<{ page: ", + "<{ alertId: ", + "StringC", + "; page: ", "StringC", "; perPage: ", "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params?: { query?: { page?: string | undefined; perPage?: string | undefined; } | undefined; } | undefined; }) => Promise<{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; parameters: { timeRange: { from: number; to: number; }; }; }[]; }>; } & ", + " & { params?: { query?: { alertId?: string | undefined; page?: string | undefined; perPage?: string | undefined; } | undefined; } | undefined; }) => Promise<{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; \"POST /api/observability/investigations 2023-10-31\": { endpoint: \"POST /api/observability/investigations 2023-10-31\"; params?: ", "TypeC", @@ -80,7 +172,7 @@ "StringC", "; title: ", "StringC", - "; parameters: ", + "; params: ", "TypeC", "<{ timeRange: ", "TypeC", @@ -88,9 +180,21 @@ "NumberC", "; to: ", "NumberC", - "; }>; }>; }>; }> | undefined; handler: ({}: ", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { body: { id: string; title: string; parameters: { timeRange: { from: number; to: number; }; }; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; parameters: { timeRange: { from: number; to: number; }; }; }>; } & ", + " & { params: { body: { id: string; title: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; }" ], diff --git a/api_docs/investigate_app.mdx b/api_docs/investigate_app.mdx index 0a293531d288d..1a96a005cbad7 100644 --- a/api_docs/investigate_app.mdx +++ b/api_docs/investigate_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigateApp title: "investigateApp" image: https://source.unsplash.com/400x175/?github description: API docs for the investigateApp plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigateApp'] --- import investigateAppObj from './investigate_app.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 6945fca8517fd..c2bec03adf02e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_actions_types.mdx b/api_docs/kbn_actions_types.mdx index d825c18507e05..86aa210a61988 100644 --- a/api_docs/kbn_actions_types.mdx +++ b/api_docs/kbn_actions_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-actions-types title: "@kbn/actions-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/actions-types plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/actions-types'] --- import kbnActionsTypesObj from './kbn_actions_types.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index a7cf39daf17e9..ec20c870397e4 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_pattern_analysis.mdx b/api_docs/kbn_aiops_log_pattern_analysis.mdx index cf190be499623..1fb44a6ba2de5 100644 --- a/api_docs/kbn_aiops_log_pattern_analysis.mdx +++ b/api_docs/kbn_aiops_log_pattern_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-pattern-analysis title: "@kbn/aiops-log-pattern-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-pattern-analysis plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-pattern-analysis'] --- import kbnAiopsLogPatternAnalysisObj from './kbn_aiops_log_pattern_analysis.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_rate_analysis.mdx b/api_docs/kbn_aiops_log_rate_analysis.mdx index 9ce12851d693c..9148cd56ee082 100644 --- a/api_docs/kbn_aiops_log_rate_analysis.mdx +++ b/api_docs/kbn_aiops_log_rate_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-rate-analysis title: "@kbn/aiops-log-rate-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-rate-analysis plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-rate-analysis'] --- import kbnAiopsLogRateAnalysisObj from './kbn_aiops_log_rate_analysis.devdocs.json'; diff --git a/api_docs/kbn_alerting_api_integration_helpers.mdx b/api_docs/kbn_alerting_api_integration_helpers.mdx index c29dfeff9b5a1..81d6969c574ed 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-api-integration-helpers'] --- import kbnAlertingApiIntegrationHelpersObj from './kbn_alerting_api_integration_helpers.devdocs.json'; diff --git a/api_docs/kbn_alerting_comparators.mdx b/api_docs/kbn_alerting_comparators.mdx index b9d1c3e3c4a54..f8183c0225b6a 100644 --- a/api_docs/kbn_alerting_comparators.mdx +++ b/api_docs/kbn_alerting_comparators.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-comparators title: "@kbn/alerting-comparators" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-comparators plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-comparators'] --- import kbnAlertingComparatorsObj from './kbn_alerting_comparators.devdocs.json'; diff --git a/api_docs/kbn_alerting_state_types.devdocs.json b/api_docs/kbn_alerting_state_types.devdocs.json index 4beda471f14be..2afc1a566a537 100644 --- a/api_docs/kbn_alerting_state_types.devdocs.json +++ b/api_docs/kbn_alerting_state_types.devdocs.json @@ -124,7 +124,7 @@ "label": "LatestAlertInstanceMetaSchema", "description": [], "signature": [ - "{ readonly uuid?: string | undefined; readonly lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; readonly flappingHistory?: boolean[] | undefined; readonly flapping?: boolean | undefined; readonly maintenanceWindowIds?: string[] | undefined; readonly pendingRecoveredCount?: number | undefined; readonly activeCount?: number | undefined; }" + "{ readonly flapping?: boolean | undefined; readonly uuid?: string | undefined; readonly lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; readonly flappingHistory?: boolean[] | undefined; readonly maintenanceWindowIds?: string[] | undefined; readonly pendingRecoveredCount?: number | undefined; readonly activeCount?: number | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -169,7 +169,7 @@ "label": "LatestRawAlertInstanceSchema", "description": [], "signature": [ - "{ readonly meta?: Readonly<{ uuid?: string | undefined; lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; readonly state?: Record | undefined; }" + "{ readonly meta?: Readonly<{ flapping?: boolean | undefined; uuid?: string | undefined; lastScheduledActions?: Readonly<{ actions?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; readonly state?: Record | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -184,7 +184,7 @@ "label": "LatestTaskStateSchema", "description": [], "signature": [ - "{ readonly alertTypeState?: Record | undefined; readonly alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly previousStartedAt?: string | null | undefined; readonly summaryActions?: Record> | undefined; }" + "{ readonly alertTypeState?: Record | undefined; readonly alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; readonly previousStartedAt?: string | null | undefined; readonly summaryActions?: Record> | undefined; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -214,7 +214,7 @@ "label": "MutableLatestAlertInstanceMetaSchema", "description": [], "signature": [ - "{ uuid?: Mutable; lastScheduledActions?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined>; flappingHistory?: Mutable; flapping?: Mutable; maintenanceWindowIds?: Mutable; pendingRecoveredCount?: Mutable; activeCount?: Mutable; }" + "{ flapping?: Mutable; uuid?: Mutable; lastScheduledActions?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined>; flappingHistory?: Mutable; maintenanceWindowIds?: Mutable; pendingRecoveredCount?: Mutable; activeCount?: Mutable; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -229,7 +229,7 @@ "label": "MutableLatestTaskStateSchema", "description": [], "signature": [ - "{ alertTypeState?: Mutable | undefined>; alertInstances?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; alertRecoveredInstances?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; previousStartedAt?: Mutable; summaryActions?: Mutable> | undefined>; }" + "{ alertTypeState?: Mutable | undefined>; alertInstances?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; alertRecoveredInstances?: Mutable> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; previousStartedAt?: Mutable; summaryActions?: Mutable> | undefined>; }" ], "path": "x-pack/packages/kbn-alerting-state-types/src/task_state/index.ts", "deprecated": false, @@ -404,7 +404,7 @@ "label": "1", "description": [], "signature": [ - "{ up: (state: Record) => Readonly<{ alertTypeState?: Record | undefined; alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; previousStartedAt?: string | null | undefined; summaryActions?: Record> | undefined; } & {}>; schema: ", + "{ up: (state: Record) => Readonly<{ alertTypeState?: Record | undefined; alertInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; alertRecoveredInstances?: Record> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined; previousStartedAt?: string | null | undefined; summaryActions?: Record> | undefined; } & {}>; schema: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -428,7 +428,7 @@ "section": "def-common.Type", "text": "Type" }, - "> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; alertRecoveredInstances: ", + "> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; alertRecoveredInstances: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -436,7 +436,7 @@ "section": "def-common.Type", "text": "Type" }, - "> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; previousStartedAt: ", + "> | undefined; subgroup?: string | undefined; } & { date: string; group: string; }> | undefined; flappingHistory?: boolean[] | undefined; maintenanceWindowIds?: string[] | undefined; pendingRecoveredCount?: number | undefined; activeCount?: number | undefined; } & {}> | undefined; state?: Record | undefined; } & {}>> | undefined>; previousStartedAt: ", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/kbn_alerting_state_types.mdx b/api_docs/kbn_alerting_state_types.mdx index ff4c8e52f7432..4b6938882fb4c 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: 2024-08-14 +date: 2024-08-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_alerting_types.devdocs.json b/api_docs/kbn_alerting_types.devdocs.json index 51c85cf8a437e..7c10c27a4d38a 100644 --- a/api_docs/kbn_alerting_types.devdocs.json +++ b/api_docs/kbn_alerting_types.devdocs.json @@ -1577,6 +1577,20 @@ "path": "packages/kbn-alerting-types/rule_types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerting-types", + "id": "def-common.Rule.flapping", + "type": "Object", + "tags": [], + "label": "flapping", + "description": [], + "signature": [ + "{ lookBackWindow: number; statusChangeThreshold: number; } | undefined" + ], + "path": "packages/kbn-alerting-types/rule_types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -3206,6 +3220,66 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/alerting-types", + "id": "def-common.MAX_LOOK_BACK_WINDOW", + "type": "number", + "tags": [], + "label": "MAX_LOOK_BACK_WINDOW", + "description": [], + "signature": [ + "20" + ], + "path": "packages/kbn-alerting-types/rule_flapping.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerting-types", + "id": "def-common.MAX_STATUS_CHANGE_THRESHOLD", + "type": "number", + "tags": [], + "label": "MAX_STATUS_CHANGE_THRESHOLD", + "description": [], + "signature": [ + "20" + ], + "path": "packages/kbn-alerting-types/rule_flapping.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerting-types", + "id": "def-common.MIN_LOOK_BACK_WINDOW", + "type": "number", + "tags": [], + "label": "MIN_LOOK_BACK_WINDOW", + "description": [], + "signature": [ + "2" + ], + "path": "packages/kbn-alerting-types/rule_flapping.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerting-types", + "id": "def-common.MIN_STATUS_CHANGE_THRESHOLD", + "type": "number", + "tags": [], + "label": "MIN_STATUS_CHANGE_THRESHOLD", + "description": [], + "signature": [ + "2" + ], + "path": "packages/kbn-alerting-types/rule_flapping.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/alerting-types", "id": "def-common.RecoveredActionGroupId", diff --git a/api_docs/kbn_alerting_types.mdx b/api_docs/kbn_alerting_types.mdx index c0f51ae3b546a..85e0efabe824b 100644 --- a/api_docs/kbn_alerting_types.mdx +++ b/api_docs/kbn_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-types title: "@kbn/alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-types plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-types'] --- import kbnAlertingTypesObj from './kbn_alerting_types.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 | |-------------------|-----------|------------------------|-----------------| -| 217 | 0 | 214 | 0 | +| 222 | 0 | 219 | 0 | ## Common diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index f76d9fe54a2bc..5ba4e8ccdb11f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts_grouping.devdocs.json b/api_docs/kbn_alerts_grouping.devdocs.json index 718a5c1791d96..e3042f1c99a59 100644 --- a/api_docs/kbn_alerts_grouping.devdocs.json +++ b/api_docs/kbn_alerts_grouping.devdocs.json @@ -13,15 +13,15 @@ "\nA coordinator component to show multiple alert tables grouped by one or more fields\n" ], "signature": [ - "React.NamedExoticComponent<", + "> & { readonly type: (props: ", + ">(props: ", { "pluginId": "@kbn/alerts-grouping", "scope": "public", @@ -29,7 +29,7 @@ "section": "def-public.AlertsGroupingProps", "text": "AlertsGroupingProps" }, - "<{}>) => JSX.Element; }" + ") => JSX.Element" ], "path": "packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx", "deprecated": false, @@ -39,14 +39,21 @@ { "parentPluginId": "@kbn/alerts-grouping", "id": "def-public.AlertsGrouping.$1", - "type": "Uncategorized", + "type": "Object", "tags": [], "label": "props", "description": [], "signature": [ - "P" + { + "pluginId": "@kbn/alerts-grouping", + "scope": "public", + "docId": "kibKbnAlertsGroupingPluginApi", + "section": "def-public.AlertsGroupingProps", + "text": "AlertsGroupingProps" + }, + "" ], - "path": "node_modules/@types/react/index.d.ts", + "path": "packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx", "deprecated": false, "trackAdoption": false } @@ -92,6 +99,70 @@ } ], "interfaces": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupAggregationBucket", + "type": "Interface", + "tags": [], + "label": "AlertsGroupAggregationBucket", + "description": [], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupAggregationBucket.key", + "type": "string", + "tags": [], + "label": "key", + "description": [], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupAggregationBucket.doc_count", + "type": "number", + "tags": [], + "label": "doc_count", + "description": [], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupAggregationBucket.isNullGroup", + "type": "CompoundType", + "tags": [], + "label": "isNullGroup", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupAggregationBucket.unitsCount", + "type": "Object", + "tags": [], + "label": "unitsCount", + "description": [], + "signature": [ + "{ value: number; } | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/alerts-grouping", "id": "def-public.AlertsGroupingProps", @@ -467,6 +538,70 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.BaseAlertsGroupAggregations", + "type": "Interface", + "tags": [], + "label": "BaseAlertsGroupAggregations", + "description": [], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.BaseAlertsGroupAggregations.groupByFields", + "type": "Object", + "tags": [], + "label": "groupByFields", + "description": [], + "signature": [ + "{ doc_count_error_upper_bound: number; sum_other_doc_count: number; buckets: ", + { + "pluginId": "@kbn/alerts-grouping", + "scope": "public", + "docId": "kibKbnAlertsGroupingPluginApi", + "section": "def-public.AlertsGroupAggregationBucket", + "text": "AlertsGroupAggregationBucket" + }, + "[]; }" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.BaseAlertsGroupAggregations.groupsCount", + "type": "Object", + "tags": [], + "label": "groupsCount", + "description": [], + "signature": [ + "{ value: number; }" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.BaseAlertsGroupAggregations.unitsCount", + "type": "Object", + "tags": [], + "label": "unitsCount", + "description": [], + "signature": [ + "{ value: number; }" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [], diff --git a/api_docs/kbn_alerts_grouping.mdx b/api_docs/kbn_alerts_grouping.mdx index ce8c8702492a0..ead5dbc68e9e9 100644 --- a/api_docs/kbn_alerts_grouping.mdx +++ b/api_docs/kbn_alerts_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-grouping title: "@kbn/alerts-grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-grouping plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-grouping'] --- import kbnAlertsGroupingObj from './kbn_alerts_grouping.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 | |-------------------|-----------|------------------------|-----------------| -| 22 | 0 | 5 | 1 | +| 31 | 0 | 15 | 1 | ## Client diff --git a/api_docs/kbn_alerts_ui_shared.devdocs.json b/api_docs/kbn_alerts_ui_shared.devdocs.json index 10feecc712b89..c4423422e2a72 100644 --- a/api_docs/kbn_alerts_ui_shared.devdocs.json +++ b/api_docs/kbn_alerts_ui_shared.devdocs.json @@ -425,7 +425,7 @@ "tags": [], "label": "useGetAlertsGroupAggregationsQuery", "description": [ - "\nFetches alerts aggregations for a given groupByField.\n\nSome default aggregations are applied:\n- `groupByFields`, to get the buckets based on the provided grouping field,\n - `unitsCount`, to count the number of alerts in each bucket,\n- `unitsCount`, to count the total number of alerts targeted by the query,\n- `groupsCount`, to count the total number of groups.\n\nThe provided `aggregations` are applied within `groupByFields`. Here the `groupByField` runtime\nfield can be used to perform grouping-based aggregations.\n\nApplies alerting RBAC through featureIds." + "\nFetches alerts aggregations for a given groupByField.\n\nSome default aggregations are applied:\n- `groupByFields`, to get the buckets based on the provided grouping field,\n - `unitsCount`, to count the number of alerts in each bucket,\n- `unitsCount`, to count the total number of alerts targeted by the query,\n- `groupsCount`, to count the total number of groups.\n\nThe provided `aggregations` are applied within `groupByFields`. Here the `groupByField` runtime\nfield can be used to perform grouping-based aggregations.\n`groupByField` buckets computed over a field with a null/absent value are marked with the\n`isNullGroup` flag set to true and their key is set to the `--` string.\n\nApplies alerting RBAC through featureIds." ], "signature": [ "({ http, toasts, enabled, params, }: ", @@ -4129,7 +4129,7 @@ "label": "setRuleProperty", "description": [], "signature": [ - "(key: Prop, value: ", + "(key: Prop, value: ", { "pluginId": "@kbn/alerts-ui-shared", "scope": "public", diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index 05f194fc71c74..2f4f06d62f2ec 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: 2024-08-14 +date: 2024-08-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 03a590c496c4b..871f9c2786434 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_collection_utils.mdx b/api_docs/kbn_analytics_collection_utils.mdx index 8e5199c3c9771..ca10af2336113 100644 --- a/api_docs/kbn_analytics_collection_utils.mdx +++ b/api_docs/kbn_analytics_collection_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-collection-utils title: "@kbn/analytics-collection-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-collection-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-collection-utils'] --- import kbnAnalyticsCollectionUtilsObj from './kbn_analytics_collection_utils.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index cd255e8aba329..27a71a2f9a74a 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: 2024-08-14 +date: 2024-08-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_data_view.mdx b/api_docs/kbn_apm_data_view.mdx index c5e02ed95ee2f..0cf3b6ec4242c 100644 --- a/api_docs/kbn_apm_data_view.mdx +++ b/api_docs/kbn_apm_data_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-data-view title: "@kbn/apm-data-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-data-view plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-data-view'] --- import kbnApmDataViewObj from './kbn_apm_data_view.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.devdocs.json b/api_docs/kbn_apm_synthtrace.devdocs.json index d1fa4a2a3ee91..33cbffd896893 100644 --- a/api_docs/kbn_apm_synthtrace.devdocs.json +++ b/api_docs/kbn_apm_synthtrace.devdocs.json @@ -633,6 +633,38 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "@kbn/apm-synthtrace", + "id": "def-server.InfraSynthtraceKibanaClient.uninstallSystemPackage", + "type": "Function", + "tags": [], + "label": "uninstallSystemPackage", + "description": [], + "signature": [ + "(packageVersion: string) => Promise" + ], + "path": "packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/apm-synthtrace", + "id": "def-server.InfraSynthtraceKibanaClient.uninstallSystemPackage.$1", + "type": "string", + "tags": [], + "label": "packageVersion", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index 5afe53bce34ad..5c29e8fcdbcd2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/te | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 51 | 0 | 51 | 9 | +| 53 | 0 | 53 | 9 | ## Server diff --git a/api_docs/kbn_apm_synthtrace_client.devdocs.json b/api_docs/kbn_apm_synthtrace_client.devdocs.json index d7755119aa2c2..8f29a85704f03 100644 --- a/api_docs/kbn_apm_synthtrace_client.devdocs.json +++ b/api_docs/kbn_apm_synthtrace_client.devdocs.json @@ -2724,7 +2724,9 @@ " | ", "K8sContainerMetricsDocument", " | ", - "AWSRdsMetricsDocument" + "AWSRdsMetricsDocument", + " | ", + "K8sNodeMetricsDocument" ], "path": "packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts", "deprecated": false, @@ -2739,7 +2741,7 @@ "label": "LogDocument", "description": [], "signature": [ - "{ '@timestamp'?: number | undefined; } & Partial<{ 'input.type': string; 'log.file.path'?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'data_stream.namespace': string; 'data_stream.type': string; 'data_stream.dataset': string; message?: string | undefined; 'error.message'?: string | undefined; 'event.original'?: string | undefined; 'event.dataset': string; 'log.level'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.id'?: string | undefined; 'agent.id'?: string | undefined; 'agent.name'?: string | undefined; 'orchestrator.cluster.name'?: string | undefined; 'orchestrator.cluster.id'?: string | undefined; 'orchestrator.resource.id'?: string | undefined; 'kubernetes.pod.uid'?: string | undefined; 'aws.s3.bucket.name'?: string | undefined; 'orchestrator.namespace'?: string | undefined; 'container.name'?: string | undefined; 'cloud.provider'?: string | undefined; 'cloud.region'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.project.id'?: string | undefined; 'cloud.instance.id'?: string | undefined; 'error.stack_trace'?: string | undefined; 'error.exception.stacktrace'?: string | undefined; 'error.log.stacktrace'?: string | undefined; 'log.custom': Record; }>" + "{ '@timestamp'?: number | undefined; } & Partial<{ 'input.type': string; 'log.file.path'?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'data_stream.namespace': string; 'data_stream.type': string; 'data_stream.dataset': string; message?: string | undefined; 'error.message'?: string | undefined; 'event.original'?: string | undefined; 'event.dataset': string; 'log.level'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.id'?: string | undefined; 'agent.id'?: string | undefined; 'agent.name'?: string | undefined; 'orchestrator.cluster.name'?: string | undefined; 'orchestrator.cluster.id'?: string | undefined; 'orchestrator.resource.id'?: string | undefined; 'kubernetes.pod.uid'?: string | undefined; 'aws.s3.bucket.name'?: string | undefined; 'orchestrator.namespace'?: string | undefined; 'container.name'?: string | undefined; 'cloud.provider'?: string | undefined; 'cloud.region'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.project.id'?: string | undefined; 'cloud.instance.id'?: string | undefined; 'error.stack_trace'?: string | undefined; 'error.exception.stacktrace'?: string | undefined; 'error.log.stacktrace'?: string | undefined; 'log.custom': Record; 'host.geo.location': number[]; 'host.ip': string; 'network.bytes': number; 'tls.established': boolean; 'event.duration': number; 'event.start': Date; 'event.end': Date; }>" ], "path": "packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts", "deprecated": false, @@ -3135,6 +3137,46 @@ "trackAdoption": false } ] + }, + { + "parentPluginId": "@kbn/apm-synthtrace-client", + "id": "def-common.infra.k8sNode", + "type": "Function", + "tags": [], + "label": "k8sNode", + "description": [], + "signature": [ + "(name: string, podUid: string) => ", + "K8sNode" + ], + "path": "packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/apm-synthtrace-client", + "id": "def-common.infra.k8sNode.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_node.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/apm-synthtrace-client", + "id": "def-common.infra.k8sNode.$2", + "type": "string", + "tags": [], + "label": "podUid", + "description": [], + "path": "packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_node.ts", + "deprecated": false, + "trackAdoption": false + } + ] } ], "initialIsOpen": false diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index ba486da2e413e..6daa9485c935c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/te | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 201 | 0 | 201 | 31 | +| 204 | 0 | 204 | 33 | ## Common diff --git a/api_docs/kbn_apm_types.mdx b/api_docs/kbn_apm_types.mdx index 28855d2d82fb5..04e1465b5ecfd 100644 --- a/api_docs/kbn_apm_types.mdx +++ b/api_docs/kbn_apm_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-types title: "@kbn/apm-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-types plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-types'] --- import kbnApmTypesObj from './kbn_apm_types.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 700f89e83d28a..bda841b9357f2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_avc_banner.mdx b/api_docs/kbn_avc_banner.mdx index 6ba33f6911c82..98cd4073f07f3 100644 --- a/api_docs/kbn_avc_banner.mdx +++ b/api_docs/kbn_avc_banner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-avc-banner title: "@kbn/avc-banner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/avc-banner plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/avc-banner'] --- import kbnAvcBannerObj from './kbn_avc_banner.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 868cd848f99ae..abd16eaf2bda0 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bfetch_error.mdx b/api_docs/kbn_bfetch_error.mdx index 5c971fb508c8c..856ac761d93ca 100644 --- a/api_docs/kbn_bfetch_error.mdx +++ b/api_docs/kbn_bfetch_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bfetch-error title: "@kbn/bfetch-error" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bfetch-error plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bfetch-error'] --- import kbnBfetchErrorObj from './kbn_bfetch_error.devdocs.json'; diff --git a/api_docs/kbn_calculate_auto.mdx b/api_docs/kbn_calculate_auto.mdx index 182bea3782238..af7347e5f019c 100644 --- a/api_docs/kbn_calculate_auto.mdx +++ b/api_docs/kbn_calculate_auto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-auto title: "@kbn/calculate-auto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-auto plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-auto'] --- import kbnCalculateAutoObj from './kbn_calculate_auto.devdocs.json'; diff --git a/api_docs/kbn_calculate_width_from_char_count.mdx b/api_docs/kbn_calculate_width_from_char_count.mdx index f787c0fcab79e..1f1b428851c22 100644 --- a/api_docs/kbn_calculate_width_from_char_count.mdx +++ b/api_docs/kbn_calculate_width_from_char_count.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-width-from-char-count title: "@kbn/calculate-width-from-char-count" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-width-from-char-count plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-width-from-char-count'] --- import kbnCalculateWidthFromCharCountObj from './kbn_calculate_width_from_char_count.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index d36f034425ff9..3127bd446582e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cbor.devdocs.json b/api_docs/kbn_cbor.devdocs.json new file mode 100644 index 0000000000000..aaa703e771f89 --- /dev/null +++ b/api_docs/kbn_cbor.devdocs.json @@ -0,0 +1,171 @@ +{ + "id": "@kbn/cbor", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.KbnCbor", + "type": "Class", + "tags": [], + "label": "KbnCbor", + "description": [], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.KbnCbor.encode", + "type": "Function", + "tags": [], + "label": "encode", + "description": [], + "signature": [ + "(data: unknown) => any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.KbnCbor.encode.$1", + "type": "Unknown", + "tags": [], + "label": "data", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.KbnCbor.decode", + "type": "Function", + "tags": [], + "label": "decode", + "description": [], + "signature": [ + "(uint8: any) => any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.KbnCbor.decode.$1", + "type": "Any", + "tags": [], + "label": "uint8", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.decode", + "type": "Function", + "tags": [], + "label": "decode", + "description": [], + "signature": [ + "(uint8: any) => any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.decode.$1", + "type": "Any", + "tags": [], + "label": "uint8", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.encode", + "type": "Function", + "tags": [], + "label": "encode", + "description": [], + "signature": [ + "(data: unknown) => any" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/cbor", + "id": "def-common.encode.$1", + "type": "Unknown", + "tags": [], + "label": "data", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/kbn-cbor/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_cbor.mdx b/api_docs/kbn_cbor.mdx new file mode 100644 index 0000000000000..d3902c9dfc683 --- /dev/null +++ b/api_docs/kbn_cbor.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnCborPluginApi +slug: /kibana-dev-docs/api/kbn-cbor +title: "@kbn/cbor" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/cbor plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cbor'] +--- +import kbnCborObj from './kbn_cbor.devdocs.json'; + + + +Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 2 | 9 | 0 | + +## Common + +### Functions + + +### Classes + + diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index 545c880b21b33..e40d6e271db55 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: 2024-08-14 +date: 2024-08-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 cf8c8c64ccfcc..d5271d494e0a0 100644 --- a/api_docs/kbn_chart_expressions_common.devdocs.json +++ b/api_docs/kbn_chart_expressions_common.devdocs.json @@ -133,7 +133,7 @@ "section": "def-common.DatatableRow", "text": "DatatableRow" }, - "[], accessor: string | undefined) => (string | string[])[]" + "[], accessor: string | undefined, isTransposed: boolean | undefined, exclude: any[] | undefined) => (string | string[])[]" ], "path": "src/plugins/chart_expressions/common/color_categories.ts", "deprecated": false, @@ -175,6 +175,36 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "@kbn/chart-expressions-common", + "id": "def-common.getColorCategories.$3", + "type": "CompoundType", + "tags": [], + "label": "isTransposed", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/chart_expressions/common/color_categories.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/chart-expressions-common", + "id": "def-common.getColorCategories.$4", + "type": "Array", + "tags": [], + "label": "exclude", + "description": [], + "signature": [ + "any[] | undefined" + ], + "path": "src/plugins/chart_expressions/common/color_categories.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [], diff --git a/api_docs/kbn_chart_expressions_common.mdx b/api_docs/kbn_chart_expressions_common.mdx index f273d7e884bc7..c179d3f6fe721 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: 2024-08-14 +date: 2024-08-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 | |-------------------|-----------|------------------------|-----------------| -| 23 | 0 | 19 | 0 | +| 25 | 0 | 21 | 0 | ## Common diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 5eeca824aae90..1c798e4bfe695 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: 2024-08-14 +date: 2024-08-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 95aaccf8a209e..eefbddd3fee38 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: 2024-08-14 +date: 2024-08-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 89b97e15d61c4..a4831f5248c3b 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: 2024-08-14 +date: 2024-08-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 f16268fc691b9..ec7bb460d141e 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: 2024-08-14 +date: 2024-08-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 1ddfd772fbe60..1e899d11711d4 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: 2024-08-14 +date: 2024-08-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_cloud_security_posture.devdocs.json b/api_docs/kbn_cloud_security_posture.devdocs.json new file mode 100644 index 0000000000000..56abf5d314460 --- /dev/null +++ b/api_docs/kbn_cloud_security_posture.devdocs.json @@ -0,0 +1,563 @@ +{ + "id": "@kbn/cloud-security-posture", + "client": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast", + "type": "Function", + "tags": [], + "label": "showErrorToast", + "description": [], + "signature": [ + "(toasts: ", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "public", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-public.IToasts", + "text": "IToasts" + }, + ", error: unknown) => void" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast.$1", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "public", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-public.IToasts", + "text": "IToasts" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast.$2", + "type": "Unknown", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps", + "type": "Interface", + "tags": [], + "label": "CspClientPluginStartDeps", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.data", + "type": "Object", + "tags": [], + "label": "data", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.DataPublicPluginStart", + "text": "DataPublicPluginStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.dataViews", + "type": "Object", + "tags": [], + "label": "dataViews", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "public", + "docId": "kibDataViewsPluginApi", + "section": "def-public.DataViewsServicePublic", + "text": "DataViewsServicePublic" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.dataViewFieldEditor", + "type": "Object", + "tags": [], + "label": "dataViewFieldEditor", + "description": [], + "signature": [ + { + "pluginId": "dataViewFieldEditor", + "scope": "public", + "docId": "kibDataViewFieldEditorPluginApi", + "section": "def-public.PluginStart", + "text": "PluginStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.unifiedSearch", + "type": "Object", + "tags": [], + "label": "unifiedSearch", + "description": [], + "signature": [ + { + "pluginId": "unifiedSearch", + "scope": "public", + "docId": "kibUnifiedSearchPluginApi", + "section": "def-public.UnifiedSearchPublicPluginStart", + "text": "UnifiedSearchPublicPluginStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.uiActions", + "type": "Object", + "tags": [], + "label": "uiActions", + "description": [], + "signature": [ + "{ readonly registerTrigger: (trigger: ", + { + "pluginId": "@kbn/ui-actions-browser", + "scope": "common", + "docId": "kibKbnUiActionsBrowserPluginApi", + "section": "def-common.Trigger", + "text": "Trigger" + }, + ") => void; readonly hasTrigger: (triggerId: string) => boolean; readonly getTrigger: (triggerId: string) => ", + "TriggerContract", + "; readonly registerAction: (definition: ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" + }, + ") => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" + }, + "; readonly unregisterAction: (actionId: string) => void; readonly hasAction: (actionId: string) => boolean; readonly attachAction: (triggerId: string, actionId: string) => void; readonly detachAction: (triggerId: string, actionId: string) => void; readonly addTriggerAction: (triggerId: string, action: ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" + }, + ") => void; readonly getAction: (id: string) => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" + }, + "; readonly getTriggerActions: (triggerId: string) => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" + }, + "[]; readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise<", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" + }, + "[]>; readonly getFrequentlyChangingActionsForTrigger: (triggerId: string, context: object) => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.FrequentCompatibilityChangeAction", + "text": "FrequentCompatibilityChangeAction" + }, + "[]; readonly executeTriggerActions: (triggerId: string, context: object) => Promise; readonly clear: () => void; readonly fork: () => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.UiActionsService", + "text": "UiActionsService" + }, + "; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.fieldFormats", + "type": "CompoundType", + "tags": [], + "label": "fieldFormats", + "description": [], + "signature": [ + "Omit<", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormatsRegistry", + "text": "FieldFormatsRegistry" + }, + ", \"init\" | \"register\"> & { deserialize: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FormatFactory", + "text": "FormatFactory" + }, + "; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.toastNotifications", + "type": "Object", + "tags": [], + "label": "toastNotifications", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "public", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-public.IToasts", + "text": "IToasts" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.charts", + "type": "CompoundType", + "tags": [], + "label": "charts", + "description": [], + "signature": [ + { + "pluginId": "charts", + "scope": "public", + "docId": "kibChartsPluginApi", + "section": "def-public.ChartsPluginSetup", + "text": "ChartsPluginSetup" + }, + " & { activeCursor: ", + "ActiveCursor", + "; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.discover", + "type": "Object", + "tags": [], + "label": "discover", + "description": [], + "signature": [ + { + "pluginId": "discover", + "scope": "public", + "docId": "kibDiscoverPluginApi", + "section": "def-public.DiscoverStart", + "text": "DiscoverStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.fleet", + "type": "Object", + "tags": [], + "label": "fleet", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "public", + "docId": "kibFleetPluginApi", + "section": "def-public.FleetStart", + "text": "FleetStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.licensing", + "type": "Object", + "tags": [], + "label": "licensing", + "description": [], + "signature": [ + { + "pluginId": "licensing", + "scope": "public", + "docId": "kibLicensingPluginApi", + "section": "def-public.LicensingPluginStart", + "text": "LicensingPluginStart" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.share", + "type": "CompoundType", + "tags": [], + "label": "share", + "description": [], + "signature": [ + "{ toggleShareContextMenu: (options: ", + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.ShowShareMenuOptions", + "text": "ShowShareMenuOptions" + }, + ") => void; } & { url: ", + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.BrowserUrlService", + "text": "BrowserUrlService" + }, + "; navigate(options: ", + "RedirectOptions", + "<", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + }, + ">): void; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.storage", + "type": "Object", + "tags": [], + "label": "storage", + "description": [], + "signature": [ + { + "pluginId": "kibanaUtils", + "scope": "public", + "docId": "kibKibanaUtilsPluginApi", + "section": "def-public.Storage", + "text": "Storage" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.spaces", + "type": "Object", + "tags": [], + "label": "spaces", + "description": [], + "signature": [ + { + "pluginId": "spaces", + "scope": "public", + "docId": "kibSpacesPluginApi", + "section": "def-public.SpacesApi", + "text": "SpacesApi" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.cloud", + "type": "Object", + "tags": [], + "label": "cloud", + "description": [], + "signature": [ + { + "pluginId": "cloud", + "scope": "public", + "docId": "kibCloudPluginApi", + "section": "def-public.CloudSetup", + "text": "CloudSetup" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.CspClientPluginStartDeps.usageCollection", + "type": "Object", + "tags": [], + "label": "usageCollection", + "description": [], + "signature": [ + { + "pluginId": "usageCollection", + "scope": "public", + "docId": "kibUsageCollectionPluginApi", + "section": "def-public.UsageCollectionStart", + "text": "UsageCollectionStart" + }, + " | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.FindingsBaseEsQuery", + "type": "Interface", + "tags": [], + "label": "FindingsBaseEsQuery", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.FindingsBaseEsQuery.query", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "{ bool: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.BoolQuery", + "text": "BoolQuery" + }, + "; } | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/type.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_cloud_security_posture.mdx b/api_docs/kbn_cloud_security_posture.mdx new file mode 100644 index 0000000000000..d45a101061453 --- /dev/null +++ b/api_docs/kbn_cloud_security_posture.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnCloudSecurityPosturePluginApi +slug: /kibana-dev-docs/api/kbn-cloud-security-posture +title: "@kbn/cloud-security-posture" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/cloud-security-posture plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture'] +--- +import kbnCloudSecurityPostureObj from './kbn_cloud_security_posture.devdocs.json'; + + + +Contact [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 22 | 0 | 22 | 0 | + +## Client + +### Functions + + +### Interfaces + + diff --git a/api_docs/kbn_cloud_security_posture_common.devdocs.json b/api_docs/kbn_cloud_security_posture_common.devdocs.json new file mode 100644 index 0000000000000..ccac5b517f03c --- /dev/null +++ b/api_docs/kbn_cloud_security_posture_common.devdocs.json @@ -0,0 +1,754 @@ +{ + "id": "@kbn/cloud-security-posture-common", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.buildMutedRulesFilter", + "type": "Function", + "tags": [], + "label": "buildMutedRulesFilter", + "description": [], + "signature": [ + "(rulesStates: Record>) => ", + "QueryDslQueryContainer", + "[]" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.buildMutedRulesFilter.$1", + "type": "Object", + "tags": [], + "label": "rulesStates", + "description": [], + "signature": [ + "Record>" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage", + "type": "Function", + "tags": [], + "label": "extractErrorMessage", + "description": [], + "signature": [ + "(e: unknown, fallbackMessage?: string | undefined) => string" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage.$1", + "type": "Unknown", + "tags": [], + "label": "e", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage.$2", + "type": "string", + "tags": [], + "label": "fallbackMessage", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupBothPolicy", + "type": "Interface", + "tags": [], + "label": "BaseCspSetupBothPolicy", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupBothPolicy.status", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [], + "signature": [ + "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupBothPolicy.installedPackagePolicies", + "type": "number", + "tags": [], + "label": "installedPackagePolicies", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupBothPolicy.healthyAgents", + "type": "number", + "tags": [], + "label": "healthyAgents", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus", + "type": "Interface", + "tags": [], + "label": "BaseCspSetupStatus", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.indicesDetails", + "type": "Array", + "tags": [], + "label": "indicesDetails", + "description": [], + "signature": [ + { + "pluginId": "@kbn/cloud-security-posture-common", + "scope": "common", + "docId": "kibKbnCloudSecurityPostureCommonPluginApi", + "section": "def-common.IndexDetails", + "text": "IndexDetails" + }, + "[]" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.latestPackageVersion", + "type": "string", + "tags": [], + "label": "latestPackageVersion", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.cspm", + "type": "Object", + "tags": [], + "label": "cspm", + "description": [], + "signature": [ + { + "pluginId": "@kbn/cloud-security-posture-common", + "scope": "common", + "docId": "kibKbnCloudSecurityPostureCommonPluginApi", + "section": "def-common.BaseCspSetupBothPolicy", + "text": "BaseCspSetupBothPolicy" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.kspm", + "type": "Object", + "tags": [], + "label": "kspm", + "description": [], + "signature": [ + { + "pluginId": "@kbn/cloud-security-posture-common", + "scope": "common", + "docId": "kibKbnCloudSecurityPostureCommonPluginApi", + "section": "def-common.BaseCspSetupBothPolicy", + "text": "BaseCspSetupBothPolicy" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.vuln_mgmt", + "type": "Object", + "tags": [], + "label": "vuln_mgmt", + "description": [], + "signature": [ + { + "pluginId": "@kbn/cloud-security-posture-common", + "scope": "common", + "docId": "kibKbnCloudSecurityPostureCommonPluginApi", + "section": "def-common.BaseCspSetupBothPolicy", + "text": "BaseCspSetupBothPolicy" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.isPluginInitialized", + "type": "boolean", + "tags": [], + "label": "isPluginInitialized", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.installedPackageVersion", + "type": "string", + "tags": [], + "label": "installedPackageVersion", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BaseCspSetupStatus.hasMisconfigurationsFindings", + "type": "CompoundType", + "tags": [], + "label": "hasMisconfigurationsFindings", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding", + "type": "Interface", + "tags": [], + "label": "CspFinding", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.timestamp", + "type": "string", + "tags": [], + "label": "'@timestamp'", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.cluster_id", + "type": "string", + "tags": [], + "label": "cluster_id", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.orchestrator", + "type": "Object", + "tags": [], + "label": "orchestrator", + "description": [], + "signature": [ + "CspFindingOrchestrator | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.cloud", + "type": "Object", + "tags": [], + "label": "cloud", + "description": [], + "signature": [ + "CspFindingCloud | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.result", + "type": "Object", + "tags": [], + "label": "result", + "description": [], + "signature": [ + "CspFindingResult" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.resource", + "type": "Object", + "tags": [], + "label": "resource", + "description": [], + "signature": [ + "CspFindingResource" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.rule", + "type": "Object", + "tags": [], + "label": "rule", + "description": [], + "signature": [ + "{ readonly impact?: string | undefined; readonly references?: string | undefined; readonly default_value?: string | undefined; readonly id: string; readonly version: string; readonly name: string; readonly tags: string[]; readonly description: string; readonly section: string; readonly audit: string; readonly benchmark: Readonly<{ posture_type?: \"kspm\" | \"cspm\" | undefined; rule_number?: string | undefined; } & { id: string; version: string; name: string; }>; readonly profile_applicability: string; readonly rationale: string; readonly rego_rule_id: string; readonly remediation: string; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.host", + "type": "Object", + "tags": [], + "label": "host", + "description": [], + "signature": [ + "CspFindingHost" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.event", + "type": "Object", + "tags": [], + "label": "event", + "description": [], + "signature": [ + "EcsEvent" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.data_stream", + "type": "Object", + "tags": [], + "label": "data_stream", + "description": [], + "signature": [ + "EcsDataStream" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.agent", + "type": "Object", + "tags": [], + "label": "agent", + "description": [], + "signature": [ + "CspFindingAgent" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspFinding.ecs", + "type": "Object", + "tags": [], + "label": "ecs", + "description": [], + "signature": [ + "{ version: string; }" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.IndexDetails", + "type": "Interface", + "tags": [], + "label": "IndexDetails", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.IndexDetails.index", + "type": "string", + "tags": [], + "label": "index", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.IndexDetails.status", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [], + "signature": [ + "\"empty\" | \"not-empty\" | \"unprivileged\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BenchmarksCisId", + "type": "Type", + "tags": [], + "label": "BenchmarksCisId", + "description": [], + "signature": [ + "\"cis_k8s\" | \"cis_azure\" | \"cis_aws\" | \"cis_eks\" | \"cis_gcp\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN", + "type": "string", + "tags": [], + "label": "CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN", + "description": [], + "signature": [ + "\"logs-cloud_security_posture.findings_latest-default\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CDR_LATEST_THIRD_PARTY_MISCONFIGURATIONS_INDEX_PATTERN", + "type": "string", + "tags": [], + "label": "CDR_LATEST_THIRD_PARTY_MISCONFIGURATIONS_INDEX_PATTERN", + "description": [], + "signature": [ + "\"logs-*_latest_misconfigurations_cdr\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CDR_MISCONFIGURATIONS_INDEX_PATTERN", + "type": "string", + "tags": [], + "label": "CDR_MISCONFIGURATIONS_INDEX_PATTERN", + "description": [], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION", + "type": "string", + "tags": [], + "label": "CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION", + "description": [], + "signature": [ + "\"1\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH", + "type": "string", + "tags": [], + "label": "CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH", + "description": [], + "signature": [ + "\"/internal/cloud_security_posture/rules/_get_states\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CSPM_POLICY_TEMPLATE", + "type": "string", + "tags": [], + "label": "CSPM_POLICY_TEMPLATE", + "description": [], + "signature": [ + "\"cspm\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspSetupStatus", + "type": "Type", + "tags": [], + "label": "CspSetupStatus", + "description": [], + "signature": [ + { + "pluginId": "@kbn/cloud-security-posture-common", + "scope": "common", + "docId": "kibKbnCloudSecurityPostureCommonPluginApi", + "section": "def-common.BaseCspSetupStatus", + "text": "BaseCspSetupStatus" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.CspStatusCode", + "type": "Type", + "tags": [], + "label": "CspStatusCode", + "description": [], + "signature": [ + "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.IndexStatus", + "type": "Type", + "tags": [], + "label": "IndexStatus", + "description": [], + "signature": [ + "\"empty\" | \"not-empty\" | \"unprivileged\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.KSPM_POLICY_TEMPLATE", + "type": "string", + "tags": [], + "label": "KSPM_POLICY_TEMPLATE", + "description": [], + "signature": [ + "\"kspm\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.LATEST_FINDINGS_RETENTION_POLICY", + "type": "string", + "tags": [], + "label": "LATEST_FINDINGS_RETENTION_POLICY", + "description": [], + "signature": [ + "\"26h\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.MAX_FINDINGS_TO_LOAD", + "type": "number", + "tags": [], + "label": "MAX_FINDINGS_TO_LOAD", + "description": [], + "signature": [ + "500" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.STATUS_API_CURRENT_VERSION", + "type": "string", + "tags": [], + "label": "STATUS_API_CURRENT_VERSION", + "description": [], + "signature": [ + "\"1\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.STATUS_ROUTE_PATH", + "type": "string", + "tags": [], + "label": "STATUS_ROUTE_PATH", + "description": [], + "signature": [ + "\"/internal/cloud_security_posture/status\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_cloud_security_posture_common.mdx b/api_docs/kbn_cloud_security_posture_common.mdx new file mode 100644 index 0000000000000..08aac5b54cf57 --- /dev/null +++ b/api_docs/kbn_cloud_security_posture_common.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: kibKbnCloudSecurityPostureCommonPluginApi +slug: /kibana-dev-docs/api/kbn-cloud-security-posture-common +title: "@kbn/cloud-security-posture-common" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/cloud-security-posture-common plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-common'] +--- +import kbnCloudSecurityPostureCommonObj from './kbn_cloud_security_posture_common.devdocs.json'; + + + +Contact [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 49 | 0 | 49 | 0 | + +## Common + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index f841b4f1dedae..c2ed421dc1c53 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: 2024-08-14 +date: 2024-08-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_mock.mdx b/api_docs/kbn_code_editor_mock.mdx index c009e2996c45f..d7fa4bb3f7476 100644 --- a/api_docs/kbn_code_editor_mock.mdx +++ b/api_docs/kbn_code_editor_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor-mock title: "@kbn/code-editor-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor-mock plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor-mock'] --- import kbnCodeEditorMockObj from './kbn_code_editor_mock.devdocs.json'; diff --git a/api_docs/kbn_code_owners.mdx b/api_docs/kbn_code_owners.mdx index 975989cb17a70..926f78a9e34ae 100644 --- a/api_docs/kbn_code_owners.mdx +++ b/api_docs/kbn_code_owners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-owners title: "@kbn/code-owners" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-owners plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-owners'] --- import kbnCodeOwnersObj from './kbn_code_owners.devdocs.json'; diff --git a/api_docs/kbn_coloring.devdocs.json b/api_docs/kbn_coloring.devdocs.json index 16719bc0c8a0e..a1d23178234a6 100644 --- a/api_docs/kbn_coloring.devdocs.json +++ b/api_docs/kbn_coloring.devdocs.json @@ -1297,6 +1297,41 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getSpecialString", + "type": "Function", + "tags": [], + "label": "getSpecialString", + "description": [ + "\nReturns special string for sake of color mapping/syncing" + ], + "signature": [ + "(value: string) => string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getSpecialString.$1", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/coloring", "id": "def-common.getStepValue", @@ -1817,6 +1852,111 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputCategoricalData", + "type": "Interface", + "tags": [], + "label": "ColorMappingInputCategoricalData", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputCategoricalData.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categories\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputCategoricalData.categories", + "type": "Array", + "tags": [], + "label": "categories", + "description": [ + "an ORDERED array of categories rendered in the visualization" + ], + "signature": [ + "(string | string[])[]" + ], + "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.ColorMappingInputContinuousData", + "type": "Interface", + "tags": [], + "label": "ColorMappingInputContinuousData", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputContinuousData.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"ranges\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputContinuousData.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputContinuousData.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputContinuousData.bins", + "type": "number", + "tags": [], + "label": "bins", + "description": [], + "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.ColorMappingProps", @@ -1874,7 +2014,21 @@ "A data description of what needs to be colored" ], "signature": [ - "{ type: \"categories\"; categories: (string | string[])[]; } | { type: \"ranges\"; min: number; max: number; bins: number; }" + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingInputCategoricalData", + "text": "ColorMappingInputCategoricalData" + }, + " | ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingInputContinuousData", + "text": "ColorMappingInputContinuousData" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, @@ -2790,7 +2944,21 @@ "\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; }" + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingInputCategoricalData", + "text": "ColorMappingInputCategoricalData" + }, + " | ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingInputContinuousData", + "text": "ColorMappingInputContinuousData" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, @@ -3686,10 +3854,10 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.SPECIAL_TOKENS_STRING_CONVERTION", + "id": "def-common.SPECIAL_TOKENS_STRING_CONVERSION", "type": "Object", "tags": [], - "label": "SPECIAL_TOKENS_STRING_CONVERTION", + "label": "SPECIAL_TOKENS_STRING_CONVERSION", "description": [], "signature": [ "Map" diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 0537d907829c2..d3a065b8dc211 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.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 | |-------------------|-----------|------------------------|-----------------| -| 217 | 0 | 180 | 9 | +| 227 | 0 | 188 | 9 | ## Common diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 422c9dc3ecd3e..63a936f7e2366 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: 2024-08-14 +date: 2024-08-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 d65a147f530a2..989543bcf19f9 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_config_schema.devdocs.json index 409941bbe1c88..27e04a098acd6 100644 --- a/api_docs/kbn_config_schema.devdocs.json +++ b/api_docs/kbn_config_schema.devdocs.json @@ -4670,7 +4670,113 @@ "section": "def-common.ObjectType", "text": "ObjectType" }, - "

; oneOf: { (types: [", + "

; oneOf: { (types: [", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "], options?: ", + "UnionTypeOptions", + " | undefined): ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; (types: [", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -9076,7 +9182,113 @@ "label": "oneOf", "description": [], "signature": [ - "{ (types: [", + "{ (types: [", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + ", ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "], options?: ", + "UnionTypeOptions", + " | undefined): ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; (types: [", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index f0af22686cb55..332adb157e365 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_content_management_content_editor.devdocs.json index 5c5c0f8208433..fc863182b74d3 100644 --- a/api_docs/kbn_content_management_content_editor.devdocs.json +++ b/api_docs/kbn_content_management_content_editor.devdocs.json @@ -170,7 +170,7 @@ "Item", "; isReadonly?: boolean | undefined; readonlyReason?: string | undefined; entityName: string; customValidators?: ", "CustomValidators", - " | undefined; showActivityView?: boolean | undefined; }" + " | undefined; appendRows?: React.ReactNode; }" ], "path": "packages/content-management/content_editor/src/open_content_editor.tsx", "deprecated": false, diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index 1a6d0496fb185..e1bf511ecc5e4 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: 2024-08-14 +date: 2024-08-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_content_insights_public.devdocs.json b/api_docs/kbn_content_management_content_insights_public.devdocs.json new file mode 100644 index 0000000000000..0e6c72081bd1b --- /dev/null +++ b/api_docs/kbn_content_management_content_insights_public.devdocs.json @@ -0,0 +1,619 @@ +{ + "id": "@kbn/content-management-content-insights-public", + "client": { + "classes": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient", + "type": "Class", + "tags": [], + "label": "ContentInsightsClient", + "description": [ + "\nClient for the Content Management Insights service." + ], + "signature": [ + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ContentInsightsClient", + "text": "ContentInsightsClient" + }, + " implements ", + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ContentInsightsClientPublic", + "text": "ContentInsightsClientPublic" + } + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "deps", + "description": [], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.Unnamed.$1.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "public", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-public.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.Unnamed.$2.domainId", + "type": "string", + "tags": [], + "label": "domainId", + "description": [], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.track", + "type": "Function", + "tags": [], + "label": "track", + "description": [], + "signature": [ + "(id: string, eventType: \"viewed\") => void" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.track.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.track.$2", + "type": "string", + "tags": [], + "label": "eventType", + "description": [], + "signature": [ + "\"viewed\"" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.getStats", + "type": "Function", + "tags": [], + "label": "getStats", + "description": [], + "signature": [ + "(id: string, eventType: \"viewed\") => Promise<", + { + "pluginId": "@kbn/content-management-content-insights-server", + "scope": "server", + "docId": "kibKbnContentManagementContentInsightsServerPluginApi", + "section": "def-server.ContentInsightsStats", + "text": "ContentInsightsStats" + }, + ">" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.getStats.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClient.getStats.$2", + "type": "string", + "tags": [], + "label": "eventType", + "description": [], + "signature": [ + "\"viewed\"" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ActivityView", + "type": "Function", + "tags": [], + "label": "ActivityView", + "description": [], + "signature": [ + "({ item }: ", + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ActivityViewProps", + "text": "ActivityViewProps" + }, + ") => JSX.Element" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ActivityView.$1", + "type": "Object", + "tags": [], + "label": "{ item }", + "description": [], + "signature": [ + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ActivityViewProps", + "text": "ActivityViewProps" + } + ], + "path": "packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsProvider", + "type": "Function", + "tags": [], + "label": "ContentInsightsProvider", + "description": [ + "\nAbstract external service Provider." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren>>) => JSX.Element" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren>>" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.useServices", + "type": "Function", + "tags": [], + "label": "useServices", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ContentInsightsServices", + "text": "ContentInsightsServices" + }, + " | null" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ViewsStats", + "type": "Function", + "tags": [], + "label": "ViewsStats", + "description": [], + "signature": [ + "({ item }: { item: ", + { + "pluginId": "@kbn/content-management-table-list-view-common", + "scope": "common", + "docId": "kibKbnContentManagementTableListViewCommonPluginApi", + "section": "def-common.UserContentCommonSchema", + "text": "UserContentCommonSchema" + }, + "; }) => JSX.Element" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ViewsStats.$1", + "type": "Object", + "tags": [], + "label": "{ item }", + "description": [], + "path": "packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ViewsStats.$1.item", + "type": "Object", + "tags": [], + "label": "item", + "description": [], + "signature": [ + { + "pluginId": "@kbn/content-management-table-list-view-common", + "scope": "common", + "docId": "kibKbnContentManagementTableListViewCommonPluginApi", + "section": "def-common.UserContentCommonSchema", + "text": "UserContentCommonSchema" + } + ], + "path": "packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ActivityViewProps", + "type": "Interface", + "tags": [], + "label": "ActivityViewProps", + "description": [], + "path": "packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ActivityViewProps.item", + "type": "Object", + "tags": [], + "label": "item", + "description": [], + "signature": [ + "{ createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; managed?: boolean | undefined; }" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic", + "type": "Interface", + "tags": [], + "label": "ContentInsightsClientPublic", + "description": [ + "\nPublic interface of the Content Management Insights service." + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.track", + "type": "Function", + "tags": [], + "label": "track", + "description": [], + "signature": [ + "(id: string, eventType: \"viewed\") => void" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.track.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.track.$2", + "type": "string", + "tags": [], + "label": "eventType", + "description": [], + "signature": [ + "\"viewed\"" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.getStats", + "type": "Function", + "tags": [], + "label": "getStats", + "description": [], + "signature": [ + "(id: string, eventType: \"viewed\") => Promise<", + { + "pluginId": "@kbn/content-management-content-insights-server", + "scope": "server", + "docId": "kibKbnContentManagementContentInsightsServerPluginApi", + "section": "def-server.ContentInsightsStats", + "text": "ContentInsightsStats" + }, + ">" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.getStats.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsClientPublic.getStats.$2", + "type": "string", + "tags": [], + "label": "eventType", + "description": [], + "signature": [ + "\"viewed\"" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsServices", + "type": "Interface", + "tags": [], + "label": "ContentInsightsServices", + "description": [ + "\nAbstract external services for this component." + ], + "path": "packages/content-management/content_insights/content_insights_public/src/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsServices.contentInsightsClient", + "type": "Object", + "tags": [], + "label": "contentInsightsClient", + "description": [], + "signature": [ + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ContentInsightsClientPublic", + "text": "ContentInsightsClientPublic" + } + ], + "path": "packages/content-management/content_insights/content_insights_public/src/services.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/content-management-content-insights-public", + "id": "def-public.ContentInsightsEventTypes", + "type": "Type", + "tags": [], + "label": "ContentInsightsEventTypes", + "description": [], + "signature": [ + "\"viewed\"" + ], + "path": "packages/content-management/content_insights/content_insights_public/src/client.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_content_management_content_insights_public.mdx b/api_docs/kbn_content_management_content_insights_public.mdx new file mode 100644 index 0000000000000..92696453da6fa --- /dev/null +++ b/api_docs/kbn_content_management_content_insights_public.mdx @@ -0,0 +1,39 @@ +--- +#### +#### This 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: kibKbnContentManagementContentInsightsPublicPluginApi +slug: /kibana-dev-docs/api/kbn-content-management-content-insights-public +title: "@kbn/content-management-content-insights-public" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/content-management-content-insights-public plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-public'] +--- +import kbnContentManagementContentInsightsPublicObj from './kbn_content_management_content_insights_public.devdocs.json'; + + + +Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 32 | 0 | 28 | 0 | + +## Client + +### Functions + + +### Classes + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_content_management_content_insights_server.devdocs.json b/api_docs/kbn_content_management_content_insights_server.devdocs.json new file mode 100644 index 0000000000000..1e282575547c7 --- /dev/null +++ b/api_docs/kbn_content_management_content_insights_server.devdocs.json @@ -0,0 +1,171 @@ +{ + "id": "@kbn/content-management-content-insights-server", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.registerContentInsights", + "type": "Function", + "tags": [], + "label": "registerContentInsights", + "description": [], + "signature": [ + "({ usageCollection, http, getStartServices }: ", + "ContentInsightsDependencies", + ", config: ", + "ContentInsightsConfig", + ") => void" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.registerContentInsights.$1", + "type": "Object", + "tags": [], + "label": "{ usageCollection, http, getStartServices }", + "description": [], + "signature": [ + "ContentInsightsDependencies" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.registerContentInsights.$2", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "ContentInsightsConfig" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStats", + "type": "Interface", + "tags": [], + "label": "ContentInsightsStats", + "description": [], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStats.from", + "type": "string", + "tags": [], + "label": "from", + "description": [ + "\nThe date from which the data is counted" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStats.count", + "type": "number", + "tags": [], + "label": "count", + "description": [ + "\nTotal count of events" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStats.daily", + "type": "Array", + "tags": [], + "label": "daily", + "description": [ + "\nDaily counts of events" + ], + "signature": [ + "{ date: string; count: number; }[]" + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStatsResponse", + "type": "Interface", + "tags": [], + "label": "ContentInsightsStatsResponse", + "description": [], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/content-management-content-insights-server", + "id": "def-server.ContentInsightsStatsResponse.result", + "type": "Object", + "tags": [], + "label": "result", + "description": [], + "signature": [ + { + "pluginId": "@kbn/content-management-content-insights-server", + "scope": "server", + "docId": "kibKbnContentManagementContentInsightsServerPluginApi", + "section": "def-server.ContentInsightsStats", + "text": "ContentInsightsStats" + } + ], + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_content_management_content_insights_server.mdx b/api_docs/kbn_content_management_content_insights_server.mdx new file mode 100644 index 0000000000000..9b5d0fd8e1024 --- /dev/null +++ b/api_docs/kbn_content_management_content_insights_server.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnContentManagementContentInsightsServerPluginApi +slug: /kibana-dev-docs/api/kbn-content-management-content-insights-server +title: "@kbn/content-management-content-insights-server" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/content-management-content-insights-server plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-server'] +--- +import kbnContentManagementContentInsightsServerObj from './kbn_content_management_content_insights_server.devdocs.json'; + + + +Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 0 | 6 | 2 | + +## Server + +### Functions + + +### Interfaces + + diff --git a/api_docs/kbn_content_management_favorites_public.mdx b/api_docs/kbn_content_management_favorites_public.mdx index 386db5e5499f0..e25533f713255 100644 --- a/api_docs/kbn_content_management_favorites_public.mdx +++ b/api_docs/kbn_content_management_favorites_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-public title: "@kbn/content-management-favorites-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-public plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-public'] --- import kbnContentManagementFavoritesPublicObj from './kbn_content_management_favorites_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_server.mdx b/api_docs/kbn_content_management_favorites_server.mdx index e040ecd7e6341..e26262cee9b9c 100644 --- a/api_docs/kbn_content_management_favorites_server.mdx +++ b/api_docs/kbn_content_management_favorites_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-server title: "@kbn/content-management-favorites-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-server'] --- import kbnContentManagementFavoritesServerObj from './kbn_content_management_favorites_server.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 e48b3e2666143..06d373073c96e 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: 2024-08-14 +date: 2024-08-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 f4b9decbc851c..7b30566e188b2 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: 2024-08-14 +date: 2024-08-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_common.mdx b/api_docs/kbn_content_management_table_list_view_common.mdx index bcb522f8a92a2..d6b55f4c778ea 100644 --- a/api_docs/kbn_content_management_table_list_view_common.mdx +++ b/api_docs/kbn_content_management_table_list_view_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-common title: "@kbn/content-management-table-list-view-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-common'] --- import kbnContentManagementTableListViewCommonObj from './kbn_content_management_table_list_view_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.devdocs.json b/api_docs/kbn_content_management_table_list_view_table.devdocs.json index 4159e15e02447..958e9a551308d 100644 --- a/api_docs/kbn_content_management_table_list_view_table.devdocs.json +++ b/api_docs/kbn_content_management_table_list_view_table.devdocs.json @@ -348,6 +348,29 @@ "path": "packages/content-management/table_list_view_table/src/services.tsx", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-table-list-view-table", + "id": "def-public.TableListViewKibanaDependencies.contentInsightsClient", + "type": "Object", + "tags": [], + "label": "contentInsightsClient", + "description": [ + "\nContent insights client to enable content insights features." + ], + "signature": [ + { + "pluginId": "@kbn/content-management-content-insights-public", + "scope": "public", + "docId": "kibKbnContentManagementContentInsightsPublicPluginApi", + "section": "def-public.ContentInsightsClientPublic", + "text": "ContentInsightsClientPublic" + }, + " | undefined" + ], + "path": "packages/content-management/table_list_view_table/src/services.tsx", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false 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 b7ea73b69039c..704e81d77e954 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: 2024-08-14 +date: 2024-08-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'; @@ -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 | |-------------------|-----------|------------------------|-----------------| -| 50 | 0 | 33 | 3 | +| 51 | 0 | 33 | 3 | ## Client diff --git a/api_docs/kbn_content_management_user_profiles.mdx b/api_docs/kbn_content_management_user_profiles.mdx index 44f736994f0c8..324af8596e167 100644 --- a/api_docs/kbn_content_management_user_profiles.mdx +++ b/api_docs/kbn_content_management_user_profiles.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-user-profiles title: "@kbn/content-management-user-profiles" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-user-profiles plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-user-profiles'] --- import kbnContentManagementUserProfilesObj from './kbn_content_management_user_profiles.devdocs.json'; diff --git a/api_docs/kbn_content_management_utils.devdocs.json b/api_docs/kbn_content_management_utils.devdocs.json index 5ad26a1d86d38..fcff56097ad51 100644 --- a/api_docs/kbn_content_management_utils.devdocs.json +++ b/api_docs/kbn_content_management_utils.devdocs.json @@ -9,18 +9,10 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage", + "id": "def-server.SOContentStorage", "type": "Class", "tags": [], "label": "SOContentStorage", @@ -28,9 +20,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorage", + "section": "def-server.SOContentStorage", "text": "SOContentStorage" }, " implements ", @@ -57,7 +49,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.Unnamed", + "id": "def-server.SOContentStorage.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -71,7 +63,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.Unnamed.$1", + "id": "def-server.SOContentStorage.Unnamed.$1", "type": "Object", "tags": [], "label": "{\n savedObjectType,\n cmServicesDefinition,\n createArgsToSoCreateOptions,\n updateArgsToSoUpdateOptions,\n searchArgsToSOFindOptions,\n enableMSearch,\n allowedSavedObjectAttributes,\n mSearchAdditionalSearchFields,\n logger,\n throwOnResultValidationError,\n }", @@ -79,9 +71,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorageConstructorParams", + "section": "def-server.SOContentStorageConstructorParams", "text": "SOContentStorageConstructorParams" }, "" @@ -96,7 +88,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.mSearch", + "id": "def-server.SOContentStorage.mSearch", "type": "Object", "tags": [], "label": "mSearch", @@ -126,7 +118,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get", + "id": "def-server.SOContentStorage.get", "type": "Function", "tags": [], "label": "get", @@ -148,7 +140,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get.$1", + "id": "def-server.SOContentStorage.get.$1", "type": "Object", "tags": [], "label": "ctx", @@ -169,7 +161,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get.$2", + "id": "def-server.SOContentStorage.get.$2", "type": "string", "tags": [], "label": "id", @@ -187,7 +179,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.bulkGet", + "id": "def-server.SOContentStorage.bulkGet", "type": "Function", "tags": [], "label": "bulkGet", @@ -203,7 +195,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create", + "id": "def-server.SOContentStorage.create", "type": "Function", "tags": [], "label": "create", @@ -225,7 +217,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$1", + "id": "def-server.SOContentStorage.create.$1", "type": "Object", "tags": [], "label": "ctx", @@ -246,7 +238,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$2", + "id": "def-server.SOContentStorage.create.$2", "type": "Uncategorized", "tags": [], "label": "data", @@ -261,7 +253,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$3", + "id": "def-server.SOContentStorage.create.$3", "type": "Uncategorized", "tags": [], "label": "options", @@ -279,7 +271,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update", + "id": "def-server.SOContentStorage.update", "type": "Function", "tags": [], "label": "update", @@ -301,7 +293,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$1", + "id": "def-server.SOContentStorage.update.$1", "type": "Object", "tags": [], "label": "ctx", @@ -322,7 +314,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$2", + "id": "def-server.SOContentStorage.update.$2", "type": "string", "tags": [], "label": "id", @@ -337,7 +329,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$3", + "id": "def-server.SOContentStorage.update.$3", "type": "Uncategorized", "tags": [], "label": "data", @@ -352,7 +344,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$4", + "id": "def-server.SOContentStorage.update.$4", "type": "Uncategorized", "tags": [], "label": "options", @@ -370,7 +362,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete", + "id": "def-server.SOContentStorage.delete", "type": "Function", "tags": [], "label": "delete", @@ -392,7 +384,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$1", + "id": "def-server.SOContentStorage.delete.$1", "type": "Object", "tags": [], "label": "ctx", @@ -413,7 +405,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$2", + "id": "def-server.SOContentStorage.delete.$2", "type": "string", "tags": [], "label": "id", @@ -428,7 +420,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$3", + "id": "def-server.SOContentStorage.delete.$3", "type": "Object", "tags": [], "label": "options", @@ -439,7 +431,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$3.force", + "id": "def-server.SOContentStorage.delete.$3.force", "type": "boolean", "tags": [], "label": "force", @@ -455,7 +447,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search", + "id": "def-server.SOContentStorage.search", "type": "Function", "tags": [], "label": "search", @@ -485,7 +477,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$1", + "id": "def-server.SOContentStorage.search.$1", "type": "Object", "tags": [], "label": "ctx", @@ -506,7 +498,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$2", + "id": "def-server.SOContentStorage.search.$2", "type": "Object", "tags": [], "label": "query", @@ -527,7 +519,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$3", + "id": "def-server.SOContentStorage.search.$3", "type": "Uncategorized", "tags": [], "label": "options", @@ -550,7 +542,7 @@ "functions": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createArgsToSoCreateOptionsDefault", + "id": "def-server.createArgsToSoCreateOptionsDefault", "type": "Function", "tags": [], "label": "createArgsToSoCreateOptionsDefault", @@ -579,7 +571,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createArgsToSoCreateOptionsDefault.$1", + "id": "def-server.createArgsToSoCreateOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -604,7 +596,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createResultSchema", + "id": "def-server.createResultSchema", "type": "Function", "tags": [], "label": "createResultSchema", @@ -642,7 +634,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createResultSchema.$1", + "id": "def-server.createResultSchema.$1", "type": "Object", "tags": [], "label": "soSchema", @@ -668,7 +660,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.getMSearch", + "id": "def-server.getMSearch", "type": "Function", "tags": [], "label": "getMSearch", @@ -698,7 +690,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.getMSearch.$1", + "id": "def-server.getMSearch.$1", "type": "Object", "tags": [], "label": "{\n savedObjectType,\n cmServicesDefinition,\n allowedSavedObjectAttributes,\n}", @@ -717,7 +709,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.objectTypeToGetResultSchema", + "id": "def-server.objectTypeToGetResultSchema", "type": "Function", "tags": [], "label": "objectTypeToGetResultSchema", @@ -787,7 +779,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.objectTypeToGetResultSchema.$1", + "id": "def-server.objectTypeToGetResultSchema.$1", "type": "Object", "tags": [], "label": "soSchema", @@ -813,7 +805,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.savedObjectSchema", + "id": "def-server.savedObjectSchema", "type": "Function", "tags": [], "label": "savedObjectSchema", @@ -923,7 +915,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.savedObjectSchema.$1", + "id": "def-server.savedObjectSchema.$1", "type": "Object", "tags": [], "label": "attributesSchema", @@ -949,7 +941,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchArgsToSOFindOptionsDefault", + "id": "def-server.searchArgsToSOFindOptionsDefault", "type": "Function", "tags": [], "label": "searchArgsToSOFindOptionsDefault", @@ -966,9 +958,9 @@ ") => ", @@ -986,7 +978,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchArgsToSOFindOptionsDefault.$1", + "id": "def-server.searchArgsToSOFindOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -1002,9 +994,9 @@ "" @@ -1020,7 +1012,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions", + "id": "def-server.tagsToFindOptions", "type": "Function", "tags": [], "label": "tagsToFindOptions", @@ -1050,7 +1042,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1", + "id": "def-server.tagsToFindOptions.$1", "type": "Object", "tags": [], "label": "{\n included,\n excluded,\n}", @@ -1061,7 +1053,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1.included", + "id": "def-server.tagsToFindOptions.$1.included", "type": "Array", "tags": [], "label": "included", @@ -1075,7 +1067,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1.excluded", + "id": "def-server.tagsToFindOptions.$1.excluded", "type": "Array", "tags": [], "label": "excluded", @@ -1095,7 +1087,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateArgsToSoUpdateOptionsDefault", + "id": "def-server.updateArgsToSoUpdateOptionsDefault", "type": "Function", "tags": [], "label": "updateArgsToSoUpdateOptionsDefault", @@ -1104,9 +1096,9 @@ "(params: ", @@ -1133,7 +1125,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateArgsToSoUpdateOptionsDefault.$1", + "id": "def-server.updateArgsToSoUpdateOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -1161,7 +1153,7 @@ "interfaces": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes", + "id": "def-server.CMCrudTypes", "type": "Interface", "tags": [], "label": "CMCrudTypes", @@ -1172,7 +1164,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.Attributes", + "id": "def-server.CMCrudTypes.Attributes", "type": "Uncategorized", "tags": [], "label": "Attributes", @@ -1188,7 +1180,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.Item", + "id": "def-server.CMCrudTypes.Item", "type": "Object", "tags": [], "label": "Item", @@ -1198,9 +1190,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -1211,7 +1203,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.PartialItem", + "id": "def-server.CMCrudTypes.PartialItem", "type": "CompoundType", "tags": [], "label": "PartialItem", @@ -1222,17 +1214,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: object; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -1243,7 +1235,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.GetIn", + "id": "def-server.CMCrudTypes.GetIn", "type": "Object", "tags": [], "label": "GetIn", @@ -1266,7 +1258,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.GetOut", + "id": "def-server.CMCrudTypes.GetOut", "type": "Object", "tags": [], "label": "GetOut", @@ -1277,9 +1269,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }" @@ -1290,7 +1282,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateIn", + "id": "def-server.CMCrudTypes.CreateIn", "type": "Object", "tags": [], "label": "CreateIn", @@ -1313,7 +1305,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateOut", + "id": "def-server.CMCrudTypes.CreateOut", "type": "Object", "tags": [], "label": "CreateOut", @@ -1324,9 +1316,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }" @@ -1337,7 +1329,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateOptions", + "id": "def-server.CMCrudTypes.CreateOptions", "type": "Uncategorized", "tags": [], "label": "CreateOptions", @@ -1353,7 +1345,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchIn", + "id": "def-server.CMCrudTypes.SearchIn", "type": "Object", "tags": [], "label": "SearchIn", @@ -1376,7 +1368,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchOut", + "id": "def-server.CMCrudTypes.SearchOut", "type": "Object", "tags": [], "label": "SearchOut", @@ -1387,9 +1379,9 @@ "{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }" @@ -1400,7 +1392,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchOptions", + "id": "def-server.CMCrudTypes.SearchOptions", "type": "Uncategorized", "tags": [], "label": "SearchOptions", @@ -1416,7 +1408,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateIn", + "id": "def-server.CMCrudTypes.UpdateIn", "type": "Object", "tags": [], "label": "UpdateIn", @@ -1439,7 +1431,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateOut", + "id": "def-server.CMCrudTypes.UpdateOut", "type": "Object", "tags": [], "label": "UpdateOut", @@ -1450,9 +1442,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }" @@ -1463,7 +1455,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateOptions", + "id": "def-server.CMCrudTypes.UpdateOptions", "type": "Uncategorized", "tags": [], "label": "UpdateOptions", @@ -1479,7 +1471,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.DeleteIn", + "id": "def-server.CMCrudTypes.DeleteIn", "type": "Object", "tags": [], "label": "DeleteIn", @@ -1502,7 +1494,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.DeleteOut", + "id": "def-server.CMCrudTypes.DeleteOut", "type": "Object", "tags": [], "label": "DeleteOut", @@ -1527,7 +1519,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes", + "id": "def-server.ContentManagementCrudTypes", "type": "Interface", "tags": [ "argument", @@ -1540,9 +1532,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ContentManagementCrudTypes", + "section": "def-server.ContentManagementCrudTypes", "text": "ContentManagementCrudTypes" }, "" @@ -1553,7 +1545,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.Attributes", + "id": "def-server.ContentManagementCrudTypes.Attributes", "type": "Uncategorized", "tags": [], "label": "Attributes", @@ -1567,7 +1559,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.Item", + "id": "def-server.ContentManagementCrudTypes.Item", "type": "Object", "tags": [], "label": "Item", @@ -1577,9 +1569,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -1590,7 +1582,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.PartialItem", + "id": "def-server.ContentManagementCrudTypes.PartialItem", "type": "CompoundType", "tags": [], "label": "PartialItem", @@ -1601,17 +1593,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: Partial; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -1622,7 +1614,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateOptions", + "id": "def-server.ContentManagementCrudTypes.CreateOptions", "type": "Uncategorized", "tags": [], "label": "CreateOptions", @@ -1638,7 +1630,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateOptions", + "id": "def-server.ContentManagementCrudTypes.UpdateOptions", "type": "Uncategorized", "tags": [], "label": "UpdateOptions", @@ -1654,7 +1646,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchOptions", + "id": "def-server.ContentManagementCrudTypes.SearchOptions", "type": "Uncategorized", "tags": [], "label": "SearchOptions", @@ -1670,7 +1662,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.GetIn", + "id": "def-server.ContentManagementCrudTypes.GetIn", "type": "Object", "tags": [], "label": "GetIn", @@ -1693,7 +1685,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.GetOut", + "id": "def-server.ContentManagementCrudTypes.GetOut", "type": "Object", "tags": [], "label": "GetOut", @@ -1704,9 +1696,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }" @@ -1717,7 +1709,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateIn", + "id": "def-server.ContentManagementCrudTypes.CreateIn", "type": "Object", "tags": [], "label": "CreateIn", @@ -1740,7 +1732,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateOut", + "id": "def-server.ContentManagementCrudTypes.CreateOut", "type": "Object", "tags": [], "label": "CreateOut", @@ -1751,9 +1743,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }" @@ -1764,7 +1756,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchIn", + "id": "def-server.ContentManagementCrudTypes.SearchIn", "type": "Object", "tags": [], "label": "SearchIn", @@ -1787,7 +1779,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchOut", + "id": "def-server.ContentManagementCrudTypes.SearchOut", "type": "Object", "tags": [], "label": "SearchOut", @@ -1798,9 +1790,9 @@ "{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }" @@ -1811,7 +1803,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateIn", + "id": "def-server.ContentManagementCrudTypes.UpdateIn", "type": "Object", "tags": [], "label": "UpdateIn", @@ -1834,7 +1826,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateOut", + "id": "def-server.ContentManagementCrudTypes.UpdateOut", "type": "Object", "tags": [], "label": "UpdateOut", @@ -1845,9 +1837,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }" @@ -1858,7 +1850,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.DeleteIn", + "id": "def-server.ContentManagementCrudTypes.DeleteIn", "type": "Object", "tags": [], "label": "DeleteIn", @@ -1881,7 +1873,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.DeleteOut", + "id": "def-server.ContentManagementCrudTypes.DeleteOut", "type": "Object", "tags": [], "label": "DeleteOut", @@ -1906,7 +1898,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType", + "id": "def-server.GetMSearchType", "type": "Interface", "tags": [], "label": "GetMSearchType", @@ -1914,9 +1906,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.GetMSearchType", + "section": "def-server.GetMSearchType", "text": "GetMSearchType" }, "" @@ -1927,7 +1919,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.savedObjectType", + "id": "def-server.GetMSearchType.savedObjectType", "type": "string", "tags": [], "label": "savedObjectType", @@ -1938,7 +1930,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult", + "id": "def-server.GetMSearchType.toItemResult", "type": "Function", "tags": [], "label": "toItemResult", @@ -1968,7 +1960,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult.$1", + "id": "def-server.GetMSearchType.toItemResult.$1", "type": "Object", "tags": [], "label": "ctx", @@ -1989,7 +1981,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult.$2", + "id": "def-server.GetMSearchType.toItemResult.$2", "type": "Object", "tags": [], "label": "savedObject", @@ -2017,7 +2009,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference", + "id": "def-server.Reference", "type": "Interface", "tags": [], "label": "Reference", @@ -2028,7 +2020,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.type", + "id": "def-server.Reference.type", "type": "string", "tags": [], "label": "type", @@ -2039,7 +2031,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.id", + "id": "def-server.Reference.id", "type": "string", "tags": [], "label": "id", @@ -2050,7 +2042,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.name", + "id": "def-server.Reference.name", "type": "string", "tags": [], "label": "name", @@ -2064,7 +2056,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions", + "id": "def-server.SavedObjectCreateOptions", "type": "Interface", "tags": [], "label": "SavedObjectCreateOptions", @@ -2077,7 +2069,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.id", + "id": "def-server.SavedObjectCreateOptions.id", "type": "string", "tags": [], "label": "id", @@ -2093,7 +2085,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.overwrite", + "id": "def-server.SavedObjectCreateOptions.overwrite", "type": "CompoundType", "tags": [], "label": "overwrite", @@ -2109,7 +2101,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.version", + "id": "def-server.SavedObjectCreateOptions.version", "type": "string", "tags": [], "label": "version", @@ -2125,7 +2117,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.references", + "id": "def-server.SavedObjectCreateOptions.references", "type": "Array", "tags": [], "label": "references", @@ -2135,9 +2127,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" @@ -2148,7 +2140,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.refresh", + "id": "def-server.SavedObjectCreateOptions.refresh", "type": "CompoundType", "tags": [], "label": "refresh", @@ -2164,7 +2156,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.initialNamespaces", + "id": "def-server.SavedObjectCreateOptions.initialNamespaces", "type": "Array", "tags": [], "label": "initialNamespaces", @@ -2183,7 +2175,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions", + "id": "def-server.SavedObjectSearchOptions", "type": "Interface", "tags": [], "label": "SavedObjectSearchOptions", @@ -2196,7 +2188,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.page", + "id": "def-server.SavedObjectSearchOptions.page", "type": "number", "tags": [], "label": "page", @@ -2212,7 +2204,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.perPage", + "id": "def-server.SavedObjectSearchOptions.perPage", "type": "number", "tags": [], "label": "perPage", @@ -2228,7 +2220,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.sortField", + "id": "def-server.SavedObjectSearchOptions.sortField", "type": "string", "tags": [], "label": "sortField", @@ -2244,7 +2236,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.sortOrder", + "id": "def-server.SavedObjectSearchOptions.sortOrder", "type": "CompoundType", "tags": [], "label": "sortOrder", @@ -2261,7 +2253,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.fields", + "id": "def-server.SavedObjectSearchOptions.fields", "type": "Array", "tags": [], "label": "fields", @@ -2277,7 +2269,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.search", + "id": "def-server.SavedObjectSearchOptions.search", "type": "string", "tags": [], "label": "search", @@ -2293,7 +2285,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.searchFields", + "id": "def-server.SavedObjectSearchOptions.searchFields", "type": "Array", "tags": [], "label": "searchFields", @@ -2309,7 +2301,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.searchAfter", + "id": "def-server.SavedObjectSearchOptions.searchAfter", "type": "Array", "tags": [], "label": "searchAfter", @@ -2326,7 +2318,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.rootSearchFields", + "id": "def-server.SavedObjectSearchOptions.rootSearchFields", "type": "Array", "tags": [], "label": "rootSearchFields", @@ -2342,7 +2334,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasReference", + "id": "def-server.SavedObjectSearchOptions.hasReference", "type": "CompoundType", "tags": [], "label": "hasReference", @@ -2373,7 +2365,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasReferenceOperator", + "id": "def-server.SavedObjectSearchOptions.hasReferenceOperator", "type": "CompoundType", "tags": [], "label": "hasReferenceOperator", @@ -2389,7 +2381,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasNoReference", + "id": "def-server.SavedObjectSearchOptions.hasNoReference", "type": "CompoundType", "tags": [], "label": "hasNoReference", @@ -2420,7 +2412,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasNoReferenceOperator", + "id": "def-server.SavedObjectSearchOptions.hasNoReferenceOperator", "type": "CompoundType", "tags": [], "label": "hasNoReferenceOperator", @@ -2436,7 +2428,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.defaultSearchOperator", + "id": "def-server.SavedObjectSearchOptions.defaultSearchOperator", "type": "CompoundType", "tags": [], "label": "defaultSearchOperator", @@ -2452,7 +2444,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.filter", + "id": "def-server.SavedObjectSearchOptions.filter", "type": "Any", "tags": [], "label": "filter", @@ -2468,7 +2460,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.aggs", + "id": "def-server.SavedObjectSearchOptions.aggs", "type": "Object", "tags": [ "alpha" @@ -2488,7 +2480,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.namespaces", + "id": "def-server.SavedObjectSearchOptions.namespaces", "type": "Array", "tags": [], "label": "namespaces", @@ -2504,7 +2496,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.pit", + "id": "def-server.SavedObjectSearchOptions.pit", "type": "Object", "tags": [], "label": "pit", @@ -2530,7 +2522,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions", + "id": "def-server.SavedObjectUpdateOptions", "type": "Interface", "tags": [], "label": "SavedObjectUpdateOptions", @@ -2540,9 +2532,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, "" @@ -2553,7 +2545,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.references", + "id": "def-server.SavedObjectUpdateOptions.references", "type": "Array", "tags": [], "label": "references", @@ -2563,9 +2555,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" @@ -2576,7 +2568,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.version", + "id": "def-server.SavedObjectUpdateOptions.version", "type": "string", "tags": [], "label": "version", @@ -2590,7 +2582,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.refresh", + "id": "def-server.SavedObjectUpdateOptions.refresh", "type": "CompoundType", "tags": [], "label": "refresh", @@ -2613,7 +2605,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.upsert", + "id": "def-server.SavedObjectUpdateOptions.upsert", "type": "Uncategorized", "tags": [], "label": "upsert", @@ -2629,7 +2621,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.retryOnConflict", + "id": "def-server.SavedObjectUpdateOptions.retryOnConflict", "type": "number", "tags": [], "label": "retryOnConflict", @@ -2645,7 +2637,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.mergeAttributes", + "id": "def-server.SavedObjectUpdateOptions.mergeAttributes", "type": "CompoundType", "tags": [], "label": "mergeAttributes", @@ -2664,7 +2656,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault", "type": "Interface", "tags": [], "label": "SearchArgsToSOFindOptionsOptionsDefault", @@ -2675,7 +2667,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault.fields", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault.fields", "type": "Array", "tags": [], "label": "fields", @@ -2689,7 +2681,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault.searchFields", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault.searchFields", "type": "Array", "tags": [], "label": "searchFields", @@ -2706,7 +2698,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ServicesDefinitionSet", + "id": "def-server.ServicesDefinitionSet", "type": "Interface", "tags": [], "label": "ServicesDefinitionSet", @@ -2717,7 +2709,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ServicesDefinitionSet.Unnamed", + "id": "def-server.ServicesDefinitionSet.Unnamed", "type": "IndexSignature", "tags": [], "label": "[version: number]: ServicesDefinition", @@ -2741,7 +2733,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams", + "id": "def-server.SOContentStorageConstructorParams", "type": "Interface", "tags": [], "label": "SOContentStorageConstructorParams", @@ -2749,9 +2741,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorageConstructorParams", + "section": "def-server.SOContentStorageConstructorParams", "text": "SOContentStorageConstructorParams" }, "" @@ -2762,7 +2754,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.savedObjectType", + "id": "def-server.SOContentStorageConstructorParams.savedObjectType", "type": "string", "tags": [], "label": "savedObjectType", @@ -2773,7 +2765,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.cmServicesDefinition", + "id": "def-server.SOContentStorageConstructorParams.cmServicesDefinition", "type": "Object", "tags": [], "label": "cmServicesDefinition", @@ -2781,9 +2773,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ServicesDefinitionSet", + "section": "def-server.ServicesDefinitionSet", "text": "ServicesDefinitionSet" } ], @@ -2793,7 +2785,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.allowedSavedObjectAttributes", + "id": "def-server.SOContentStorageConstructorParams.allowedSavedObjectAttributes", "type": "Array", "tags": [], "label": "allowedSavedObjectAttributes", @@ -2807,7 +2799,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.createArgsToSoCreateOptions", + "id": "def-server.SOContentStorageConstructorParams.createArgsToSoCreateOptions", "type": "Function", "tags": [], "label": "createArgsToSoCreateOptions", @@ -2815,9 +2807,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.CreateArgsToSoCreateOptions", + "section": "def-server.CreateArgsToSoCreateOptions", "text": "CreateArgsToSoCreateOptions" }, " | undefined" @@ -2828,7 +2820,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.updateArgsToSoUpdateOptions", + "id": "def-server.SOContentStorageConstructorParams.updateArgsToSoUpdateOptions", "type": "Function", "tags": [], "label": "updateArgsToSoUpdateOptions", @@ -2836,9 +2828,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.UpdateArgsToSoUpdateOptions", + "section": "def-server.UpdateArgsToSoUpdateOptions", "text": "UpdateArgsToSoUpdateOptions" }, " | undefined" @@ -2849,7 +2841,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.searchArgsToSOFindOptions", + "id": "def-server.SOContentStorageConstructorParams.searchArgsToSOFindOptions", "type": "Function", "tags": [], "label": "searchArgsToSOFindOptions", @@ -2857,9 +2849,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SearchArgsToSOFindOptions", + "section": "def-server.SearchArgsToSOFindOptions", "text": "SearchArgsToSOFindOptions" }, " | undefined" @@ -2870,7 +2862,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.enableMSearch", + "id": "def-server.SOContentStorageConstructorParams.enableMSearch", "type": "CompoundType", "tags": [], "label": "enableMSearch", @@ -2886,7 +2878,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.mSearchAdditionalSearchFields", + "id": "def-server.SOContentStorageConstructorParams.mSearchAdditionalSearchFields", "type": "Array", "tags": [], "label": "mSearchAdditionalSearchFields", @@ -2900,7 +2892,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.logger", + "id": "def-server.SOContentStorageConstructorParams.logger", "type": "Object", "tags": [], "label": "logger", @@ -2920,7 +2912,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.throwOnResultValidationError", + "id": "def-server.SOContentStorageConstructorParams.throwOnResultValidationError", "type": "boolean", "tags": [], "label": "throwOnResultValidationError", @@ -2934,7 +2926,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata", + "id": "def-server.SOWithMetadata", "type": "Interface", "tags": [], "label": "SOWithMetadata", @@ -2944,9 +2936,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -2957,7 +2949,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.id", + "id": "def-server.SOWithMetadata.id", "type": "string", "tags": [], "label": "id", @@ -2968,7 +2960,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.type", + "id": "def-server.SOWithMetadata.type", "type": "string", "tags": [], "label": "type", @@ -2979,7 +2971,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.version", + "id": "def-server.SOWithMetadata.version", "type": "string", "tags": [], "label": "version", @@ -2993,7 +2985,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.createdAt", + "id": "def-server.SOWithMetadata.createdAt", "type": "string", "tags": [], "label": "createdAt", @@ -3007,7 +2999,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.updatedAt", + "id": "def-server.SOWithMetadata.updatedAt", "type": "string", "tags": [], "label": "updatedAt", @@ -3021,7 +3013,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.createdBy", + "id": "def-server.SOWithMetadata.createdBy", "type": "string", "tags": [], "label": "createdBy", @@ -3035,7 +3027,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.updatedBy", + "id": "def-server.SOWithMetadata.updatedBy", "type": "string", "tags": [], "label": "updatedBy", @@ -3049,7 +3041,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.error", + "id": "def-server.SOWithMetadata.error", "type": "Object", "tags": [], "label": "error", @@ -3063,7 +3055,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.managed", + "id": "def-server.SOWithMetadata.managed", "type": "CompoundType", "tags": [], "label": "managed", @@ -3077,7 +3069,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.attributes", + "id": "def-server.SOWithMetadata.attributes", "type": "Uncategorized", "tags": [], "label": "attributes", @@ -3091,7 +3083,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.references", + "id": "def-server.SOWithMetadata.references", "type": "Array", "tags": [], "label": "references", @@ -3099,9 +3091,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -3112,7 +3104,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.namespaces", + "id": "def-server.SOWithMetadata.namespaces", "type": "Array", "tags": [], "label": "namespaces", @@ -3126,7 +3118,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.originId", + "id": "def-server.SOWithMetadata.originId", "type": "string", "tags": [], "label": "originId", @@ -3146,7 +3138,7 @@ "misc": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CreateArgsToSoCreateOptions", + "id": "def-server.CreateArgsToSoCreateOptions", "type": "Type", "tags": [], "label": "CreateArgsToSoCreateOptions", @@ -3168,7 +3160,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CreateArgsToSoCreateOptions.$1", + "id": "def-server.CreateArgsToSoCreateOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3185,7 +3177,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetResultSO", + "id": "def-server.GetResultSO", "type": "Type", "tags": [], "label": "GetResultSO", @@ -3202,7 +3194,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptions", + "id": "def-server.SearchArgsToSOFindOptions", "type": "Type", "tags": [], "label": "SearchArgsToSOFindOptions", @@ -3224,7 +3216,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptions.$1", + "id": "def-server.SearchArgsToSOFindOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3241,7 +3233,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadataPartial", + "id": "def-server.SOWithMetadataPartial", "type": "Type", "tags": [], "label": "SOWithMetadataPartial", @@ -3250,17 +3242,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: Partial; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -3272,7 +3264,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.UpdateArgsToSoUpdateOptions", + "id": "def-server.UpdateArgsToSoUpdateOptions", "type": "Type", "tags": [], "label": "UpdateArgsToSoUpdateOptions", @@ -3295,7 +3287,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.UpdateArgsToSoUpdateOptions.$1", + "id": "def-server.UpdateArgsToSoUpdateOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3314,7 +3306,7 @@ "objects": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.apiError", + "id": "def-server.apiError", "type": "Object", "tags": [], "label": "apiError", @@ -3368,7 +3360,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas", + "id": "def-server.createOptionsSchemas", "type": "Object", "tags": [], "label": "createOptionsSchemas", @@ -3379,7 +3371,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.id", + "id": "def-server.createOptionsSchemas.id", "type": "Object", "tags": [], "label": "id", @@ -3400,7 +3392,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.references", + "id": "def-server.createOptionsSchemas.references", "type": "Object", "tags": [], "label": "references", @@ -3421,7 +3413,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.overwrite", + "id": "def-server.createOptionsSchemas.overwrite", "type": "Object", "tags": [], "label": "overwrite", @@ -3442,7 +3434,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.version", + "id": "def-server.createOptionsSchemas.version", "type": "Object", "tags": [], "label": "version", @@ -3463,7 +3455,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.refresh", + "id": "def-server.createOptionsSchemas.refresh", "type": "Object", "tags": [], "label": "refresh", @@ -3484,7 +3476,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.initialNamespaces", + "id": "def-server.createOptionsSchemas.initialNamespaces", "type": "Object", "tags": [], "label": "initialNamespaces", @@ -3508,7 +3500,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.referenceSchema", + "id": "def-server.referenceSchema", "type": "Object", "tags": [], "label": "referenceSchema", @@ -3554,7 +3546,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.referencesSchema", + "id": "def-server.referencesSchema", "type": "Object", "tags": [], "label": "referencesSchema", @@ -3576,7 +3568,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.schemaAndOr", + "id": "def-server.schemaAndOr", "type": "Object", "tags": [], "label": "schemaAndOr", @@ -3598,7 +3590,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas", + "id": "def-server.searchOptionsSchemas", "type": "Object", "tags": [], "label": "searchOptionsSchemas", @@ -3609,7 +3601,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.page", + "id": "def-server.searchOptionsSchemas.page", "type": "Object", "tags": [], "label": "page", @@ -3630,7 +3622,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.perPage", + "id": "def-server.searchOptionsSchemas.perPage", "type": "Object", "tags": [], "label": "perPage", @@ -3651,7 +3643,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.sortField", + "id": "def-server.searchOptionsSchemas.sortField", "type": "Object", "tags": [], "label": "sortField", @@ -3672,7 +3664,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.sortOrder", + "id": "def-server.searchOptionsSchemas.sortOrder", "type": "Object", "tags": [], "label": "sortOrder", @@ -3693,7 +3685,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.fields", + "id": "def-server.searchOptionsSchemas.fields", "type": "Object", "tags": [], "label": "fields", @@ -3714,7 +3706,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.search", + "id": "def-server.searchOptionsSchemas.search", "type": "Object", "tags": [], "label": "search", @@ -3735,7 +3727,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.searchFields", + "id": "def-server.searchOptionsSchemas.searchFields", "type": "Object", "tags": [], "label": "searchFields", @@ -3756,7 +3748,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.rootSearchFields", + "id": "def-server.searchOptionsSchemas.rootSearchFields", "type": "Object", "tags": [], "label": "rootSearchFields", @@ -3777,7 +3769,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasReference", + "id": "def-server.searchOptionsSchemas.hasReference", "type": "Object", "tags": [], "label": "hasReference", @@ -3798,7 +3790,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasReferenceOperator", + "id": "def-server.searchOptionsSchemas.hasReferenceOperator", "type": "Object", "tags": [], "label": "hasReferenceOperator", @@ -3819,7 +3811,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasNoReference", + "id": "def-server.searchOptionsSchemas.hasNoReference", "type": "Object", "tags": [], "label": "hasNoReference", @@ -3840,7 +3832,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasNoReferenceOperator", + "id": "def-server.searchOptionsSchemas.hasNoReferenceOperator", "type": "Object", "tags": [], "label": "hasNoReferenceOperator", @@ -3861,7 +3853,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.defaultSearchOperator", + "id": "def-server.searchOptionsSchemas.defaultSearchOperator", "type": "Object", "tags": [], "label": "defaultSearchOperator", @@ -3882,7 +3874,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.namespaces", + "id": "def-server.searchOptionsSchemas.namespaces", "type": "Object", "tags": [], "label": "namespaces", @@ -3903,7 +3895,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.type", + "id": "def-server.searchOptionsSchemas.type", "type": "Object", "tags": [], "label": "type", @@ -3924,7 +3916,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.filter", + "id": "def-server.searchOptionsSchemas.filter", "type": "Object", "tags": [], "label": "filter", @@ -3945,7 +3937,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.pit", + "id": "def-server.searchOptionsSchemas.pit", "type": "Object", "tags": [], "label": "pit", @@ -3969,7 +3961,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema", + "id": "def-server.updateOptionsSchema", "type": "Object", "tags": [], "label": "updateOptionsSchema", @@ -3980,7 +3972,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.references", + "id": "def-server.updateOptionsSchema.references", "type": "Object", "tags": [], "label": "references", @@ -4001,7 +3993,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.version", + "id": "def-server.updateOptionsSchema.version", "type": "Object", "tags": [], "label": "version", @@ -4022,7 +4014,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.refresh", + "id": "def-server.updateOptionsSchema.refresh", "type": "Object", "tags": [], "label": "refresh", @@ -4043,7 +4035,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.upsert", + "id": "def-server.updateOptionsSchema.upsert", "type": "Function", "tags": [], "label": "upsert", @@ -4073,7 +4065,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.upsert.$1", + "id": "def-server.updateOptionsSchema.upsert.$1", "type": "Object", "tags": [], "label": "attributesSchema", @@ -4098,7 +4090,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.retryOnConflict", + "id": "def-server.updateOptionsSchema.retryOnConflict", "type": "Object", "tags": [], "label": "retryOnConflict", @@ -4119,7 +4111,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.mergeAttributes", + "id": "def-server.updateOptionsSchema.mergeAttributes", "type": "Object", "tags": [], "label": "mergeAttributes", @@ -4142,5 +4134,13 @@ "initialIsOpen": false } ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index 0d4f902971d1d..15b4b43713a02 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; @@ -23,20 +23,20 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k |-------------------|-----------|------------------------|-----------------| | 195 | 1 | 128 | 0 | -## Common +## Server ### Objects - + ### Functions - + ### Classes - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_core_analytics_browser.devdocs.json b/api_docs/kbn_core_analytics_browser.devdocs.json index 502a1f60df079..6071d4931ceb7 100644 --- a/api_docs/kbn_core_analytics_browser.devdocs.json +++ b/api_docs/kbn_core_analytics_browser.devdocs.json @@ -708,7 +708,7 @@ }, { "plugin": "elasticAssistant", - "path": "x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts" + "path": "x-pack/plugins/elastic_assistant/server/routes/helpers.ts" }, { "plugin": "elasticAssistant", @@ -724,7 +724,7 @@ }, { "plugin": "elasticAssistant", - "path": "x-pack/plugins/elastic_assistant/server/routes/helpers.ts" + "path": "x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts" }, { "plugin": "elasticAssistant", @@ -982,6 +982,10 @@ "plugin": "observabilityLogsExplorer", "path": "x-pack/plugins/observability_solution/observability_logs_explorer/public/state_machines/observability_logs_explorer/src/telemetry_events.ts" }, + { + "plugin": "observabilityOnboarding", + "path": "x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/shared/feedback_buttons.tsx" + }, { "plugin": "observabilityOnboarding", "path": "x-pack/plugins/observability_solution/observability_onboarding/public/hooks/use_flow_progress_telemetry.ts" diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index e4ad35b4fd80b..56f247497ffda 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: 2024-08-14 +date: 2024-08-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 29dfa47a7a005..ca63afd28d58e 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: 2024-08-14 +date: 2024-08-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 79e2e94a469cf..9289e659e0218 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_analytics_server.devdocs.json index 1194fae25d085..ade36dd60bde5 100644 --- a/api_docs/kbn_core_analytics_server.devdocs.json +++ b/api_docs/kbn_core_analytics_server.devdocs.json @@ -716,7 +716,7 @@ }, { "plugin": "elasticAssistant", - "path": "x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts" + "path": "x-pack/plugins/elastic_assistant/server/routes/helpers.ts" }, { "plugin": "elasticAssistant", @@ -732,7 +732,7 @@ }, { "plugin": "elasticAssistant", - "path": "x-pack/plugins/elastic_assistant/server/routes/helpers.ts" + "path": "x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts" }, { "plugin": "elasticAssistant", @@ -990,6 +990,10 @@ "plugin": "observabilityLogsExplorer", "path": "x-pack/plugins/observability_solution/observability_logs_explorer/public/state_machines/observability_logs_explorer/src/telemetry_events.ts" }, + { + "plugin": "observabilityOnboarding", + "path": "x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/shared/feedback_buttons.tsx" + }, { "plugin": "observabilityOnboarding", "path": "x-pack/plugins/observability_solution/observability_onboarding/public/hooks/use_flow_progress_telemetry.ts" diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 833722768ab41..f0728061ebdc4 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: 2024-08-14 +date: 2024-08-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 dad7a733b9377..5cb3b7a5d9602 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: 2024-08-14 +date: 2024-08-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 b8b89e6d381be..7f88ab68074c3 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_core_application_browser.mdx index 202e7c21775b0..7b3e3d50b1cd0 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: 2024-08-14 +date: 2024-08-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 995ec4f0b75d1..644ecf90dc402 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: 2024-08-14 +date: 2024-08-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 47736149cf1d2..cd545bdb88acb 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: 2024-08-14 +date: 2024-08-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 eeff041b83163..2199d5cdbe7f6 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: 2024-08-14 +date: 2024-08-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 918b4897c1c82..b01ea07a6ccdc 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: 2024-08-14 +date: 2024-08-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 32df345b857a7..02dd69d0b2538 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: 2024-08-14 +date: 2024-08-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 d5aef7fee726a..f5dc067f67194 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: 2024-08-14 +date: 2024-08-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 1c9738541c275..b898ca85db4f8 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: 2024-08-14 +date: 2024-08-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 1584ffcd7379b..1a3ff723eb4e6 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: 2024-08-14 +date: 2024-08-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 25eae5c1c4c16..7fc314639e1b1 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: 2024-08-14 +date: 2024-08-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 ebc51615d9e8e..e59e47ccd1692 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: 2024-08-14 +date: 2024-08-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 df1235c5105f8..6cfcb6f94f6a4 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: 2024-08-14 +date: 2024-08-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 1022a8f5d48f2..6163030964d57 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: 2024-08-14 +date: 2024-08-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 6141fe740a194..9ab5d917ef407 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: 2024-08-14 +date: 2024-08-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 08632fba94c16..d9db907fadebe 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: 2024-08-14 +date: 2024-08-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 f8fadfa7b7a26..c1c3d5b8793a4 100644 --- a/api_docs/kbn_core_chrome_browser.devdocs.json +++ b/api_docs/kbn_core_chrome_browser.devdocs.json @@ -3700,7 +3700,7 @@ "label": "AppDeepLinkId", "description": [], "signature": [ - "\"fleet\" | \"graph\" | \"ml\" | \"monitoring\" | \"metrics\" | \"management\" | \"apm\" | \"synthetics\" | \"ux\" | \"logs\" | \"profiling\" | \"dashboards\" | \"slo\" | \"observabilityAIAssistant\" | \"home\" | \"canvas\" | \"integrations\" | \"discover\" | \"observability-overview\" | \"appSearch\" | \"dev_tools\" | \"maps\" | \"visualize\" | \"dev_tools:console\" | \"dev_tools:searchprofiler\" | \"dev_tools:painless_lab\" | \"dev_tools:grokdebugger\" | \"ml:notifications\" | \"ml:nodes\" | \"ml:overview\" | \"ml:memoryUsage\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:logPatternAnalysis\" | \"ml:logRateAnalysis\" | \"ml:singleMetricViewer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:dataDrift\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:esqlDataVisualizer\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:cross_cluster_replication\" | \"management:dataViews\" | \"management:spaces\" | \"management:settings\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchRelevance\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\" | \"enterpriseSearchRelevance:inferenceEndpoints\" | \"observability-logs-explorer\" | \"observabilityOnboarding\" | \"logs:settings\" | \"logs:stream\" | \"logs:log-categories\" | \"logs:anomalies\" | \"observability-overview:cases\" | \"observability-overview:alerts\" | \"observability-overview:rules\" | \"observability-overview:cases_create\" | \"observability-overview:cases_configure\" | \"metrics:settings\" | \"metrics:hosts\" | \"metrics:inventory\" | \"metrics:metrics-explorer\" | \"metrics:assetDetails\" | \"apm:traces\" | \"apm:dependencies\" | \"apm:service-map\" | \"apm:settings\" | \"apm:services\" | \"apm:service-groups-list\" | \"apm:storage-explorer\" | \"synthetics:overview\" | \"synthetics:certificates\" | \"profiling:stacktraces\" | \"profiling:flamegraphs\" | \"profiling:functions\" | \"securitySolutionUI\" | \"securitySolutionUI:\" | \"securitySolutionUI:cases\" | \"securitySolutionUI:alerts\" | \"securitySolutionUI:rules\" | \"securitySolutionUI:policy\" | \"securitySolutionUI:overview\" | \"securitySolutionUI:dashboards\" | \"securitySolutionUI:cases_create\" | \"securitySolutionUI:cases_configure\" | \"securitySolutionUI:hosts\" | \"securitySolutionUI:users\" | \"securitySolutionUI:cloud_defend-policies\" | \"securitySolutionUI:cloud_security_posture-dashboard\" | \"securitySolutionUI:cloud_security_posture-findings\" | \"securitySolutionUI:cloud_security_posture-benchmarks\" | \"securitySolutionUI:kubernetes\" | \"securitySolutionUI:network\" | \"securitySolutionUI:data_quality\" | \"securitySolutionUI:explore\" | \"securitySolutionUI:assets\" | \"securitySolutionUI:cloud_defend\" | \"securitySolutionUI:administration\" | \"securitySolutionUI:attack_discovery\" | \"securitySolutionUI:blocklist\" | \"securitySolutionUI:cloud_security_posture-rules\" | \"securitySolutionUI:detections\" | \"securitySolutionUI:detection_response\" | \"securitySolutionUI:endpoints\" | \"securitySolutionUI:event_filters\" | \"securitySolutionUI:exceptions\" | \"securitySolutionUI:host_isolation_exceptions\" | \"securitySolutionUI:hosts-all\" | \"securitySolutionUI:hosts-anomalies\" | \"securitySolutionUI:hosts-risk\" | \"securitySolutionUI:hosts-events\" | \"securitySolutionUI:hosts-sessions\" | \"securitySolutionUI:hosts-uncommon_processes\" | \"securitySolutionUI:investigations\" | \"securitySolutionUI:get_started\" | \"securitySolutionUI:machine_learning-landing\" | \"securitySolutionUI:network-anomalies\" | \"securitySolutionUI:network-dns\" | \"securitySolutionUI:network-events\" | \"securitySolutionUI:network-flows\" | \"securitySolutionUI:network-http\" | \"securitySolutionUI:network-tls\" | \"securitySolutionUI:response_actions_history\" | \"securitySolutionUI:rules-add\" | \"securitySolutionUI:rules-create\" | \"securitySolutionUI:rules-landing\" | \"securitySolutionUI:threat_intelligence\" | \"securitySolutionUI:timelines\" | \"securitySolutionUI:timelines-templates\" | \"securitySolutionUI:trusted_apps\" | \"securitySolutionUI:users-all\" | \"securitySolutionUI:users-anomalies\" | \"securitySolutionUI:users-authentications\" | \"securitySolutionUI:users-events\" | \"securitySolutionUI:users-risk\" | \"securitySolutionUI:entity_analytics\" | \"securitySolutionUI:entity_analytics-management\" | \"securitySolutionUI:entity_analytics-asset-classification\" | \"securitySolutionUI:coverage-overview\" | \"securitySolutionUI:notes-management\" | \"fleet:settings\" | \"fleet:policies\" | \"fleet:data_streams\" | \"fleet:enrollment_tokens\" | \"fleet:uninstall_tokens\" | \"fleet:agents\"" + "\"fleet\" | \"graph\" | \"ml\" | \"monitoring\" | \"profiling\" | \"metrics\" | \"management\" | \"apm\" | \"synthetics\" | \"ux\" | \"logs\" | \"dashboards\" | \"slo\" | \"observabilityAIAssistant\" | \"home\" | \"canvas\" | \"integrations\" | \"discover\" | \"observability-overview\" | \"appSearch\" | \"dev_tools\" | \"maps\" | \"visualize\" | \"dev_tools:console\" | \"dev_tools:searchprofiler\" | \"dev_tools:painless_lab\" | \"dev_tools:grokdebugger\" | \"ml:notifications\" | \"ml:nodes\" | \"ml:overview\" | \"ml:memoryUsage\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:logPatternAnalysis\" | \"ml:logRateAnalysis\" | \"ml:singleMetricViewer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:dataDrift\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:esqlDataVisualizer\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:cross_cluster_replication\" | \"management:dataViews\" | \"management:spaces\" | \"management:settings\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchRelevance\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\" | \"enterpriseSearchRelevance:inferenceEndpoints\" | \"observability-logs-explorer\" | \"observabilityOnboarding\" | \"logs:settings\" | \"logs:stream\" | \"logs:log-categories\" | \"logs:anomalies\" | \"observability-overview:cases\" | \"observability-overview:alerts\" | \"observability-overview:rules\" | \"observability-overview:cases_create\" | \"observability-overview:cases_configure\" | \"metrics:settings\" | \"metrics:hosts\" | \"metrics:inventory\" | \"metrics:metrics-explorer\" | \"metrics:assetDetails\" | \"apm:traces\" | \"apm:dependencies\" | \"apm:service-map\" | \"apm:settings\" | \"apm:services\" | \"apm:service-groups-list\" | \"apm:storage-explorer\" | \"synthetics:overview\" | \"synthetics:certificates\" | \"profiling:stacktraces\" | \"profiling:flamegraphs\" | \"profiling:functions\" | \"securitySolutionUI\" | \"securitySolutionUI:\" | \"securitySolutionUI:cases\" | \"securitySolutionUI:alerts\" | \"securitySolutionUI:rules\" | \"securitySolutionUI:policy\" | \"securitySolutionUI:overview\" | \"securitySolutionUI:dashboards\" | \"securitySolutionUI:cases_create\" | \"securitySolutionUI:cases_configure\" | \"securitySolutionUI:hosts\" | \"securitySolutionUI:users\" | \"securitySolutionUI:cloud_defend-policies\" | \"securitySolutionUI:cloud_security_posture-dashboard\" | \"securitySolutionUI:cloud_security_posture-findings\" | \"securitySolutionUI:cloud_security_posture-benchmarks\" | \"securitySolutionUI:kubernetes\" | \"securitySolutionUI:network\" | \"securitySolutionUI:data_quality\" | \"securitySolutionUI:explore\" | \"securitySolutionUI:assets\" | \"securitySolutionUI:cloud_defend\" | \"securitySolutionUI:administration\" | \"securitySolutionUI:attack_discovery\" | \"securitySolutionUI:blocklist\" | \"securitySolutionUI:cloud_security_posture-rules\" | \"securitySolutionUI:detections\" | \"securitySolutionUI:detection_response\" | \"securitySolutionUI:endpoints\" | \"securitySolutionUI:event_filters\" | \"securitySolutionUI:exceptions\" | \"securitySolutionUI:host_isolation_exceptions\" | \"securitySolutionUI:hosts-all\" | \"securitySolutionUI:hosts-anomalies\" | \"securitySolutionUI:hosts-risk\" | \"securitySolutionUI:hosts-events\" | \"securitySolutionUI:hosts-sessions\" | \"securitySolutionUI:hosts-uncommon_processes\" | \"securitySolutionUI:investigations\" | \"securitySolutionUI:get_started\" | \"securitySolutionUI:machine_learning-landing\" | \"securitySolutionUI:network-anomalies\" | \"securitySolutionUI:network-dns\" | \"securitySolutionUI:network-events\" | \"securitySolutionUI:network-flows\" | \"securitySolutionUI:network-http\" | \"securitySolutionUI:network-tls\" | \"securitySolutionUI:response_actions_history\" | \"securitySolutionUI:rules-add\" | \"securitySolutionUI:rules-create\" | \"securitySolutionUI:rules-landing\" | \"securitySolutionUI:threat_intelligence\" | \"securitySolutionUI:timelines\" | \"securitySolutionUI:timelines-templates\" | \"securitySolutionUI:trusted_apps\" | \"securitySolutionUI:users-all\" | \"securitySolutionUI:users-anomalies\" | \"securitySolutionUI:users-authentications\" | \"securitySolutionUI:users-events\" | \"securitySolutionUI:users-risk\" | \"securitySolutionUI:entity_analytics\" | \"securitySolutionUI:entity_analytics-management\" | \"securitySolutionUI:entity_analytics-asset-classification\" | \"securitySolutionUI:coverage-overview\" | \"securitySolutionUI:notes-management\" | \"fleet:settings\" | \"fleet:policies\" | \"fleet:data_streams\" | \"fleet:enrollment_tokens\" | \"fleet:uninstall_tokens\" | \"fleet:agents\"" ], "path": "packages/core/chrome/core-chrome-browser/src/project_navigation.ts", "deprecated": false, diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index a129ab5dc1f49..f962a7241b4ca 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index cd6d96f92af9b..1292119a1058d 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: 2024-08-14 +date: 2024-08-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 4517d9a92da86..25d7622d4863a 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: 2024-08-14 +date: 2024-08-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 d7671e366d0cc..cf55fa92654e6 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: 2024-08-14 +date: 2024-08-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 d5b7d7a8cbcfb..f98de8505e1f8 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: 2024-08-14 +date: 2024-08-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 72a8aee0893e9..65939649fc33e 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: 2024-08-14 +date: 2024-08-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 17478f4586535..0080504544aee 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: 2024-08-14 +date: 2024-08-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 91ae8c25d3159..db45503be1298 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: 2024-08-14 +date: 2024-08-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 1d088c96b46ef..1a7320779ebca 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: 2024-08-14 +date: 2024-08-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 3085393b972d9..2ba409ecbdc6d 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: 2024-08-14 +date: 2024-08-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 6df41573214d3..31f59bfcad944 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: 2024-08-14 +date: 2024-08-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 419860d3edd0e..5f85d5883fe62 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: 2024-08-14 +date: 2024-08-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 c96b55d4eeb8e..dbf6d4b8c9c0f 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: 2024-08-14 +date: 2024-08-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 d36424f8390be..6905cc90e3c91 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: 2024-08-14 +date: 2024-08-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 4437cc885cc11..ce189d907b6b8 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: 2024-08-14 +date: 2024-08-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 e3e90d7e6dc45..1586f020aca01 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: 2024-08-14 +date: 2024-08-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 e4c0e68bc150c..cf227eb174946 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: 2024-08-14 +date: 2024-08-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 3e312d0285c39..acce0aad66232 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: 2024-08-14 +date: 2024-08-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 59c581155479a..6920f677e82dc 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: 2024-08-14 +date: 2024-08-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 9d3f6025521e2..2aecc91585752 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: 2024-08-14 +date: 2024-08-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 2a06b64c257ad..57da52aa0718f 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: 2024-08-14 +date: 2024-08-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 300f2e8c35d81..33333bc8a8ccd 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json index def897d69232b..a567679020039 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json @@ -353,7 +353,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -411,6 +411,22 @@ "BulkRequest", ", options?: ", "TransportRequestOptions", + " | undefined]>; capabilities: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClientApiMockInstance", + "text": "ClientApiMockInstance" + }, + ", [params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", " | undefined]>; cat: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -473,6 +489,16 @@ }, "<", "default", + ">; connector: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; count: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -987,7 +1013,17 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; putScript: ", + " | undefined]>; profiling: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; putScript: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1003,7 +1039,7 @@ "PutScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; queryRuleset: ", + " | undefined]>; queryRules: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1205,6 +1241,16 @@ }, "<", "default", + ">; simulate: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; slm: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -1526,7 +1572,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1584,6 +1630,22 @@ "BulkRequest", ", options?: ", "TransportRequestOptions", + " | undefined]>; capabilities: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClientApiMockInstance", + "text": "ClientApiMockInstance" + }, + ", [params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", " | undefined]>; cat: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -1646,6 +1708,16 @@ }, "<", "default", + ">; connector: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; count: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -2160,7 +2232,17 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; putScript: ", + " | undefined]>; profiling: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; putScript: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2176,7 +2258,7 @@ "PutScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; queryRuleset: ", + " | undefined]>; queryRules: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2378,6 +2460,16 @@ }, "<", "default", + ">; simulate: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; slm: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -2653,7 +2745,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2711,6 +2803,22 @@ "BulkRequest", ", options?: ", "TransportRequestOptions", + " | undefined]>; capabilities: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClientApiMockInstance", + "text": "ClientApiMockInstance" + }, + ", [params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", " | undefined]>; cat: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -2773,6 +2881,16 @@ }, "<", "default", + ">; connector: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; count: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -3287,7 +3405,17 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; putScript: ", + " | undefined]>; profiling: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; putScript: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3303,7 +3431,7 @@ "PutScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; queryRuleset: ", + " | undefined]>; queryRules: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3505,6 +3633,16 @@ }, "<", "default", + ">; simulate: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; slm: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -3780,7 +3918,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3838,6 +3976,22 @@ "BulkRequest", ", options?: ", "TransportRequestOptions", + " | undefined]>; capabilities: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClientApiMockInstance", + "text": "ClientApiMockInstance" + }, + ", [params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", " | undefined]>; cat: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -3900,6 +4054,16 @@ }, "<", "default", + ">; connector: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; count: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -4414,7 +4578,17 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; putScript: ", + " | undefined]>; profiling: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; putScript: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -4430,7 +4604,7 @@ "PutScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; queryRuleset: ", + " | undefined]>; queryRules: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -4632,6 +4806,16 @@ }, "<", "default", + ">; simulate: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; slm: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -4998,7 +5182,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + " | undefined]>; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -5056,6 +5240,22 @@ "BulkRequest", ", options?: ", "TransportRequestOptions", + " | undefined]>; capabilities: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.ClientApiMockInstance", + "text": "ClientApiMockInstance" + }, + ", [params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", " | undefined]>; cat: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -5118,6 +5318,16 @@ }, "<", "default", + ">; connector: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; count: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -5632,7 +5842,17 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; putScript: ", + " | undefined]>; profiling: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; putScript: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -5648,7 +5868,7 @@ "PutScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; queryRuleset: ", + " | undefined]>; queryRules: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -5850,6 +6070,16 @@ }, "<", "default", + ">; simulate: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; slm: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index e6a23c3d779c9..2a121bf37e631 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_elasticsearch_server.devdocs.json index 794765550dca2..be09c9b65cbd1 100644 --- a/api_docs/kbn_core_elasticsearch_server.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server.devdocs.json @@ -1233,7 +1233,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -1269,6 +1269,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -1327,6 +1353,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1921,7 +1949,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1947,7 +1977,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -2193,6 +2223,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -2967,7 +2999,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -3003,6 +3035,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -3061,6 +3119,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -3655,7 +3715,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -3681,7 +3743,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -3927,6 +3989,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -4205,7 +4269,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -4241,6 +4305,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -4299,6 +4389,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -4893,7 +4985,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -4919,7 +5013,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -5165,6 +5259,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -5443,7 +5539,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -5479,6 +5575,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -5537,6 +5659,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -6131,7 +6255,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -6157,7 +6283,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -6403,6 +6529,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -6934,7 +7062,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -6970,6 +7098,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -7028,6 +7182,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -7622,7 +7778,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -7648,7 +7806,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -7894,6 +8052,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index a1784310cea1c..8362ef2eca044 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json index ef42b4ea560c9..89c6626b9fd7d 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json @@ -190,7 +190,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -226,6 +226,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -284,6 +310,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -878,7 +906,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -904,7 +934,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1150,6 +1180,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -1935,7 +1967,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -1971,6 +2003,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -2029,6 +2087,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -2623,7 +2683,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -2649,7 +2711,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -2895,6 +2957,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index c6127eea237e9..d0cb51210fba1 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: 2024-08-14 +date: 2024-08-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 fa12213bdc9ec..37929f5bde93e 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: 2024-08-14 +date: 2024-08-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 687b453d68012..3904ae973f588 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: 2024-08-14 +date: 2024-08-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 1d3c14efd9e25..1eeb489f401bd 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: 2024-08-14 +date: 2024-08-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 610549aac909a..849afd32c7594 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: 2024-08-14 +date: 2024-08-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 82a78960e36d0..9687209d71c51 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: 2024-08-14 +date: 2024-08-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 0ba664d6f4b61..7e023b7c8e87f 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: 2024-08-14 +date: 2024-08-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 c3414513cc3fe..2be170be56451 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: 2024-08-14 +date: 2024-08-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 8949dd69d12de..2b91d0dbbd1d2 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: 2024-08-14 +date: 2024-08-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 c8861c20020f0..eefdee2bed0df 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: 2024-08-14 +date: 2024-08-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 17b957f5f90ce..435deacf6d7c2 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: 2024-08-14 +date: 2024-08-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 6fc8034ebbe8c..a98faf2c038d7 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: 2024-08-14 +date: 2024-08-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 920c9d63e00e1..05a44f46b0649 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: 2024-08-14 +date: 2024-08-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 62d89d074e84f..b142744f526d0 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: 2024-08-14 +date: 2024-08-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 e3c1893c81ad3..c29fb53cb87de 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: 2024-08-14 +date: 2024-08-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 8677378bbeadb..7ddf92f8670b3 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: 2024-08-14 +date: 2024-08-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 5581c3377785a..c0e44f87fb8f6 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: 2024-08-14 +date: 2024-08-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 6bc52a068c6c0..b2f801695bd2f 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: 2024-08-14 +date: 2024-08-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 fe95460dde003..8698e8700a9bf 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: 2024-08-14 +date: 2024-08-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 3093cbbc4078d..4a9ffd9f5a486 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: 2024-08-14 +date: 2024-08-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 eb10dce094e62..dfe1b75f1d512 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: 2024-08-14 +date: 2024-08-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 e5929c5f55ac9..c14f8e640f5e5 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: 2024-08-14 +date: 2024-08-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 30b19ede4a9c9..267bef0eacf61 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: 2024-08-14 +date: 2024-08-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 3c916b4e48532..a86012081af4a 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: 2024-08-14 +date: 2024-08-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 9c76bd94dbc44..6f04acd9efdd4 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -3506,6 +3506,18 @@ "plugin": "usageCollection", "path": "src/plugins/usage_collection/server/routes/stats/stats.ts" }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/health.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/metrics.ts" + }, { "plugin": "licensing", "path": "x-pack/plugins/licensing/server/routes/info.ts" @@ -3550,18 +3562,6 @@ "plugin": "spaces", "path": "x-pack/plugins/spaces/server/routes/api/internal/get_content_summary.ts" }, - { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/health.ts" - }, - { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.ts" - }, - { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/metrics.ts" - }, { "plugin": "security", "path": "x-pack/plugins/security/server/routes/api_keys/enabled.ts" @@ -3834,6 +3834,10 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/get_aad_fields_by_rule_type.ts" }, + { + "plugin": "@kbn/content-management-content-insights-server", + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts" + }, { "plugin": "banners", "path": "x-pack/plugins/banners/server/routes/info.ts" @@ -4566,6 +4570,14 @@ "plugin": "rollup", "path": "x-pack/plugins/rollup/server/routes/api/jobs/register_get_route.ts" }, + { + "plugin": "searchIndices", + "path": "x-pack/plugins/search_indices/server/routes/status.ts" + }, + { + "plugin": "searchIndices", + "path": "x-pack/plugins/search_indices/server/routes/status.ts" + }, { "plugin": "searchInferenceEndpoints", "path": "x-pack/plugins/search_inference_endpoints/server/routes.ts" @@ -6548,6 +6560,10 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/get_alert_summary.ts" }, + { + "plugin": "@kbn/content-management-content-insights-server", + "path": "packages/content-management/content_insights/content_insights_server/src/register.ts" + }, { "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts" @@ -6676,10 +6692,6 @@ "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": "globalSearch", "path": "x-pack/plugins/global_search/server/routes/find.ts" @@ -6692,6 +6704,10 @@ "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/routes/app_search/adaptive_relevance.ts" }, + { + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/routes/app_search/app_search_gated_form.ts" + }, { "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts" @@ -7368,6 +7384,10 @@ "plugin": "console", "path": "src/plugins/console/server/routes/api/console/proxy/index.ts" }, + { + "plugin": "console", + "path": "src/plugins/console/server/routes/api/console/convert_request_to_language/index.ts" + }, { "plugin": "contentManagement", "path": "src/plugins/content_management/server/plugin.test.ts" @@ -8602,6 +8622,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" }, + { + "plugin": "logsShared", + "path": "x-pack/plugins/observability_solution/logs_shared/server/routes/deprecations/migrate_log_view_settings.ts" + }, { "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/routes/enterprise_search/crawler/crawler_extraction_rules.ts" @@ -14378,6 +14402,10 @@ "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts" }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/server/routes.ts" + }, { "plugin": "ecsDataQualityDashboard", "path": "x-pack/plugins/ecs_data_quality_dashboard/server/routes/get_index_mappings.ts" @@ -15720,6 +15748,10 @@ "plugin": "canvas", "path": "x-pack/plugins/canvas/server/routes/workpad/import.ts" }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/functions/functions.ts" + }, { "plugin": "telemetry", "path": "src/plugins/telemetry/server/routes/telemetry_opt_in_stats.ts" @@ -15948,6 +15980,10 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/job_service.ts" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/job_service.ts" + }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/saved_objects.ts" @@ -16120,6 +16156,10 @@ "plugin": "fileUpload", "path": "x-pack/plugins/file_upload/server/routes.ts" }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" + }, { "plugin": "integrationAssistant", "path": "x-pack/plugins/integration_assistant/server/routes/ecs_routes.ts" @@ -16140,6 +16180,10 @@ "plugin": "integrationAssistant", "path": "x-pack/plugins/integration_assistant/server/routes/pipeline_routes.ts" }, + { + "plugin": "integrationAssistant", + "path": "x-pack/plugins/integration_assistant/server/routes/analyze_logs_routes.ts" + }, { "plugin": "lists", "path": "x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts" diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index e0fe8c084cf7e..216b0f2650245 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_http_server_internal.devdocs.json index 255b6d7785d10..836cd9c2eff11 100644 --- a/api_docs/kbn_core_http_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_server_internal.devdocs.json @@ -1470,7 +1470,7 @@ "label": "HttpConfigType", "description": [], "signature": [ - "{ readonly uuid?: string | undefined; readonly basePath?: string | undefined; readonly publicBaseUrl?: string | undefined; readonly name: string; readonly ssl: Readonly<{ key?: string | undefined; certificateAuthorities?: string | string[] | undefined; certificate?: string | undefined; keyPassphrase?: string | undefined; redirectHttpFromPort?: number | undefined; } & { enabled: boolean; keystore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; readonly host: string; readonly http2: Readonly<{} & { allowUnsecure: boolean; }>; readonly protocol: \"http1\" | \"http2\"; readonly port: number; readonly compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; readonly cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; readonly versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; readonly autoListen: boolean; readonly shutdownTimeout: moment.Duration; readonly cdn: Readonly<{ url?: string | null | undefined; } & {}>; readonly oas: Readonly<{} & { enabled: boolean; }>; readonly securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; readonly customResponseHeaders: Record; readonly maxPayload: ", + "{ readonly uuid?: string | undefined; readonly basePath?: string | undefined; readonly publicBaseUrl?: string | undefined; readonly name: string; readonly ssl: Readonly<{ key?: string | undefined; certificateAuthorities?: string | string[] | undefined; certificate?: string | undefined; keyPassphrase?: string | undefined; redirectHttpFromPort?: number | undefined; } & { enabled: boolean; keystore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"required\" | \"optional\"; }>; readonly host: string; readonly http2: Readonly<{} & { allowUnsecure: boolean; }>; readonly protocol: \"http1\" | \"http2\"; readonly port: number; readonly compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; readonly cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; readonly versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; readonly autoListen: boolean; readonly shutdownTimeout: moment.Duration; readonly cdn: Readonly<{ url?: string | null | undefined; } & {}>; readonly oas: Readonly<{} & { enabled: boolean; }>; readonly securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; readonly customResponseHeaders: Record; readonly maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 55dfd59543221..15c40600aad85 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_http_server_mocks.devdocs.json index 085616047e523..235e68eaeb05e 100644 --- a/api_docs/kbn_core_http_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_server_mocks.devdocs.json @@ -19,7 +19,7 @@ "label": "createConfigService", "description": [], "signature": [ - "({ server, externalUrl, csp, }?: Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", + "({ server, externalUrl, csp, }?: Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"required\" | \"optional\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -56,7 +56,7 @@ "label": "{\n server,\n externalUrl,\n csp,\n}", "description": [], "signature": [ - "Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", + "Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"required\" | \"optional\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 6cc6a9ec278a4..6d79a75de9571 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: 2024-08-14 +date: 2024-08-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 4c12007e55a76..430909fbeb9b8 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: 2024-08-14 +date: 2024-08-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 d0d12389c7178..334e72f32f389 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: 2024-08-14 +date: 2024-08-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 ce2686c649a3a..cb2ef3b21e97a 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: 2024-08-14 +date: 2024-08-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 b783cc4194086..d0122640c3b4d 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: 2024-08-14 +date: 2024-08-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 5728e3cc005f6..6ae5cd08528fe 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: 2024-08-14 +date: 2024-08-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 bb20be08ad4c8..2da1456d75879 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: 2024-08-14 +date: 2024-08-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 547ffdd69eca2..f764c7ccd9401 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: 2024-08-14 +date: 2024-08-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 d0edef79a76b2..8c327ce9b6b9f 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: 2024-08-14 +date: 2024-08-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 7d77d5e24fb6f..91f4d4c2c1b90 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: 2024-08-14 +date: 2024-08-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 5fdbc8055d3b4..fd1f4165f2df9 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: 2024-08-14 +date: 2024-08-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 191a32521fc66..add3289086a37 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: 2024-08-14 +date: 2024-08-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 399da03b2b657..70ef4c84dcea5 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: 2024-08-14 +date: 2024-08-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 fc06e2b33f6d8..7751b8612805f 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: 2024-08-14 +date: 2024-08-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 6be785521f4b1..f0d55cd21685e 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: 2024-08-14 +date: 2024-08-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 5fbda638427ff..4610200ab7f4c 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: 2024-08-14 +date: 2024-08-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 7df6828c40885..e70b9146fdc7b 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: 2024-08-14 +date: 2024-08-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 b409ba8d206f3..8150eeb3b34dc 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: 2024-08-14 +date: 2024-08-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 d61be66e9d4a5..cd5f2e4f9a42c 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: 2024-08-14 +date: 2024-08-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 a0ff22b30f19d..10621cabbc820 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: 2024-08-14 +date: 2024-08-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 530de0043c591..a9681cc5819d3 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: 2024-08-14 +date: 2024-08-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 8e98ac9abf9ed..94385934616e1 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: 2024-08-14 +date: 2024-08-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 31c4059faaf8c..6ac70bdf8feb2 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: 2024-08-14 +date: 2024-08-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 5a08ad6e8c54b..e9ba06110dee3 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: 2024-08-14 +date: 2024-08-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 02784c7ce719d..3ef9a2ba20764 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: 2024-08-14 +date: 2024-08-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 c267b3c51d2aa..462894e9225d3 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: 2024-08-14 +date: 2024-08-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 7a5e9bf191bce..d84e43e11cddb 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: 2024-08-14 +date: 2024-08-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 80d3af1a45f69..29abf25a72a96 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: 2024-08-14 +date: 2024-08-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 736b1ed0c9a2a..589145bfc6956 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: 2024-08-14 +date: 2024-08-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 afc2ed420002e..b3bedd4ff1ec9 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: 2024-08-14 +date: 2024-08-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 2f5c05145c957..856aa43772b0b 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: 2024-08-14 +date: 2024-08-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 3ffe1a9932e38..54a5f4877415f 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: 2024-08-14 +date: 2024-08-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 c2ffa734b753d..356970549b5e8 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: 2024-08-14 +date: 2024-08-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 331f91c4bf7f4..41c71210a45aa 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: 2024-08-14 +date: 2024-08-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 e91da1f10ac6c..d5b270192baef 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: 2024-08-14 +date: 2024-08-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_contracts_browser.mdx b/api_docs/kbn_core_plugins_contracts_browser.mdx index f19bee48cd072..97afbbc2bc283 100644 --- a/api_docs/kbn_core_plugins_contracts_browser.mdx +++ b/api_docs/kbn_core_plugins_contracts_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-browser title: "@kbn/core-plugins-contracts-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-browser plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-browser'] --- import kbnCorePluginsContractsBrowserObj from './kbn_core_plugins_contracts_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_server.mdx b/api_docs/kbn_core_plugins_contracts_server.mdx index 4dda3179e08d8..4247aa3eaefdb 100644 --- a/api_docs/kbn_core_plugins_contracts_server.mdx +++ b/api_docs/kbn_core_plugins_contracts_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-server title: "@kbn/core-plugins-contracts-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-server'] --- import kbnCorePluginsContractsServerObj from './kbn_core_plugins_contracts_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index e43c863367b03..1653daaeb963e 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: 2024-08-14 +date: 2024-08-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 7126f822719ac..701f1f3a92ac3 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: 2024-08-14 +date: 2024-08-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 60ca129133b24..18c0a7963f760 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: 2024-08-14 +date: 2024-08-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 24a9342d5a678..ef81a023363c8 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: 2024-08-14 +date: 2024-08-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 10160a2967e71..dd5fe30a0f3f0 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: 2024-08-14 +date: 2024-08-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 69b558602c886..e9e82932bff9c 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: 2024-08-14 +date: 2024-08-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 cf3e1c0866b29..1626a9c40107f 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: 2024-08-14 +date: 2024-08-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 0b0a7d5bd13c8..53dd770b22454 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 309c558ce9318..56a716f94c073 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index a609abf7602e7..e781f01a07a94 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: 2024-08-14 +date: 2024-08-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 e708581e009af..511f10dbafeec 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: 2024-08-14 +date: 2024-08-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 5ef725ee9ab40..2633d21c6e805 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: 2024-08-14 +date: 2024-08-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 0fa8a985d4dd8..fbb848e78eff8 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index b85f34fceaa18..8f8553d6ffb0c 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: 2024-08-14 +date: 2024-08-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 c82f9fb065933..9530ba874caa8 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: 2024-08-14 +date: 2024-08-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 c7bb08a67399c..36da011dc2c6d 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: 2024-08-14 +date: 2024-08-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 12f98a813006b..aaef3b4e30c50 100644 --- a/api_docs/kbn_core_saved_objects_common.devdocs.json +++ b/api_docs/kbn_core_saved_objects_common.devdocs.json @@ -2004,19 +2004,19 @@ }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { "plugin": "lens", @@ -2024,35 +2024,35 @@ }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "path": "x-pack/plugins/lens/public/utils.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "path": "x-pack/plugins/lens/public/utils.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "path": "x-pack/plugins/lens/public/utils.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "path": "x-pack/plugins/lens/public/utils.ts" }, { "plugin": "lens", diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index f2545251537ae..8eba6577eb294 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: 2024-08-14 +date: 2024-08-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 781d2095018b4..c5539cd067718 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: 2024-08-14 +date: 2024-08-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 79d015f2c125d..9a1ec59ae1b2b 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json index 258c7bf8d53f8..37ba415678d77 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.devdocs.json @@ -2549,7 +2549,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -2585,6 +2585,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -2643,6 +2669,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -3237,7 +3265,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -3263,7 +3293,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -3509,6 +3539,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", 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 028db3c5261fb..00a946314aee1 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: 2024-08-14 +date: 2024-08-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 ce791980c09ed..751d35e01a656 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: 2024-08-14 +date: 2024-08-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 d0bc2ff65739e..9ebfadee68a64 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -10594,16 +10594,16 @@ "path": "packages/core/usage-data/core-usage-data-server-internal/src/saved_objects/core_usage_stats.ts" }, { - "plugin": "spaces", - "path": "x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/saved_objects/index.ts" }, { "plugin": "spaces", "path": "x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/saved_objects/index.ts" + "plugin": "spaces", + "path": "x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts" }, { "plugin": "actions", @@ -13336,6 +13336,8 @@ ], "signature": [ "MappingProperty", + " & ", + "MappingPropertyBase", " & { dynamic?: false | \"strict\" | undefined; properties?: Record | undefined; }" diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 594679420732f..35e42df96db25 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: 2024-08-14 +date: 2024-08-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 ae4e0f437aabd..a29a59ddaf646 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: 2024-08-14 +date: 2024-08-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 b53eb72fa03b5..6aac7635466f9 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: 2024-08-14 +date: 2024-08-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 933e6ec6c02df..4cf16a777c894 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: 2024-08-14 +date: 2024-08-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_security_browser.mdx b/api_docs/kbn_core_security_browser.mdx index d84d2e403efca..e7c1ddade6b2d 100644 --- a/api_docs/kbn_core_security_browser.mdx +++ b/api_docs/kbn_core_security_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser title: "@kbn/core-security-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser'] --- import kbnCoreSecurityBrowserObj from './kbn_core_security_browser.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_internal.mdx b/api_docs/kbn_core_security_browser_internal.mdx index b3968ed953bce..4d2b0e5f58045 100644 --- a/api_docs/kbn_core_security_browser_internal.mdx +++ b/api_docs/kbn_core_security_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-internal title: "@kbn/core-security-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-internal plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-internal'] --- import kbnCoreSecurityBrowserInternalObj from './kbn_core_security_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_mocks.mdx b/api_docs/kbn_core_security_browser_mocks.mdx index d0d0854b6e6d4..905322c2a4c53 100644 --- a/api_docs/kbn_core_security_browser_mocks.mdx +++ b/api_docs/kbn_core_security_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-mocks title: "@kbn/core-security-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-mocks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-mocks'] --- import kbnCoreSecurityBrowserMocksObj from './kbn_core_security_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_security_common.mdx b/api_docs/kbn_core_security_common.mdx index d626994ebfcc1..ac169ab4025d0 100644 --- a/api_docs/kbn_core_security_common.mdx +++ b/api_docs/kbn_core_security_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-common title: "@kbn/core-security-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-common'] --- import kbnCoreSecurityCommonObj from './kbn_core_security_common.devdocs.json'; diff --git a/api_docs/kbn_core_security_server.mdx b/api_docs/kbn_core_security_server.mdx index 299cc88feb601..9d7e275ead0b2 100644 --- a/api_docs/kbn_core_security_server.mdx +++ b/api_docs/kbn_core_security_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server title: "@kbn/core-security-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server'] --- import kbnCoreSecurityServerObj from './kbn_core_security_server.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_internal.mdx b/api_docs/kbn_core_security_server_internal.mdx index 5688d6ea29bbf..c9367aac121fc 100644 --- a/api_docs/kbn_core_security_server_internal.mdx +++ b/api_docs/kbn_core_security_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-internal title: "@kbn/core-security-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-internal plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-internal'] --- import kbnCoreSecurityServerInternalObj from './kbn_core_security_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_mocks.mdx b/api_docs/kbn_core_security_server_mocks.mdx index 98e8ffa3b3d97..c3186f03df986 100644 --- a/api_docs/kbn_core_security_server_mocks.mdx +++ b/api_docs/kbn_core_security_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-mocks title: "@kbn/core-security-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-mocks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-mocks'] --- import kbnCoreSecurityServerMocksObj from './kbn_core_security_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index f1871608d728f..b3b82c6d0bf70 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: 2024-08-14 +date: 2024-08-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 49a5aebb95f10..94034fcf6bf98 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: 2024-08-14 +date: 2024-08-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 2dee59e6983f3..b2c0fa67337d6 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: 2024-08-14 +date: 2024-08-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 402dcbfc2d281..b817f6521fec5 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: 2024-08-14 +date: 2024-08-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 587624d5a1bc5..40434b27e53d8 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: 2024-08-14 +date: 2024-08-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 3addae91cc20b..1d9f275eaa77e 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: 2024-08-14 +date: 2024-08-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 de5e8575ef6b3..8797e269cd2b4 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: 2024-08-14 +date: 2024-08-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 56a2d343acb6e..9f3517e0e5ef1 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: 2024-08-14 +date: 2024-08-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_model_versions.mdx b/api_docs/kbn_core_test_helpers_model_versions.mdx index 947791ceb6cae..68bae7d10f25f 100644 --- a/api_docs/kbn_core_test_helpers_model_versions.mdx +++ b/api_docs/kbn_core_test_helpers_model_versions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-model-versions title: "@kbn/core-test-helpers-model-versions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-model-versions plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-model-versions'] --- import kbnCoreTestHelpersModelVersionsObj from './kbn_core_test_helpers_model_versions.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 62af46d086f92..4519a3967cf38 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: 2024-08-14 +date: 2024-08-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 e39e2c5a2e491..0bb70f1211527 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: 2024-08-14 +date: 2024-08-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 96d4e4b50ba95..e398e1802f7a5 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: 2024-08-14 +date: 2024-08-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 100b3d39141dd..e0b6017f619ba 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_ui_settings_browser.devdocs.json index c938dfe76cea1..4a500591da24b 100644 --- a/api_docs/kbn_core_ui_settings_browser.devdocs.json +++ b/api_docs/kbn_core_ui_settings_browser.devdocs.json @@ -597,7 +597,7 @@ "section": "def-common.GetUiSettingsContext", "text": "GetUiSettingsContext" }, - " | undefined) => Promise) | undefined; category?: string[] | undefined; metric?: { type: string; name: string; } | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; readonlyMode?: ", + " | undefined) => Promise) | undefined; category?: string[] | undefined; metric?: { type: string; name: string; } | undefined; readonly?: boolean | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonlyMode?: ", { "pluginId": "@kbn/core-ui-settings-common", "scope": "common", diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index a0ade194dc49f..2edc8360ea37a 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: 2024-08-14 +date: 2024-08-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 b760ba42d3f7b..5e55c418c8bd3 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: 2024-08-14 +date: 2024-08-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 fb17694a3bbf4..f87403775f0e8 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_ui_settings_common.devdocs.json index 83a41545ecaf4..7e6ddbebbc0c5 100644 --- a/api_docs/kbn_core_ui_settings_common.devdocs.json +++ b/api_docs/kbn_core_ui_settings_common.devdocs.json @@ -657,7 +657,7 @@ "\nUI element type to represent the settings." ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"image\" | \"select\" | \"json\" | \"array\" | \"markdown\"" + "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"array\" | \"image\" | \"select\" | \"json\" | \"markdown\"" ], "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false, diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 3b9167822ecce..b9639f10680fc 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: 2024-08-14 +date: 2024-08-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 73be4ba662ba3..bc148124ff898 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: 2024-08-14 +date: 2024-08-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 27b8b39f22210..62f39e77143da 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: 2024-08-14 +date: 2024-08-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 9321c70959802..d77a7b0453bbf 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_core_usage_data_server.devdocs.json index 3071e12fefa09..4ba0e9204206d 100644 --- a/api_docs/kbn_core_usage_data_server.devdocs.json +++ b/api_docs/kbn_core_usage_data_server.devdocs.json @@ -47,7 +47,7 @@ "label": "http", "description": [], "signature": [ - "{ basePathConfigured: boolean; maxPayloadInBytes: number; rewriteBasePath: boolean; keepaliveTimeout: number; socketTimeout: number; compression: { enabled: boolean; referrerWhitelistConfigured: boolean; }; xsrf: { disableProtection: boolean; allowlistConfigured: boolean; }; requestId: { allowFromAnyIp: boolean; ipAllowlistConfigured: boolean; }; ssl: { certificateAuthoritiesConfigured: boolean; certificateConfigured: boolean; cipherSuites: string[]; keyConfigured: boolean; keystoreConfigured: boolean; truststoreConfigured: boolean; redirectHttpFromPortConfigured: boolean; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }; securityResponseHeaders: { strictTransportSecurity: string; xContentTypeOptions: string; referrerPolicy: string; permissionsPolicyConfigured: boolean; disableEmbedding: boolean; crossOriginOpenerPolicy: string; }; }" + "{ basePathConfigured: boolean; maxPayloadInBytes: number; rewriteBasePath: boolean; keepaliveTimeout: number; socketTimeout: number; compression: { enabled: boolean; referrerWhitelistConfigured: boolean; }; xsrf: { disableProtection: boolean; allowlistConfigured: boolean; }; requestId: { allowFromAnyIp: boolean; ipAllowlistConfigured: boolean; }; ssl: { certificateAuthoritiesConfigured: boolean; certificateConfigured: boolean; cipherSuites: string[]; keyConfigured: boolean; keystoreConfigured: boolean; truststoreConfigured: boolean; redirectHttpFromPortConfigured: boolean; supportedProtocols: string[]; clientAuthentication: \"none\" | \"required\" | \"optional\"; }; securityResponseHeaders: { strictTransportSecurity: string; xContentTypeOptions: string; referrerPolicy: string; permissionsPolicyConfigured: boolean; disableEmbedding: boolean; crossOriginOpenerPolicy: string; }; }" ], "path": "packages/core/usage-data/core-usage-data-server/src/core_usage_data.ts", "deprecated": false, diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 4597e28f87b8a..39a2dfe21db4a 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: 2024-08-14 +date: 2024-08-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 8d0afabeaaac2..c408708fbc885 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: 2024-08-14 +date: 2024-08-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 e8bf5cbe3661c..cca3346d6aa7a 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: 2024-08-14 +date: 2024-08-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_profile_browser.mdx b/api_docs/kbn_core_user_profile_browser.mdx index 696f252dad7e7..25c456b828802 100644 --- a/api_docs/kbn_core_user_profile_browser.mdx +++ b/api_docs/kbn_core_user_profile_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser title: "@kbn/core-user-profile-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser'] --- import kbnCoreUserProfileBrowserObj from './kbn_core_user_profile_browser.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_internal.mdx b/api_docs/kbn_core_user_profile_browser_internal.mdx index 0ffdc2a445247..c3be4a1f1ec01 100644 --- a/api_docs/kbn_core_user_profile_browser_internal.mdx +++ b/api_docs/kbn_core_user_profile_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-internal title: "@kbn/core-user-profile-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-internal plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-internal'] --- import kbnCoreUserProfileBrowserInternalObj from './kbn_core_user_profile_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_mocks.mdx b/api_docs/kbn_core_user_profile_browser_mocks.mdx index ebae6b16abbd7..90b8bb4602bc3 100644 --- a/api_docs/kbn_core_user_profile_browser_mocks.mdx +++ b/api_docs/kbn_core_user_profile_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-mocks title: "@kbn/core-user-profile-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-mocks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-mocks'] --- import kbnCoreUserProfileBrowserMocksObj from './kbn_core_user_profile_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_common.mdx b/api_docs/kbn_core_user_profile_common.mdx index b515d4a51064f..82b70a57bd727 100644 --- a/api_docs/kbn_core_user_profile_common.mdx +++ b/api_docs/kbn_core_user_profile_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-common title: "@kbn/core-user-profile-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-common'] --- import kbnCoreUserProfileCommonObj from './kbn_core_user_profile_common.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server.mdx b/api_docs/kbn_core_user_profile_server.mdx index fcc903e125836..68185206cd22e 100644 --- a/api_docs/kbn_core_user_profile_server.mdx +++ b/api_docs/kbn_core_user_profile_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server title: "@kbn/core-user-profile-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server'] --- import kbnCoreUserProfileServerObj from './kbn_core_user_profile_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_internal.mdx b/api_docs/kbn_core_user_profile_server_internal.mdx index 069dfd9617928..afe318c75ddd1 100644 --- a/api_docs/kbn_core_user_profile_server_internal.mdx +++ b/api_docs/kbn_core_user_profile_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-internal title: "@kbn/core-user-profile-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-internal plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-internal'] --- import kbnCoreUserProfileServerInternalObj from './kbn_core_user_profile_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_mocks.mdx b/api_docs/kbn_core_user_profile_server_mocks.mdx index ff9423e85ef3b..0ec76e40f86e6 100644 --- a/api_docs/kbn_core_user_profile_server_mocks.mdx +++ b/api_docs/kbn_core_user_profile_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-mocks title: "@kbn/core-user-profile-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-mocks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-mocks'] --- import kbnCoreUserProfileServerMocksObj from './kbn_core_user_profile_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 3a5896d7b9354..7dce73b50b0e7 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: 2024-08-14 +date: 2024-08-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_mocks.mdx b/api_docs/kbn_core_user_settings_server_mocks.mdx index 8342a8b987325..e44bfe3905db1 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: 2024-08-14 +date: 2024-08-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 f3138f5bd215b..cb4af6014f825 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: 2024-08-14 +date: 2024-08-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 4a2bbd73cb4cd..d249a40ef932b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_custom_icons.mdx b/api_docs/kbn_custom_icons.mdx index e87adb3748950..29fcff84d8b17 100644 --- a/api_docs/kbn_custom_icons.mdx +++ b/api_docs/kbn_custom_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-icons title: "@kbn/custom-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-icons plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-icons'] --- import kbnCustomIconsObj from './kbn_custom_icons.devdocs.json'; diff --git a/api_docs/kbn_custom_integrations.mdx b/api_docs/kbn_custom_integrations.mdx index d7df137332a95..7336aeb870493 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: 2024-08-14 +date: 2024-08-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 a692461e615d6..bf31146018ae3 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_forge.mdx b/api_docs/kbn_data_forge.mdx index ae8832af213d2..3b2fdf8b10992 100644 --- a/api_docs/kbn_data_forge.mdx +++ b/api_docs/kbn_data_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-forge title: "@kbn/data-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-forge plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-forge'] --- import kbnDataForgeObj from './kbn_data_forge.devdocs.json'; diff --git a/api_docs/kbn_data_service.mdx b/api_docs/kbn_data_service.mdx index cfe809c8edf57..57e1a538f8bfc 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-service'] --- import kbnDataServiceObj from './kbn_data_service.devdocs.json'; diff --git a/api_docs/kbn_data_stream_adapter.mdx b/api_docs/kbn_data_stream_adapter.mdx index b54eccd484701..e7382e3d09d2e 100644 --- a/api_docs/kbn_data_stream_adapter.mdx +++ b/api_docs/kbn_data_stream_adapter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-stream-adapter title: "@kbn/data-stream-adapter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-stream-adapter plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-stream-adapter'] --- import kbnDataStreamAdapterObj from './kbn_data_stream_adapter.devdocs.json'; diff --git a/api_docs/kbn_data_view_utils.mdx b/api_docs/kbn_data_view_utils.mdx index 0d88da1c80548..3d51cc8c8a260 100644 --- a/api_docs/kbn_data_view_utils.mdx +++ b/api_docs/kbn_data_view_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-view-utils title: "@kbn/data-view-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-view-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-view-utils'] --- import kbnDataViewUtilsObj from './kbn_data_view_utils.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index dc589862d7278..887fec4110041 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: 2024-08-14 +date: 2024-08-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 c6abd45474915..108ad531828ba 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: 2024-08-14 +date: 2024-08-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 94c60229a108b..51e461117346d 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-devtools'] --- import kbnDeeplinksDevtoolsObj from './kbn_deeplinks_devtools.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_fleet.mdx b/api_docs/kbn_deeplinks_fleet.mdx index 873c5768789b4..2d7e104007316 100644 --- a/api_docs/kbn_deeplinks_fleet.mdx +++ b/api_docs/kbn_deeplinks_fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-fleet title: "@kbn/deeplinks-fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-fleet plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-fleet'] --- import kbnDeeplinksFleetObj from './kbn_deeplinks_fleet.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index c76d3bcb8d2f7..6500dcff3976c 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: 2024-08-14 +date: 2024-08-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 d05ec31a86b8c..c87217e743f3a 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_deeplinks_observability.devdocs.json index 8a0fac7dab160..8f071974422c8 100644 --- a/api_docs/kbn_deeplinks_observability.devdocs.json +++ b/api_docs/kbn_deeplinks_observability.devdocs.json @@ -22,18 +22,18 @@ "interfaces": [ { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DataQualityLocatorParams", + "id": "def-common.DataQualityDetailsLocatorParams", "type": "Interface", "tags": [], - "label": "DataQualityLocatorParams", + "label": "DataQualityDetailsLocatorParams", "description": [], "signature": [ { "pluginId": "@kbn/deeplinks-observability", "scope": "common", "docId": "kibKbnDeeplinksObservabilityPluginApi", - "section": "def-common.DataQualityLocatorParams", - "text": "DataQualityLocatorParams" + "section": "def-common.DataQualityDetailsLocatorParams", + "text": "DataQualityDetailsLocatorParams" }, " extends ", { @@ -44,33 +44,103 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DataQualityLocatorParams.filters", + "id": "def-common.DataQualityDetailsLocatorParams.dataStream", + "type": "string", + "tags": [], + "label": "dataStream", + "description": [], + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DataQualityDetailsLocatorParams.timeRange", "type": "Object", "tags": [], - "label": "filters", + "label": "timeRange", "description": [], "signature": [ - "Filters | undefined" + "TimeRangeConfig | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DataQualityLocatorParams.flyout", + "id": "def-common.DataQualityDetailsLocatorParams.breakdownField", + "type": "string", + "tags": [], + "label": "breakdownField", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DataQualityDetailsLocatorParams.degradedFields", "type": "Object", "tags": [], - "label": "flyout", + "label": "degradedFields", "description": [], "signature": [ - "{ dataset: DatasetConfig; } | undefined" + "{ table?: DegradedFieldsTable | undefined; } | undefined" + ], + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DataQualityLocatorParams", + "type": "Interface", + "tags": [], + "label": "DataQualityLocatorParams", + "description": [], + "signature": [ + { + "pluginId": "@kbn/deeplinks-observability", + "scope": "common", + "docId": "kibKbnDeeplinksObservabilityPluginApi", + "section": "def-common.DataQualityLocatorParams", + "text": "DataQualityLocatorParams" + }, + " extends ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + } + ], + "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DataQualityLocatorParams.filters", + "type": "Object", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filters | undefined" ], "path": "packages/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, @@ -759,13 +829,28 @@ "label": "AppId", "description": [], "signature": [ - "\"metrics\" | \"apm\" | \"synthetics\" | \"ux\" | \"logs\" | \"profiling\" | \"slo\" | \"observabilityAIAssistant\" | \"observability-overview\" | \"observability-logs-explorer\" | \"observabilityOnboarding\"" + "\"profiling\" | \"metrics\" | \"apm\" | \"synthetics\" | \"ux\" | \"logs\" | \"slo\" | \"observabilityAIAssistant\" | \"observability-overview\" | \"observability-logs-explorer\" | \"observabilityOnboarding\"" ], "path": "packages/deeplinks/observability/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DATA_QUALITY_DETAILS_LOCATOR_ID", + "type": "string", + "tags": [], + "label": "DATA_QUALITY_DETAILS_LOCATOR_ID", + "description": [], + "signature": [ + "\"DATA_QUALITY_DETAILS_LOCATOR\"" + ], + "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/deeplinks-observability", "id": "def-common.DATA_QUALITY_LOCATOR_ID", diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index ade73e0c6af2f..e43a9e71f1294 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 56 | 0 | 44 | 0 | +| 61 | 0 | 49 | 0 | ## Common diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index a4fd365ef9d00..c676b0d469ca3 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-search'] --- import kbnDeeplinksSearchObj from './kbn_deeplinks_search.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_security.mdx b/api_docs/kbn_deeplinks_security.mdx index c1d7721c05830..ad19ad4ccae2c 100644 --- a/api_docs/kbn_deeplinks_security.mdx +++ b/api_docs/kbn_deeplinks_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-security title: "@kbn/deeplinks-security" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-security plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-security'] --- import kbnDeeplinksSecurityObj from './kbn_deeplinks_security.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_shared.mdx b/api_docs/kbn_deeplinks_shared.mdx index fe310f0fde92e..3e527dacab04f 100644 --- a/api_docs/kbn_deeplinks_shared.mdx +++ b/api_docs/kbn_deeplinks_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-shared title: "@kbn/deeplinks-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-shared plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-shared'] --- import kbnDeeplinksSharedObj from './kbn_deeplinks_shared.devdocs.json'; diff --git a/api_docs/kbn_default_nav_analytics.mdx b/api_docs/kbn_default_nav_analytics.mdx index a4baea4b5f448..3c56b9505a43d 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: 2024-08-14 +date: 2024-08-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 64249431ef31a..830d9e4f50878 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: 2024-08-14 +date: 2024-08-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 e235a1bc75cc2..102d2da6dd73e 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: 2024-08-14 +date: 2024-08-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 8c8b9d3173808..4f2c606a3e8a0 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: 2024-08-14 +date: 2024-08-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 42528ac8c24e7..f026f10630fda 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_dev_cli_runner.devdocs.json index 2869fb3262724..0849bb298f7e4 100644 --- a/api_docs/kbn_dev_cli_runner.devdocs.json +++ b/api_docs/kbn_dev_cli_runner.devdocs.json @@ -1541,7 +1541,7 @@ "label": "log", "description": [], "signature": [ - "{ defaultLevel?: \"error\" | \"info\" | \"warning\" | \"success\" | \"debug\" | \"silent\" | \"verbose\" | undefined; } | undefined" + "{ defaultLevel?: \"error\" | \"info\" | \"warning\" | \"success\" | \"debug\" | \"silent\" | \"verbose\" | undefined; context?: string | undefined; } | undefined" ], "path": "packages/kbn-dev-cli-runner/src/run.ts", "deprecated": false, @@ -1600,7 +1600,7 @@ "label": "log", "description": [], "signature": [ - "{ defaultLevel?: \"error\" | \"info\" | \"warning\" | \"success\" | \"debug\" | \"silent\" | \"verbose\" | undefined; } | undefined" + "{ defaultLevel?: \"error\" | \"info\" | \"warning\" | \"success\" | \"debug\" | \"silent\" | \"verbose\" | undefined; context?: string | undefined; } | undefined" ], "path": "packages/kbn-dev-cli-runner/src/run_with_commands.ts", "deprecated": false, diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 2e43f5d965680..2ff3b29a3dce7 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: 2024-08-14 +date: 2024-08-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 3b1ac9bf8ae1b..6b07b6dc419d6 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: 2024-08-14 +date: 2024-08-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 fe3dac4a5c7a2..2f63945e9989b 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_discover_utils.devdocs.json index 6fdce1d53b5e2..1e985acf20643 100644 --- a/api_docs/kbn_discover_utils.devdocs.json +++ b/api_docs/kbn_discover_utils.devdocs.json @@ -817,6 +817,68 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/discover-utils", + "id": "def-common.getFieldValue", + "type": "Function", + "tags": [], + "label": "getFieldValue", + "description": [], + "signature": [ + "(record: ", + { + "pluginId": "@kbn/discover-utils", + "scope": "common", + "docId": "kibKbnDiscoverUtilsPluginApi", + "section": "def-common.DataTableRecord", + "text": "DataTableRecord" + }, + ", field: string) => any" + ], + "path": "packages/kbn-discover-utils/src/utils/get_field_value.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/discover-utils", + "id": "def-common.getFieldValue.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + { + "pluginId": "@kbn/discover-utils", + "scope": "common", + "docId": "kibKbnDiscoverUtilsPluginApi", + "section": "def-common.DataTableRecord", + "text": "DataTableRecord" + } + ], + "path": "packages/kbn-discover-utils/src/utils/get_field_value.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/discover-utils", + "id": "def-common.getFieldValue.$2", + "type": "string", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-discover-utils/src/utils/get_field_value.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/discover-utils", "id": "def-common.getIgnoredReason", diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index 53dccec4d6cda..05c729b9dff2d 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_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 | |-------------------|-----------|------------------------|-----------------| -| 133 | 0 | 106 | 1 | +| 136 | 0 | 109 | 1 | ## Common diff --git a/api_docs/kbn_doc_links.devdocs.json b/api_docs/kbn_doc_links.devdocs.json index 98086a1171dda..5b28689a78f06 100644 --- a/api_docs/kbn_doc_links.devdocs.json +++ b/api_docs/kbn_doc_links.devdocs.json @@ -560,7 +560,7 @@ "label": "query", "description": [], "signature": [ - "{ readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuery: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; readonly queryESQL: string; }" + "{ readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuery: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; readonly queryESQL: string; readonly queryESQLExamples: string; }" ], "path": "packages/kbn-doc-links/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index ec6492ec70767..6dd87a7d363e1 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: 2024-08-14 +date: 2024-08-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 94d6ea6b5ce0d..9d73c84cafacd 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_dom_drag_drop.devdocs.json index 434b89203c86e..4112bf83a67b0 100644 --- a/api_docs/kbn_dom_drag_drop.devdocs.json +++ b/api_docs/kbn_dom_drag_drop.devdocs.json @@ -159,7 +159,13 @@ ], "signature": [ "(props: ", - "DroppableProps", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DroppableProps", + "text": "DroppableProps" + }, ") => JSX.Element" ], "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", @@ -174,7 +180,13 @@ "label": "props", "description": [], "signature": [ - "DroppableProps" + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DroppableProps", + "text": "DroppableProps" + } ], "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", "deprecated": false, @@ -528,6 +540,322 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps", + "type": "Interface", + "tags": [], + "label": "DroppableProps", + "description": [ + "\nThe base props to the Droppable component." + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.className", + "type": "string", + "tags": [], + "label": "className", + "description": [ + "\nThe CSS class(es) for the root element." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.onDrop", + "type": "Function", + "tags": [], + "label": "onDrop", + "description": [ + "\nThe event handler that fires when an item\nis dropped onto this Droppable component." + ], + "signature": [ + "DropHandler", + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.value", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [ + "\nThe value associated with this item." + ], + "signature": [ + "Record & { id: string; humanData: ", + "HumanData", + "; }" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.children", + "type": "Object", + "tags": [], + "label": "children", + "description": [ + "\nThe React element which will be passed the draggable handlers" + ], + "signature": [ + "React.ReactElement>" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.isDisabled", + "type": "CompoundType", + "tags": [], + "label": "isDisabled", + "description": [ + "\nDisable any drag & drop behaviour" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnEnter", + "type": "Function", + "tags": [], + "label": "getAdditionalClassesOnEnter", + "description": [ + "\nAdditional class names to apply when another element is over the drop target" + ], + "signature": [ + "((dropType?: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined) => string | undefined) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnEnter.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnDroppable", + "type": "Function", + "tags": [], + "label": "getAdditionalClassesOnDroppable", + "description": [ + "\nAdditional class names to apply when another element is droppable for a currently dragged item" + ], + "signature": [ + "((dropType?: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined) => string | undefined) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnDroppable.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [ + "\nThe optional test subject associated with this DOM element." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.reorderableGroup", + "type": "Array", + "tags": [], + "label": "reorderableGroup", + "description": [ + "\nitems belonging to the same group that can be reordered" + ], + "signature": [ + "{ id: string; }[] | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.dropTypes", + "type": "Array", + "tags": [], + "label": "dropTypes", + "description": [ + "\nIndicates the type of drop targets - when undefined, the currently dragged item\ncannot be dropped onto this component." + ], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + "[] | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.order", + "type": "Array", + "tags": [], + "label": "order", + "description": [ + "\nOrder for keyboard dragging. This takes an array of numbers which will be used to order hierarchically" + ], + "signature": [ + "number[]" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getCustomDropTarget", + "type": "Function", + "tags": [], + "label": "getCustomDropTarget", + "description": [ + "\nExtra drop targets by dropType" + ], + "signature": [ + "((dropType: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + ") => React.ReactElement> | null) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getCustomDropTarget.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + } + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false } ], "enums": [], diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index 578a627c5084b..16a5f8adc7c0e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.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 | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 27 | 6 | +| 57 | 0 | 30 | 6 | ## Common diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 0e07b9e495a0d..bd1dd6c8245a5 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json b/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json index 48c4823f73460..a74c5506b1f6a 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json +++ b/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json @@ -13,7 +13,7 @@ "signature": [ "(indexName: string) => string" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27,7 +27,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -48,7 +48,7 @@ "signature": [ "React.NamedExoticComponent" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -82,7 +82,7 @@ "signature": [ "(phase: string) => string" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -96,7 +96,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -109,6 +109,18 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/ecs-data-quality-dashboard", + "id": "def-public.DATA_QUALITY_DASHBOARD_CONVERSATION_ID", + "type": "string", + "tags": [], + "label": "DATA_QUALITY_DASHBOARD_CONVERSATION_ID", + "description": [], + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ecs-data-quality-dashboard", "id": "def-public.DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP", @@ -116,7 +128,7 @@ "tags": [], "label": "DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP", "description": [], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -130,7 +142,7 @@ "description": [ "The subtitle displayed on the Data Quality dashboard" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -142,7 +154,22 @@ "tags": [], "label": "DATA_QUALITY_SUGGESTED_USER_PROMPT", "description": [], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ecs-data-quality-dashboard", + "id": "def-public.ECS_FIELD_REFERENCE_URL", + "type": "string", + "tags": [], + "label": "ECS_FIELD_REFERENCE_URL", + "description": [], + "signature": [ + "\"https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html\"" + ], + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -159,7 +186,7 @@ "signature": [ "\"https://www.elastic.co/guide/en/ecs/current/ecs-reference.html\"" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -173,7 +200,7 @@ "description": [ "The label displayed for the `ILM phase` combo box on the Data Quality dashboard" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -187,7 +214,22 @@ "description": [ "The tooltip for the `ILM phase` combo box on the Data Quality Dashboard" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/ecs-data-quality-dashboard", + "id": "def-public.MAPPING_URL", + "type": "string", + "tags": [], + "label": "MAPPING_URL", + "description": [], + "signature": [ + "\"https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html\"" + ], + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -201,7 +243,7 @@ "description": [ "The placeholder for the `ILM phase` combo box on the Data Quality Dashboard" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index 90ebb41f3b151..7592132923708 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-threat-hunting-explore](https://github.com/orgs/elast | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 5 | 0 | +| 16 | 0 | 8 | 0 | ## Client diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index acf97f7bfa45a..14ee67b0a5cd2 100644 --- a/api_docs/kbn_elastic_agent_utils.mdx +++ b/api_docs/kbn_elastic_agent_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-agent-utils title: "@kbn/elastic-agent-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-agent-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-agent-utils'] --- import kbnElasticAgentUtilsObj from './kbn_elastic_agent_utils.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant.mdx b/api_docs/kbn_elastic_assistant.mdx index 8bd9ca40cfd94..a58f8d0928cdd 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant_common.devdocs.json b/api_docs/kbn_elastic_assistant_common.devdocs.json index 703a1f2b44cd4..b30a7523fd7fd 100644 --- a/api_docs/kbn_elastic_assistant_common.devdocs.json +++ b/api_docs/kbn_elastic_assistant_common.devdocs.json @@ -1169,7 +1169,7 @@ "label": "ChatCompleteProps", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -1184,7 +1184,7 @@ "label": "ChatCompleteRequestBody", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -1199,7 +1199,7 @@ "label": "ChatCompleteRequestBodyInput", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -1604,36 +1604,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.Dataset", - "type": "Type", - "tags": [], - "label": "Dataset", - "description": [], - "signature": [ - "{ input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[]" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.DatasetItem", - "type": "Type", - "tags": [], - "label": "DatasetItem", - "description": [], - "signature": [ - "{ input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/elastic-assistant-common", "id": "def-common.DeleteConversationRequestParams", @@ -1904,6 +1874,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/elastic-assistant-common", + "id": "def-common.ELASTIC_AI_ASSISTANT_EVALUATE_URL", + "type": "string", + "tags": [], + "label": "ELASTIC_AI_ASSISTANT_EVALUATE_URL", + "description": [], + "signature": [ + "\"/internal/elastic_assistant/evaluate\"" + ], + "path": "x-pack/packages/kbn-elastic-assistant-common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/elastic-assistant-common", "id": "def-common.ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION", @@ -2424,7 +2409,7 @@ "label": "GetEvaluateResponse", "description": [], "signature": [ - "{ agentExecutors: string[]; }" + "{ datasets: string[]; graphs: string[]; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts", "deprecated": false, @@ -2756,21 +2741,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.OutputIndex", - "type": "Type", - "tags": [], - "label": "OutputIndex", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/elastic-assistant-common", "id": "def-common.PerformBulkActionRequestBody", @@ -2869,7 +2839,7 @@ "label": "PostEvaluateBody", "description": [], "signature": [ - "{ dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }" + "{ size: number; alertsIndexPattern: string; replacements: {} & { [k: string]: string; }; graphs: string[]; datasetName: string; connectorIds: string[]; langSmithApiKey?: string | undefined; runName?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", "deprecated": false, @@ -2884,7 +2854,7 @@ "label": "PostEvaluateRequestBody", "description": [], "signature": [ - "{ dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }" + "{ size: number; alertsIndexPattern: string; replacements: {} & { [k: string]: string; }; graphs: string[]; datasetName: string; connectorIds: string[]; langSmithApiKey?: string | undefined; runName?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", "deprecated": false, @@ -2899,37 +2869,7 @@ "label": "PostEvaluateRequestBodyInput", "description": [], "signature": [ - "{ dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.PostEvaluateRequestQuery", - "type": "Type", - "tags": [], - "label": "PostEvaluateRequestQuery", - "description": [], - "signature": [ - "{ agents: string; models: string; outputIndex: string; projectName?: string | undefined; datasetName?: string | undefined; evaluationType?: string | undefined; evalModel?: string | undefined; runName?: string | undefined; }" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.PostEvaluateRequestQueryInput", - "type": "Type", - "tags": [], - "label": "PostEvaluateRequestQueryInput", - "description": [], - "signature": [ - "{ agents: string; models: string; outputIndex: string; projectName?: string | undefined; datasetName?: string | undefined; evaluationType?: string | undefined; evalModel?: string | undefined; runName?: string | undefined; }" + "{ graphs: string[]; datasetName: string; connectorIds: string[]; size?: number | undefined; alertsIndexPattern?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithApiKey?: string | undefined; runName?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", "deprecated": false, @@ -3798,7 +3738,7 @@ "label": "ChatCompleteProps", "description": [], "signature": [ - "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }>" + "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -3813,7 +3753,7 @@ "label": "ChatCompleteRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }>" + "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -4165,36 +4105,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.Dataset", - "type": "Object", - "tags": [], - "label": "Dataset", - "description": [], - "signature": [ - "Zod.ZodDefault; input: Zod.ZodString; prediction: Zod.ZodOptional; reference: Zod.ZodString; tags: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }>, \"many\">>" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.DatasetItem", - "type": "Object", - "tags": [], - "label": "DatasetItem", - "description": [], - "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; input: Zod.ZodString; prediction: Zod.ZodOptional; reference: Zod.ZodString; tags: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }>" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/elastic-assistant-common", "id": "def-common.defaultAssistantFeatures", @@ -4580,7 +4490,7 @@ "label": "GetEvaluateResponse", "description": [], "signature": [ - "Zod.ZodObject<{ agentExecutors: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { agentExecutors: string[]; }, { agentExecutors: string[]; }>" + "Zod.ZodObject<{ datasets: Zod.ZodArray; graphs: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { datasets: string[]; graphs: string[]; }, { datasets: string[]; graphs: string[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts", "deprecated": false, @@ -4887,21 +4797,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.OutputIndex", - "type": "Object", - "tags": [], - "label": "OutputIndex", - "description": [], - "signature": [ - "Zod.ZodString" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/elastic-assistant-common", "id": "def-common.PerformBulkActionRequestBody", @@ -4970,7 +4865,7 @@ "label": "PostEvaluateBody", "description": [], "signature": [ - "Zod.ZodObject<{ dataset: Zod.ZodOptional; input: Zod.ZodString; prediction: Zod.ZodOptional; reference: Zod.ZodString; tags: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }>, \"many\">>>; evalPrompt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }, { dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }>" + "Zod.ZodObject<{ graphs: Zod.ZodArray; datasetName: Zod.ZodString; connectorIds: Zod.ZodArray; runName: Zod.ZodOptional; alertsIndexPattern: Zod.ZodDefault>; langSmithApiKey: Zod.ZodOptional; replacements: Zod.ZodDefault, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>>; size: Zod.ZodDefault>; }, \"strip\", Zod.ZodTypeAny, { size: number; alertsIndexPattern: string; replacements: {} & { [k: string]: string; }; graphs: string[]; datasetName: string; connectorIds: string[]; langSmithApiKey?: string | undefined; runName?: string | undefined; }, { graphs: string[]; datasetName: string; connectorIds: string[]; size?: number | undefined; alertsIndexPattern?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithApiKey?: string | undefined; runName?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", "deprecated": false, @@ -4985,22 +4880,7 @@ "label": "PostEvaluateRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ dataset: Zod.ZodOptional; input: Zod.ZodString; prediction: Zod.ZodOptional; reference: Zod.ZodString; tags: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }, { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }>, \"many\">>>; evalPrompt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }, { dataset?: { input: string; reference: string; id?: string | undefined; tags?: string[] | undefined; prediction?: string | undefined; }[] | undefined; evalPrompt?: string | undefined; }>" - ], - "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/elastic-assistant-common", - "id": "def-common.PostEvaluateRequestQuery", - "type": "Object", - "tags": [], - "label": "PostEvaluateRequestQuery", - "description": [], - "signature": [ - "Zod.ZodObject<{ agents: Zod.ZodString; datasetName: Zod.ZodOptional; evaluationType: Zod.ZodOptional; evalModel: Zod.ZodOptional; models: Zod.ZodString; outputIndex: Zod.ZodString; projectName: Zod.ZodOptional; runName: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { agents: string; models: string; outputIndex: string; projectName?: string | undefined; datasetName?: string | undefined; evaluationType?: string | undefined; evalModel?: string | undefined; runName?: string | undefined; }, { agents: string; models: string; outputIndex: string; projectName?: string | undefined; datasetName?: string | undefined; evaluationType?: string | undefined; evalModel?: string | undefined; runName?: string | undefined; }>" + "Zod.ZodObject<{ graphs: Zod.ZodArray; datasetName: Zod.ZodString; connectorIds: Zod.ZodArray; runName: Zod.ZodOptional; alertsIndexPattern: Zod.ZodDefault>; langSmithApiKey: Zod.ZodOptional; replacements: Zod.ZodDefault, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>>; size: Zod.ZodDefault>; }, \"strip\", Zod.ZodTypeAny, { size: number; alertsIndexPattern: string; replacements: {} & { [k: string]: string; }; graphs: string[]; datasetName: string; connectorIds: string[]; langSmithApiKey?: string | undefined; runName?: string | undefined; }, { graphs: string[]; datasetName: string; connectorIds: string[]; size?: number | undefined; alertsIndexPattern?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithApiKey?: string | undefined; runName?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts", "deprecated": false, diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index a0687d3a26f68..40b5a9737edde 100644 --- a/api_docs/kbn_elastic_assistant_common.mdx +++ b/api_docs/kbn_elastic_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant-common title: "@kbn/elastic-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant-common'] --- import kbnElasticAssistantCommonObj from './kbn_elastic_assistant_common.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 354 | 0 | 328 | 0 | +| 346 | 0 | 320 | 0 | ## Common diff --git a/api_docs/kbn_entities_schema.devdocs.json b/api_docs/kbn_entities_schema.devdocs.json index 29fa10784d55b..f27af1ce315d9 100644 --- a/api_docs/kbn_entities_schema.devdocs.json +++ b/api_docs/kbn_entities_schema.devdocs.json @@ -119,7 +119,43 @@ "initialIsOpen": false } ], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.MetadataRecord", + "type": "Interface", + "tags": [], + "label": "MetadataRecord", + "description": [], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.MetadataRecord.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[key: string]: string | string[] | MetadataRecord", + "description": [], + "signature": [ + "[key: string]: string | string[] | ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "section": "def-common.MetadataRecord", + "text": "MetadataRecord" + } + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], "enums": [ { "parentPluginId": "@kbn/entities-schema", @@ -241,7 +277,7 @@ "section": "def-common.BasicAggregations", "text": "BasicAggregations" }, - "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; }" + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; installStatus?: \"failed\" | \"installed\" | \"installing\" | \"upgrading\" | undefined; installStartedAt?: string | undefined; }" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts", "deprecated": false, @@ -448,6 +484,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.entityBaseSchema", + "type": "Object", + "tags": [], + "label": "entityBaseSchema", + "description": [], + "signature": [ + "Zod.ZodObject<{ id: Zod.ZodString; type: Zod.ZodString; identityFields: Zod.ZodArray; displayName: Zod.ZodString; metrics: Zod.ZodRecord; definitionVersion: Zod.ZodString; schemaVersion: Zod.ZodString; definitionId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }>" + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/entities-schema", "id": "def-common.entityDefinitionSchema", @@ -496,7 +547,7 @@ "section": "def-common.BasicAggregations", "text": "BasicAggregations" }, - "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }>, \"many\">>; staticFields: Zod.ZodOptional>; managed: Zod.ZodDefault>; history: Zod.ZodObject<{ timestampField: Zod.ZodString; interval: Zod.ZodEffects; settings: Zod.ZodEffects; syncDelay: Zod.ZodOptional; lookbackPeriod: Zod.ZodDefault>; frequency: Zod.ZodOptional; backfillSyncDelay: Zod.ZodOptional; backfillLookbackPeriod: Zod.ZodOptional; backfillFrequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }>>, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined>; }, \"strip\", Zod.ZodTypeAny, { interval: string; settings: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }; timestampField: string; }, { interval: string; timestampField: string; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; }>; latest: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; version: string; name: string; history: { interval: string; settings: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }; timestampField: string; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; filter?: string | undefined; description?: string | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }>, \"many\">>; staticFields: Zod.ZodOptional>; managed: Zod.ZodDefault>; history: Zod.ZodObject<{ timestampField: Zod.ZodString; interval: Zod.ZodEffects; settings: Zod.ZodEffects; syncDelay: Zod.ZodOptional; lookbackPeriod: Zod.ZodDefault>; frequency: Zod.ZodOptional; backfillSyncDelay: Zod.ZodOptional; backfillLookbackPeriod: Zod.ZodOptional; backfillFrequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }>>, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined>; }, \"strip\", Zod.ZodTypeAny, { interval: string; settings: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }; timestampField: string; }, { interval: string; timestampField: string; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; }>; latest: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }>>; installStatus: Zod.ZodOptional, Zod.ZodLiteral<\"upgrading\">, Zod.ZodLiteral<\"installed\">, Zod.ZodLiteral<\"failed\">]>>; installStartedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; version: string; name: string; history: { interval: string; settings: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }; timestampField: string; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; filter?: string | undefined; description?: string | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", { "pluginId": "@kbn/entities-schema", "scope": "common", @@ -504,7 +555,7 @@ "section": "def-common.BasicAggregations", "text": "BasicAggregations" }, - "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; }, { id: string; type: string; version: string; name: string; history: { interval: string; timestampField: string; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; }; indexPatterns: string[]; identityFields: (string | { field: string; optional: boolean; })[]; displayNameTemplate: string; filter?: string | undefined; description?: string | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; installStatus?: \"failed\" | \"installed\" | \"installing\" | \"upgrading\" | undefined; installStartedAt?: string | undefined; }, { id: string; type: string; version: string; name: string; history: { interval: string; timestampField: string; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; }; indexPatterns: string[]; identityFields: (string | { field: string; optional: boolean; })[]; displayNameTemplate: string; filter?: string | undefined; description?: string | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", { "pluginId": "@kbn/entities-schema", "scope": "common", @@ -512,7 +563,7 @@ "section": "def-common.BasicAggregations", "text": "BasicAggregations" }, - "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; managed?: boolean | undefined; metadata?: (string | { source: string; limit?: number | undefined; destination?: string | undefined; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; }>" + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; managed?: boolean | undefined; metadata?: (string | { source: string; limit?: number | undefined; destination?: string | undefined; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; staticFields?: Record | undefined; installStatus?: \"failed\" | \"installed\" | \"installing\" | \"upgrading\" | undefined; installStartedAt?: string | undefined; }>" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts", "deprecated": false, @@ -527,7 +578,22 @@ "label": "entityHistorySchema", "description": [], "signature": [ - "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; metrics: Record; displayName: string; identityFields: string[]; }>; }, { \"@timestamp\": Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { \"@timestamp\": string; entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; }, { \"@timestamp\": string; entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; }>, Zod.ZodRecord>>" + "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; definitionVersion: Zod.ZodString; schemaVersion: Zod.ZodString; definitionId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }>; }, \"strip\", Zod.ZodTypeAny, { '@timestamp': string; entity: { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }; }, { '@timestamp': string; entity: { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; }; }>, Zod.ZodType>" + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.entityLatestSchema", + "type": "Object", + "tags": [], + "label": "entityLatestSchema", + "description": [], + "signature": [ + "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; definitionVersion: Zod.ZodString; schemaVersion: Zod.ZodString; definitionId: Zod.ZodString; }, { lastSeenTimestamp: Zod.ZodString; firstSeenTimestamp: Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; lastSeenTimestamp: string; firstSeenTimestamp: string; }, { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; lastSeenTimestamp: string; firstSeenTimestamp: string; }>; }, \"strip\", Zod.ZodTypeAny, { entity: { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; lastSeenTimestamp: string; firstSeenTimestamp: string; }; }, { entity: { id: string; type: string; metrics: Record; displayName: string; identityFields: string[]; definitionVersion: string; schemaVersion: string; definitionId: string; lastSeenTimestamp: string; firstSeenTimestamp: string; }; }>, Zod.ZodType>" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", "deprecated": false, @@ -536,13 +602,13 @@ }, { "parentPluginId": "@kbn/entities-schema", - "id": "def-common.entitySummarySchema", + "id": "def-common.entityMetadataSchema", "type": "Object", "tags": [], - "label": "entitySummarySchema", + "label": "entityMetadataSchema", "description": [], "signature": [ - "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; metrics: Record; displayName: string; identityFields: string[]; }>; }, { lastSeenTimestamp: Zod.ZodString; firstSeenTimestamp: Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }, { entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }>, Zod.ZodRecord>>" + "Zod.ZodType" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", "deprecated": false, diff --git a/api_docs/kbn_entities_schema.mdx b/api_docs/kbn_entities_schema.mdx index b1d666abb4493..d061a4db5ef9a 100644 --- a/api_docs/kbn_entities_schema.mdx +++ b/api_docs/kbn_entities_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-entities-schema title: "@kbn/entities-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/entities-schema plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entiti | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 37 | 0 | 37 | 0 | +| 41 | 0 | 41 | 0 | ## Common @@ -31,6 +31,9 @@ Contact [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entiti ### Functions +### Interfaces + + ### Enums diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index ecfa0afae0860..312883a2315b0 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: 2024-08-14 +date: 2024-08-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 66fd1bb3ef5c1..b83e432f2f7b9 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: 2024-08-14 +date: 2024-08-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 2ba3d435e777d..5f3423c360629 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_es_query.devdocs.json index d4e035d56caa0..1acb94440bf54 100644 --- a/api_docs/kbn_es_query.devdocs.json +++ b/api_docs/kbn_es_query.devdocs.json @@ -6539,7 +6539,7 @@ " & { meta: ", "PhraseFilterMeta", "; query: { script: { script: ", - "InlineScript", + "Script", "; }; }; }" ], "path": "packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts", @@ -6571,7 +6571,7 @@ "text": "RangeFilterMeta" }, "; query: { script: { script: ", - "InlineScript", + "Script", "; }; }; }" ], "path": "packages/kbn-es-query/src/filters/build_filters/range_filter.ts", diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 33a923dbb3157..f3338830a9d0b 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: 2024-08-14 +date: 2024-08-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 35a129281b3b8..13b5133e0c8ff 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: 2024-08-14 +date: 2024-08-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 b82e944d5faab..1d64199a22c57 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: 2024-08-14 +date: 2024-08-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_esql_ast.devdocs.json b/api_docs/kbn_esql_ast.devdocs.json index b4dd177a110e4..45b4f757885a6 100644 --- a/api_docs/kbn_esql_ast.devdocs.json +++ b/api_docs/kbn_esql_ast.devdocs.json @@ -1697,16 +1697,44 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLColumn.parts", + "type": "Array", + "tags": [], + "label": "parts", + "description": [ + "\nAn identifier can be composed of multiple parts, e.g: part1.part2.`part``3️⃣`.\nThis property contains the parsed unquoted parts of the identifier.\nFor example: `['part1', 'part2', 'part`3️⃣']`." + ], + "signature": [ + "string[]" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/esql-ast", "id": "def-common.ESQLColumn.quoted", "type": "boolean", - "tags": [], + "tags": [ + "deprecated" + ], "label": "quoted", "description": [], "path": "packages/kbn-esql-ast/src/types.ts", - "deprecated": false, - "trackAdoption": false + "deprecated": true, + "trackAdoption": false, + "references": [ + { + "plugin": "@kbn/esql-validation-autocomplete", + "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts" + }, + { + "plugin": "@kbn/esql-validation-autocomplete", + "path": "packages/kbn-esql-validation-autocomplete/src/shared/variables.ts" + } + ] } ], "initialIsOpen": false @@ -2188,6 +2216,38 @@ "path": "packages/kbn-esql-ast/src/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLSource.cluster", + "type": "string", + "tags": [], + "label": "cluster", + "description": [ + "\nRepresents the cluster part of the source identifier. Empty string if not\npresent.\n\n```\nFROM [:]\n```" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLSource.index", + "type": "string", + "tags": [], + "label": "index", + "description": [ + "\nRepresents the index part of the source identifier. Unescaped and unquoted.\n\n```\nFROM [:]\n```" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_esql_ast.mdx b/api_docs/kbn_esql_ast.mdx index a8e7f0fce6851..f1c289674b475 100644 --- a/api_docs/kbn_esql_ast.mdx +++ b/api_docs/kbn_esql_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-ast title: "@kbn/esql-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-ast plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-ast'] --- import kbnEsqlAstObj from './kbn_esql_ast.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 149 | 1 | 120 | 15 | +| 152 | 1 | 120 | 15 | ## Common diff --git a/api_docs/kbn_esql_utils.mdx b/api_docs/kbn_esql_utils.mdx index 0b75ef3a77bea..54625dca73133 100644 --- a/api_docs/kbn_esql_utils.mdx +++ b/api_docs/kbn_esql_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-utils title: "@kbn/esql-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-utils'] --- import kbnEsqlUtilsObj from './kbn_esql_utils.devdocs.json'; diff --git a/api_docs/kbn_esql_validation_autocomplete.devdocs.json b/api_docs/kbn_esql_validation_autocomplete.devdocs.json index fb68172942ca5..11b9a155e213d 100644 --- a/api_docs/kbn_esql_validation_autocomplete.devdocs.json +++ b/api_docs/kbn_esql_validation_autocomplete.devdocs.json @@ -1100,6 +1100,90 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/esql-validation-autocomplete", + "id": "def-common.getColumnForASTNode", + "type": "Function", + "tags": [], + "label": "getColumnForASTNode", + "description": [ + "\nThis function returns the variable or field matching a column" + ], + "signature": [ + "(column: ", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLColumn", + "text": "ESQLColumn" + }, + ", { fields, variables }: Pick<", + "ReferenceMaps", + ", \"fields\" | \"variables\">) => ", + { + "pluginId": "@kbn/esql-validation-autocomplete", + "scope": "common", + "docId": "kibKbnEsqlValidationAutocompletePluginApi", + "section": "def-common.ESQLRealField", + "text": "ESQLRealField" + }, + " | ", + { + "pluginId": "@kbn/esql-validation-autocomplete", + "scope": "common", + "docId": "kibKbnEsqlValidationAutocompletePluginApi", + "section": "def-common.ESQLVariable", + "text": "ESQLVariable" + }, + " | undefined" + ], + "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/esql-validation-autocomplete", + "id": "def-common.getColumnForASTNode.$1", + "type": "Object", + "tags": [], + "label": "column", + "description": [], + "signature": [ + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLColumn", + "text": "ESQLColumn" + } + ], + "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/esql-validation-autocomplete", + "id": "def-common.getColumnForASTNode.$2", + "type": "Object", + "tags": [], + "label": "{ fields, variables }", + "description": [], + "signature": [ + "Pick<", + "ReferenceMaps", + ", \"fields\" | \"variables\">" + ], + "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/esql-validation-autocomplete", "id": "def-common.getCommandDefinition", @@ -1452,7 +1536,7 @@ "section": "def-common.ESQLCallbacks", "text": "ESQLCallbacks" }, - " | undefined) => () => Promise<{ name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; }[]>" + " | undefined) => () => Promise<{ name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; type?: string | undefined; }[]>" ], "path": "packages/kbn-esql-validation-autocomplete/src/shared/resources_helpers.ts", "deprecated": false, @@ -2071,90 +2155,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/esql-validation-autocomplete", - "id": "def-common.lookupColumn", - "type": "Function", - "tags": [], - "label": "lookupColumn", - "description": [ - "\nThis function returns the variable or field matching a column" - ], - "signature": [ - "(column: ", - { - "pluginId": "@kbn/esql-ast", - "scope": "common", - "docId": "kibKbnEsqlAstPluginApi", - "section": "def-common.ESQLColumn", - "text": "ESQLColumn" - }, - ", { fields, variables }: Pick<", - "ReferenceMaps", - ", \"fields\" | \"variables\">) => ", - { - "pluginId": "@kbn/esql-validation-autocomplete", - "scope": "common", - "docId": "kibKbnEsqlValidationAutocompletePluginApi", - "section": "def-common.ESQLRealField", - "text": "ESQLRealField" - }, - " | ", - { - "pluginId": "@kbn/esql-validation-autocomplete", - "scope": "common", - "docId": "kibKbnEsqlValidationAutocompletePluginApi", - "section": "def-common.ESQLVariable", - "text": "ESQLVariable" - }, - " | undefined" - ], - "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/esql-validation-autocomplete", - "id": "def-common.lookupColumn.$1", - "type": "Object", - "tags": [], - "label": "column", - "description": [], - "signature": [ - { - "pluginId": "@kbn/esql-ast", - "scope": "common", - "docId": "kibKbnEsqlAstPluginApi", - "section": "def-common.ESQLColumn", - "text": "ESQLColumn" - } - ], - "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/esql-validation-autocomplete", - "id": "def-common.lookupColumn.$2", - "type": "Object", - "tags": [], - "label": "{ fields, variables }", - "description": [], - "signature": [ - "Pick<", - "ReferenceMaps", - ", \"fields\" | \"variables\">" - ], - "path": "packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/esql-validation-autocomplete", "id": "def-common.printFunctionSignature", @@ -3054,7 +3054,7 @@ "label": "getSources", "description": [], "signature": [ - "CallbackFn<{}, { name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; }> | undefined" + "CallbackFn<{}, { name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; type?: string | undefined; }> | undefined" ], "path": "packages/kbn-esql-validation-autocomplete/src/shared/types.ts", "deprecated": false, @@ -3193,7 +3193,7 @@ "label": "type", "description": [], "signature": [ - "\"boolean\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"keyword\" | \"text\" | \"date\" | \"date_nanos\" | \"version\" | \"integer\" | \"long\" | \"double\" | \"unsigned_long\" | \"cartesian_point\" | \"cartesian_shape\" | \"counter_integer\" | \"counter_long\" | \"counter_double\" | \"unsupported\"" + "\"boolean\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"keyword\" | \"text\" | \"date\" | \"date_nanos\" | \"version\" | \"integer\" | \"long\" | \"double\" | \"unsigned_long\" | \"unsupported\" | \"cartesian_point\" | \"cartesian_shape\" | \"counter_integer\" | \"counter_long\" | \"counter_double\"" ], "path": "packages/kbn-esql-validation-autocomplete/src/validation/types.ts", "deprecated": false, @@ -3538,6 +3538,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/esql-validation-autocomplete", + "id": "def-common.SuggestionRawDefinition.filterText", + "type": "string", + "tags": [], + "label": "filterText", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/esql-validation-autocomplete", "id": "def-common.SuggestionRawDefinition.asSnippet", @@ -3630,6 +3644,22 @@ "path": "packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-validation-autocomplete", + "id": "def-common.SuggestionRawDefinition.rangeToReplace", + "type": "Object", + "tags": [], + "label": "rangeToReplace", + "description": [ + "\nThe range that should be replaced when the suggestion is applied" + ], + "signature": [ + "{ start: number; end: number; } | undefined" + ], + "path": "packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_esql_validation_autocomplete.mdx b/api_docs/kbn_esql_validation_autocomplete.mdx index 21c9216cbfbc8..76ee11fd354c3 100644 --- a/api_docs/kbn_esql_validation_autocomplete.mdx +++ b/api_docs/kbn_esql_validation_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-validation-autocomplete title: "@kbn/esql-validation-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-validation-autocomplete plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-validation-autocomplete'] --- import kbnEsqlValidationAutocompleteObj from './kbn_esql_validation_autocomplete.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 194 | 0 | 183 | 10 | +| 196 | 0 | 184 | 10 | ## Common diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index a16d216be6c13..9aac9ed37881b 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_event_annotation_components.devdocs.json index b17e02bb66ce2..840ff9690d6ef 100644 --- a/api_docs/kbn_event_annotation_components.devdocs.json +++ b/api_docs/kbn_event_annotation_components.devdocs.json @@ -924,9 +924,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index 3204e42868163..41fb91f43ba94 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_expandable_flyout.devdocs.json index 88d40c2acec00..79c990355a921 100644 --- a/api_docs/kbn_expandable_flyout.devdocs.json +++ b/api_docs/kbn_expandable_flyout.devdocs.json @@ -140,6 +140,57 @@ "children": [], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/expandable-flyout", + "id": "def-public.withExpandableFlyoutProvider", + "type": "Function", + "tags": [], + "label": "withExpandableFlyoutProvider", + "description": [], + "signature": [ + "(Component: React.ComponentType, expandableProviderProps?: ", + "ExpandableFlyoutContextProviderProps", + " | undefined) => (props: Props) => JSX.Element" + ], + "path": "packages/kbn-expandable-flyout/src/with_provider.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/expandable-flyout", + "id": "def-public.withExpandableFlyoutProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "Component", + "description": [], + "signature": [ + "React.ComponentType" + ], + "path": "packages/kbn-expandable-flyout/src/with_provider.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/expandable-flyout", + "id": "def-public.withExpandableFlyoutProvider.$2", + "type": "Object", + "tags": [], + "label": "expandableProviderProps", + "description": [], + "signature": [ + "ExpandableFlyoutContextProviderProps", + " | undefined" + ], + "path": "packages/kbn-expandable-flyout/src/with_provider.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [ diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index d56616e3ecaa3..81fcd30e18036 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/expandable-flyout'] --- import kbnExpandableFlyoutObj from './kbn_expandable_flyout.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-threat-hunting-investigations](https://github.com/org | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 39 | 0 | 14 | 1 | +| 42 | 0 | 17 | 2 | ## Client diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index bc313f154c9f5..f12664ef7e9d6 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_field_utils.mdx b/api_docs/kbn_field_utils.mdx index c203cd6f22e54..fa45be6f73663 100644 --- a/api_docs/kbn_field_utils.mdx +++ b/api_docs/kbn_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-utils title: "@kbn/field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-utils'] --- import kbnFieldUtilsObj from './kbn_field_utils.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index cdc5ae55aa801..0b77115186b5e 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: 2024-08-14 +date: 2024-08-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_formatters.mdx b/api_docs/kbn_formatters.mdx index 4041820fc7153..be551c8703ff6 100644 --- a/api_docs/kbn_formatters.mdx +++ b/api_docs/kbn_formatters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-formatters title: "@kbn/formatters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/formatters plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/formatters'] --- import kbnFormattersObj from './kbn_formatters.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.devdocs.json b/api_docs/kbn_ftr_common_functional_services.devdocs.json index 9c00accd18000..d6aa7eb8fe944 100644 --- a/api_docs/kbn_ftr_common_functional_services.devdocs.json +++ b/api_docs/kbn_ftr_common_functional_services.devdocs.json @@ -606,7 +606,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -640,7 +640,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -710,7 +710,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -744,7 +744,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/ftr_provider_context.ts", "deprecated": false, @@ -787,6 +787,55 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ftr-common-functional-services", + "id": "def-common.SamlAuthProviderType", + "type": "Type", + "tags": [], + "label": "SamlAuthProviderType", + "description": [], + "signature": [ + "{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + "UserProfile", + ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-common.RoleCredentials", + "text": "RoleCredentials" + }, + ">; createM2mApiKeyWithRoleScope(role: string): Promise<", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-common.RoleCredentials", + "text": "RoleCredentials" + }, + ">; invalidateM2mApiKeyWithRoleScope(roleCredentials: ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-common.RoleCredentials", + "text": "RoleCredentials" + }, + "): Promise; getCommonRequestHeader(): { 'kbn-xsrf': string; }; getInternalRequestHeader(): ", + { + "pluginId": "@kbn/ftr-common-functional-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", + "section": "def-common.InternalRequestHeader", + "text": "InternalRequestHeader" + }, + "; DEFAULT_ROLE: string; }" + ], + "path": "packages/kbn-ftr-common-functional-services/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ftr-common-functional-services", "id": "def-common.SupertestWithoutAuthProviderType", @@ -927,7 +976,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -961,7 +1010,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -1031,7 +1080,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1065,7 +1114,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/es.ts", "deprecated": false, @@ -1188,7 +1237,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1222,7 +1271,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -1292,7 +1341,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1326,7 +1375,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts", "deprecated": false, @@ -1449,7 +1498,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1483,7 +1532,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -1553,7 +1602,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1587,7 +1636,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/es_archiver.ts", "deprecated": false, @@ -1728,7 +1777,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1762,7 +1811,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -1832,7 +1881,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1866,7 +1915,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/supertest_without_auth.ts", "deprecated": false, @@ -1890,7 +1939,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -1924,7 +1973,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>" + "; DEFAULT_ROLE: string; }" ], "path": "packages/kbn-ftr-common-functional-services/services/all.ts", "deprecated": false, @@ -2016,7 +2065,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -2050,7 +2099,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", + "; DEFAULT_ROLE: string; }; }, {}, ProvidedTypeMap<{ es: ({ getService }: ", { "pluginId": "@kbn/ftr-common-functional-services", "scope": "common", @@ -2120,7 +2169,7 @@ "section": "def-common.FtrProviderContext", "text": "FtrProviderContext" }, - ") => Promise<{ getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", + ") => { getInteractiveUserSessionCookieWithRoleScope(role: string): Promise; getM2MApiCredentialsWithRoleScope(role: string): Promise<{ Cookie: string; }>; getEmail(role: string): Promise; getUserData(role: string): Promise<", "UserProfile", ">; createM2mApiKeyWithDefaultRoleScope(): Promise<", { @@ -2154,7 +2203,7 @@ "section": "def-common.InternalRequestHeader", "text": "InternalRequestHeader" }, - "; DEFAULT_ROLE: string; }>; }>, ProvidedTypeMap<{}>>" + "; DEFAULT_ROLE: string; }; }>, ProvidedTypeMap<{}>>" ], "path": "packages/kbn-ftr-common-functional-services/services/saml_auth/saml_auth_provider.ts", "deprecated": false, diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index bc8b91a80912d..1a37a1335b980 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.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 | |-------------------|-----------|------------------------|-----------------| -| 46 | 0 | 31 | 1 | +| 47 | 0 | 32 | 1 | ## Common diff --git a/api_docs/kbn_ftr_common_functional_ui_services.mdx b/api_docs/kbn_ftr_common_functional_ui_services.mdx index 82d05814b2dc9..cfae6be4c1932 100644 --- a/api_docs/kbn_ftr_common_functional_ui_services.mdx +++ b/api_docs/kbn_ftr_common_functional_ui_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-ui-services title: "@kbn/ftr-common-functional-ui-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-ui-services plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-ui-services'] --- import kbnFtrCommonFunctionalUiServicesObj from './kbn_ftr_common_functional_ui_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index b7c1c0af27826..e0039da0d056f 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: 2024-08-14 +date: 2024-08-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 48cd8f137bdd3..b0eb1280b84df 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: 2024-08-14 +date: 2024-08-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 8ed89fa6dd438..04ae953662bd8 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_grid_layout.devdocs.json b/api_docs/kbn_grid_layout.devdocs.json new file mode 100644 index 0000000000000..db3bfcc3e8db1 --- /dev/null +++ b/api_docs/kbn_grid_layout.devdocs.json @@ -0,0 +1,304 @@ +{ + "id": "@kbn/grid-layout", + "client": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayout", + "type": "Function", + "tags": [], + "label": "GridLayout", + "description": [], + "signature": [ + "({ getCreationOptions, renderPanelContents, }: { getCreationOptions: () => { initialLayout: ", + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridLayoutData", + "text": "GridLayoutData" + }, + "; gridSettings: ", + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridSettings", + "text": "GridSettings" + }, + "; }; renderPanelContents: (panelId: string) => React.ReactNode; }) => JSX.Element" + ], + "path": "packages/kbn-grid-layout/grid/grid_layout.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayout.$1", + "type": "Object", + "tags": [], + "label": "{\n getCreationOptions,\n renderPanelContents,\n}", + "description": [], + "path": "packages/kbn-grid-layout/grid/grid_layout.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayout.$1.getCreationOptions", + "type": "Function", + "tags": [], + "label": "getCreationOptions", + "description": [], + "signature": [ + "() => { initialLayout: ", + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridLayoutData", + "text": "GridLayoutData" + }, + "; gridSettings: ", + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridSettings", + "text": "GridSettings" + }, + "; }" + ], + "path": "packages/kbn-grid-layout/grid/grid_layout.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayout.$1.renderPanelContents", + "type": "Function", + "tags": [], + "label": "renderPanelContents", + "description": [], + "signature": [ + "(panelId: string) => React.ReactNode" + ], + "path": "packages/kbn-grid-layout/grid/grid_layout.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayout.$1.renderPanelContents.$1", + "type": "string", + "tags": [], + "label": "panelId", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-grid-layout/grid/grid_layout.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridPanelData", + "type": "Interface", + "tags": [], + "label": "GridPanelData", + "description": [], + "signature": [ + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridPanelData", + "text": "GridPanelData" + }, + " extends ", + "GridRect" + ], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridPanelData.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridRowData", + "type": "Interface", + "tags": [], + "label": "GridRowData", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridRowData.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridRowData.isCollapsed", + "type": "boolean", + "tags": [], + "label": "isCollapsed", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridRowData.panels", + "type": "Object", + "tags": [], + "label": "panels", + "description": [], + "signature": [ + "{ [key: string]: ", + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridPanelData", + "text": "GridPanelData" + }, + "; }" + ], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridSettings", + "type": "Interface", + "tags": [], + "label": "GridSettings", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridSettings.gutterSize", + "type": "number", + "tags": [], + "label": "gutterSize", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridSettings.rowHeight", + "type": "number", + "tags": [], + "label": "rowHeight", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridSettings.columnCount", + "type": "number", + "tags": [], + "label": "columnCount", + "description": [], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/grid-layout", + "id": "def-public.GridLayoutData", + "type": "Type", + "tags": [], + "label": "GridLayoutData", + "description": [], + "signature": [ + { + "pluginId": "@kbn/grid-layout", + "scope": "public", + "docId": "kibKbnGridLayoutPluginApi", + "section": "def-public.GridRowData", + "text": "GridRowData" + }, + "[]" + ], + "path": "packages/kbn-grid-layout/grid/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_grid_layout.mdx b/api_docs/kbn_grid_layout.mdx new file mode 100644 index 0000000000000..2648e8ad46c4a --- /dev/null +++ b/api_docs/kbn_grid_layout.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: kibKbnGridLayoutPluginApi +slug: /kibana-dev-docs/api/kbn-grid-layout +title: "@kbn/grid-layout" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/grid-layout plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grid-layout'] +--- +import kbnGridLayoutObj from './kbn_grid_layout.devdocs.json'; + + + +Contact [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 16 | 0 | 16 | 1 | + +## Client + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_grouping.devdocs.json b/api_docs/kbn_grouping.devdocs.json index be6c1495f9a0b..545bf1de1263c 100644 --- a/api_docs/kbn_grouping.devdocs.json +++ b/api_docs/kbn_grouping.devdocs.json @@ -108,7 +108,9 @@ "\nHook to configure grouping component" ], "signature": [ - "({ componentProps, defaultGroupingOptions, fields, groupingId, maxGroupingLevels, onGroupChange, onOptionsChange, tracker, title, }: GroupingArgs) => ", + "({ componentProps, defaultGroupingOptions, fields, groupingId, maxGroupingLevels, onGroupChange, onOptionsChange, tracker, title, }: ", + "GroupingArgs", + ") => ", "UseGrouping", "" ], @@ -124,7 +126,8 @@ "label": "{\n componentProps,\n defaultGroupingOptions,\n fields,\n groupingId,\n maxGroupingLevels,\n onGroupChange,\n onOptionsChange,\n tracker,\n title,\n}", "description": [], "signature": [ - "GroupingArgs" + "GroupingArgs", + "" ], "path": "packages/kbn-grouping/src/hooks/use_grouping.tsx", "deprecated": false, diff --git a/api_docs/kbn_grouping.mdx b/api_docs/kbn_grouping.mdx index d2acb9209bb61..77c8c2d539cf4 100644 --- a/api_docs/kbn_grouping.mdx +++ b/api_docs/kbn_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-grouping title: "@kbn/grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/grouping plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grouping'] --- import kbnGroupingObj from './kbn_grouping.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 | |-------------------|-----------|------------------------|-----------------| -| 17 | 0 | 12 | 10 | +| 17 | 0 | 12 | 11 | ## Common diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 6665438d1c275..89b26dd3eeef2 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: 2024-08-14 +date: 2024-08-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 48da095ff7b4b..3afc33ae99277 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: 2024-08-14 +date: 2024-08-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 9e97fc3ba1d41..4f48d76871004 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: 2024-08-14 +date: 2024-08-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 06d1fd3a3ef3a..c8870bdafb45c 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: 2024-08-14 +date: 2024-08-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 eb6e11bd76a63..c4b79fb3d1f79 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: 2024-08-14 +date: 2024-08-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 44309a5750ce3..5172add4ca105 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: 2024-08-14 +date: 2024-08-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 f7cbd3987539d..4b7e35cb370a0 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: 2024-08-14 +date: 2024-08-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 08216c7621cc1..1ce5b440b8938 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: 2024-08-14 +date: 2024-08-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 f2264ca1e1e31..230e9b73c3938 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_index_management.mdx b/api_docs/kbn_index_management.mdx index 771b2912e6c0c..64189be5ce9f4 100644 --- a/api_docs/kbn_index_management.mdx +++ b/api_docs/kbn_index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-management title: "@kbn/index-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-management plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-management'] --- import kbnIndexManagementObj from './kbn_index_management.devdocs.json'; diff --git a/api_docs/kbn_inference_integration_flyout.mdx b/api_docs/kbn_inference_integration_flyout.mdx index dab3035263a52..ef503c4f11836 100644 --- a/api_docs/kbn_inference_integration_flyout.mdx +++ b/api_docs/kbn_inference_integration_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-inference_integration_flyout title: "@kbn/inference_integration_flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/inference_integration_flyout plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/inference_integration_flyout'] --- import kbnInferenceIntegrationFlyoutObj from './kbn_inference_integration_flyout.devdocs.json'; diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index 8ef1c088c6e7e..711ad60964dc7 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: 2024-08-14 +date: 2024-08-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 9c90055b34b5a..33b4ef4e63a51 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_investigation_shared.devdocs.json b/api_docs/kbn_investigation_shared.devdocs.json new file mode 100644 index 0000000000000..154f2c342d7f2 --- /dev/null +++ b/api_docs/kbn_investigation_shared.devdocs.json @@ -0,0 +1,1222 @@ +{ + "id": "@kbn/investigation-shared", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationItemParams", + "type": "Type", + "tags": [], + "label": "CreateInvestigationItemParams", + "description": [], + "signature": [ + "{ title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationItemResponse", + "type": "Type", + "tags": [], + "label": "CreateInvestigationItemResponse", + "description": [], + "signature": [ + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationNoteParams", + "type": "Type", + "tags": [], + "label": "CreateInvestigationNoteParams", + "description": [], + "signature": [ + "{ content: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationNoteResponse", + "type": "Type", + "tags": [], + "label": "CreateInvestigationNoteResponse", + "description": [], + "signature": [ + "{ id: string; content: string; createdAt: number; createdBy: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationParams", + "type": "Type", + "tags": [], + "label": "CreateInvestigationParams", + "description": [], + "signature": [ + "{ id: string; title: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.CreateInvestigationResponse", + "type": "Type", + "tags": [], + "label": "CreateInvestigationResponse", + "description": [], + "signature": [ + "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.DeleteInvestigationItemParams", + "type": "Type", + "tags": [], + "label": "DeleteInvestigationItemParams", + "description": [], + "signature": [ + "{ investigationId: string; itemId: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.DeleteInvestigationNoteParams", + "type": "Type", + "tags": [], + "label": "DeleteInvestigationNoteParams", + "description": [], + "signature": [ + "{ investigationId: string; noteId: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.DeleteInvestigationParams", + "type": "Type", + "tags": [], + "label": "DeleteInvestigationParams", + "description": [], + "signature": [ + "{ investigationId: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.FindInvestigationsParams", + "type": "Type", + "tags": [], + "label": "FindInvestigationsParams", + "description": [], + "signature": [ + "{ alertId?: string | undefined; page?: string | undefined; perPage?: string | undefined; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.FindInvestigationsResponse", + "type": "Type", + "tags": [], + "label": "FindInvestigationsResponse", + "description": [], + "signature": [ + "{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }[]; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.GetInvestigationItemsResponse", + "type": "Type", + "tags": [], + "label": "GetInvestigationItemsResponse", + "description": [], + "signature": [ + "({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.GetInvestigationNotesResponse", + "type": "Type", + "tags": [], + "label": "GetInvestigationNotesResponse", + "description": [], + "signature": [ + "{ id: string; content: string; createdAt: number; createdBy: string; }[]" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.GetInvestigationParams", + "type": "Type", + "tags": [], + "label": "GetInvestigationParams", + "description": [], + "signature": [ + "{ investigationId: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.GetInvestigationResponse", + "type": "Type", + "tags": [], + "label": "GetInvestigationResponse", + "description": [], + "signature": [ + "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.InvestigationItem", + "type": "Type", + "tags": [], + "label": "InvestigationItem", + "description": [], + "signature": [ + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.InvestigationItemResponse", + "type": "Type", + "tags": [], + "label": "InvestigationItemResponse", + "description": [], + "signature": [ + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.InvestigationNoteResponse", + "type": "Type", + "tags": [], + "label": "InvestigationNoteResponse", + "description": [], + "signature": [ + "{ id: string; content: string; createdAt: number; createdBy: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.Item", + "type": "Type", + "tags": [], + "label": "Item", + "description": [], + "signature": [ + "{ title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.alertOriginSchema", + "type": "Object", + "tags": [], + "label": "alertOriginSchema", + "description": [], + "signature": [ + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/origin.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.blankOriginSchema", + "type": "Object", + "tags": [], + "label": "blankOriginSchema", + "description": [], + "signature": [ + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/origin.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationItemParamsSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationItemParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationItemResponseSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationItemResponseSchema", + "description": [], + "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationNoteParamsSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationNoteParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ content: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationNoteResponseSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationNoteResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationParamsSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; title: ", + "StringC", + "; params: ", + "TypeC", + "<{ timeRange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.createInvestigationResponseSchema", + "type": "Object", + "tags": [], + "label": "createInvestigationResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; title: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; params: ", + "TypeC", + "<{ timeRange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; status: ", + "UnionC", + "<[", + "LiteralC", + "<\"ongoing\">, ", + "LiteralC", + "<\"closed\">]>; notes: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>>; items: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.deleteInvestigationItemParamsSchema", + "type": "Object", + "tags": [], + "label": "deleteInvestigationItemParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; itemId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.deleteInvestigationNoteParamsSchema", + "type": "Object", + "tags": [], + "label": "deleteInvestigationNoteParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; noteId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.deleteInvestigationParamsSchema", + "type": "Object", + "tags": [], + "label": "deleteInvestigationParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/delete.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.findInvestigationsParamsSchema", + "type": "Object", + "tags": [], + "label": "findInvestigationsParamsSchema", + "description": [], + "signature": [ + "PartialC", + "<{ query: ", + "PartialC", + "<{ alertId: ", + "StringC", + "; page: ", + "StringC", + "; perPage: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.findInvestigationsResponseSchema", + "type": "Object", + "tags": [], + "label": "findInvestigationsResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ page: ", + "NumberC", + "; perPage: ", + "NumberC", + "; total: ", + "NumberC", + "; results: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; title: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; params: ", + "TypeC", + "<{ timeRange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; status: ", + "UnionC", + "<[", + "LiteralC", + "<\"ongoing\">, ", + "LiteralC", + "<\"closed\">]>; notes: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>>; items: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>>; }>>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationItemsParamsSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationItemsParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationItemsResponseSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationItemsResponseSchema", + "description": [], + "signature": [ + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationNotesParamsSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationNotesParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationNotesResponseSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationNotesResponseSchema", + "description": [], + "signature": [ + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationParamsSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.getInvestigationResponseSchema", + "type": "Object", + "tags": [], + "label": "getInvestigationResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; title: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; params: ", + "TypeC", + "<{ timeRange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; status: ", + "UnionC", + "<[", + "LiteralC", + "<\"ongoing\">, ", + "LiteralC", + "<\"closed\">]>; notes: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>>; items: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.investigationItemResponseSchema", + "type": "Object", + "tags": [], + "label": "investigationItemResponseSchema", + "description": [], + "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.investigationItemSchema", + "type": "Object", + "tags": [], + "label": "investigationItemSchema", + "description": [], + "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.investigationNoteResponseSchema", + "type": "Object", + "tags": [], + "label": "investigationNoteResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.investigationNoteSchema", + "type": "Object", + "tags": [], + "label": "investigationNoteSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.investigationSchema", + "type": "Object", + "tags": [], + "label": "investigationSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; title: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; params: ", + "TypeC", + "<{ timeRange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; }>; }>; origin: ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"alert\">; id: ", + "StringC", + "; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<\"blank\">; }>]>; status: ", + "UnionC", + "<[", + "LiteralC", + "<\"ongoing\">, ", + "LiteralC", + "<\"closed\">]>; notes: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>>; items: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>]>>; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.itemSchema", + "type": "Object", + "tags": [], + "label": "itemSchema", + "description": [], + "signature": [ + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_investigation_shared.mdx b/api_docs/kbn_investigation_shared.mdx new file mode 100644 index 0000000000000..38096d13d9bf2 --- /dev/null +++ b/api_docs/kbn_investigation_shared.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnInvestigationSharedPluginApi +slug: /kibana-dev-docs/api/kbn-investigation-shared +title: "@kbn/investigation-shared" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/investigation-shared plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/investigation-shared'] +--- +import kbnInvestigationSharedObj from './kbn_investigation_shared.devdocs.json'; + + + +Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 44 | 0 | 44 | 0 | + +## Common + +### Objects + + +### Consts, variables and types + + diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index d06281dc19ade..6e35fb413f63d 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: 2024-08-14 +date: 2024-08-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_ipynb.mdx b/api_docs/kbn_ipynb.mdx index d533e064f37a5..a2484264bcc02 100644 --- a/api_docs/kbn_ipynb.mdx +++ b/api_docs/kbn_ipynb.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ipynb title: "@kbn/ipynb" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ipynb plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ipynb'] --- import kbnIpynbObj from './kbn_ipynb.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 9e3cfc4efd94f..4ac4665e1810e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 697757bc88cb0..6aac219ecd6ff 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index d64519963a034..fd0aa1074c2a5 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_json_schemas.mdx b/api_docs/kbn_json_schemas.mdx index 0198a01e2e27a..eb029f92511cd 100644 --- a/api_docs/kbn_json_schemas.mdx +++ b/api_docs/kbn_json_schemas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-schemas title: "@kbn/json-schemas" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-schemas plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-schemas'] --- import kbnJsonSchemasObj from './kbn_json_schemas.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index ab96c35093dbd..f4b80da9910ef 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: 2024-08-14 +date: 2024-08-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 c3265f1d51574..7e26a327a2491 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: 2024-08-14 +date: 2024-08-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 f29816c569193..9fcbc65b75935 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: 2024-08-14 +date: 2024-08-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_lens_formula_docs.mdx b/api_docs/kbn_lens_formula_docs.mdx index 328aef9a3566b..786b29b546990 100644 --- a/api_docs/kbn_lens_formula_docs.mdx +++ b/api_docs/kbn_lens_formula_docs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-formula-docs title: "@kbn/lens-formula-docs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-formula-docs plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-formula-docs'] --- import kbnLensFormulaDocsObj from './kbn_lens_formula_docs.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 783dd15ac1006..5f612b59fca0e 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: 2024-08-14 +date: 2024-08-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 bd5c61e68fa97..da39b938ca78b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_content_badge.devdocs.json b/api_docs/kbn_managed_content_badge.devdocs.json index 9eee12d881aff..c9b58c13a3b94 100644 --- a/api_docs/kbn_managed_content_badge.devdocs.json +++ b/api_docs/kbn_managed_content_badge.devdocs.json @@ -11,9 +11,9 @@ "label": "getManagedContentBadge", "description": [], "signature": [ - "(tooltipText: string) => { 'data-test-subj': string; badgeText: string; title: string; color: string; iconType: string; toolTipProps: ", + "(tooltipText: string, enableTooltipProps?: boolean | undefined) => { 'data-test-subj': string; badgeText: string; title: string; color: string; iconType: string; toolTipProps: ", "EuiToolTipProps", - "; }" + " | undefined; }" ], "path": "packages/kbn-managed-content-badge/index.ts", "deprecated": false, @@ -33,6 +33,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "@kbn/managed-content-badge", + "id": "def-public.getManagedContentBadge.$2", + "type": "CompoundType", + "tags": [], + "label": "enableTooltipProps", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-managed-content-badge/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [], diff --git a/api_docs/kbn_managed_content_badge.mdx b/api_docs/kbn_managed_content_badge.mdx index 5e80347ea0c32..c7aa445c0c585 100644 --- a/api_docs/kbn_managed_content_badge.mdx +++ b/api_docs/kbn_managed_content_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-content-badge title: "@kbn/managed-content-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-content-badge plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-content-badge'] --- import kbnManagedContentBadgeObj from './kbn_managed_content_badge.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 | |-------------------|-----------|------------------------|-----------------| -| 2 | 0 | 2 | 0 | +| 3 | 0 | 3 | 0 | ## Client diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index e3ee959b3a4dd..a22bafb8698ac 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: 2024-08-14 +date: 2024-08-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 1f9b68430c31b..1a4f05dfd6ef3 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: 2024-08-14 +date: 2024-08-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_application.mdx b/api_docs/kbn_management_settings_application.mdx index 76b82be2f036d..bdb39d72399d2 100644 --- a/api_docs/kbn_management_settings_application.mdx +++ b/api_docs/kbn_management_settings_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-application title: "@kbn/management-settings-application" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-application plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-application'] --- import kbnManagementSettingsApplicationObj from './kbn_management_settings_application.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_category.mdx b/api_docs/kbn_management_settings_components_field_category.mdx index 94635e3b14d3f..92c8b82597bda 100644 --- a/api_docs/kbn_management_settings_components_field_category.mdx +++ b/api_docs/kbn_management_settings_components_field_category.mdx @@ -8,7 +8,7 @@ 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-category'] --- import kbnManagementSettingsComponentsFieldCategoryObj from './kbn_management_settings_components_field_category.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_input.mdx b/api_docs/kbn_management_settings_components_field_input.mdx index 703837874f3a0..c9c6d6cf6430d 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_management_settings_components_field_row.mdx index db88ad99ee4c1..5056d5af28e5e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-row'] --- import kbnManagementSettingsComponentsFieldRowObj from './kbn_management_settings_components_field_row.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_form.mdx b/api_docs/kbn_management_settings_components_form.mdx index dfe4a7a2b56e5..decd973e6e0d2 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: 2024-08-14 +date: 2024-08-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 73e8487c00fb3..a92a0487eb089 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_management_settings_ids.devdocs.json index f5662d441bdc0..02da2b2d9b18f 100644 --- a/api_docs/kbn_management_settings_ids.devdocs.json +++ b/api_docs/kbn_management_settings_ids.devdocs.json @@ -1087,21 +1087,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/management-settings-ids", - "id": "def-common.OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE", - "type": "string", - "tags": [], - "label": "OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "packages/kbn-management/settings/setting_ids/index.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/management-settings-ids", "id": "def-common.OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN", diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index 09d4dd628c6cc..90bc63858011c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 143 | 0 | 141 | 0 | +| 142 | 0 | 140 | 0 | ## Common diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index 54c48c77e2a43..26f9bd5c39902 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: 2024-08-14 +date: 2024-08-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 4ae9026a187f5..590f1a7c44d3f 100644 --- a/api_docs/kbn_management_settings_types.devdocs.json +++ b/api_docs/kbn_management_settings_types.devdocs.json @@ -1613,7 +1613,7 @@ "\nThis is a local type equivalent to {@link UiSettingsType} for flexibility." ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"image\" | \"select\" | \"json\" | \"array\" | \"markdown\"" + "\"string\" | \"number\" | \"boolean\" | \"undefined\" | \"color\" | \"array\" | \"image\" | \"select\" | \"json\" | \"markdown\"" ], "path": "packages/kbn-management/settings/types/setting_type.ts", "deprecated": false, diff --git a/api_docs/kbn_management_settings_types.mdx b/api_docs/kbn_management_settings_types.mdx index 3b27a22bd6abe..10393d78ee0b4 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-types'] --- import kbnManagementSettingsTypesObj from './kbn_management_settings_types.devdocs.json'; diff --git a/api_docs/kbn_management_settings_utilities.mdx b/api_docs/kbn_management_settings_utilities.mdx index 45a58c2805227..f3b6dd57105f9 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-utilities'] --- import kbnManagementSettingsUtilitiesObj from './kbn_management_settings_utilities.devdocs.json'; diff --git a/api_docs/kbn_management_storybook_config.mdx b/api_docs/kbn_management_storybook_config.mdx index e82100942cff7..7bf380e91cc7b 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: 2024-08-14 +date: 2024-08-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 e6b149a8ae299..261b0172ddaf4 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: 2024-08-14 +date: 2024-08-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 92dbbf615331e..8c646c25cb3ff 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_ml_agg_utils.devdocs.json index 3e2c306db4d73..5994abdf8b656 100644 --- a/api_docs/kbn_ml_agg_utils.devdocs.json +++ b/api_docs/kbn_ml_agg_utils.devdocs.json @@ -698,7 +698,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -734,6 +734,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -792,6 +818,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1386,7 +1414,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1412,7 +1442,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1658,6 +1688,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 70873594351b2..3fc1e37fbe925 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: 2024-08-14 +date: 2024-08-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 b8226eeb31aa8..847b398ec3cb3 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: 2024-08-14 +date: 2024-08-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_cancellable_search.mdx b/api_docs/kbn_ml_cancellable_search.mdx index 5fa5476ef7dcc..9ed2c18cc6ef6 100644 --- a/api_docs/kbn_ml_cancellable_search.mdx +++ b/api_docs/kbn_ml_cancellable_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-cancellable-search title: "@kbn/ml-cancellable-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-cancellable-search plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-cancellable-search'] --- import kbnMlCancellableSearchObj from './kbn_ml_cancellable_search.devdocs.json'; diff --git a/api_docs/kbn_ml_category_validator.mdx b/api_docs/kbn_ml_category_validator.mdx index 5c9f98df7f504..51b814cf7a8dd 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: 2024-08-14 +date: 2024-08-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 9ee5245037d96..dfc1835a0c168 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: 2024-08-14 +date: 2024-08-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 efde0b3d53975..e12e56f7e1ffd 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: 2024-08-14 +date: 2024-08-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 eadd86e183a29..66e553b9b63be 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_ml_date_picker.devdocs.json index 092772ed4e32d..a2401c59a14ba 100644 --- a/api_docs/kbn_ml_date_picker.devdocs.json +++ b/api_docs/kbn_ml_date_picker.devdocs.json @@ -728,7 +728,7 @@ "section": "def-common.RefreshInterval", "text": "RefreshInterval" }, - "; setRefreshInterval: (refreshInterval: Partial<", + "; getMinRefreshInterval: () => number; setRefreshInterval: (refreshInterval: Partial<", { "pluginId": "data", "scope": "common", diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index 2b122bb24520d..1fc6ac99df933 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: 2024-08-14 +date: 2024-08-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 da71df7117b89..5f01e8448d063 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: 2024-08-14 +date: 2024-08-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 c725e889899ca..bb3e3320938b4 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: 2024-08-14 +date: 2024-08-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 28c42340b4a0b..5a7f0c243cb27 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: 2024-08-14 +date: 2024-08-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 5371dd08dae60..6a453a82a5b2a 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: 2024-08-14 +date: 2024-08-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 43294d5b5f9b9..b109a87ebbfd8 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: 2024-08-14 +date: 2024-08-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 0538067f84ede..ecc633f5a09c3 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: 2024-08-14 +date: 2024-08-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 27ae3e1da67a9..f11a95cbc0114 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: 2024-08-14 +date: 2024-08-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 60ab878e80d06..2e0063282349a 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: 2024-08-14 +date: 2024-08-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 e642d012d1e6b..781a843de0663 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: 2024-08-14 +date: 2024-08-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 b9802f749dd78..d58c528713709 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: 2024-08-14 +date: 2024-08-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 dcdf9607444da..dd86793573528 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: 2024-08-14 +date: 2024-08-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 d88298647f02e..c01fa8f45b8bf 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: 2024-08-14 +date: 2024-08-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 a0fce172f186a..e50ae41a97513 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: 2024-08-14 +date: 2024-08-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 16b5658911ca1..94b44d9e6afa4 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: 2024-08-14 +date: 2024-08-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_time_buckets.mdx b/api_docs/kbn_ml_time_buckets.mdx index c9d7b9b728a35..0622698eb074b 100644 --- a/api_docs/kbn_ml_time_buckets.mdx +++ b/api_docs/kbn_ml_time_buckets.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-time-buckets title: "@kbn/ml-time-buckets" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-time-buckets plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-time-buckets'] --- import kbnMlTimeBucketsObj from './kbn_ml_time_buckets.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.devdocs.json b/api_docs/kbn_ml_trained_models_utils.devdocs.json index 29e317f3d5c28..da7f83967f765 100644 --- a/api_docs/kbn_ml_trained_models_utils.devdocs.json +++ b/api_docs/kbn_ml_trained_models_utils.devdocs.json @@ -472,7 +472,7 @@ "label": "InferenceAPIConfigResponse", "description": [], "signature": [ - "{ model_id: string; task_type: \"sparse_embedding\" | \"text_embedding\"; task_settings: { model?: string | undefined; }; } & ", + "{ inference_id: string; task_type: \"sparse_embedding\" | \"text_embedding\"; task_settings: { model?: string | undefined; }; } & ", "InferenceServiceSettings" ], "path": "x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts", diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index eee2c16b3b5e1..3b67041a0000d 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: 2024-08-14 +date: 2024-08-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_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index f209e0f35fe87..d51e24f4da8b3 100644 --- a/api_docs/kbn_ml_ui_actions.mdx +++ b/api_docs/kbn_ml_ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-ui-actions title: "@kbn/ml-ui-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-ui-actions plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-ui-actions'] --- import kbnMlUiActionsObj from './kbn_ml_ui_actions.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index ec8cc0b5b229d..4501a64f31031 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: 2024-08-14 +date: 2024-08-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_mock_idp_utils.mdx b/api_docs/kbn_mock_idp_utils.mdx index 42b4b0eb36c5d..45dc4347a7198 100644 --- a/api_docs/kbn_mock_idp_utils.mdx +++ b/api_docs/kbn_mock_idp_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mock-idp-utils title: "@kbn/mock-idp-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mock-idp-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mock-idp-utils'] --- import kbnMockIdpUtilsObj from './kbn_mock_idp_utils.devdocs.json'; diff --git a/api_docs/kbn_monaco.devdocs.json b/api_docs/kbn_monaco.devdocs.json index 4a8466768ac91..6034d3f573795 100644 --- a/api_docs/kbn_monaco.devdocs.json +++ b/api_docs/kbn_monaco.devdocs.json @@ -482,7 +482,7 @@ "label": "getSources", "description": [], "signature": [ - "CallbackFn<{}, { name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; }> | undefined" + "CallbackFn<{}, { name: string; hidden: boolean; title?: string | undefined; dataStreams?: { name: string; title?: string | undefined; }[] | undefined; type?: string | undefined; }> | undefined" ], "path": "packages/kbn-esql-validation-autocomplete/src/shared/types.ts", "deprecated": false, @@ -1186,45 +1186,6 @@ "path": "packages/kbn-monaco/src/console/types.ts", "deprecated": false, "trackAdoption": false - }, - { - "parentPluginId": "@kbn/monaco", - "id": "def-common.ParsedRequest.method", - "type": "string", - "tags": [], - "label": "method", - "description": [], - "path": "packages/kbn-monaco/src/console/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/monaco", - "id": "def-common.ParsedRequest.url", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-monaco/src/console/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/monaco", - "id": "def-common.ParsedRequest.data", - "type": "Array", - "tags": [], - "label": "data", - "description": [], - "signature": [ - "Record[] | undefined" - ], - "path": "packages/kbn-monaco/src/console/types.ts", - "deprecated": false, - "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 77f0f3e059fa6..b061d4c89f82c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.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 | |-------------------|-----------|------------------------|-----------------| -| 123 | 0 | 123 | 3 | +| 120 | 0 | 120 | 3 | ## Common diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 48f88ad91dc83..c20cbde4516e4 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: 2024-08-14 +date: 2024-08-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 f9bc13b08521e..ffb5c6ef7bbbb 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: 2024-08-14 +date: 2024-08-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_observability_alerting_rule_utils.mdx b/api_docs/kbn_observability_alerting_rule_utils.mdx index 9f2c79b66ffca..cf6367fa59d88 100644 --- a/api_docs/kbn_observability_alerting_rule_utils.mdx +++ b/api_docs/kbn_observability_alerting_rule_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-rule-utils title: "@kbn/observability-alerting-rule-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-rule-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-rule-utils'] --- import kbnObservabilityAlertingRuleUtilsObj from './kbn_observability_alerting_rule_utils.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index 78334265b8785..936795814ad7a 100644 --- a/api_docs/kbn_observability_alerting_test_data.mdx +++ b/api_docs/kbn_observability_alerting_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-test-data title: "@kbn/observability-alerting-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-test-data plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-test-data'] --- import kbnObservabilityAlertingTestDataObj from './kbn_observability_alerting_test_data.devdocs.json'; diff --git a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx index 52d60a7b0c0fc..8590f019a303d 100644 --- a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx +++ b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-get-padded-alert-time-range-util title: "@kbn/observability-get-padded-alert-time-range-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-get-padded-alert-time-range-util plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-get-padded-alert-time-range-util'] --- import kbnObservabilityGetPaddedAlertTimeRangeUtilObj from './kbn_observability_get_padded_alert_time_range_util.devdocs.json'; diff --git a/api_docs/kbn_openapi_bundler.mdx b/api_docs/kbn_openapi_bundler.mdx index 3768a52c138b9..07add5a4da06d 100644 --- a/api_docs/kbn_openapi_bundler.mdx +++ b/api_docs/kbn_openapi_bundler.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-bundler title: "@kbn/openapi-bundler" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-bundler plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-bundler'] --- import kbnOpenapiBundlerObj from './kbn_openapi_bundler.devdocs.json'; diff --git a/api_docs/kbn_openapi_generator.mdx b/api_docs/kbn_openapi_generator.mdx index c1e693425c72f..fcc8468a531bf 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: 2024-08-14 +date: 2024-08-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 4b3fed916e339..35feb1923a817 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: 2024-08-14 +date: 2024-08-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 bca62a0e44c79..06a26caf7f3cb 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: 2024-08-14 +date: 2024-08-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 6884b462d4918..34002bfc45bdd 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: 2024-08-14 +date: 2024-08-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_panel_loader.mdx b/api_docs/kbn_panel_loader.mdx index 73d1e03ba4fe0..91a90d3fadbd5 100644 --- a/api_docs/kbn_panel_loader.mdx +++ b/api_docs/kbn_panel_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-panel-loader title: "@kbn/panel-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/panel-loader plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/panel-loader'] --- import kbnPanelLoaderObj from './kbn_panel_loader.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 8fc05e2a106f9..0135893bb9d8b 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: 2024-08-14 +date: 2024-08-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_check.mdx b/api_docs/kbn_plugin_check.mdx index 3d00390084283..564e6e759f403 100644 --- a/api_docs/kbn_plugin_check.mdx +++ b/api_docs/kbn_plugin_check.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-check title: "@kbn/plugin-check" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-check plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-check'] --- import kbnPluginCheckObj from './kbn_plugin_check.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index dff5ce53da2a2..5f99c4d37c974 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: 2024-08-14 +date: 2024-08-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 80f0b9ada7b80..7358cca85b376 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_presentation_containers.devdocs.json b/api_docs/kbn_presentation_containers.devdocs.json index d3adf3e03080d..3216e399f98ba 100644 --- a/api_docs/kbn_presentation_containers.devdocs.json +++ b/api_docs/kbn_presentation_containers.devdocs.json @@ -1751,9 +1751,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" diff --git a/api_docs/kbn_presentation_containers.mdx b/api_docs/kbn_presentation_containers.mdx index 9b042fdfa01f2..3eefd985c6cb8 100644 --- a/api_docs/kbn_presentation_containers.mdx +++ b/api_docs/kbn_presentation_containers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-containers title: "@kbn/presentation-containers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-containers plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-containers'] --- import kbnPresentationContainersObj from './kbn_presentation_containers.devdocs.json'; diff --git a/api_docs/kbn_presentation_publishing.mdx b/api_docs/kbn_presentation_publishing.mdx index f26dcf01b90b7..c7cc88a83203c 100644 --- a/api_docs/kbn_presentation_publishing.mdx +++ b/api_docs/kbn_presentation_publishing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-publishing title: "@kbn/presentation-publishing" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-publishing plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-publishing'] --- import kbnPresentationPublishingObj from './kbn_presentation_publishing.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index ef1461090a162..356e737bb41c3 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: 2024-08-14 +date: 2024-08-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 3a4e5facb195d..f02397fd1b03a 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: 2024-08-14 +date: 2024-08-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 b4db182346dcc..9daf5a9531cce 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_react_hooks.mdx b/api_docs/kbn_react_hooks.mdx index 663f33328e966..f87fb2ff68eed 100644 --- a/api_docs/kbn_react_hooks.mdx +++ b/api_docs/kbn_react_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-hooks title: "@kbn/react-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-hooks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-hooks'] --- import kbnReactHooksObj from './kbn_react_hooks.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index dbee79a200bfa..416fb1f972a6c 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: 2024-08-14 +date: 2024-08-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 21393fb1bbffa..899fc3515fb5b 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: 2024-08-14 +date: 2024-08-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 3620fb16659f2..dc9a1e114a38d 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: 2024-08-14 +date: 2024-08-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 370029428d144..e30b190449d88 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: 2024-08-14 +date: 2024-08-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 79f459b09077a..57d8e88f75b90 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_react_kibana_mount.devdocs.json index b26c6e53f7459..9340067e42c1e 100644 --- a/api_docs/kbn_react_kibana_mount.devdocs.json +++ b/api_docs/kbn_react_kibana_mount.devdocs.json @@ -152,7 +152,7 @@ "label": "useIfMounted", "description": [], "signature": [ - "() => (func: any) => void" + "() => (func?: (() => void) | undefined) => void" ], "path": "packages/react/kibana_mount/utils.ts", "deprecated": false, diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 4ed4ebd48f412..694b7656dd42d 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: 2024-08-14 +date: 2024-08-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_recently_accessed.mdx b/api_docs/kbn_recently_accessed.mdx index 34fb928683ba7..a907261cc9d4a 100644 --- a/api_docs/kbn_recently_accessed.mdx +++ b/api_docs/kbn_recently_accessed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-recently-accessed title: "@kbn/recently-accessed" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/recently-accessed plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/recently-accessed'] --- import kbnRecentlyAccessedObj from './kbn_recently_accessed.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index f850f06b14040..15757f00ac4ce 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: 2024-08-14 +date: 2024-08-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 f9b1708b8fbd6..0a18a3eb773da 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: 2024-08-14 +date: 2024-08-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 b92ddbf5afe19..f0b05ed30f3f3 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: 2024-08-14 +date: 2024-08-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 be831af64c033..4551e5d8b7162 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: 2024-08-14 +date: 2024-08-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 cbb1be25f5c45..7b3e3f7e5b0c1 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-common'] --- import kbnReportingCommonObj from './kbn_reporting_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_csv_share_panel.mdx b/api_docs/kbn_reporting_csv_share_panel.mdx index 68f45ab666d18..d71f19fbc4a14 100644 --- a/api_docs/kbn_reporting_csv_share_panel.mdx +++ b/api_docs/kbn_reporting_csv_share_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-csv-share-panel title: "@kbn/reporting-csv-share-panel" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-csv-share-panel plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-csv-share-panel'] --- import kbnReportingCsvSharePanelObj from './kbn_reporting_csv_share_panel.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv.devdocs.json b/api_docs/kbn_reporting_export_types_csv.devdocs.json index 42fd45ce66450..8fe9f3243962b 100644 --- a/api_docs/kbn_reporting_export_types_csv.devdocs.json +++ b/api_docs/kbn_reporting_export_types_csv.devdocs.json @@ -168,7 +168,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -176,7 +176,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -192,7 +192,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -200,7 +200,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/csv/csv_searchsource.ts", "deprecated": false, @@ -569,7 +569,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -577,7 +577,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -593,7 +593,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -601,7 +601,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/csv/csv_searchsource_immediate.ts", "deprecated": false, @@ -917,7 +917,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -925,7 +925,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -941,7 +941,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -949,7 +949,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/csv/csv_v2.ts", "deprecated": false, diff --git a/api_docs/kbn_reporting_export_types_csv.mdx b/api_docs/kbn_reporting_export_types_csv.mdx index d262b929ea70c..1730b8aba0734 100644 --- a/api_docs/kbn_reporting_export_types_csv.mdx +++ b/api_docs/kbn_reporting_export_types_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv title: "@kbn/reporting-export-types-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv'] --- import kbnReportingExportTypesCsvObj from './kbn_reporting_export_types_csv.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv_common.mdx b/api_docs/kbn_reporting_export_types_csv_common.mdx index badbf0d56efe4..1dd6e8c0fa8ff 100644 --- a/api_docs/kbn_reporting_export_types_csv_common.mdx +++ b/api_docs/kbn_reporting_export_types_csv_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv-common title: "@kbn/reporting-export-types-csv-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv-common'] --- import kbnReportingExportTypesCsvCommonObj from './kbn_reporting_export_types_csv_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf.devdocs.json b/api_docs/kbn_reporting_export_types_pdf.devdocs.json index 3a4986f51971f..b6c461c57acfa 100644 --- a/api_docs/kbn_reporting_export_types_pdf.devdocs.json +++ b/api_docs/kbn_reporting_export_types_pdf.devdocs.json @@ -176,7 +176,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -184,7 +184,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -200,7 +200,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -208,7 +208,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/pdf/printable_pdf_v2.ts", "deprecated": false, @@ -597,7 +597,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -605,7 +605,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -621,7 +621,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -629,7 +629,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/pdf/printable_pdf.ts", "deprecated": false, diff --git a/api_docs/kbn_reporting_export_types_pdf.mdx b/api_docs/kbn_reporting_export_types_pdf.mdx index 0675d9a7a5f55..861933893658b 100644 --- a/api_docs/kbn_reporting_export_types_pdf.mdx +++ b/api_docs/kbn_reporting_export_types_pdf.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf title: "@kbn/reporting-export-types-pdf" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf'] --- import kbnReportingExportTypesPdfObj from './kbn_reporting_export_types_pdf.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf_common.mdx b/api_docs/kbn_reporting_export_types_pdf_common.mdx index 71dfafe2de7ef..a7addd095fe23 100644 --- a/api_docs/kbn_reporting_export_types_pdf_common.mdx +++ b/api_docs/kbn_reporting_export_types_pdf_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf-common title: "@kbn/reporting-export-types-pdf-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf-common'] --- import kbnReportingExportTypesPdfCommonObj from './kbn_reporting_export_types_pdf_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png.devdocs.json b/api_docs/kbn_reporting_export_types_png.devdocs.json index aba2f914b2974..f8c2e8f045ec2 100644 --- a/api_docs/kbn_reporting_export_types_png.devdocs.json +++ b/api_docs/kbn_reporting_export_types_png.devdocs.json @@ -176,7 +176,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + ", config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -184,7 +184,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, logger: ", { "pluginId": "@kbn/logging", "scope": "common", @@ -200,7 +200,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -208,7 +208,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>]" ], "path": "packages/kbn-reporting/export_types/png/png_v2.ts", "deprecated": false, diff --git a/api_docs/kbn_reporting_export_types_png.mdx b/api_docs/kbn_reporting_export_types_png.mdx index 21364a0070dbb..9ee324b8b3402 100644 --- a/api_docs/kbn_reporting_export_types_png.mdx +++ b/api_docs/kbn_reporting_export_types_png.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png title: "@kbn/reporting-export-types-png" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png'] --- import kbnReportingExportTypesPngObj from './kbn_reporting_export_types_png.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png_common.mdx b/api_docs/kbn_reporting_export_types_png_common.mdx index a98e70ed32022..cd09d6fc42e6d 100644 --- a/api_docs/kbn_reporting_export_types_png_common.mdx +++ b/api_docs/kbn_reporting_export_types_png_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png-common title: "@kbn/reporting-export-types-png-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png-common'] --- import kbnReportingExportTypesPngCommonObj from './kbn_reporting_export_types_png_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_mocks_server.devdocs.json b/api_docs/kbn_reporting_mocks_server.devdocs.json index 008248db99552..e347bc511219a 100644 --- a/api_docs/kbn_reporting_mocks_server.devdocs.json +++ b/api_docs/kbn_reporting_mocks_server.devdocs.json @@ -29,7 +29,7 @@ "signature": [ "(overrides?: ", "_DeepPartialObject", - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -37,7 +37,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>) => Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>) => Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -45,7 +45,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" ], "path": "packages/kbn-reporting/mocks_server/index.ts", "deprecated": false, @@ -60,7 +60,7 @@ "description": [], "signature": [ "_DeepPartialObject", - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -68,7 +68,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>" ], "path": "packages/kbn-reporting/mocks_server/index.ts", "deprecated": false, diff --git a/api_docs/kbn_reporting_mocks_server.mdx b/api_docs/kbn_reporting_mocks_server.mdx index 0b0f1972e456d..7c2ff8ebf5b2b 100644 --- a/api_docs/kbn_reporting_mocks_server.mdx +++ b/api_docs/kbn_reporting_mocks_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-mocks-server title: "@kbn/reporting-mocks-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-mocks-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-mocks-server'] --- import kbnReportingMocksServerObj from './kbn_reporting_mocks_server.devdocs.json'; diff --git a/api_docs/kbn_reporting_public.mdx b/api_docs/kbn_reporting_public.mdx index 20398726244f3..bee38532dfbf6 100644 --- a/api_docs/kbn_reporting_public.mdx +++ b/api_docs/kbn_reporting_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-public title: "@kbn/reporting-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-public plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-public'] --- import kbnReportingPublicObj from './kbn_reporting_public.devdocs.json'; diff --git a/api_docs/kbn_reporting_server.devdocs.json b/api_docs/kbn_reporting_server.devdocs.json index e9786a2dc0459..ecd948e6f0478 100644 --- a/api_docs/kbn_reporting_server.devdocs.json +++ b/api_docs/kbn_reporting_server.devdocs.json @@ -416,7 +416,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -424,7 +424,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" ], "path": "packages/kbn-reporting/server/export_type.ts", "deprecated": false, @@ -467,7 +467,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -475,7 +475,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>>" ], "path": "packages/kbn-reporting/server/export_type.ts", "deprecated": false, @@ -949,7 +949,7 @@ "label": "getFullRedirectAppUrl", "description": [], "signature": [ - "(config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "(config: Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -957,7 +957,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, serverInfo: ", + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>, serverInfo: ", "ReportingServerInfo", ", spaceId: string | undefined, forceNow: string | undefined) => string" ], @@ -973,7 +973,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "Readonly<{ encryptionKey?: string | undefined; } & { enabled: boolean; csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -981,7 +981,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; capture: Readonly<{} & { maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; statefulSettings: Readonly<{} & { enabled: boolean; }>; }>" ], "path": "packages/kbn-reporting/server/get_full_redirect_app_url.ts", "deprecated": false, @@ -1661,7 +1661,7 @@ "label": "ReportingConfigType", "description": [], "signature": [ - "{ readonly encryptionKey?: string | undefined; readonly enabled: boolean; readonly capture: Readonly<{} & { maxAttempts: number; }>; readonly roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; readonly kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; readonly queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; readonly csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", + "{ readonly encryptionKey?: string | undefined; readonly enabled: boolean; readonly csv: Readonly<{} & { scroll: Readonly<{} & { duration: string; size: number; strategy: \"scroll\" | \"pit\"; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -1669,7 +1669,7 @@ "section": "def-common.ByteSizeValue", "text": "ByteSizeValue" }, - "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; readonly poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; readonly export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; readonly statefulSettings: Readonly<{} & { enabled: boolean; }>; }" + "; useByteOrderMarkEncoding: boolean; maxConcurrentShardRequests: number; }>; readonly capture: Readonly<{} & { maxAttempts: number; }>; readonly roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; readonly kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; readonly queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; readonly poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; readonly export_types: Readonly<{} & { csv: Readonly<{} & { enabled: boolean; }>; png: Readonly<{} & { enabled: boolean; }>; pdf: Readonly<{} & { enabled: boolean; }>; }>; readonly statefulSettings: Readonly<{} & { enabled: boolean; }>; }" ], "path": "packages/kbn-reporting/server/types.ts", "deprecated": false, diff --git a/api_docs/kbn_reporting_server.mdx b/api_docs/kbn_reporting_server.mdx index c5e44903dcba2..ecf0978c05710 100644 --- a/api_docs/kbn_reporting_server.mdx +++ b/api_docs/kbn_reporting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-server title: "@kbn/reporting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-server'] --- import kbnReportingServerObj from './kbn_reporting_server.devdocs.json'; diff --git a/api_docs/kbn_resizable_layout.mdx b/api_docs/kbn_resizable_layout.mdx index 1f60f48b68fc1..3ccaddda1f819 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/resizable-layout'] --- import kbnResizableLayoutObj from './kbn_resizable_layout.devdocs.json'; diff --git a/api_docs/kbn_response_ops_feature_flag_service.mdx b/api_docs/kbn_response_ops_feature_flag_service.mdx index 8833e8ad8f42b..27e778cfcceac 100644 --- a/api_docs/kbn_response_ops_feature_flag_service.mdx +++ b/api_docs/kbn_response_ops_feature_flag_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-feature-flag-service title: "@kbn/response-ops-feature-flag-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-feature-flag-service plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-feature-flag-service'] --- import kbnResponseOpsFeatureFlagServiceObj from './kbn_response_ops_feature_flag_service.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index 0207c052f3bf2..748288eb14184 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_rollup.mdx b/api_docs/kbn_rollup.mdx index 77327e9ffc837..f2c82185226e0 100644 --- a/api_docs/kbn_rollup.mdx +++ b/api_docs/kbn_rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rollup title: "@kbn/rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rollup plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rollup'] --- import kbnRollupObj from './kbn_rollup.devdocs.json'; diff --git a/api_docs/kbn_router_to_openapispec.mdx b/api_docs/kbn_router_to_openapispec.mdx index 1e4761be96b86..48fbaeece164a 100644 --- a/api_docs/kbn_router_to_openapispec.mdx +++ b/api_docs/kbn_router_to_openapispec.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-to-openapispec title: "@kbn/router-to-openapispec" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-to-openapispec plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-to-openapispec'] --- import kbnRouterToOpenapispecObj from './kbn_router_to_openapispec.devdocs.json'; diff --git a/api_docs/kbn_router_utils.mdx b/api_docs/kbn_router_utils.mdx index 501b39252edff..8b2aaf218d30f 100644 --- a/api_docs/kbn_router_utils.mdx +++ b/api_docs/kbn_router_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-utils title: "@kbn/router-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-utils'] --- import kbnRouterUtilsObj from './kbn_router_utils.devdocs.json'; diff --git a/api_docs/kbn_rrule.mdx b/api_docs/kbn_rrule.mdx index 681362ff12970..0db75685a1c29 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: 2024-08-14 +date: 2024-08-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 f467633000031..bc49d8f77b6c6 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: 2024-08-14 +date: 2024-08-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 836d9c0c77b17..e6de3f110c023 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: 2024-08-14 +date: 2024-08-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_screenshotting_server.devdocs.json b/api_docs/kbn_screenshotting_server.devdocs.json new file mode 100644 index 0000000000000..f320f3ca33d1e --- /dev/null +++ b/api_docs/kbn_screenshotting_server.devdocs.json @@ -0,0 +1,806 @@ +{ + "id": "@kbn/screenshotting-server", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths", + "type": "Class", + "tags": [], + "label": "ChromiumArchivePaths", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.packages", + "type": "Array", + "tags": [], + "label": "packages", + "description": [], + "signature": [ + "(CustomPackageInfo | CommonPackageInfo)[]" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.archivesPath", + "type": "string", + "tags": [], + "label": "archivesPath", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.find", + "type": "Function", + "tags": [], + "label": "find", + "description": [], + "signature": [ + "(platform: string, architecture: string, packages?: ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + "[]) => ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + " | undefined" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.find.$1", + "type": "string", + "tags": [], + "label": "platform", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.find.$2", + "type": "string", + "tags": [], + "label": "architecture", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.find.$3", + "type": "Array", + "tags": [], + "label": "packages", + "description": [], + "signature": [ + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + "[]" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.resolvePath", + "type": "Function", + "tags": [], + "label": "resolvePath", + "description": [], + "signature": [ + "(p: ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + ") => string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.resolvePath.$1", + "type": "Object", + "tags": [], + "label": "p", + "description": [], + "signature": [ + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + } + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getAllArchiveFilenames", + "type": "Function", + "tags": [], + "label": "getAllArchiveFilenames", + "description": [], + "signature": [ + "() => string[]" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getDownloadUrl", + "type": "Function", + "tags": [], + "label": "getDownloadUrl", + "description": [], + "signature": [ + "(p: ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + ") => string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getDownloadUrl.$1", + "type": "Object", + "tags": [], + "label": "p", + "description": [], + "signature": [ + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + } + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getBinaryPath", + "type": "Function", + "tags": [], + "label": "getBinaryPath", + "description": [], + "signature": [ + "(p: ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + }, + ", chromiumPath: string) => string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getBinaryPath.$1", + "type": "Object", + "tags": [], + "label": "p", + "description": [], + "signature": [ + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + } + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ChromiumArchivePaths.getBinaryPath.$2", + "type": "string", + "tags": [], + "label": "chromiumPath", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.args", + "type": "Function", + "tags": [], + "label": "args", + "description": [], + "signature": [ + "({ userDataDir, disableSandbox, windowSize, proxy: proxyConfig, }: LaunchArgs) => string[]" + ], + "path": "packages/kbn-screenshotting-server/src/args.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.args.$1", + "type": "Object", + "tags": [], + "label": "{\n userDataDir,\n disableSandbox,\n windowSize,\n proxy: proxyConfig,\n}", + "description": [], + "signature": [ + "LaunchArgs" + ], + "path": "packages/kbn-screenshotting-server/src/args.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.createConfig", + "type": "Function", + "tags": [], + "label": "createConfig", + "description": [], + "signature": [ + "(parentLogger: ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.Logger", + "text": "Logger" + }, + ", config: Readonly<{} & { enabled: boolean; capture: Readonly<{ loadDelay?: number | moment.Duration | undefined; } & { zoom: number; timeouts: Readonly<{} & { renderComplete: number | moment.Duration; openUrl: number | moment.Duration; waitForElements: number | moment.Duration; }>; }>; browser: Readonly<{} & { autoDownload: boolean; chromium: Readonly<{ inspect?: boolean | undefined; disableSandbox?: boolean | undefined; } & { proxy: Readonly<{ server?: string | undefined; bypass?: string[] | undefined; } & { enabled: boolean; }>; }>; }>; networkPolicy: Readonly<{} & { enabled: boolean; rules: Readonly<{ host?: string | undefined; protocol?: string | undefined; } & { allow: boolean; }>[]; }>; poolSize: number; }>) => Promise; }>; browser: Readonly<{} & { autoDownload: boolean; chromium: Readonly<{ inspect?: boolean | undefined; disableSandbox?: boolean | undefined; } & { proxy: Readonly<{ server?: string | undefined; bypass?: string[] | undefined; } & { enabled: boolean; }>; }>; }>; networkPolicy: Readonly<{} & { enabled: boolean; rules: Readonly<{ host?: string | undefined; protocol?: string | undefined; } & { allow: boolean; }>[]; }>; poolSize: number; }>>" + ], + "path": "packages/kbn-screenshotting-server/src/config/create_config.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.createConfig.$1", + "type": "Object", + "tags": [], + "label": "parentLogger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.Logger", + "text": "Logger" + } + ], + "path": "packages/kbn-screenshotting-server/src/config/create_config.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.createConfig.$2", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "Readonly<{} & { enabled: boolean; capture: Readonly<{ loadDelay?: number | moment.Duration | undefined; } & { zoom: number; timeouts: Readonly<{} & { renderComplete: number | moment.Duration; openUrl: number | moment.Duration; waitForElements: number | moment.Duration; }>; }>; browser: Readonly<{} & { autoDownload: boolean; chromium: Readonly<{ inspect?: boolean | undefined; disableSandbox?: boolean | undefined; } & { proxy: Readonly<{ server?: string | undefined; bypass?: string[] | undefined; } & { enabled: boolean; }>; }>; }>; networkPolicy: Readonly<{} & { enabled: boolean; rules: Readonly<{ host?: string | undefined; protocol?: string | undefined; } & { allow: boolean; }>[]; }>; poolSize: number; }>" + ], + "path": "packages/kbn-screenshotting-server/src/config/create_config.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.durationToNumber", + "type": "Function", + "tags": [], + "label": "durationToNumber", + "description": [ + "\nHelper function" + ], + "signature": [ + "(value: number | moment.Duration) => number" + ], + "path": "packages/kbn-screenshotting-server/src/config/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.durationToNumber.$1", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | moment.Duration" + ], + "path": "packages/kbn-screenshotting-server/src/config/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.getChromiumPackage", + "type": "Function", + "tags": [], + "label": "getChromiumPackage", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/screenshotting-server", + "scope": "server", + "docId": "kibKbnScreenshottingServerPluginApi", + "section": "def-server.PackageInfo", + "text": "PackageInfo" + } + ], + "path": "packages/kbn-screenshotting-server/src/get_chromium_package.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo", + "type": "Interface", + "tags": [], + "label": "PackageInfo", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.platform", + "type": "CompoundType", + "tags": [], + "label": "platform", + "description": [], + "signature": [ + "\"linux\" | \"darwin\" | \"win32\"" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.architecture", + "type": "CompoundType", + "tags": [], + "label": "architecture", + "description": [], + "signature": [ + "\"x64\" | \"arm64\"" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.archiveFilename", + "type": "string", + "tags": [], + "label": "archiveFilename", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.archiveChecksum", + "type": "string", + "tags": [], + "label": "archiveChecksum", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.binaryChecksum", + "type": "string", + "tags": [], + "label": "binaryChecksum", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.binaryRelativePath", + "type": "string", + "tags": [], + "label": "binaryRelativePath", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.isPreInstalled", + "type": "boolean", + "tags": [], + "label": "isPreInstalled", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.location", + "type": "CompoundType", + "tags": [], + "label": "location", + "description": [], + "signature": [ + "\"custom\" | \"common\"" + ], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.PackageInfo.revision", + "type": "number", + "tags": [], + "label": "revision", + "description": [], + "path": "packages/kbn-screenshotting-server/src/paths.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ConfigType", + "type": "Type", + "tags": [], + "label": "ConfigType", + "description": [], + "signature": [ + "{ readonly enabled: boolean; readonly capture: Readonly<{ loadDelay?: number | moment.Duration | undefined; } & { zoom: number; timeouts: Readonly<{} & { renderComplete: number | moment.Duration; openUrl: number | moment.Duration; waitForElements: number | moment.Duration; }>; }>; readonly browser: Readonly<{} & { autoDownload: boolean; chromium: Readonly<{ inspect?: boolean | undefined; disableSandbox?: boolean | undefined; } & { proxy: Readonly<{ server?: string | undefined; bypass?: string[] | undefined; } & { enabled: boolean; }>; }>; }>; readonly networkPolicy: Readonly<{} & { enabled: boolean; rules: Readonly<{ host?: string | undefined; protocol?: string | undefined; } & { allow: boolean; }>[]; }>; readonly poolSize: number; }" + ], + "path": "packages/kbn-screenshotting-server/src/config/schema.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/screenshotting-server", + "id": "def-server.ConfigSchema", + "type": "Object", + "tags": [], + "label": "ConfigSchema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ enabled: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ConditionalType", + "text": "ConditionalType" + }, + "; networkPolicy: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ enabled: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; rules: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "[]>; }>; browser: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ autoDownload: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ConditionalType", + "text": "ConditionalType" + }, + "; chromium: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ inspect: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ConditionalType", + "text": "ConditionalType" + }, + "; disableSandbox: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; proxy: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ enabled: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; server: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ConditionalType", + "text": "ConditionalType" + }, + "; bypass: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ConditionalType", + "text": "ConditionalType" + }, + "; }>; }>; }>; capture: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ timeouts: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ openUrl: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; waitForElements: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; renderComplete: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; }>; zoom: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; loadDelay: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; }>; poolSize: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; }>" + ], + "path": "packages/kbn-screenshotting-server/src/config/schema.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_screenshotting_server.mdx b/api_docs/kbn_screenshotting_server.mdx new file mode 100644 index 0000000000000..6a1f75bcc8cc8 --- /dev/null +++ b/api_docs/kbn_screenshotting_server.mdx @@ -0,0 +1,42 @@ +--- +#### +#### This 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: kibKbnScreenshottingServerPluginApi +slug: /kibana-dev-docs/api/kbn-screenshotting-server +title: "@kbn/screenshotting-server" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/screenshotting-server plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/screenshotting-server'] +--- +import kbnScreenshottingServerObj from './kbn_screenshotting_server.devdocs.json'; + + + +Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 35 | 0 | 34 | 0 | + +## Server + +### Objects + + +### Functions + + +### Classes + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index c9507c1afe5e0..08967a289b716 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: 2024-08-14 +date: 2024-08-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 d479a2e60045c..39f72e1e8cb18 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-connectors'] --- import kbnSearchConnectorsObj from './kbn_search_connectors.devdocs.json'; diff --git a/api_docs/kbn_search_errors.mdx b/api_docs/kbn_search_errors.mdx index 56522a7e4b746..67a2361579689 100644 --- a/api_docs/kbn_search_errors.mdx +++ b/api_docs/kbn_search_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-errors title: "@kbn/search-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-errors plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-errors'] --- import kbnSearchErrorsObj from './kbn_search_errors.devdocs.json'; diff --git a/api_docs/kbn_search_index_documents.mdx b/api_docs/kbn_search_index_documents.mdx index 643755f85ecec..80e09e4d6bbd8 100644 --- a/api_docs/kbn_search_index_documents.mdx +++ b/api_docs/kbn_search_index_documents.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-index-documents title: "@kbn/search-index-documents" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-index-documents plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-index-documents'] --- import kbnSearchIndexDocumentsObj from './kbn_search_index_documents.devdocs.json'; diff --git a/api_docs/kbn_search_response_warnings.mdx b/api_docs/kbn_search_response_warnings.mdx index 4f8df22d09e8b..9c0f4e16a03a6 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: 2024-08-14 +date: 2024-08-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_search_types.mdx b/api_docs/kbn_search_types.mdx index 9d7d0419e87de..3953007209662 100644 --- a/api_docs/kbn_search_types.mdx +++ b/api_docs/kbn_search_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-types title: "@kbn/search-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-types plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-types'] --- import kbnSearchTypesObj from './kbn_search_types.devdocs.json'; diff --git a/api_docs/kbn_security_api_key_management.mdx b/api_docs/kbn_security_api_key_management.mdx index 31dd3ce433fd5..8ead181dd4930 100644 --- a/api_docs/kbn_security_api_key_management.mdx +++ b/api_docs/kbn_security_api_key_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-api-key-management title: "@kbn/security-api-key-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-api-key-management plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-api-key-management'] --- import kbnSecurityApiKeyManagementObj from './kbn_security_api_key_management.devdocs.json'; diff --git a/api_docs/kbn_security_authorization_core.devdocs.json b/api_docs/kbn_security_authorization_core.devdocs.json new file mode 100644 index 0000000000000..75a43d937d9f0 --- /dev/null +++ b/api_docs/kbn_security_authorization_core.devdocs.json @@ -0,0 +1,468 @@ +{ + "id": "@kbn/security-authorization-core", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions", + "type": "Class", + "tags": [], + "label": "Actions", + "description": [ + "Actions are used to create the \"actions\" that are associated with Elasticsearch's\napplication privileges, and are used to perform the authorization checks implemented\nby the various `checkPrivilegesWithRequest` derivatives." + ], + "signature": [ + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.Actions", + "text": "Actions" + }, + " implements ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.Actions", + "text": "Actions" + } + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.api", + "type": "Object", + "tags": [], + "label": "api", + "description": [], + "signature": [ + "ApiActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.app", + "type": "Object", + "tags": [], + "label": "app", + "description": [], + "signature": [ + "AppActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "CasesActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.login", + "type": "string", + "tags": [], + "label": "login", + "description": [], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.savedObject", + "type": "Object", + "tags": [], + "label": "savedObject", + "description": [], + "signature": [ + "SavedObjectActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.alerting", + "type": "Object", + "tags": [], + "label": "alerting", + "description": [], + "signature": [ + "AlertingActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.space", + "type": "Object", + "tags": [], + "label": "space", + "description": [], + "signature": [ + "SpaceActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.ui", + "type": "Object", + "tags": [], + "label": "ui", + "description": [], + "signature": [ + "UIActions" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.Actions.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/authorization_core/src/actions/actions.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.privilegesFactory", + "type": "Function", + "tags": [], + "label": "privilegesFactory", + "description": [], + "signature": [ + "(actions: ", + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.Actions", + "text": "Actions" + }, + ", featuresService: ", + { + "pluginId": "features", + "scope": "server", + "docId": "kibFeaturesPluginApi", + "section": "def-server.FeaturesPluginSetup", + "text": "FeaturesPluginSetup" + }, + ", licenseService: Pick<", + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.SecurityLicense", + "text": "SecurityLicense" + }, + ", \"getFeatures\" | \"hasAtLeast\">) => { get(respectLicenseLevel?: boolean): { features: Record>; global: { all: string[]; read: string[]; }; space: { all: string[]; read: string[]; }; reserved: Record; }; }" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.privilegesFactory.$1", + "type": "Object", + "tags": [], + "label": "actions", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.Actions", + "text": "Actions" + } + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.privilegesFactory.$2", + "type": "Object", + "tags": [], + "label": "featuresService", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "server", + "docId": "kibFeaturesPluginApi", + "section": "def-server.FeaturesPluginSetup", + "text": "FeaturesPluginSetup" + } + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.privilegesFactory.$3", + "type": "Object", + "tags": [], + "label": "licenseService", + "description": [], + "signature": [ + "Pick<", + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.SecurityLicense", + "text": "SecurityLicense" + }, + ", \"getFeatures\" | \"hasAtLeast\">" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.PrivilegesService", + "type": "Interface", + "tags": [], + "label": "PrivilegesService", + "description": [], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.PrivilegesService.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(respectLicenseLevel?: boolean | undefined) => ", + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.RawKibanaPrivileges", + "text": "RawKibanaPrivileges" + } + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.PrivilegesService.get.$1", + "type": "CompoundType", + "tags": [], + "label": "respectLicenseLevel", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaFeaturePrivileges", + "type": "Interface", + "tags": [], + "label": "RawKibanaFeaturePrivileges", + "description": [], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaFeaturePrivileges.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[featureId: string]: { [privilegeId: string]: string[]; }", + "description": [], + "signature": [ + "[featureId: string]: { [privilegeId: string]: string[]; }" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaPrivileges", + "type": "Interface", + "tags": [], + "label": "RawKibanaPrivileges", + "description": [], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaPrivileges.global", + "type": "Object", + "tags": [], + "label": "global", + "description": [], + "signature": [ + "{ [x: string]: string[]; }" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaPrivileges.features", + "type": "Object", + "tags": [], + "label": "features", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.RawKibanaFeaturePrivileges", + "text": "RawKibanaFeaturePrivileges" + } + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaPrivileges.space", + "type": "Object", + "tags": [], + "label": "space", + "description": [], + "signature": [ + "{ [x: string]: string[]; }" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.RawKibanaPrivileges.reserved", + "type": "Object", + "tags": [], + "label": "reserved", + "description": [], + "signature": [ + "{ [x: string]: string[]; }" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/security-authorization-core", + "id": "def-server.CasesSupportedOperations", + "type": "Type", + "tags": [], + "label": "CasesSupportedOperations", + "description": [], + "signature": [ + "\"getTags\" | \"pushCase\" | \"createCase\" | \"createComment\" | \"getCase\" | \"getComment\" | \"getReporters\" | \"getUserActions\" | \"findConfigurations\" | \"updateCase\" | \"updateComment\" | \"deleteCase\" | \"deleteComment\" | \"createConfiguration\" | \"updateConfiguration\"" + ], + "path": "x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_security_authorization_core.mdx b/api_docs/kbn_security_authorization_core.mdx new file mode 100644 index 0000000000000..c51c75c3b5491 --- /dev/null +++ b/api_docs/kbn_security_authorization_core.mdx @@ -0,0 +1,39 @@ +--- +#### +#### This 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: kibKbnSecurityAuthorizationCorePluginApi +slug: /kibana-dev-docs/api/kbn-security-authorization-core +title: "@kbn/security-authorization-core" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/security-authorization-core plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core'] +--- +import kbnSecurityAuthorizationCoreObj from './kbn_security_authorization_core.devdocs.json'; + + + +Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 25 | 0 | 24 | 7 | + +## Server + +### Functions + + +### Classes + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_security_form_components.mdx b/api_docs/kbn_security_form_components.mdx index 7b107a0561b2b..775cc4344712f 100644 --- a/api_docs/kbn_security_form_components.mdx +++ b/api_docs/kbn_security_form_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-form-components title: "@kbn/security-form-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-form-components plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-form-components'] --- import kbnSecurityFormComponentsObj from './kbn_security_form_components.devdocs.json'; diff --git a/api_docs/kbn_security_hardening.mdx b/api_docs/kbn_security_hardening.mdx index 2446680a0ac7f..fb9b5e1ef9cb6 100644 --- a/api_docs/kbn_security_hardening.mdx +++ b/api_docs/kbn_security_hardening.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-hardening title: "@kbn/security-hardening" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-hardening plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-hardening'] --- import kbnSecurityHardeningObj from './kbn_security_hardening.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_common.mdx b/api_docs/kbn_security_plugin_types_common.mdx index ba64ff37f7114..e628301da26df 100644 --- a/api_docs/kbn_security_plugin_types_common.mdx +++ b/api_docs/kbn_security_plugin_types_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-common title: "@kbn/security-plugin-types-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-common plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-common'] --- import kbnSecurityPluginTypesCommonObj from './kbn_security_plugin_types_common.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_public.devdocs.json b/api_docs/kbn_security_plugin_types_public.devdocs.json index 5cf42e58fba57..3dee61c995c96 100644 --- a/api_docs/kbn_security_plugin_types_public.devdocs.json +++ b/api_docs/kbn_security_plugin_types_public.devdocs.json @@ -1,7 +1,76 @@ { "id": "@kbn/security-plugin-types-public", "client": { - "classes": [], + "classes": [ + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientPublicContract", + "type": "Class", + "tags": [], + "label": "PrivilegesAPIClientPublicContract", + "description": [], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientPublicContract.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "(args: ", + { + "pluginId": "@kbn/security-plugin-types-public", + "scope": "public", + "docId": "kibKbnSecurityPluginTypesPublicPluginApi", + "section": "def-public.PrivilegesAPIClientGetAllArgs", + "text": "PrivilegesAPIClientGetAllArgs" + }, + ") => Promise<", + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.RawKibanaPrivileges", + "text": "RawKibanaPrivileges" + }, + ">" + ], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientPublicContract.getAll.$1", + "type": "Object", + "tags": [], + "label": "args", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-public", + "scope": "public", + "docId": "kibKbnSecurityPluginTypesPublicPluginApi", + "section": "def-public.PrivilegesAPIClientGetAllArgs", + "text": "PrivilegesAPIClientGetAllArgs" + } + ], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], "functions": [], "interfaces": [ { @@ -112,6 +181,28 @@ "path": "x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.AuthorizationServiceSetup.privileges", + "type": "Object", + "tags": [], + "label": "privileges", + "description": [ + "\nA set of methods to work with Kibana role privileges" + ], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-public", + "scope": "public", + "docId": "kibKbnSecurityPluginTypesPublicPluginApi", + "section": "def-public.PrivilegesAPIClientPublicContract", + "text": "PrivilegesAPIClientPublicContract" + } + ], + "path": "x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -187,6 +278,42 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientGetAllArgs", + "type": "Interface", + "tags": [], + "label": "PrivilegesAPIClientGetAllArgs", + "description": [], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientGetAllArgs.includeActions", + "type": "boolean", + "tags": [], + "label": "includeActions", + "description": [], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-public", + "id": "def-public.PrivilegesAPIClientGetAllArgs.respectLicenseLevel", + "type": "boolean", + "tags": [], + "label": "respectLicenseLevel", + "description": [], + "path": "x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/security-plugin-types-public", "id": "def-public.RolePutPayload", @@ -639,10 +766,6 @@ "plugin": "cloudLinks", "path": "x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts" }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_current_user.ts" - }, { "plugin": "cases", "path": "x-pack/plugins/cases/public/common/lib/kibana/hooks.ts" diff --git a/api_docs/kbn_security_plugin_types_public.mdx b/api_docs/kbn_security_plugin_types_public.mdx index 5ac79e29f801d..1c721f890b421 100644 --- a/api_docs/kbn_security_plugin_types_public.mdx +++ b/api_docs/kbn_security_plugin_types_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-public title: "@kbn/security-plugin-types-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-public plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-public'] --- import kbnSecurityPluginTypesPublicObj from './kbn_security_plugin_types_public.devdocs.json'; @@ -21,10 +21,13 @@ Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 51 | 0 | 25 | 0 | +| 58 | 0 | 31 | 0 | ## Client +### Classes + + ### Interfaces diff --git a/api_docs/kbn_security_plugin_types_server.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 8cb38d693b598..27045f6d4b60f 100644 --- a/api_docs/kbn_security_plugin_types_server.mdx +++ b/api_docs/kbn_security_plugin_types_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-server title: "@kbn/security-plugin-types-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-server plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.devdocs.json'; diff --git a/api_docs/kbn_security_role_management_model.devdocs.json b/api_docs/kbn_security_role_management_model.devdocs.json new file mode 100644 index 0000000000000..7182dd6e7bd9c --- /dev/null +++ b/api_docs/kbn_security_role_management_model.devdocs.json @@ -0,0 +1,1489 @@ +{ + "id": "@kbn/security-role-management-model", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege", + "type": "Class", + "tags": [], + "label": "KibanaPrivilege", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.Unnamed.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.Unnamed.$2", + "type": "Array", + "tags": [], + "label": "actions", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.grantsPrivilege", + "type": "Function", + "tags": [], + "label": "grantsPrivilege", + "description": [], + "signature": [ + "(candidatePrivilege: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + }, + ") => boolean" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivilege.grantsPrivilege.$1", + "type": "Object", + "tags": [], + "label": "candidatePrivilege", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges", + "type": "Class", + "tags": [], + "label": "KibanaPrivileges", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "rawKibanaPrivileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.RawKibanaPrivileges", + "text": "RawKibanaPrivileges" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.Unnamed.$2", + "type": "Array", + "tags": [], + "label": "features", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.KibanaFeature", + "text": "KibanaFeature" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.getBasePrivileges", + "type": "Function", + "tags": [], + "label": "getBasePrivileges", + "description": [], + "signature": [ + "(entry: ", + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + }, + ") => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.getBasePrivileges.$1", + "type": "Object", + "tags": [], + "label": "entry", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.getSecuredFeature", + "type": "Function", + "tags": [], + "label": "getSecuredFeature", + "description": [], + "signature": [ + "(featureId: string) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredFeature", + "text": "SecuredFeature" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.getSecuredFeature.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.getSecuredFeatures", + "type": "Function", + "tags": [], + "label": "getSecuredFeatures", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredFeature", + "text": "SecuredFeature" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.createCollectionFromRoleKibanaPrivileges", + "type": "Function", + "tags": [], + "label": "createCollectionFromRoleKibanaPrivileges", + "description": [], + "signature": [ + "(roleKibanaPrivileges: ", + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + }, + "[]) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrivilegeCollection", + "text": "PrivilegeCollection" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.KibanaPrivileges.createCollectionFromRoleKibanaPrivileges.$1", + "type": "Array", + "tags": [], + "label": "roleKibanaPrivileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege", + "type": "Class", + "tags": [], + "label": "PrimaryFeaturePrivilege", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrimaryFeaturePrivilege", + "text": "PrimaryFeaturePrivilege" + }, + " extends ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.Unnamed.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.FeatureKibanaPrivileges", + "text": "FeatureKibanaPrivileges" + } + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.Unnamed.$3", + "type": "Array", + "tags": [], + "label": "actions", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.isMinimalFeaturePrivilege", + "type": "Function", + "tags": [], + "label": "isMinimalFeaturePrivilege", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.getMinimalPrivilegeId", + "type": "Function", + "tags": [], + "label": "getMinimalPrivilegeId", + "description": [], + "signature": [ + "() => string" + ], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.requireAllSpaces", + "type": "boolean", + "tags": [], + "label": "requireAllSpaces", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrimaryFeaturePrivilege.disabled", + "type": "boolean", + "tags": [], + "label": "disabled", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrivilegeCollection", + "type": "Class", + "tags": [], + "label": "PrivilegeCollection", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/privilege_collection.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrivilegeCollection.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/privilege_collection.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrivilegeCollection.Unnamed.$1", + "type": "Array", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/privilege_collection.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrivilegeCollection.grantsPrivilege", + "type": "Function", + "tags": [], + "label": "grantsPrivilege", + "description": [], + "signature": [ + "(privilege: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + }, + ") => boolean" + ], + "path": "x-pack/packages/security/role_management_model/src/privilege_collection.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.PrivilegeCollection.grantsPrivilege.$1", + "type": "Object", + "tags": [], + "label": "privilege", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/privilege_collection.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature", + "type": "Class", + "tags": [], + "label": "SecuredFeature", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredFeature", + "text": "SecuredFeature" + }, + " extends ", + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.KibanaFeature", + "text": "KibanaFeature" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.KibanaFeatureConfig", + "text": "KibanaFeatureConfig" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "actionMapping", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.Unnamed.$2.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[privilegeId: string]: string[]", + "description": [], + "signature": [ + "[privilegeId: string]: string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getPrivilegesTooltip", + "type": "Function", + "tags": [], + "label": "getPrivilegesTooltip", + "description": [], + "signature": [ + "() => string | undefined" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getAllPrivileges", + "type": "Function", + "tags": [], + "label": "getAllPrivileges", + "description": [], + "signature": [ + "() => (", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrimaryFeaturePrivilege", + "text": "PrimaryFeaturePrivilege" + }, + " | ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + ")[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getPrimaryFeaturePrivileges", + "type": "Function", + "tags": [], + "label": "getPrimaryFeaturePrivileges", + "description": [], + "signature": [ + "({ includeMinimalFeaturePrivileges }?: { includeMinimalFeaturePrivileges: boolean; }) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrimaryFeaturePrivilege", + "text": "PrimaryFeaturePrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getPrimaryFeaturePrivileges.$1", + "type": "Object", + "tags": [], + "label": "{ includeMinimalFeaturePrivileges }", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getPrimaryFeaturePrivileges.$1.includeMinimalFeaturePrivileges", + "type": "boolean", + "tags": [], + "label": "includeMinimalFeaturePrivileges", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getMinimalFeaturePrivileges", + "type": "Function", + "tags": [], + "label": "getMinimalFeaturePrivileges", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrimaryFeaturePrivilege", + "text": "PrimaryFeaturePrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getSubFeaturePrivileges", + "type": "Function", + "tags": [], + "label": "getSubFeaturePrivileges", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredFeature.getSubFeatures", + "type": "Function", + "tags": [], + "label": "getSubFeatures", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredSubFeature", + "text": "SecuredSubFeature" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature", + "type": "Class", + "tags": [], + "label": "SecuredSubFeature", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredSubFeature", + "text": "SecuredSubFeature" + }, + " extends ", + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.SubFeature", + "text": "SubFeature" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privileges", + "type": "Array", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegesTooltip", + "type": "string", + "tags": [], + "label": "privilegesTooltip", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.SubFeatureConfig", + "text": "SubFeatureConfig" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "actionMapping", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.Unnamed.$2.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[privilegeId: string]: string[]", + "description": [], + "signature": [ + "[privilegeId: string]: string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.getPrivilegeGroups", + "type": "Function", + "tags": [], + "label": "getPrivilegeGroups", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilegeGroup", + "text": "SubFeaturePrivilegeGroup" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegeIterator", + "type": "Function", + "tags": [], + "label": "privilegeIterator", + "description": [], + "signature": [ + "({ predicate, }?: { predicate?: ((privilege: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + ", feature: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredSubFeature", + "text": "SecuredSubFeature" + }, + ") => boolean) | undefined; }) => IterableIterator<", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + ">" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegeIterator.$1", + "type": "Object", + "tags": [], + "label": "{\n predicate = () => true,\n }", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegeIterator.$1.predicate", + "type": "Function", + "tags": [], + "label": "predicate", + "description": [], + "signature": [ + "((privilege: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + ", feature: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredSubFeature", + "text": "SecuredSubFeature" + }, + ") => boolean) | undefined" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegeIterator.$1.predicate.$1", + "type": "Object", + "tags": [], + "label": "privilege", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.privilegeIterator.$1.predicate.$2", + "type": "Object", + "tags": [], + "label": "feature", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SecuredSubFeature", + "text": "SecuredSubFeature" + } + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SecuredSubFeature.getDescription", + "type": "Function", + "tags": [], + "label": "getDescription", + "description": [], + "signature": [ + "() => string" + ], + "path": "x-pack/packages/security/role_management_model/src/secured_sub_feature.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege", + "type": "Class", + "tags": [], + "label": "SubFeaturePrivilege", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + " extends ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "subPrivilegeConfig", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.SubFeaturePrivilegeConfig", + "text": "SubFeaturePrivilegeConfig" + } + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.Unnamed.$2", + "type": "Array", + "tags": [], + "label": "actions", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.disabled", + "type": "CompoundType", + "tags": [], + "label": "disabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilege.requireAllSpaces", + "type": "boolean", + "tags": [], + "label": "requireAllSpaces", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup", + "type": "Class", + "tags": [], + "label": "SubFeaturePrivilegeGroup", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + { + "pluginId": "features", + "scope": "common", + "docId": "kibFeaturesPluginApi", + "section": "def-common.SubFeaturePrivilegeGroupConfig", + "text": "SubFeaturePrivilegeGroupConfig" + } + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "actionMapping", + "description": [], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.Unnamed.$2.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[privilegeId: string]: string[]", + "description": [], + "signature": [ + "[privilegeId: string]: string[]" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.groupType", + "type": "CompoundType", + "tags": [], + "label": "groupType", + "description": [], + "signature": [ + "\"mutually_exclusive\" | \"independent\"" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.SubFeaturePrivilegeGroup.privileges", + "type": "Array", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + "[]" + ], + "path": "x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.isGlobalPrivilegeDefinition", + "type": "Function", + "tags": [], + "label": "isGlobalPrivilegeDefinition", + "description": [ + "\nDetermines if the passed privilege spec defines global privileges." + ], + "signature": [ + "(privilegeSpec: ", + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + }, + ") => boolean" + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-role-management-model", + "id": "def-common.isGlobalPrivilegeDefinition.$1", + "type": "Object", + "tags": [], + "label": "privilegeSpec", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.RoleKibanaPrivilege", + "text": "RoleKibanaPrivilege" + } + ], + "path": "x-pack/packages/security/role_management_model/src/kibana_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_security_role_management_model.mdx b/api_docs/kbn_security_role_management_model.mdx new file mode 100644 index 0000000000000..ffe4ffe18eba6 --- /dev/null +++ b/api_docs/kbn_security_role_management_model.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnSecurityRoleManagementModelPluginApi +slug: /kibana-dev-docs/api/kbn-security-role-management-model +title: "@kbn/security-role-management-model" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/security-role-management-model plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-role-management-model'] +--- +import kbnSecurityRoleManagementModelObj from './kbn_security_role_management_model.devdocs.json'; + + + +Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 75 | 0 | 74 | 0 | + +## Common + +### Functions + + +### Classes + + diff --git a/api_docs/kbn_security_solution_common.devdocs.json b/api_docs/kbn_security_solution_common.devdocs.json new file mode 100644 index 0000000000000..18ebfccd424ad --- /dev/null +++ b/api_docs/kbn_security_solution_common.devdocs.json @@ -0,0 +1,1025 @@ +{ + "id": "@kbn/security-solution-common", + "client": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_CONTENT_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_CONTENT_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_CONTENT_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_LEFT_SECTION_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_HEADER_LEFT_SECTION_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_LEFT_SECTION_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_RIGHT_SECTION_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_HEADER_RIGHT_SECTION_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_RIGHT_SECTION_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_LOADING_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_LOADING_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_LOADING_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID", + "type": "Function", + "tags": [], + "label": "EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.ExpandablePanel", + "type": "Function", + "tags": [], + "label": "ExpandablePanel", + "description": [ + "\nWrapper component that is composed of a header section and a content section.\nThe header can display an icon, a title (that can be a link), and an optional content section on the right.\nThe content section can display a loading spinner, an error message, or any other content.\nThe component can be expanded or collapsed by clicking on the chevron icon on the left of the title." + ], + "signature": [ + "{ ({ header: { title, link, iconType, headerContent }, content: { loading, error }, expand: { expandable, expandedOnFirstRender }, \"data-test-subj\": dataTestSubj, children, }: React.PropsWithChildren>): JSX.Element; displayName: string | undefined; }" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.ExpandablePanel.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n header: { title, link, iconType, headerContent },\n content: { loading, error } = { loading: false, error: false },\n expand: { expandable, expandedOnFirstRender } = {\n expandable: false,\n expandedOnFirstRender: false,\n },\n 'data-test-subj': dataTestSubj,\n children,\n}", + "description": [], + "signature": [ + "React.PropsWithChildren>" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutBody", + "type": "Function", + "tags": [], + "label": "FlyoutBody", + "description": [ + "\nWrapper of `EuiFlyoutBody`, setting the recommended `16px` padding using a EuiPanel." + ], + "signature": [ + "React.FunctionComponent" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_body.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutBody.$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/security-solution-common", + "id": "def-public.FlyoutBody.$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/security-solution-common", + "id": "def-public.FlyoutError", + "type": "Function", + "tags": [], + "label": "FlyoutError", + "description": [ + "\nUse this when you need to show an error state in the flyout" + ], + "signature": [ + "{ (): JSX.Element; displayName: string | undefined; }" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutFooter", + "type": "Function", + "tags": [], + "label": "FlyoutFooter", + "description": [ + "\nWrapper of `EuiFlyoutFooter`, setting the recommended `16px` padding using a EuiPanel." + ], + "signature": [ + "React.FunctionComponent" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_footer.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutFooter.$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/security-solution-common", + "id": "def-public.FlyoutFooter.$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/security-solution-common", + "id": "def-public.FlyoutHeader", + "type": "Function", + "tags": [], + "label": "FlyoutHeader", + "description": [ + "\nWrapper of `EuiFlyoutHeader`, setting the recommended `16px` padding using a EuiPanel." + ], + "signature": [ + "React.FunctionComponent" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutHeader.$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/security-solution-common", + "id": "def-public.FlyoutHeader.$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/security-solution-common", + "id": "def-public.FlyoutHeaderTabs", + "type": "Function", + "tags": [], + "label": "FlyoutHeaderTabs", + "description": [ + "\nWrapper of `EuiTabs`, setting bottom margin to align with the flyout header divider" + ], + "signature": [ + "React.FunctionComponent" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header_tabs.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutHeaderTabs.$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/security-solution-common", + "id": "def-public.FlyoutHeaderTabs.$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/security-solution-common", + "id": "def-public.FlyoutLoading", + "type": "Function", + "tags": [], + "label": "FlyoutLoading", + "description": [ + "\nUse this when you need to show a loading state in the flyout" + ], + "signature": [ + "({ \"data-test-subj\": dataTestSubj, }: React.PropsWithChildren<", + "FlyoutLoadingProps", + ">) => JSX.Element" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutLoading.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n 'data-test-subj': dataTestSubj = FLYOUT_LOADING_TEST_ID,\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "FlyoutLoadingProps", + ">" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutNavigation", + "type": "Function", + "tags": [], + "label": "FlyoutNavigation", + "description": [ + "\nNavigation menu on the right panel only, with expand/collapse button and option to\npass in a list of actions to be displayed on top." + ], + "signature": [ + "React.FunctionComponent<", + "FlyoutNavigationProps", + ">" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutNavigation.$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/security-solution-common", + "id": "def-public.FlyoutNavigation.$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/security-solution-common", + "id": "def-public.FlyoutTitle", + "type": "Function", + "tags": [], + "label": "FlyoutTitle", + "description": [ + "\nTitle component with optional icon to indicate the type of document, can be used for text or a link" + ], + "signature": [ + "React.FunctionComponent<", + "FlyoutTitleProps", + ">" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FlyoutTitle.$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/security-solution-common", + "id": "def-public.FlyoutTitle.$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/security-solution-common", + "id": "def-public.getDiscoverCellRenderer", + "type": "Function", + "tags": [], + "label": "getDiscoverCellRenderer", + "description": [], + "signature": [ + "({ fieldName }: GetRendererArgs) => ", + { + "pluginId": "@kbn/security-solution-common", + "scope": "public", + "docId": "kibKbnSecuritySolutionCommonPluginApi", + "section": "def-public.DiscoverCellRenderer", + "text": "DiscoverCellRenderer" + } + ], + "path": "x-pack/packages/security-solution/common/src/cells/renderers/discover.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.getDiscoverCellRenderer.$1", + "type": "Object", + "tags": [], + "label": "{ fieldName }", + "description": [], + "signature": [ + "GetRendererArgs" + ], + "path": "x-pack/packages/security-solution/common/src/cells/renderers/discover.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HostDetailsButton", + "type": "Function", + "tags": [], + "label": "HostDetailsButton", + "description": [], + "signature": [ + "({ children, onClick, title, }: React.PropsWithChildren) => JSX.Element" + ], + "path": "x-pack/packages/security-solution/common/src/cells/renderers/host/button.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HostDetailsButton.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n onClick,\n title,\n}", + "description": [], + "signature": [ + "React.PropsWithChildren" + ], + "path": "x-pack/packages/security-solution/common/src/cells/renderers/host/button.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HostRightPanel", + "type": "Function", + "tags": [], + "label": "HostRightPanel", + "description": [], + "signature": [ + "(props: ", + "HostRightPanelParamProps", + ") => JSX.Element" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/panels/host/right/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HostRightPanel.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "HostRightPanelParamProps" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/panels/host/right/index.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_HEADER_ICON_TEST_ID", + "type": "Function", + "tags": [], + "label": "TITLE_HEADER_ICON_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_HEADER_ICON_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_HEADER_TEXT_TEST_ID", + "type": "Function", + "tags": [], + "label": "TITLE_HEADER_TEXT_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_HEADER_TEXT_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_LINK_ICON_TEST_ID", + "type": "Function", + "tags": [], + "label": "TITLE_LINK_ICON_TEST_ID", + "description": [], + "signature": [ + "(dataTestSubj: string) => string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.TITLE_LINK_ICON_TEST_ID.$1", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.COLLAPSE_DETAILS_BUTTON_TEST_ID", + "type": "string", + "tags": [], + "label": "COLLAPSE_DETAILS_BUTTON_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutNavigationCollapseDetailButton\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.DiscoverCellRenderer", + "type": "Type", + "tags": [], + "label": "DiscoverCellRenderer", + "description": [], + "signature": [ + "React.ComponentClass, any> | React.FunctionComponent>" + ], + "path": "x-pack/packages/security-solution/common/src/cells/renderers/discover.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.EXPAND_DETAILS_BUTTON_TEST_ID", + "type": "string", + "tags": [], + "label": "EXPAND_DETAILS_BUTTON_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutNavigationExpandDetailButton\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FLYOUT_ERROR_TEST_ID", + "type": "string", + "tags": [], + "label": "FLYOUT_ERROR_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutError\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.FLYOUT_LOADING_TEST_ID", + "type": "string", + "tags": [], + "label": "FLYOUT_LOADING_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutLoading\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HEADER_ACTIONS_TEST_ID", + "type": "string", + "tags": [], + "label": "HEADER_ACTIONS_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutNavigationActions\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.HEADER_NAVIGATION_BUTTON_TEST_ID", + "type": "string", + "tags": [], + "label": "HEADER_NAVIGATION_BUTTON_TEST_ID", + "description": [], + "signature": [ + "\"securitySolutionFlyoutNavigationButton\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-solution-common", + "id": "def-public.PREFIX", + "type": "string", + "tags": [], + "label": "PREFIX", + "description": [], + "signature": [ + "\"securitySolutionFlyout\"" + ], + "path": "x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_security_solution_common.mdx b/api_docs/kbn_security_solution_common.mdx new file mode 100644 index 0000000000000..662dd064bb58d --- /dev/null +++ b/api_docs/kbn_security_solution_common.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnSecuritySolutionCommonPluginApi +slug: /kibana-dev-docs/api/kbn-security-solution-common +title: "@kbn/security-solution-common" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/security-solution-common plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-common'] +--- +import kbnSecuritySolutionCommonObj from './kbn_security_solution_common.devdocs.json'; + + + +Contact [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 59 | 0 | 38 | 5 | + +## Client + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_security_solution_distribution_bar.mdx b/api_docs/kbn_security_solution_distribution_bar.mdx index 6571c64bcf177..2833a865c42f0 100644 --- a/api_docs/kbn_security_solution_distribution_bar.mdx +++ b/api_docs/kbn_security_solution_distribution_bar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-distribution-bar title: "@kbn/security-solution-distribution-bar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-distribution-bar plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-distribution-bar'] --- import kbnSecuritySolutionDistributionBarObj from './kbn_security_solution_distribution_bar.devdocs.json'; diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index ee34f2615387b..dfe2677747d5f 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: 2024-08-14 +date: 2024-08-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 d9cd293372f44..c259e0c5d0630 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: 2024-08-14 +date: 2024-08-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 1f3129ecb1c8d..c99a74eb197a6 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: 2024-08-14 +date: 2024-08-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 916c02489043e..0c9d855ea008c 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: 2024-08-14 +date: 2024-08-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_security_ui_components.devdocs.json b/api_docs/kbn_security_ui_components.devdocs.json new file mode 100644 index 0000000000000..9a0cd5098d114 --- /dev/null +++ b/api_docs/kbn_security_ui_components.devdocs.json @@ -0,0 +1,880 @@ +{ + "id": "@kbn/security-ui-components", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable", + "type": "Class", + "tags": [], + "label": "FeatureTable", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-ui-components", + "scope": "common", + "docId": "kibKbnSecurityUiComponentsPluginApi", + "section": "def-common.FeatureTable", + "text": "FeatureTable" + }, + " extends React.Component" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.defaultProps", + "type": "Object", + "tags": [], + "label": "defaultProps", + "description": [], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.defaultProps.privilegeIndex", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.defaultProps.showLocks", + "type": "boolean", + "tags": [], + "label": "showLocks", + "description": [], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "Props" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTable.render", + "type": "Function", + "tags": [], + "label": "render", + "description": [], + "signature": [ + "() => JSX.Element" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator", + "type": "Class", + "tags": [], + "label": "PrivilegeFormCalculator", + "description": [ + "\nCalculator responsible for determining the displayed and effective privilege values for the following interfaces:\n- and children\n- and children" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "kibanaPrivileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivileges", + "text": "KibanaPrivileges" + } + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "role", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-common", + "scope": "common", + "docId": "kibKbnSecurityPluginTypesCommonPluginApi", + "section": "def-common.Role", + "text": "Role" + } + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getBasePrivilege", + "type": "Function", + "tags": [], + "label": "getBasePrivilege", + "description": [ + "\nReturns the assigned base privilege.\nIf more than one base privilege is assigned, the most permissive privilege will be returned.\nIf no base privileges are assigned, then this will return `undefined`.\n" + ], + "signature": [ + "(privilegeIndex: number) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.KibanaPrivilege", + "text": "KibanaPrivilege" + }, + " | undefined" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getBasePrivilege.$1", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isWildcardBasePrivilege", + "type": "Function", + "tags": [], + "label": "isWildcardBasePrivilege", + "description": [ + "\nReturns true if it is base wildcard (*) privilege.\n" + ], + "signature": [ + "(privilegeIndex: number) => boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isWildcardBasePrivilege.$1", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getDisplayedPrimaryFeaturePrivilegeId", + "type": "Function", + "tags": [], + "label": "getDisplayedPrimaryFeaturePrivilegeId", + "description": [ + "\nReturns the ID of the *displayed* Primary Feature Privilege for the indicated feature and privilege index.\nIf the effective primary feature privilege is a \"minimal\" version, then this returns the corresponding non-minimal version.\n" + ], + "signature": [ + "(featureId: string, privilegeIndex: number, allSpacesSelected: boolean) => string | undefined" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getDisplayedPrimaryFeaturePrivilegeId.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id to get the Primary Feature KibanaPrivilege for." + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getDisplayedPrimaryFeaturePrivilegeId.$2", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getDisplayedPrimaryFeaturePrivilegeId.$3", + "type": "boolean", + "tags": [], + "label": "allSpacesSelected", + "description": [ + "indicates if the privilege form is configured to grant access to all spaces." + ], + "signature": [ + "boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasCustomizedSubFeaturePrivileges", + "type": "Function", + "tags": [], + "label": "hasCustomizedSubFeaturePrivileges", + "description": [ + "\nDetermines if the indicated feature has sub-feature privilege assignments which differ from the \"displayed\" primary feature privilege.\n" + ], + "signature": [ + "(featureId: string, privilegeIndex: number, allSpacesSelected: boolean) => boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasCustomizedSubFeaturePrivileges.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasCustomizedSubFeaturePrivileges.$2", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasCustomizedSubFeaturePrivileges.$3", + "type": "boolean", + "tags": [], + "label": "allSpacesSelected", + "description": [ + "indicates if the privilege form is configured to grant access to all spaces." + ], + "signature": [ + "boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getEffectivePrimaryFeaturePrivilege", + "type": "Function", + "tags": [], + "label": "getEffectivePrimaryFeaturePrivilege", + "description": [ + "\nReturns the most permissive effective Primary Feature KibanaPrivilege, including the minimal versions.\n" + ], + "signature": [ + "(featureId: string, privilegeIndex: number, allSpacesSelected?: boolean | undefined) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.PrimaryFeaturePrivilege", + "text": "PrimaryFeaturePrivilege" + }, + " | undefined" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getEffectivePrimaryFeaturePrivilege.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getEffectivePrimaryFeaturePrivilege.$2", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getEffectivePrimaryFeaturePrivilege.$3", + "type": "CompoundType", + "tags": [], + "label": "allSpacesSelected", + "description": [ + "indicates if the privilege form is configured to grant access to all spaces." + ], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isIndependentSubFeaturePrivilegeGranted", + "type": "Function", + "tags": [], + "label": "isIndependentSubFeaturePrivilegeGranted", + "description": [ + "\nDetermines if the indicated sub-feature privilege is granted.\n" + ], + "signature": [ + "(featureId: string, privilegeId: string, privilegeIndex: number) => boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isIndependentSubFeaturePrivilegeGranted.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isIndependentSubFeaturePrivilegeGranted.$2", + "type": "string", + "tags": [], + "label": "privilegeId", + "description": [ + "the sub feature privilege id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.isIndependentSubFeaturePrivilegeGranted.$3", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getSelectedMutuallyExclusiveSubFeaturePrivilege", + "type": "Function", + "tags": [], + "label": "getSelectedMutuallyExclusiveSubFeaturePrivilege", + "description": [ + "\nReturns the most permissive effective privilege within the indicated mutually-exclusive sub feature privilege group.\n" + ], + "signature": [ + "(featureId: string, subFeatureGroup: ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilegeGroup", + "text": "SubFeaturePrivilegeGroup" + }, + ", privilegeIndex: number) => ", + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilege", + "text": "SubFeaturePrivilege" + }, + " | undefined" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getSelectedMutuallyExclusiveSubFeaturePrivilege.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getSelectedMutuallyExclusiveSubFeaturePrivilege.$2", + "type": "Object", + "tags": [], + "label": "subFeatureGroup", + "description": [ + "the mutually-exclusive sub feature group" + ], + "signature": [ + { + "pluginId": "@kbn/security-role-management-model", + "scope": "common", + "docId": "kibKbnSecurityRoleManagementModelPluginApi", + "section": "def-common.SubFeaturePrivilegeGroup", + "text": "SubFeaturePrivilegeGroup" + } + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.getSelectedMutuallyExclusiveSubFeaturePrivilege.$3", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.canCustomizeSubFeaturePrivileges", + "type": "Function", + "tags": [], + "label": "canCustomizeSubFeaturePrivileges", + "description": [ + "\nDetermines if the indicated feature is capable of having its sub-feature privileges customized.\n" + ], + "signature": [ + "(featureId: string, privilegeIndex: number) => boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.canCustomizeSubFeaturePrivileges.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.canCustomizeSubFeaturePrivileges.$2", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.updateSelectedFeaturePrivilegesForCustomization", + "type": "Function", + "tags": [], + "label": "updateSelectedFeaturePrivilegesForCustomization", + "description": [ + "\nReturns an updated set of feature privileges based on the toggling of the \"Customize sub-feature privileges\" control.\n" + ], + "signature": [ + "(featureId: string, privilegeIndex: number, willBeCustomizing: boolean, allSpacesSelected: boolean) => string[]" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.updateSelectedFeaturePrivilegesForCustomization.$1", + "type": "string", + "tags": [], + "label": "featureId", + "description": [ + "the feature id" + ], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.updateSelectedFeaturePrivilegesForCustomization.$2", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.updateSelectedFeaturePrivilegesForCustomization.$3", + "type": "boolean", + "tags": [], + "label": "willBeCustomizing", + "description": [ + "flag indicating if this feature is about to have its sub-feature privileges customized or not" + ], + "signature": [ + "boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.updateSelectedFeaturePrivilegesForCustomization.$4", + "type": "boolean", + "tags": [], + "label": "allSpacesSelected", + "description": [ + "indicates if the privilege form is configured to grant access to all spaces." + ], + "signature": [ + "boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasSupersededInheritedPrivileges", + "type": "Function", + "tags": [], + "label": "hasSupersededInheritedPrivileges", + "description": [ + "\nDetermines if the indicated privilege entry is less permissive than the configured \"global\" entry for the role." + ], + "signature": [ + "(privilegeIndex: number) => boolean" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.PrivilegeFormCalculator.hasSupersededInheritedPrivileges.$1", + "type": "number", + "tags": [], + "label": "privilegeIndex", + "description": [ + "the index of the kibana privileges role component" + ], + "signature": [ + "number" + ], + "path": "x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTableCell", + "type": "Function", + "tags": [], + "label": "FeatureTableCell", + "description": [], + "signature": [ + "({ feature, className }: Props) => JSX.Element" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-ui-components", + "id": "def-common.FeatureTableCell.$1", + "type": "Object", + "tags": [], + "label": "{ feature, className }", + "description": [], + "signature": [ + "Props" + ], + "path": "x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_security_ui_components.mdx b/api_docs/kbn_security_ui_components.mdx new file mode 100644 index 0000000000000..b7070467e24c4 --- /dev/null +++ b/api_docs/kbn_security_ui_components.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnSecurityUiComponentsPluginApi +slug: /kibana-dev-docs/api/kbn-security-ui-components +title: "@kbn/security-ui-components" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/security-ui-components plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-ui-components'] +--- +import kbnSecurityUiComponentsObj from './kbn_security_ui_components.devdocs.json'; + + + +Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 47 | 0 | 12 | 0 | + +## Common + +### Functions + + +### Classes + + diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index eae4ecc692e76..7e03a18016699 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: 2024-08-14 +date: 2024-08-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 e389ce4bf36af..e7ef6cfe9ce94 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: 2024-08-14 +date: 2024-08-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 3e35d8a1ed095..ce67b54e18ba3 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_securitysolution_es_utils.devdocs.json index 11713763f55f1..e7dcb1d4de62f 100644 --- a/api_docs/kbn_securitysolution_es_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_es_utils.devdocs.json @@ -778,7 +778,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; asyncSearch: ", "default", @@ -810,6 +810,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -868,6 +894,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1462,7 +1490,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1488,7 +1518,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1734,6 +1764,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -2058,7 +2090,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; asyncSearch: ", "default", @@ -2090,6 +2122,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -2148,6 +2206,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -2742,7 +2802,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -2768,7 +2830,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -3014,6 +3076,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 007a3a4d78df0..64ffb880b066e 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json index fa61ae7f0558f..c74cbf9537ed0 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json +++ b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json @@ -851,7 +851,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"path\" | \"code\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"form\" | \"line\" | \"rect\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"path\" | \"form\" | \"line\" | \"rect\" | \"code\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -865,7 +865,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"path\" | \"code\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"form\" | \"line\" | \"rect\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"path\" | \"form\" | \"line\" | \"rect\" | \"code\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -1004,7 +1004,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"path\" | \"code\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"form\" | \"line\" | \"rect\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"path\" | \"form\" | \"line\" | \"rect\" | \"code\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -1018,7 +1018,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"path\" | \"code\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"form\" | \"line\" | \"rect\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"path\" | \"form\" | \"line\" | \"rect\" | \"code\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -1144,7 +1144,7 @@ "label": "showValueListModal", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"path\" | \"code\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"form\" | \"line\" | \"rect\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"q\" | \"body\" | \"html\" | \"stop\" | \"main\" | \"path\" | \"form\" | \"line\" | \"rect\" | \"code\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 54d439d87bf77..61237e7aa1951 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: 2024-08-14 +date: 2024-08-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_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 5198750974cfb..6f1227ed88e75 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: 2024-08-14 +date: 2024-08-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 da8a8fa7a449a..919429ebe2dfa 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: 2024-08-14 +date: 2024-08-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 31670e37a59b0..7e2037ab690a6 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: 2024-08-14 +date: 2024-08-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 1c9d3bdf700d0..5f9c758f86ca6 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: 2024-08-14 +date: 2024-08-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 ff5bf580681bb..29831dd98da6b 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: 2024-08-14 +date: 2024-08-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 a949349d9f995..c00df870cd0b5 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: 2024-08-14 +date: 2024-08-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.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index eac9f4a558a29..d06ae6b05210f 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: 2024-08-14 +date: 2024-08-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 320bcd4c66f04..37a28104dee7e 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: 2024-08-14 +date: 2024-08-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 56d65a8d56103..db3290d407e4d 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: 2024-08-14 +date: 2024-08-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 5044452d0088a..100f05e2ac102 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: 2024-08-14 +date: 2024-08-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 13850320795ab..d5ce15f435685 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: 2024-08-14 +date: 2024-08-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 d11a7928549db..3b704edbc3942 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_server_http_tools.devdocs.json index c5fb8122cb494..241ce4eaf16b7 100644 --- a/api_docs/kbn_server_http_tools.devdocs.json +++ b/api_docs/kbn_server_http_tools.devdocs.json @@ -1268,7 +1268,7 @@ "section": "def-common.Type", "text": "Type" }, - "<\"none\" | \"optional\" | \"required\">; }>" + "<\"none\" | \"required\" | \"optional\">; }>" ], "path": "packages/kbn-server-http-tools/src/ssl/ssl_config.ts", "deprecated": false, diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index aecd39fd64e43..89efb64226fd4 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_server_route_repository.devdocs.json index 131bad8a5f347..68fa7221f6e1c 100644 --- a/api_docs/kbn_server_route_repository.devdocs.json +++ b/api_docs/kbn_server_route_repository.devdocs.json @@ -60,7 +60,7 @@ "label": "decodeRequestParams", "description": [], "signature": [ - "(params: KibanaRequestParams, paramsRt: T) => ", + "(params: Partial<{ path: any; query: any; body: any; }>, paramsRt: T) => ", "OutputOf", "" ], @@ -76,7 +76,7 @@ "label": "params", "description": [], "signature": [ - "KibanaRequestParams" + "Partial<{ path: any; query: any; body: any; }>" ], "path": "packages/kbn-server-route-repository/src/decode_request_params.ts", "deprecated": false, @@ -314,6 +314,39 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/server-route-repository", + "id": "def-server.stripNullishRequestParameters", + "type": "Function", + "tags": [], + "label": "stripNullishRequestParameters", + "description": [], + "signature": [ + "(params: KibanaRequestParams) => Partial<{ path: any; body: any; query: any; }>" + ], + "path": "packages/kbn-server-route-repository/src/strip_nullish_request_parameters.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/server-route-repository", + "id": "def-server.stripNullishRequestParameters.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "KibanaRequestParams" + ], + "path": "packages/kbn-server-route-repository/src/strip_nullish_request_parameters.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [ @@ -528,6 +561,27 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/server-route-repository", + "id": "def-server.IoTsParamsObject", + "type": "Type", + "tags": [], + "label": "IoTsParamsObject", + "description": [], + "signature": [ + "Omit<", + "Type", + "<{ path?: any; query?: any; body?: any; }, { path?: any; query?: any; body?: any; }, unknown>, \"encode\" | \"asEncoder\"> & { encode: ", + "Encode", + "; asEncoder: () => ", + "Encoder", + "; }" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/server-route-repository", "id": "def-server.ReturnOf", @@ -577,13 +631,21 @@ "label": "RouteParamsRT", "description": [], "signature": [ - "Omit<", - "Type", - "<{ path?: any; query?: any; body?: any; }, { path?: any; query?: any; body?: any; }, unknown>, \"encode\" | \"asEncoder\"> & { encode: ", - "Encode", - "; asEncoder: () => ", - "Encoder", - "; }" + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.IoTsParamsObject", + "text": "IoTsParamsObject" + }, + " | ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ZodParamsObject", + "text": "ZodParamsObject" + } ], "path": "packages/kbn-server-route-repository-utils/src/typings.ts", "deprecated": false, @@ -727,77 +789,54 @@ "objects": [ { "parentPluginId": "@kbn/server-route-repository", - "id": "def-server.routeValidationObject", + "id": "def-server.passThroughValidationObject", "type": "Object", "tags": [], - "label": "routeValidationObject", + "label": "passThroughValidationObject", "description": [], - "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", + "path": "packages/kbn-server-route-repository/src/validation_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/server-route-repository", - "id": "def-server.routeValidationObject.body", + "id": "def-server.passThroughValidationObject.body", "type": "Object", "tags": [], "label": "body", - "description": [ - "// `body` can be null, but `validate` expects non-nullable types\n// if any validation is defined. Not having validation currently\n// means we don't get the payload. See\n// https://github.com/elastic/kibana/issues/50179" - ], + "description": [], "signature": [ - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - " | null>" + "Zod.ZodAny" ], - "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", + "path": "packages/kbn-server-route-repository/src/validation_objects.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/server-route-repository", - "id": "def-server.routeValidationObject.params", + "id": "def-server.passThroughValidationObject.params", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.ObjectType", - "text": "ObjectType" - }, - "<{}>" + "Zod.ZodAny" ], - "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", + "path": "packages/kbn-server-route-repository/src/validation_objects.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/server-route-repository", - "id": "def-server.routeValidationObject.query", + "id": "def-server.passThroughValidationObject.query", "type": "Object", "tags": [], "label": "query", "description": [], "signature": [ - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.ObjectType", - "text": "ObjectType" - }, - "<{}>" + "Zod.ZodAny" ], - "path": "packages/kbn-server-route-repository/src/route_validation_object.ts", + "path": "packages/kbn-server-route-repository/src/validation_objects.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index bd3158eb90c7f..37c739b729532 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 35 | 0 | 34 | 0 | +| 38 | 0 | 38 | 0 | ## Server diff --git a/api_docs/kbn_server_route_repository_client.mdx b/api_docs/kbn_server_route_repository_client.mdx index 367bdd85f9549..bc8a03e6c6ffa 100644 --- a/api_docs/kbn_server_route_repository_client.mdx +++ b/api_docs/kbn_server_route_repository_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-client title: "@kbn/server-route-repository-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-client plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-client'] --- import kbnServerRouteRepositoryClientObj from './kbn_server_route_repository_client.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_utils.devdocs.json b/api_docs/kbn_server_route_repository_utils.devdocs.json index b46edcb83eca7..b5c3169828c1a 100644 --- a/api_docs/kbn_server_route_repository_utils.devdocs.json +++ b/api_docs/kbn_server_route_repository_utils.devdocs.json @@ -334,6 +334,27 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/server-route-repository-utils", + "id": "def-common.IoTsParamsObject", + "type": "Type", + "tags": [], + "label": "IoTsParamsObject", + "description": [], + "signature": [ + "Omit<", + "Type", + "<{ path?: any; query?: any; body?: any; }, { path?: any; query?: any; body?: any; }, unknown>, \"encode\" | \"asEncoder\"> & { encode: ", + "Encode", + "; asEncoder: () => ", + "Encoder", + "; }" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/server-route-repository-utils", "id": "def-common.ReturnOf", @@ -383,13 +404,21 @@ "label": "RouteParamsRT", "description": [], "signature": [ - "Omit<", - "Type", - "<{ path?: any; query?: any; body?: any; }, { path?: any; query?: any; body?: any; }, unknown>, \"encode\" | \"asEncoder\"> & { encode: ", - "Encode", - "; asEncoder: () => ", - "Encoder", - "; }" + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.IoTsParamsObject", + "text": "IoTsParamsObject" + }, + " | ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ZodParamsObject", + "text": "ZodParamsObject" + } ], "path": "packages/kbn-server-route-repository-utils/src/typings.ts", "deprecated": false, @@ -558,6 +587,21 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/server-route-repository-utils", + "id": "def-common.ZodParamsObject", + "type": "Type", + "tags": [], + "label": "ZodParamsObject", + "description": [], + "signature": [ + "Zod.ZodObject<{ path?: any; query?: any; body?: any; }, Zod.UnknownKeysParam, Zod.ZodTypeAny, { query?: any; body?: any; path?: any; }, { query?: any; body?: any; path?: any; }>" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_server_route_repository_utils.mdx b/api_docs/kbn_server_route_repository_utils.mdx index dcd94174422f4..d8e21430895e9 100644 --- a/api_docs/kbn_server_route_repository_utils.mdx +++ b/api_docs/kbn_server_route_repository_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-utils title: "@kbn/server-route-repository-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-utils'] --- import kbnServerRouteRepositoryUtilsObj from './kbn_server_route_repository_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 24 | 0 | 24 | 0 | +| 26 | 0 | 26 | 0 | ## Common diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index 3c21b08f5a75c..910aea6d0acb7 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: 2024-08-14 +date: 2024-08-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 fb9b0e392995d..d2a3e713f0254 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: 2024-08-14 +date: 2024-08-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 b950eb5869cc5..59f8a1fa2543a 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: 2024-08-14 +date: 2024-08-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 b95e0c42d5d46..3b4a188a096ad 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: 2024-08-14 +date: 2024-08-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 5413cc31c8f9f..1d623c28cbf9a 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: 2024-08-14 +date: 2024-08-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 6126004bbd438..d0efe18378255 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: 2024-08-14 +date: 2024-08-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 5a8234ff4195a..6c4274c131c79 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: 2024-08-14 +date: 2024-08-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 f5bd1bf883643..28bc0c39a6605 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: 2024-08-14 +date: 2024-08-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_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 604dc3903d1f4..1d8f701bdebc0 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: 2024-08-14 +date: 2024-08-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_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index ddbbd8dbd4f29..2d66642d37ac3 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: 2024-08-14 +date: 2024-08-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 445b6932f3b7e..2dd56b135b4c5 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: 2024-08-14 +date: 2024-08-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 c547be6fe638c..aa9b987e72f98 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_shared_ux_chrome_navigation.devdocs.json index 3b673465c3055..0adc32c67e70c 100644 --- a/api_docs/kbn_shared_ux_chrome_navigation.devdocs.json +++ b/api_docs/kbn_shared_ux_chrome_navigation.devdocs.json @@ -464,7 +464,7 @@ "section": "def-public.ChromeProjectNavigationNode", "text": "ChromeProjectNavigationNode" }, - ", \"id\" | \"children\" | \"path\" | \"sideNavStatus\"> & { title: React.ReactNode; }" + ", \"id\" | \"children\" | \"path\" | \"sideNavStatus\" | \"deepLink\"> & { title: React.ReactNode; }" ], "path": "packages/shared-ux/chrome/navigation/src/ui/components/panel/types.ts", "deprecated": false, diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index ad6c1940a4e21..47c21b54c2e8c 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: 2024-08-14 +date: 2024-08-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_error_boundary.mdx b/api_docs/kbn_shared_ux_error_boundary.mdx index c410601c2af9a..a5168e16b5be1 100644 --- a/api_docs/kbn_shared_ux_error_boundary.mdx +++ b/api_docs/kbn_shared_ux_error_boundary.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-error-boundary title: "@kbn/shared-ux-error-boundary" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-error-boundary plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-error-boundary'] --- import kbnSharedUxErrorBoundaryObj from './kbn_shared_ux_error_boundary.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index 7a7e485a3d3e8..c61c717657bd2 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: 2024-08-14 +date: 2024-08-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 2faac2f5355b4..4a0a27cccc824 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: 2024-08-14 +date: 2024-08-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 d14acd773cb07..c3d7458252ee6 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: 2024-08-14 +date: 2024-08-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 547810f95b1b8..907696ae66f8f 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: 2024-08-14 +date: 2024-08-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 fd1c431ae821f..6718522037261 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: 2024-08-14 +date: 2024-08-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 82a4e0f413f5c..7e2bb41331112 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: 2024-08-14 +date: 2024-08-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 1529a702dfc45..82fc89af90a54 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: 2024-08-14 +date: 2024-08-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 41a43c334db45..61d0288b5328d 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: 2024-08-14 +date: 2024-08-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 de87c62815d23..d7f4205a22426 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: 2024-08-14 +date: 2024-08-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 c55c977414d1c..38c81d78d3878 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: 2024-08-14 +date: 2024-08-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 f5aaadf4f1cb1..fcf77a278339a 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: 2024-08-14 +date: 2024-08-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 dff807049fe54..4abbe8d05da72 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: 2024-08-14 +date: 2024-08-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 25bbf954cc7af..5709a2d7c0def 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: 2024-08-14 +date: 2024-08-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 e1f24c9024c45..ba5dc6db47fc0 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: 2024-08-14 +date: 2024-08-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 35ad45b95954d..8941a26a324d7 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: 2024-08-14 +date: 2024-08-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 2bcb3c16995c7..4b1c23b93a08e 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: 2024-08-14 +date: 2024-08-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 49288419edce5..3510e566a2386 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: 2024-08-14 +date: 2024-08-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 0102c137a72bd..c9e83d2f769e0 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: 2024-08-14 +date: 2024-08-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 10c189c22ceae..5698e15842920 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: 2024-08-14 +date: 2024-08-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 f4149f6bc3679..a808ca5dce15f 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: 2024-08-14 +date: 2024-08-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 4509b07dd2fc5..1ea8b0b0c2098 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: 2024-08-14 +date: 2024-08-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 65b15a063534e..09e617adeaeca 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: 2024-08-14 +date: 2024-08-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 cee4d8d8850ba..237312a0443c9 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: 2024-08-14 +date: 2024-08-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 08b8715810d6f..a08a7442e1267 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: 2024-08-14 +date: 2024-08-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 1938287553b7c..6d3e8095360a0 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: 2024-08-14 +date: 2024-08-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 dade6465124b4..f43bc4073d4e7 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: 2024-08-14 +date: 2024-08-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 79d3ecd074d85..1805977c0c728 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: 2024-08-14 +date: 2024-08-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 43603b3020bc0..9d3af376a71c4 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: 2024-08-14 +date: 2024-08-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 3414102617bff..13be50b5d42b9 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: 2024-08-14 +date: 2024-08-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 7e2618ee417ec..76049bbe16b05 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: 2024-08-14 +date: 2024-08-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_tabbed_modal.mdx b/api_docs/kbn_shared_ux_tabbed_modal.mdx index dbaddea46e649..91d15cb263b88 100644 --- a/api_docs/kbn_shared_ux_tabbed_modal.mdx +++ b/api_docs/kbn_shared_ux_tabbed_modal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-tabbed-modal title: "@kbn/shared-ux-tabbed-modal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-tabbed-modal plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-tabbed-modal'] --- import kbnSharedUxTabbedModalObj from './kbn_shared_ux_tabbed_modal.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_table_persist.devdocs.json b/api_docs/kbn_shared_ux_table_persist.devdocs.json new file mode 100644 index 0000000000000..470b02bafd6c9 --- /dev/null +++ b/api_docs/kbn_shared_ux_table_persist.devdocs.json @@ -0,0 +1,86 @@ +{ + "id": "@kbn/shared-ux-table-persist", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-table-persist", + "id": "def-common.useEuiTablePersist", + "type": "Function", + "tags": [], + "label": "useEuiTablePersist", + "description": [ + "\nA hook that stores and retrieves from local storage the table page size and sort criteria.\nReturns the persisting page size and sort and the onTableChange handler that should be passed\nas props to an Eui table component." + ], + "signature": [ + "({ tableId, customOnTableChange, initialSort, initialPageSize, pageSizeOptions, }: ", + "EuiTablePersistProps", + ") => { pageSize: number; sorting: boolean | { sort: ", + "PropertySort", + "; }; onTableChange: (nextValues: ", + "Criteria", + ") => void; }" + ], + "path": "packages/shared-ux/table_persist/src/use_table_persist.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-table-persist", + "id": "def-common.useEuiTablePersist.$1", + "type": "Object", + "tags": [], + "label": "{\n tableId,\n customOnTableChange,\n initialSort,\n initialPageSize,\n pageSizeOptions,\n}", + "description": [], + "signature": [ + "EuiTablePersistProps", + "" + ], + "path": "packages/shared-ux/table_persist/src/use_table_persist.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-table-persist", + "id": "def-common.DEFAULT_PAGE_SIZE_OPTIONS", + "type": "Array", + "tags": [], + "label": "DEFAULT_PAGE_SIZE_OPTIONS", + "description": [], + "signature": [ + "number[]" + ], + "path": "packages/shared-ux/table_persist/src/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_table_persist.mdx b/api_docs/kbn_shared_ux_table_persist.mdx new file mode 100644 index 0000000000000..5be2f5ee7f539 --- /dev/null +++ b/api_docs/kbn_shared_ux_table_persist.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This 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: kibKbnSharedUxTablePersistPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-table-persist +title: "@kbn/shared-ux-table-persist" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-table-persist plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-table-persist'] +--- +import kbnSharedUxTablePersistObj from './kbn_shared_ux_table_persist.devdocs.json'; + + + +Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3 | 0 | 2 | 2 | + +## Common + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 83e4497c39588..c402df512a212 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: 2024-08-14 +date: 2024-08-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 b30eea970a3a7..ab99cb5ae6400 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: 2024-08-14 +date: 2024-08-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 ef9177554746f..b32d746d8b468 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: 2024-08-14 +date: 2024-08-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_sort_predicates.mdx b/api_docs/kbn_sort_predicates.mdx index 4d40daae012e4..6884bc4e90033 100644 --- a/api_docs/kbn_sort_predicates.mdx +++ b/api_docs/kbn_sort_predicates.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-predicates title: "@kbn/sort-predicates" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-predicates plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-predicates'] --- import kbnSortPredicatesObj from './kbn_sort_predicates.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 0c95c06505a61..b45c8eb5da0ea 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: 2024-08-14 +date: 2024-08-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 b0eece95b5e75..6e674db183b6d 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: 2024-08-14 +date: 2024-08-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 40e60ce87e3b0..c208d67b3da9d 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_synthetics_e2e.mdx b/api_docs/kbn_synthetics_e2e.mdx index 3a96a8463870d..a1d83d0ac7773 100644 --- a/api_docs/kbn_synthetics_e2e.mdx +++ b/api_docs/kbn_synthetics_e2e.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-e2e title: "@kbn/synthetics-e2e" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-e2e plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-e2e'] --- import kbnSyntheticsE2eObj from './kbn_synthetics_e2e.devdocs.json'; diff --git a/api_docs/kbn_synthetics_private_location.mdx b/api_docs/kbn_synthetics_private_location.mdx index a50e0035b3a2d..7d1e9327fc8f3 100644 --- a/api_docs/kbn_synthetics_private_location.mdx +++ b/api_docs/kbn_synthetics_private_location.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-private-location title: "@kbn/synthetics-private-location" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-private-location plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-private-location'] --- import kbnSyntheticsPrivateLocationObj from './kbn_synthetics_private_location.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 8201490daab9b..44c0386215ad4 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: 2024-08-14 +date: 2024-08-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 d46b9c99fa4a0..09237dab27985 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_eui_helpers.mdx b/api_docs/kbn_test_eui_helpers.mdx index ee180469a7915..a232c83c23c3e 100644 --- a/api_docs/kbn_test_eui_helpers.mdx +++ b/api_docs/kbn_test_eui_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-eui-helpers title: "@kbn/test-eui-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-eui-helpers plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-eui-helpers'] --- import kbnTestEuiHelpersObj from './kbn_test_eui_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 6a126af88e462..ff889ca1c4282 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: 2024-08-14 +date: 2024-08-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 df25e09fcb9e9..69d04133cc166 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: 2024-08-14 +date: 2024-08-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 e8ef0b0b9ebd1..8adf93ce1c8de 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: 2024-08-14 +date: 2024-08-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_timerange.mdx b/api_docs/kbn_timerange.mdx index b5ce959a3d15c..652463023f2c9 100644 --- a/api_docs/kbn_timerange.mdx +++ b/api_docs/kbn_timerange.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-timerange title: "@kbn/timerange" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/timerange plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/timerange'] --- import kbnTimerangeObj from './kbn_timerange.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.devdocs.json b/api_docs/kbn_tooling_log.devdocs.json index 14df922644371..6321db886076e 100644 --- a/api_docs/kbn_tooling_log.devdocs.json +++ b/api_docs/kbn_tooling_log.devdocs.json @@ -620,7 +620,7 @@ "tags": [], "label": "write", "description": [ - "\nCalled by ToolingLog, extends messages with the source if message includes one." + "\nCalled by ToolingLog, extends messages with the source and context if message include it." ], "signature": [ "(msg: ", @@ -1086,6 +1086,22 @@ "path": "packages/kbn-tooling-log/src/message.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/tooling-log", + "id": "def-common.Message.context", + "type": "string", + "tags": [], + "label": "context", + "description": [ + "an identifier of the logging entity" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-tooling-log/src/message.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -1139,6 +1155,22 @@ "path": "packages/kbn-tooling-log/src/tooling_log.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/tooling-log", + "id": "def-common.ToolingLogOptions.context", + "type": "string", + "tags": [], + "label": "context", + "description": [ + "\nA string, conveniently the name of the script,\nthat will be prepended to log messages.\nCan be useful to identify which entity is emitting the log." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-tooling-log/src/tooling_log.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index dcfdadd00e949..3e9c62350d69a 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.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 | |-------------------|-----------|------------------------|-----------------| -| 72 | 0 | 55 | 0 | +| 74 | 0 | 55 | 0 | ## Common diff --git a/api_docs/kbn_triggers_actions_ui_types.mdx b/api_docs/kbn_triggers_actions_ui_types.mdx index ce8ae069f7bda..eb871fb22f174 100644 --- a/api_docs/kbn_triggers_actions_ui_types.mdx +++ b/api_docs/kbn_triggers_actions_ui_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-triggers-actions-ui-types title: "@kbn/triggers-actions-ui-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/triggers-actions-ui-types plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/triggers-actions-ui-types'] --- import kbnTriggersActionsUiTypesObj from './kbn_triggers_actions_ui_types.devdocs.json'; diff --git a/api_docs/kbn_try_in_console.mdx b/api_docs/kbn_try_in_console.mdx index 6996d6da824d4..a04cf5d0c7bdc 100644 --- a/api_docs/kbn_try_in_console.mdx +++ b/api_docs/kbn_try_in_console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-try-in-console title: "@kbn/try-in-console" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/try-in-console plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/try-in-console'] --- import kbnTryInConsoleObj from './kbn_try_in_console.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index 479cff0639d1b..1ab1f2f1a6cf8 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: 2024-08-14 +date: 2024-08-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 488609f209637..39df983a6be2c 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: 2024-08-14 +date: 2024-08-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 bcbf28259756a..54fb7d2c63897 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: 2024-08-14 +date: 2024-08-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 e430073b32f3a..57c70570bee78 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: 2024-08-14 +date: 2024-08-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 5fba11cd6a188..fb8c5cd2c51a6 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_unified_data_table.devdocs.json index 00dea271a943c..ff7fcf52ad553 100644 --- a/api_docs/kbn_unified_data_table.devdocs.json +++ b/api_docs/kbn_unified_data_table.devdocs.json @@ -508,7 +508,7 @@ "label": "UnifiedDataTable", "description": [], "signature": [ - "({ ariaLabelledBy, columns, columnsMeta, showColumnTokens, configHeaderRowHeight, headerRowHeightState, onUpdateHeaderRowHeight, controlColumnIds, rowAdditionalLeadingControls, dataView, loadingState, onFilter, onResize, onSetColumns, onSort, rows, searchDescription, searchTitle, settings, showTimeCol, showFullScreenButton, sort, useNewFieldsApi, isSortEnabled, isPaginationEnabled, cellActionsTriggerId, className, rowHeightState, onUpdateRowHeight, maxAllowedSampleSize, sampleSizeState, onUpdateSampleSize, isPlainRecord, rowsPerPageState, onUpdateRowsPerPage, onFieldEdited, services, renderCustomGridBody, renderCustomToolbar, externalControlColumns, trailingControlColumns, totalHits, onFetchMoreRecords, renderDocumentView, setExpandedDoc, expandedDoc, configRowHeight, showMultiFields, maxDocFieldsDisplayed, externalAdditionalControls, rowsPerPageOptions, visibleCellActions, externalCustomRenderers, additionalFieldGroups, consumer, componentsTourSteps, gridStyleOverride, rowLineHeightOverride, cellActionsMetadata, customGridColumnsConfiguration, enableComparisonMode, cellContext, renderCellPopover, getRowIndicator, }: ", + "({ ariaLabelledBy, columns, columnsMeta, showColumnTokens, configHeaderRowHeight, headerRowHeightState, onUpdateHeaderRowHeight, controlColumnIds, rowAdditionalLeadingControls, dataView, loadingState, onFilter, onResize, onSetColumns, onSort, rows, searchDescription, searchTitle, settings, showTimeCol, showFullScreenButton, sort, useNewFieldsApi, isSortEnabled, isPaginationEnabled, cellActionsTriggerId, className, rowHeightState, onUpdateRowHeight, maxAllowedSampleSize, sampleSizeState, onUpdateSampleSize, isPlainRecord, rowsPerPageState, onUpdateRowsPerPage, onFieldEdited, services, renderCustomGridBody, renderCustomToolbar, externalControlColumns, trailingControlColumns, totalHits, onFetchMoreRecords, renderDocumentView, setExpandedDoc, expandedDoc, configRowHeight, showMultiFields, maxDocFieldsDisplayed, externalAdditionalControls, rowsPerPageOptions, visibleCellActions, externalCustomRenderers, additionalFieldGroups, consumer, componentsTourSteps, gridStyleOverride, rowLineHeightOverride, cellActionsMetadata, customGridColumnsConfiguration, enableComparisonMode, cellContext, renderCellPopover, getRowIndicator, dataGridDensityState, onUpdateDataGridDensity, }: ", { "pluginId": "@kbn/unified-data-table", "scope": "public", @@ -527,7 +527,7 @@ "id": "def-public.UnifiedDataTable.$1", "type": "Object", "tags": [], - "label": "{\n ariaLabelledBy,\n columns,\n columnsMeta,\n showColumnTokens,\n configHeaderRowHeight,\n headerRowHeightState,\n onUpdateHeaderRowHeight,\n controlColumnIds = CONTROL_COLUMN_IDS_DEFAULT,\n rowAdditionalLeadingControls,\n dataView,\n loadingState,\n onFilter,\n onResize,\n onSetColumns,\n onSort,\n rows,\n searchDescription,\n searchTitle,\n settings,\n showTimeCol,\n showFullScreenButton = true,\n sort,\n useNewFieldsApi,\n isSortEnabled = true,\n isPaginationEnabled = true,\n cellActionsTriggerId,\n className,\n rowHeightState,\n onUpdateRowHeight,\n maxAllowedSampleSize,\n sampleSizeState,\n onUpdateSampleSize,\n isPlainRecord = false,\n rowsPerPageState,\n onUpdateRowsPerPage,\n onFieldEdited,\n services,\n renderCustomGridBody,\n renderCustomToolbar,\n externalControlColumns, // TODO: deprecate in favor of rowAdditionalLeadingControls\n trailingControlColumns, // TODO: deprecate in favor of rowAdditionalLeadingControls\n totalHits,\n onFetchMoreRecords,\n renderDocumentView,\n setExpandedDoc,\n expandedDoc,\n configRowHeight,\n showMultiFields = true,\n maxDocFieldsDisplayed = 50,\n externalAdditionalControls,\n rowsPerPageOptions,\n visibleCellActions,\n externalCustomRenderers,\n additionalFieldGroups,\n consumer = 'discover',\n componentsTourSteps,\n gridStyleOverride,\n rowLineHeightOverride,\n cellActionsMetadata,\n customGridColumnsConfiguration,\n enableComparisonMode,\n cellContext,\n renderCellPopover,\n getRowIndicator,\n}", + "label": "{\n ariaLabelledBy,\n columns,\n columnsMeta,\n showColumnTokens,\n configHeaderRowHeight,\n headerRowHeightState,\n onUpdateHeaderRowHeight,\n controlColumnIds = CONTROL_COLUMN_IDS_DEFAULT,\n rowAdditionalLeadingControls,\n dataView,\n loadingState,\n onFilter,\n onResize,\n onSetColumns,\n onSort,\n rows,\n searchDescription,\n searchTitle,\n settings,\n showTimeCol,\n showFullScreenButton = true,\n sort,\n useNewFieldsApi,\n isSortEnabled = true,\n isPaginationEnabled = true,\n cellActionsTriggerId,\n className,\n rowHeightState,\n onUpdateRowHeight,\n maxAllowedSampleSize,\n sampleSizeState,\n onUpdateSampleSize,\n isPlainRecord = false,\n rowsPerPageState,\n onUpdateRowsPerPage,\n onFieldEdited,\n services,\n renderCustomGridBody,\n renderCustomToolbar,\n externalControlColumns, // TODO: deprecate in favor of rowAdditionalLeadingControls\n trailingControlColumns, // TODO: deprecate in favor of rowAdditionalLeadingControls\n totalHits,\n onFetchMoreRecords,\n renderDocumentView,\n setExpandedDoc,\n expandedDoc,\n configRowHeight,\n showMultiFields = true,\n maxDocFieldsDisplayed = 50,\n externalAdditionalControls,\n rowsPerPageOptions,\n visibleCellActions,\n externalCustomRenderers,\n additionalFieldGroups,\n consumer = 'discover',\n componentsTourSteps,\n gridStyleOverride,\n rowLineHeightOverride,\n cellActionsMetadata,\n customGridColumnsConfiguration,\n enableComparisonMode,\n cellContext,\n renderCellPopover,\n getRowIndicator,\n dataGridDensityState,\n onUpdateDataGridDensity,\n}", "description": [], "signature": [ { @@ -555,7 +555,15 @@ "label": "useColumns", "description": [], "signature": [ - "({ capabilities, dataView, dataViews, setAppState, useNewFieldsApi, columns, sort, defaultOrder, }: UseColumnsProps) => { columns: string[]; onAddColumn: (columnName: string) => void; onRemoveColumn: (columnName: string) => void; onMoveColumn: (columnName: string, newIndex: number) => void; onSetColumns: (nextColumns: string[], hideTimeColumn: boolean) => void; }" + "({ capabilities, dataView, dataViews, setAppState, useNewFieldsApi, columns, sort, defaultOrder, settings, }: ", + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.UseColumnsProps", + "text": "UseColumnsProps" + }, + ") => { columns: string[]; onAddColumn: (columnName: string) => void; onRemoveColumn: (columnName: string) => void; onMoveColumn: (columnName: string, newIndex: number) => void; onSetColumns: (nextColumns: string[], hideTimeColumn: boolean) => void; }" ], "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", "deprecated": false, @@ -566,10 +574,16 @@ "id": "def-public.useColumns.$1", "type": "Object", "tags": [], - "label": "{\n capabilities,\n dataView,\n dataViews,\n setAppState,\n useNewFieldsApi,\n columns,\n sort,\n defaultOrder = 'desc',\n}", + "label": "{\n capabilities,\n dataView,\n dataViews,\n setAppState,\n useNewFieldsApi,\n columns,\n sort,\n defaultOrder = 'desc',\n settings,\n}", "description": [], "signature": [ - "UseColumnsProps" + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.UseColumnsProps", + "text": "UseColumnsProps" + } ], "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", "deprecated": false, @@ -1314,10 +1328,10 @@ "tags": [], "label": "onResize", "description": [ - "\nFunction triggered when a column is resized by the user" + "\nFunction triggered when a column is resized by the user, passes `undefined` for auto-width" ], "signature": [ - "((colSettings: { columnId: string; width: number; }) => void) | undefined" + "((colSettings: { columnId: string; width: number | undefined; }) => void) | undefined" ], "path": "packages/kbn-unified-data-table/src/components/data_table.tsx", "deprecated": false, @@ -1352,6 +1366,9 @@ "tags": [], "label": "width", "description": [], + "signature": [ + "number | undefined" + ], "path": "packages/kbn-unified-data-table/src/components/data_table.tsx", "deprecated": false, "trackAdoption": false @@ -1750,6 +1767,77 @@ ], "returnComment": [] }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UnifiedDataTableProps.dataGridDensityState", + "type": "CompoundType", + "tags": [], + "label": "dataGridDensityState", + "description": [ + "\nDensity from state" + ], + "signature": [ + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.DataGridDensity", + "text": "DataGridDensity" + }, + " | undefined" + ], + "path": "packages/kbn-unified-data-table/src/components/data_table.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UnifiedDataTableProps.onUpdateDataGridDensity", + "type": "Function", + "tags": [], + "label": "onUpdateDataGridDensity", + "description": [ + "\nCallback when the data grid density configuration is modified" + ], + "signature": [ + "((dataGridDensity: ", + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.DataGridDensity", + "text": "DataGridDensity" + }, + ") => void) | undefined" + ], + "path": "packages/kbn-unified-data-table/src/components/data_table.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UnifiedDataTableProps.onUpdateDataGridDensity.$1", + "type": "Enum", + "tags": [], + "label": "dataGridDensity", + "description": [], + "signature": [ + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.DataGridDensity", + "text": "DataGridDensity" + } + ], + "path": "packages/kbn-unified-data-table/src/components/data_table.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "@kbn/unified-data-table", "id": "def-public.UnifiedDataTableProps.isPlainRecord", @@ -2712,9 +2800,256 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps", + "type": "Interface", + "tags": [], + "label": "UseColumnsProps", + "description": [], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.capabilities", + "type": "Object", + "tags": [], + "label": "capabilities", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.dataView", + "type": "Object", + "tags": [], + "label": "dataView", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + } + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.dataViews", + "type": "Object", + "tags": [], + "label": "dataViews", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "public", + "docId": "kibDataViewsPluginApi", + "section": "def-public.DataViewsServicePublic", + "text": "DataViewsServicePublic" + } + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.useNewFieldsApi", + "type": "boolean", + "tags": [], + "label": "useNewFieldsApi", + "description": [], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.setAppState", + "type": "Function", + "tags": [], + "label": "setAppState", + "description": [], + "signature": [ + "(state: { columns: string[]; sort?: string[][] | undefined; settings?: ", + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.UnifiedDataTableSettings", + "text": "UnifiedDataTableSettings" + }, + " | undefined; }) => void" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.setAppState.$1", + "type": "Object", + "tags": [], + "label": "state", + "description": [], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.setAppState.$1.columns", + "type": "Array", + "tags": [], + "label": "columns", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.setAppState.$1.sort", + "type": "Array", + "tags": [], + "label": "sort", + "description": [], + "signature": [ + "string[][] | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.setAppState.$1.settings", + "type": "Object", + "tags": [], + "label": "settings", + "description": [], + "signature": [ + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.UnifiedDataTableSettings", + "text": "UnifiedDataTableSettings" + }, + " | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.columns", + "type": "Array", + "tags": [], + "label": "columns", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.sort", + "type": "Array", + "tags": [], + "label": "sort", + "description": [], + "signature": [ + "string[][] | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.defaultOrder", + "type": "string", + "tags": [], + "label": "defaultOrder", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.UseColumnsProps.settings", + "type": "Object", + "tags": [], + "label": "settings", + "description": [], + "signature": [ + { + "pluginId": "@kbn/unified-data-table", + "scope": "public", + "docId": "kibKbnUnifiedDataTablePluginApi", + "section": "def-public.UnifiedDataTableSettings", + "text": "UnifiedDataTableSettings" + }, + " | undefined" + ], + "path": "packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [ + { + "parentPluginId": "@kbn/unified-data-table", + "id": "def-public.DataGridDensity", + "type": "Enum", + "tags": [], + "label": "DataGridDensity", + "description": [], + "path": "packages/kbn-unified-data-table/src/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/unified-data-table", "id": "def-public.DataLoadingState", @@ -2810,7 +3145,7 @@ "section": "def-public.FieldFormatsStart", "text": "FieldFormatsStart" }, - "; closePopover: () => void; }" + "; closePopover: () => void; isCompressed?: boolean | undefined; }" ], "path": "packages/kbn-unified-data-table/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index 2f03a453e9863..453cec4ce38f6 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.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 | |-------------------|-----------|------------------------|-----------------| -| 166 | 0 | 92 | 2 | +| 184 | 0 | 108 | 2 | ## Client diff --git a/api_docs/kbn_unified_doc_viewer.devdocs.json b/api_docs/kbn_unified_doc_viewer.devdocs.json index 62463520b7db6..784e80f8d5615 100644 --- a/api_docs/kbn_unified_doc_viewer.devdocs.json +++ b/api_docs/kbn_unified_doc_viewer.devdocs.json @@ -295,7 +295,7 @@ "label": "FieldName", "description": [], "signature": [ - "({\n fieldName,\n fieldMapping,\n fieldType,\n fieldIconProps,\n scripted = false,\n highlight = '',\n isPinned = false,\n}: Props) => JSX.Element" + "({\n fieldName,\n fieldMapping,\n fieldType,\n fieldIconProps,\n scripted = false,\n highlight = '',\n}: Props) => JSX.Element" ], "path": "packages/kbn-unified-doc-viewer/src/components/field_name/field_name.tsx", "deprecated": false, @@ -306,7 +306,7 @@ "id": "def-common.FieldName.$1", "type": "Object", "tags": [], - "label": "{\n fieldName,\n fieldMapping,\n fieldType,\n fieldIconProps,\n scripted = false,\n highlight = '',\n isPinned = false,\n}", + "label": "{\n fieldName,\n fieldMapping,\n fieldType,\n fieldIconProps,\n scripted = false,\n highlight = '',\n}", "description": [], "signature": [ "Props" diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index be355c4d7ebc8..c0327ab3db776 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: 2024-08-14 +date: 2024-08-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 227f77886c449..eb4d919965710 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: 2024-08-14 +date: 2024-08-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_unsaved_changes_badge.mdx b/api_docs/kbn_unsaved_changes_badge.mdx index b0e5406061318..5b0052e81fa67 100644 --- a/api_docs/kbn_unsaved_changes_badge.mdx +++ b/api_docs/kbn_unsaved_changes_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-badge title: "@kbn/unsaved-changes-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-badge plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-badge'] --- import kbnUnsavedChangesBadgeObj from './kbn_unsaved_changes_badge.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_prompt.mdx b/api_docs/kbn_unsaved_changes_prompt.mdx index 2378098486b8e..4f22b51f9cb4f 100644 --- a/api_docs/kbn_unsaved_changes_prompt.mdx +++ b/api_docs/kbn_unsaved_changes_prompt.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-prompt title: "@kbn/unsaved-changes-prompt" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-prompt plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-prompt'] --- import kbnUnsavedChangesPromptObj from './kbn_unsaved_changes_prompt.devdocs.json'; diff --git a/api_docs/kbn_use_tracked_promise.mdx b/api_docs/kbn_use_tracked_promise.mdx index dbf104ca4f1b2..ef237a66a07a3 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: 2024-08-14 +date: 2024-08-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 15c44c7eda717..cc11e11bd9702 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: 2024-08-14 +date: 2024-08-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 8f32fdcd05009..3f62d6b90f2d1 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: 2024-08-14 +date: 2024-08-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 41d75d44fc2c0..a7630001fbdbe 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_utils.devdocs.json index f7fff669338a0..9ce76bbc13e33 100644 --- a/api_docs/kbn_utils.devdocs.json +++ b/api_docs/kbn_utils.devdocs.json @@ -9,19 +9,11 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders", + "id": "def-server.concatStreamProviders", "type": "Function", "tags": [ "return" @@ -44,7 +36,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders.$1", + "id": "def-server.concatStreamProviders.$1", "type": "Array", "tags": [], "label": "sourceProviders", @@ -61,7 +53,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders.$2", + "id": "def-server.concatStreamProviders.$2", "type": "Object", "tags": [], "label": "options", @@ -85,7 +77,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createConcatStream", + "id": "def-server.createConcatStream", "type": "Function", "tags": [ "return" @@ -104,7 +96,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createConcatStream.$1", + "id": "def-server.createConcatStream.$1", "type": "Uncategorized", "tags": [], "label": "initial", @@ -125,7 +117,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createFilterStream", + "id": "def-server.createFilterStream", "type": "Function", "tags": [], "label": "createFilterStream", @@ -140,7 +132,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createFilterStream.$1", + "id": "def-server.createFilterStream.$1", "type": "Function", "tags": [], "label": "fn", @@ -159,7 +151,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createIntersperseStream", + "id": "def-server.createIntersperseStream", "type": "Function", "tags": [ "return" @@ -178,7 +170,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createIntersperseStream.$1", + "id": "def-server.createIntersperseStream.$1", "type": "CompoundType", "tags": [], "label": "intersperseChunk", @@ -197,7 +189,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createListStream", + "id": "def-server.createListStream", "type": "Function", "tags": [ "return" @@ -216,7 +208,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createListStream.$1", + "id": "def-server.createListStream.$1", "type": "CompoundType", "tags": [], "label": "items", @@ -237,7 +229,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createMapStream", + "id": "def-server.createMapStream", "type": "Function", "tags": [], "label": "createMapStream", @@ -252,7 +244,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createMapStream.$1", + "id": "def-server.createMapStream.$1", "type": "Function", "tags": [], "label": "fn", @@ -271,7 +263,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createPromiseFromStreams", + "id": "def-server.createPromiseFromStreams", "type": "Function", "tags": [], "label": "createPromiseFromStreams", @@ -289,7 +281,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createPromiseFromStreams.$1", + "id": "def-server.createPromiseFromStreams.$1", "type": "Object", "tags": [], "label": "streams", @@ -312,7 +304,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream", + "id": "def-server.createReduceStream", "type": "Function", "tags": [ "return" @@ -331,7 +323,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream.$1", + "id": "def-server.createReduceStream.$1", "type": "Function", "tags": [], "label": "reducer", @@ -346,7 +338,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream.$2", + "id": "def-server.createReduceStream.$2", "type": "Uncategorized", "tags": [], "label": "initial", @@ -367,7 +359,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream", + "id": "def-server.createReplaceStream", "type": "Function", "tags": [], "label": "createReplaceStream", @@ -382,7 +374,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream.$1", + "id": "def-server.createReplaceStream.$1", "type": "string", "tags": [], "label": "toReplace", @@ -397,7 +389,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream.$2", + "id": "def-server.createReplaceStream.$2", "type": "CompoundType", "tags": [], "label": "replacement", @@ -416,7 +408,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createSplitStream", + "id": "def-server.createSplitStream", "type": "Function", "tags": [ "return" @@ -435,7 +427,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createSplitStream.$1", + "id": "def-server.createSplitStream.$1", "type": "CompoundType", "tags": [], "label": "splitChunk", @@ -454,7 +446,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.prettyPrintAndSortKeys", + "id": "def-server.prettyPrintAndSortKeys", "type": "Function", "tags": [], "label": "prettyPrintAndSortKeys", @@ -470,7 +462,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.prettyPrintAndSortKeys.$1", + "id": "def-server.prettyPrintAndSortKeys.$1", "type": "Uncategorized", "tags": [], "label": "object", @@ -493,7 +485,7 @@ "misc": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.PathConfigType", + "id": "def-server.PathConfigType", "type": "Type", "tags": [], "label": "PathConfigType", @@ -508,5 +500,13 @@ } ], "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index fcdab6709e0dd..75b3510c24715 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; @@ -23,11 +23,11 @@ Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kiban |-------------------|-----------|------------------------|-----------------| | 26 | 0 | 15 | 0 | -## Common +## Server ### Functions - + ### Consts, variables and types - + diff --git a/api_docs/kbn_visualization_ui_components.devdocs.json b/api_docs/kbn_visualization_ui_components.devdocs.json index 0ef41a076c1a0..684cd55d3dfae 100644 --- a/api_docs/kbn_visualization_ui_components.devdocs.json +++ b/api_docs/kbn_visualization_ui_components.devdocs.json @@ -47,7 +47,15 @@ "label": "ColorPicker", "description": [], "signature": [ - "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, }: { overwriteColor?: string | null | undefined; defaultColor?: string | null | undefined; isClearable?: boolean | undefined; setConfig: (config: { color?: string | undefined; }) => void; label?: string | undefined; disableHelpTooltip?: boolean | undefined; disabledMessage?: string | undefined; showAlpha?: boolean | undefined; }) => JSX.Element" + "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, }: ", + { + "pluginId": "@kbn/visualization-ui-components", + "scope": "public", + "docId": "kibKbnVisualizationUiComponentsPluginApi", + "section": "def-public.ColorPickerProps", + "text": "ColorPickerProps" + }, + ") => JSX.Element" ], "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", "deprecated": false, @@ -60,153 +68,19 @@ "tags": [], "label": "{\n overwriteColor,\n defaultColor,\n isClearable,\n setConfig,\n label,\n disableHelpTooltip,\n disabledMessage,\n showAlpha,\n}", "description": [], + "signature": [ + { + "pluginId": "@kbn/visualization-ui-components", + "scope": "public", + "docId": "kibKbnVisualizationUiComponentsPluginApi", + "section": "def-public.ColorPickerProps", + "text": "ColorPickerProps" + } + ], "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.overwriteColor", - "type": "CompoundType", - "tags": [], - "label": "overwriteColor", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.defaultColor", - "type": "CompoundType", - "tags": [], - "label": "defaultColor", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.isClearable", - "type": "CompoundType", - "tags": [], - "label": "isClearable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig", - "type": "Function", - "tags": [], - "label": "setConfig", - "description": [], - "signature": [ - "(config: { color?: string | undefined; }) => void" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig.$1.color", - "type": "string", - "tags": [], - "label": "color", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.label", - "type": "string", - "tags": [], - "label": "label", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.disableHelpTooltip", - "type": "CompoundType", - "tags": [], - "label": "disableHelpTooltip", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.disabledMessage", - "type": "string", - "tags": [], - "label": "disabledMessage", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.showAlpha", - "type": "CompoundType", - "tags": [], - "label": "showAlpha", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": true } ], "returnComment": [], @@ -824,39 +698,9 @@ "label": "FilterQueryInput", "description": [], "signature": [ - "({\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}: { inputFilter: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | undefined; onChange: (query: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - ") => void; dataView: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.DataViewBase", - "text": "DataViewBase" - }, - "; helpMessage?: string | null | undefined; label?: string | undefined; initiallyOpen?: boolean | undefined; \"data-test-subj\"?: string | undefined; queryInputServices: ", - { - "pluginId": "@kbn/visualization-ui-components", - "scope": "public", - "docId": "kibKbnVisualizationUiComponentsPluginApi", - "section": "def-public.QueryInputServices", - "text": "QueryInputServices" - }, - "; appName: string; }) => JSX.Element" + "({\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}: ", + "FilterQueryInputProps", + ") => JSX.Element" ], "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", "deprecated": false, @@ -869,185 +713,13 @@ "tags": [], "label": "{\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}", "description": [], + "signature": [ + "FilterQueryInputProps" + ], "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.inputFilter", - "type": "Object", - "tags": [], - "label": "inputFilter", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.onChange", - "type": "Function", - "tags": [], - "label": "onChange", - "description": [], - "signature": [ - "(query: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - ") => void" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.onChange.$1", - "type": "Object", - "tags": [], - "label": "query", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.dataView", - "type": "Object", - "tags": [], - "label": "dataView", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.DataViewBase", - "text": "DataViewBase" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.helpMessage", - "type": "CompoundType", - "tags": [], - "label": "helpMessage", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.label", - "type": "string", - "tags": [], - "label": "label", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.initiallyOpen", - "type": "CompoundType", - "tags": [], - "label": "initiallyOpen", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.datatestsubj", - "type": "string", - "tags": [], - "label": "['data-test-subj']", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.queryInputServices", - "type": "Object", - "tags": [], - "label": "queryInputServices", - "description": [], - "signature": [ - { - "pluginId": "@kbn/visualization-ui-components", - "scope": "public", - "docId": "kibKbnVisualizationUiComponentsPluginApi", - "section": "def-public.QueryInputServices", - "text": "QueryInputServices" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.appName", - "type": "string", - "tags": [], - "label": "appName", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": true } ], "returnComment": [], @@ -2141,6 +1813,162 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps", + "type": "Interface", + "tags": [], + "label": "ColorPickerProps", + "description": [], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.overwriteColor", + "type": "CompoundType", + "tags": [], + "label": "overwriteColor", + "description": [], + "signature": [ + "string | null | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.defaultColor", + "type": "CompoundType", + "tags": [], + "label": "defaultColor", + "description": [], + "signature": [ + "string | null | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.isClearable", + "type": "CompoundType", + "tags": [], + "label": "isClearable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig", + "type": "Function", + "tags": [], + "label": "setConfig", + "description": [], + "signature": [ + "(config: { color?: string | undefined; }) => void" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig.$1.color", + "type": "string", + "tags": [], + "label": "color", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.label", + "type": "string", + "tags": [], + "label": "label", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.disableHelpTooltip", + "type": "CompoundType", + "tags": [], + "label": "disableHelpTooltip", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.disabledMessage", + "type": "string", + "tags": [], + "label": "disabledMessage", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.showAlpha", + "type": "CompoundType", + "tags": [], + "label": "showAlpha", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/visualization-ui-components", "id": "def-public.FieldOptionValue", diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index 08bbd10042d9f..2dbb03ea87c5a 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-ui-components'] --- import kbnVisualizationUiComponentsObj from './kbn_visualization_ui_components.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 | |-------------------|-----------|------------------------|-----------------| -| 146 | 0 | 143 | 3 | +| 137 | 0 | 134 | 4 | ## Client diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index db526a5658fa4..84c424613c5d8 100644 --- a/api_docs/kbn_visualization_utils.mdx +++ b/api_docs/kbn_visualization_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-utils title: "@kbn/visualization-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-utils plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-utils'] --- import kbnVisualizationUtilsObj from './kbn_visualization_utils.devdocs.json'; diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index bbce3610fa945..c8b7b2d6d98ee 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: 2024-08-14 +date: 2024-08-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.devdocs.json b/api_docs/kbn_yarn_lock_validator.devdocs.json index a23de912a27b9..316310a6c43a7 100644 --- a/api_docs/kbn_yarn_lock_validator.devdocs.json +++ b/api_docs/kbn_yarn_lock_validator.devdocs.json @@ -19,6 +19,84 @@ "common": { "classes": [], "functions": [ + { + "parentPluginId": "@kbn/yarn-lock-validator", + "id": "def-common.findProductionDependencies", + "type": "Function", + "tags": [], + "label": "findProductionDependencies", + "description": [ + "\nGet a list of the all production dependencies for Kibana by starting with the\ndependencies listed in package.json and then traversing deeply into the transitive\ndependencies as declared by the yarn.lock file." + ], + "signature": [ + "(log: ", + { + "pluginId": "@kbn/some-dev-log", + "scope": "common", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-common.SomeDevLog", + "text": "SomeDevLog" + }, + ", yarnLock: ", + { + "pluginId": "@kbn/yarn-lock-validator", + "scope": "common", + "docId": "kibKbnYarnLockValidatorPluginApi", + "section": "def-common.YarnLock", + "text": "YarnLock" + }, + ") => Map" + ], + "path": "packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/yarn-lock-validator", + "id": "def-common.findProductionDependencies.$1", + "type": "Object", + "tags": [], + "label": "log", + "description": [], + "signature": [ + { + "pluginId": "@kbn/some-dev-log", + "scope": "common", + "docId": "kibKbnSomeDevLogPluginApi", + "section": "def-common.SomeDevLog", + "text": "SomeDevLog" + } + ], + "path": "packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/yarn-lock-validator", + "id": "def-common.findProductionDependencies.$2", + "type": "Object", + "tags": [], + "label": "yarnLock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/yarn-lock-validator", + "scope": "common", + "docId": "kibKbnYarnLockValidatorPluginApi", + "section": "def-common.YarnLock", + "text": "YarnLock" + } + ], + "path": "packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/yarn-lock-validator", "id": "def-common.readYarnLock", diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 24910c34dacd4..640e5022cf891 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.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 | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 2 | 0 | +| 9 | 0 | 4 | 0 | ## Common diff --git a/api_docs/kbn_zod.devdocs.json b/api_docs/kbn_zod.devdocs.json index 1c160258f9b56..4103b5ce494a8 100644 --- a/api_docs/kbn_zod.devdocs.json +++ b/api_docs/kbn_zod.devdocs.json @@ -13452,7 +13452,7 @@ "label": "getParsedType", "description": [], "signature": [ - "(data: any) => \"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"null\" | \"nan\" | \"array\" | \"promise\" | \"void\" | \"never\"" + "(data: any) => \"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"array\" | \"promise\" | \"null\" | \"nan\" | \"void\" | \"never\"" ], "path": "node_modules/zod/lib/helpers/util.d.ts", "deprecated": false, @@ -15025,7 +15025,7 @@ "label": "parsedType", "description": [], "signature": [ - "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"null\" | \"nan\" | \"array\" | \"promise\" | \"void\" | \"never\"" + "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"array\" | \"promise\" | \"null\" | \"nan\" | \"void\" | \"never\"" ], "path": "node_modules/zod/lib/helpers/parseUtil.d.ts", "deprecated": false, @@ -16352,7 +16352,7 @@ "label": "expected", "description": [], "signature": [ - "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"null\" | \"nan\" | \"array\" | \"promise\" | \"void\" | \"never\"" + "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"array\" | \"promise\" | \"null\" | \"nan\" | \"void\" | \"never\"" ], "path": "node_modules/zod/lib/ZodError.d.ts", "deprecated": false, @@ -16366,7 +16366,7 @@ "label": "received", "description": [], "signature": [ - "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"null\" | \"nan\" | \"array\" | \"promise\" | \"void\" | \"never\"" + "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"array\" | \"promise\" | \"null\" | \"nan\" | \"void\" | \"never\"" ], "path": "node_modules/zod/lib/ZodError.d.ts", "deprecated": false, @@ -19062,7 +19062,7 @@ "label": "UnknownKeysParam", "description": [], "signature": [ - "\"passthrough\" | \"strict\" | \"strip\"" + "\"strict\" | \"passthrough\" | \"strip\"" ], "path": "node_modules/zod/lib/types.d.ts", "deprecated": false, @@ -19198,7 +19198,7 @@ "label": "ZodFirstPartySchemaTypes", "description": [], "signature": [ - "Zod.ZodString | Zod.ZodBoolean | Zod.ZodNumber | Zod.ZodUnknown | Zod.ZodUndefined | Zod.ZodAny | Zod.ZodBigInt | Zod.ZodDate | Zod.ZodSymbol | Zod.ZodNull | Zod.ZodNever | Zod.ZodVoid | Zod.ZodTuple | Zod.ZodNaN | Zod.ZodArray | Zod.ZodObject | Zod.ZodUnion | Zod.ZodDiscriminatedUnion | Zod.ZodIntersection | Zod.ZodRecord | Zod.ZodMap | Zod.ZodSet | Zod.ZodFunction | Zod.ZodLazy | Zod.ZodLiteral | Zod.ZodEnum | Zod.ZodEffects | Zod.ZodNativeEnum | Zod.ZodOptional | Zod.ZodNullable | Zod.ZodDefault | Zod.ZodCatch | Zod.ZodPromise | Zod.ZodBranded | Zod.ZodPipeline | Zod.ZodReadonly" + "Zod.ZodString | Zod.ZodBoolean | Zod.ZodNumber | Zod.ZodUnknown | Zod.ZodUndefined | Zod.ZodAny | Zod.ZodNull | Zod.ZodBigInt | Zod.ZodDate | Zod.ZodSymbol | Zod.ZodNever | Zod.ZodVoid | Zod.ZodTuple | Zod.ZodNaN | Zod.ZodArray | Zod.ZodObject | Zod.ZodUnion | Zod.ZodDiscriminatedUnion | Zod.ZodIntersection | Zod.ZodRecord | Zod.ZodMap | Zod.ZodSet | Zod.ZodFunction | Zod.ZodLazy | Zod.ZodLiteral | Zod.ZodEnum | Zod.ZodEffects | Zod.ZodNativeEnum | Zod.ZodOptional | Zod.ZodNullable | Zod.ZodDefault | Zod.ZodCatch | Zod.ZodPromise | Zod.ZodBranded | Zod.ZodPipeline | Zod.ZodReadonly" ], "path": "node_modules/zod/lib/types.d.ts", "deprecated": false, @@ -19348,7 +19348,7 @@ "label": "ZodParsedType", "description": [], "signature": [ - "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"null\" | \"nan\" | \"array\" | \"promise\" | \"void\" | \"never\"" + "\"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"unknown\" | \"date\" | \"integer\" | \"float\" | \"map\" | \"set\" | \"array\" | \"promise\" | \"null\" | \"nan\" | \"void\" | \"never\"" ], "path": "node_modules/zod/lib/helpers/util.d.ts", "deprecated": false, diff --git a/api_docs/kbn_zod.mdx b/api_docs/kbn_zod.mdx index da43fb6e59087..0ca21f7c420ab 100644 --- a/api_docs/kbn_zod.mdx +++ b/api_docs/kbn_zod.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod title: "@kbn/zod" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod'] --- import kbnZodObj from './kbn_zod.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index 5f609f765bdeb..e721e4d5d9a55 100644 --- a/api_docs/kbn_zod_helpers.mdx +++ b/api_docs/kbn_zod_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod-helpers title: "@kbn/zod-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod-helpers plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod-helpers'] --- import kbnZodHelpersObj from './kbn_zod_helpers.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index e37968d4c5fa1..5ccc8f599bb6f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 1cd639b3d19a4..758de17e062db 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 296776c399396..96293527505b3 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 8b671fd8a0b94..4ebc3e8b3e5ef 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: 2024-08-14 +date: 2024-08-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 a08955b55f968..f0eb9d0f9b29a 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -2510,7 +2510,7 @@ "section": "def-public.IncompleteColumn", "text": "IncompleteColumn" }, - "> | undefined" + " | undefined> | undefined" ], "path": "x-pack/plugins/lens/public/datasources/form_based/types.ts", "deprecated": false, @@ -8634,6 +8634,56 @@ ], "returnComment": [] }, + { + "parentPluginId": "lens", + "id": "def-public.Visualization.onDatasourceUpdate", + "type": "Function", + "tags": [], + "label": "onDatasourceUpdate", + "description": [], + "signature": [ + "((state: T, frame?: ", + "FramePublicAPI", + " | undefined) => T) | undefined" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-public.Visualization.onDatasourceUpdate.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "T" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "lens", + "id": "def-public.Visualization.onDatasourceUpdate.$2", + "type": "Object", + "tags": [], + "label": "frame", + "description": [], + "signature": [ + "FramePublicAPI", + " | undefined" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, { "parentPluginId": "lens", "id": "def-public.Visualization.onIndexPatternChange", @@ -11726,7 +11776,7 @@ "section": "def-public.IncompleteColumn", "text": "IncompleteColumn" }, - "> | undefined; sampling?: number | undefined; }" + " | undefined> | undefined; sampling?: number | undefined; }" ], "path": "x-pack/plugins/lens/public/datasources/form_based/types.ts", "deprecated": false, diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index c1b6415280605..3607a91693376 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: 2024-08-14 +date: 2024-08-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 | |-------------------|-----------|------------------------|-----------------| -| 685 | 0 | 583 | 62 | +| 688 | 0 | 586 | 62 | ## Client diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 08595341b48c9..6bf76ab4b3fdd 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: 2024-08-14 +date: 2024-08-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 2e02f738f5e84..c49a73ef8cd74 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index b65516af0cf09..bea9a5807e6ac 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/links.mdx b/api_docs/links.mdx index 8f5a6ba94519e..b2394f649cbe4 100644 --- a/api_docs/links.mdx +++ b/api_docs/links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/links title: "links" image: https://source.unsplash.com/400x175/?github description: API docs for the links plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; diff --git a/api_docs/lists.devdocs.json b/api_docs/lists.devdocs.json index 4ee259f08b88e..fa444a280770c 100644 --- a/api_docs/lists.devdocs.json +++ b/api_docs/lists.devdocs.json @@ -4535,7 +4535,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -4571,6 +4571,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -4629,6 +4655,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -5223,7 +5251,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -5249,7 +5279,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -5495,6 +5525,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index bd2323183577d..7ac2612f89469 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/logs_data_access.mdx b/api_docs/logs_data_access.mdx index a37785a3c9014..db7adb4c1753d 100644 --- a/api_docs/logs_data_access.mdx +++ b/api_docs/logs_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsDataAccess title: "logsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the logsDataAccess plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsDataAccess'] --- import logsDataAccessObj from './logs_data_access.devdocs.json'; diff --git a/api_docs/logs_explorer.devdocs.json b/api_docs/logs_explorer.devdocs.json index 79932865de8a7..dc0818e98bd7f 100644 --- a/api_docs/logs_explorer.devdocs.json +++ b/api_docs/logs_explorer.devdocs.json @@ -355,6 +355,8 @@ "<(", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -375,6 +377,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -399,6 +403,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -421,6 +427,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanelGroupAPI", " & ", "WithControlPanels", @@ -499,6 +507,8 @@ "<(", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -519,6 +529,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -543,6 +555,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -565,6 +579,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanelGroupAPI", " & ", "WithControlPanels", @@ -698,15 +714,7 @@ "section": "def-public.LogsExplorerCustomizations", "text": "LogsExplorerCustomizations" }, - " | undefined; initialState?: ", - { - "pluginId": "logsExplorer", - "scope": "public", - "docId": "kibLogsExplorerPluginApi", - "section": "def-public.LogsExplorerPublicStateUpdate", - "text": "LogsExplorerPublicStateUpdate" - }, - " | undefined; }) => Promise<", + " | undefined; initialState?: InitialState | undefined; }) => Promise<", { "pluginId": "logsExplorer", "scope": "public", @@ -737,15 +745,7 @@ "section": "def-public.LogsExplorerCustomizations", "text": "LogsExplorerCustomizations" }, - " | undefined; initialState?: ", - { - "pluginId": "logsExplorer", - "scope": "public", - "docId": "kibLogsExplorerPluginApi", - "section": "def-public.LogsExplorerPublicStateUpdate", - "text": "LogsExplorerPublicStateUpdate" - }, - " | undefined; }" + " | undefined; initialState?: InitialState | undefined; }" ], "path": "x-pack/plugins/observability_solution/logs_explorer/public/controller/create_controller.ts", "deprecated": false, @@ -765,6 +765,8 @@ "(", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -785,6 +787,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -809,6 +813,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanels", " & ", { @@ -831,6 +837,8 @@ ") | (", "WithDataSourceSelection", " & ", + "WithAllSelection", + " & ", "WithControlPanelGroupAPI", " & ", "WithControlPanels", @@ -942,7 +950,29 @@ "initialIsOpen": false } ], - "objects": [], + "objects": [ + { + "parentPluginId": "logsExplorer", + "id": "def-public.DEFAULT_ALL_SELECTION", + "type": "Object", + "tags": [], + "label": "DEFAULT_ALL_SELECTION", + "description": [], + "signature": [ + { + "pluginId": "logsExplorer", + "scope": "common", + "docId": "kibLogsExplorerPluginApi", + "section": "def-common.AllDatasetSelection", + "text": "AllDatasetSelection" + } + ], + "path": "x-pack/plugins/observability_solution/logs_explorer/public/state_machines/logs_explorer_controller/src/default_all_selection.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], "setup": { "parentPluginId": "logsExplorer", "id": "def-public.LogsExplorerPluginSetup", @@ -1017,15 +1047,7 @@ "section": "def-public.LogsExplorerCustomizations", "text": "LogsExplorerCustomizations" }, - " | undefined; initialState?: ", - { - "pluginId": "logsExplorer", - "scope": "public", - "docId": "kibLogsExplorerPluginApi", - "section": "def-public.LogsExplorerPublicStateUpdate", - "text": "LogsExplorerPublicStateUpdate" - }, - " | undefined; }) => Promise<", + " | undefined; initialState?: InitialState | undefined; }) => Promise<", { "pluginId": "logsExplorer", "scope": "public", @@ -1056,15 +1078,7 @@ "section": "def-public.LogsExplorerCustomizations", "text": "LogsExplorerCustomizations" }, - " | undefined; initialState?: ", - { - "pluginId": "logsExplorer", - "scope": "public", - "docId": "kibLogsExplorerPluginApi", - "section": "def-public.LogsExplorerPublicStateUpdate", - "text": "LogsExplorerPublicStateUpdate" - }, - " | undefined; }" + " | undefined; initialState?: InitialState | undefined; }" ], "path": "x-pack/plugins/observability_solution/logs_explorer/public/controller/create_controller.ts", "deprecated": false, @@ -1172,6 +1186,22 @@ "children": [], "returnComment": [] }, + { + "parentPluginId": "logsExplorer", + "id": "def-common.AllDatasetSelection.getLocatorPlainSelection", + "type": "Function", + "tags": [], + "label": "getLocatorPlainSelection", + "description": [], + "signature": [ + "() => { selectionType: \"all\"; }" + ], + "path": "x-pack/plugins/observability_solution/logs_explorer/common/data_source_selection/all_dataset_selection.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "logsExplorer", "id": "def-common.AllDatasetSelection.create", @@ -1180,7 +1210,7 @@ "label": "create", "description": [], "signature": [ - "() => ", + "({ indices }: { indices: string; }) => ", { "pluginId": "logsExplorer", "scope": "common", @@ -1192,7 +1222,32 @@ "path": "x-pack/plugins/observability_solution/logs_explorer/common/data_source_selection/all_dataset_selection.ts", "deprecated": false, "trackAdoption": false, - "children": [], + "children": [ + { + "parentPluginId": "logsExplorer", + "id": "def-common.AllDatasetSelection.create.$1", + "type": "Object", + "tags": [], + "label": "{ indices }", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_explorer/common/data_source_selection/all_dataset_selection.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logsExplorer", + "id": "def-common.AllDatasetSelection.create.$1.indices", + "type": "string", + "tags": [], + "label": "indices", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_explorer/common/data_source_selection/all_dataset_selection.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], "returnComment": [] } ], @@ -1564,7 +1619,15 @@ "Branded", "; } & { title?: string | undefined; }; }; }) => ", + ">; } & { title?: string | undefined; }; }; }, allSelection: ", + { + "pluginId": "logsExplorer", + "scope": "common", + "docId": "kibLogsExplorerPluginApi", + "section": "def-common.AllDatasetSelection", + "text": "AllDatasetSelection" + }, + ") => ", { "pluginId": "logsExplorer", "scope": "common", @@ -1617,6 +1680,27 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "logsExplorer", + "id": "def-common.hydrateDataSourceSelection.$2", + "type": "Object", + "tags": [], + "label": "allSelection", + "description": [], + "signature": [ + { + "pluginId": "logsExplorer", + "scope": "common", + "docId": "kibLogsExplorerPluginApi", + "section": "def-common.AllDatasetSelection", + "text": "AllDatasetSelection" + } + ], + "path": "x-pack/plugins/observability_solution/logs_explorer/common/data_source_selection/hydrate_data_source_selection.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [], diff --git a/api_docs/logs_explorer.mdx b/api_docs/logs_explorer.mdx index 3ac7db4875060..8e7882305bab1 100644 --- a/api_docs/logs_explorer.mdx +++ b/api_docs/logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsExplorer title: "logsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the logsExplorer plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsExplorer'] --- import logsExplorerObj from './logs_explorer.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 117 | 4 | 117 | 22 | +| 122 | 4 | 122 | 23 | ## Client @@ -31,6 +31,9 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux ### Start +### Objects + + ### Functions diff --git a/api_docs/logs_shared.devdocs.json b/api_docs/logs_shared.devdocs.json index 32758ecf4558d..e3cf1d13960f4 100644 --- a/api_docs/logs_shared.devdocs.json +++ b/api_docs/logs_shared.devdocs.json @@ -3173,6 +3173,137 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange", + "type": "Interface", + "tags": [], + "label": "UpdatedDateRange", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange.startDateExpression", + "type": "string", + "tags": [], + "label": "startDateExpression", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange.endDateExpression", + "type": "string", + "tags": [], + "label": "endDateExpression", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval", + "type": "Interface", + "tags": [], + "label": "VisibleInterval", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.pagesBeforeStart", + "type": "number", + "tags": [], + "label": "pagesBeforeStart", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.pagesAfterEnd", + "type": "number", + "tags": [], + "label": "pagesAfterEnd", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.startKey", + "type": "CompoundType", + "tags": [], + "label": "startKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.middleKey", + "type": "CompoundType", + "tags": [], + "label": "middleKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.endKey", + "type": "CompoundType", + "tags": [], + "label": "endKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.fromScroll", + "type": "boolean", + "tags": [], + "label": "fromScroll", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "logsShared", "id": "def-public.WithSummaryProps", diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index 1cc808ad300f4..e5d481908839f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 300 | 0 | 272 | 32 | +| 310 | 0 | 282 | 32 | ## Client diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 2f322ddb7995b..c00d73cc44d76 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: 2024-08-14 +date: 2024-08-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 1abba28b7668e..2b129cee2a56d 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: 2024-08-14 +date: 2024-08-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 2e22653c7320d..bdc4c5267b84c 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.devdocs.json b/api_docs/metrics_data_access.devdocs.json index e4bb3a666e6b9..f6ec0aeef0bca 100644 --- a/api_docs/metrics_data_access.devdocs.json +++ b/api_docs/metrics_data_access.devdocs.json @@ -550,7 +550,15 @@ "label": "findInventoryModel", "description": [], "signature": [ - "(type: T) => InventoryModels" + "(type: T) => ", + { + "pluginId": "metricsDataAccess", + "scope": "common", + "docId": "kibMetricsDataAccessPluginApi", + "section": "def-common.InventoryModels", + "text": "InventoryModels" + }, + "" ], "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/index.ts", "deprecated": false, @@ -616,9 +624,14 @@ "label": "networkTraffic", "description": [], "signature": [ - "(id: string, field: string) => { [x: string]: { [x: string]: { field: string; } | undefined; } | { percentiles: { field: string; percents: number[]; }; } | { bucket_script: { buckets_path: { [x: string]: string; }; script: { source: string; lang: \"painless\" | \"expression\"; }; } & { gap_policy?: \"insert_zeros\" | \"skip\" | undefined; }; } | { cumulative_sum: { buckets_path: string; }; } | { derivative: { buckets_path: string; gap_policy: \"insert_zeros\" | \"skip\"; unit: string; }; } | { sum_bucket: { buckets_path: string; }; } | ", - "SnapshotTermsWithAggregation", - " | { cardinality: { field?: string | undefined; }; } | { top_metrics: { metrics: { field: string; }[] | { field: string; }; } & { size?: number | undefined; sort?: { [x: string]: \"asc\" | \"desc\"; } | undefined; }; } | { filter: { exists: { field: string; }; }; aggs: { period: { max: { field: string; }; }; }; }; }" + "(id: string, field: string) => ", + { + "pluginId": "metricsDataAccess", + "scope": "common", + "docId": "kibMetricsDataAccessPluginApi", + "section": "def-common.MetricsUIAggregation", + "text": "MetricsUIAggregation" + } ], "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/shared/metrics/snapshot/network_traffic.ts", "deprecated": false, @@ -659,7 +672,49 @@ "initialIsOpen": false } ], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIMetric", + "type": "Interface", + "tags": [], + "label": "MetricsAPIMetric", + "description": [], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIMetric.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIMetric.aggregations", + "type": "Object", + "tags": [], + "label": "aggregations", + "description": [], + "signature": [ + "{ [x: string]: ", + "AggregationsAggregate", + "; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], "enums": [], "misc": [ { @@ -1454,236 +1509,1037 @@ }, { "parentPluginId": "metricsDataAccess", - "id": "def-common.InventoryVisType", - "type": "Type", - "tags": [], - "label": "InventoryVisType", - "description": [], - "signature": [ - "\"line\" | \"area\" | \"bar\"" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.METRICS_EXPLORER_API_MAX_METRICS", - "type": "number", - "tags": [], - "label": "METRICS_EXPLORER_API_MAX_METRICS", - "description": [], - "signature": [ - "20" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/constants.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.MetricsUIAggregation", - "type": "Type", - "tags": [], - "label": "MetricsUIAggregation", - "description": [], - "signature": [ - "{ [x: string]: { [x: string]: { field: string; } | undefined; } | { percentiles: { field: string; percents: number[]; }; } | { bucket_script: { buckets_path: { [x: string]: string; }; script: { source: string; lang: \"painless\" | \"expression\"; }; } & { gap_policy?: \"insert_zeros\" | \"skip\" | undefined; }; } | { cumulative_sum: { buckets_path: string; }; } | { derivative: { buckets_path: string; gap_policy: \"insert_zeros\" | \"skip\"; unit: string; }; } | { sum_bucket: { buckets_path: string; }; } | ", - "SnapshotTermsWithAggregation", - " | { cardinality: { field?: string | undefined; }; } | { top_metrics: { metrics: { field: string; }[] | { field: string; }; } & { size?: number | undefined; sort?: { [x: string]: \"asc\" | \"desc\"; } | undefined; }; } | { filter: { exists: { field: string; }; }; aggs: { period: { max: { field: string; }; }; }; }; }" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.podSnapshotMetricTypes", - "type": "Array", - "tags": [], - "label": "podSnapshotMetricTypes", - "description": [], - "signature": [ - "(\"memory\" | \"rx\" | \"tx\" | \"cpu\")[]" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/kubernetes/pod/metrics/index.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.SnapshotMetricType", - "type": "Type", - "tags": [], - "label": "SnapshotMetricType", - "description": [], - "signature": [ - "\"count\" | \"memory\" | \"custom\" | \"logRate\" | \"rx\" | \"normalizedLoad1m\" | \"memoryFree\" | \"tx\" | \"cpu\" | \"s3BucketSize\" | \"s3NumberOfObjects\" | \"s3TotalRequests\" | \"s3UploadBytes\" | \"s3DownloadBytes\" | \"cpuV2\" | \"diskLatency\" | \"diskSpaceUsage\" | \"load\" | \"memoryTotal\" | \"rxV2\" | \"txV2\" | \"diskIOReadBytes\" | \"diskIOWriteBytes\" | \"rdsLatency\" | \"rdsConnections\" | \"rdsQueriesExecuted\" | \"rdsActiveTransactions\" | \"sqsMessagesVisible\" | \"sqsMessagesDelayed\" | \"sqsMessagesEmpty\" | \"sqsMessagesSent\" | \"sqsOldestMessage\"" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.TSVBMetricModel", - "type": "Type", - "tags": [], - "label": "TSVBMetricModel", - "description": [], - "signature": [ - "{ id: \"custom\" | \"hostSystemOverview\" | \"hostCpuUsageTotal\" | \"hostCpuUsage\" | \"hostFilesystem\" | \"hostK8sOverview\" | \"hostK8sCpuCap\" | \"hostK8sDiskCap\" | \"hostK8sMemoryCap\" | \"hostK8sPodCap\" | \"hostLoad\" | \"hostMemoryUsage\" | \"hostNetworkTraffic\" | \"hostDockerOverview\" | \"hostDockerInfo\" | \"hostDockerTop5ByCpu\" | \"hostDockerTop5ByMemory\" | \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsOverview\" | \"awsCpuUtilization\" | \"awsNetworkBytes\" | \"awsNetworkPackets\" | \"awsDiskioBytes\" | \"awsDiskioOps\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\"; requires: string[]; index_pattern: string | string[]; interval: string; time_field: string; type: string; series: ({ id: string; metrics: ({ id: string; type: \"count\"; } | ({ id: string; type: \"min\" | \"max\" | \"sum\" | \"avg\" | \"count\" | \"cardinality\" | \"cumulative_sum\" | \"derivative\" | \"calculation\" | \"series_agg\" | \"positive_only\"; } & { field?: string | undefined; }) | { id: string; script: string; type: \"calculation\"; variables: { field: string; id: string; name: string; }[]; } | { id: string; field: string; unit: string; type: \"derivative\"; } | ({ id: string; type: \"percentile\"; percentiles: { id: string; value: number; }[]; } & { field?: string | undefined; }) | { id: string; function: string; type: \"series_agg\"; })[]; split_mode: string; } & { terms_field?: string | undefined; terms_size?: number | undefined; terms_order_by?: string | undefined; filter?: { query: string; language: \"kuery\" | \"lucene\"; } | undefined; })[]; } & { filter?: string | undefined; map_field_to?: string | undefined; id_type?: \"cloud\" | \"node\" | undefined; drop_last_bucket?: boolean | undefined; }" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.TSVBMetricModelCreator", + "id": "def-common.InventoryModels", "type": "Type", "tags": [], - "label": "TSVBMetricModelCreator", - "description": [], - "signature": [ - "(timeField: string, indexPattern: string | string[], interval: string) => { id: \"custom\" | \"hostSystemOverview\" | \"hostCpuUsageTotal\" | \"hostCpuUsage\" | \"hostFilesystem\" | \"hostK8sOverview\" | \"hostK8sCpuCap\" | \"hostK8sDiskCap\" | \"hostK8sMemoryCap\" | \"hostK8sPodCap\" | \"hostLoad\" | \"hostMemoryUsage\" | \"hostNetworkTraffic\" | \"hostDockerOverview\" | \"hostDockerInfo\" | \"hostDockerTop5ByCpu\" | \"hostDockerTop5ByMemory\" | \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsOverview\" | \"awsCpuUtilization\" | \"awsNetworkBytes\" | \"awsNetworkPackets\" | \"awsDiskioBytes\" | \"awsDiskioOps\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\"; requires: string[]; index_pattern: string | string[]; interval: string; time_field: string; type: string; series: ({ id: string; metrics: ({ id: string; type: \"count\"; } | ({ id: string; type: \"min\" | \"max\" | \"sum\" | \"avg\" | \"count\" | \"cardinality\" | \"cumulative_sum\" | \"derivative\" | \"calculation\" | \"series_agg\" | \"positive_only\"; } & { field?: string | undefined; }) | { id: string; script: string; type: \"calculation\"; variables: { field: string; id: string; name: string; }[]; } | { id: string; field: string; unit: string; type: \"derivative\"; } | ({ id: string; type: \"percentile\"; percentiles: { id: string; value: number; }[]; } & { field?: string | undefined; }) | { id: string; function: string; type: \"series_agg\"; })[]; split_mode: string; } & { terms_field?: string | undefined; terms_size?: number | undefined; terms_order_by?: string | undefined; filter?: { query: string; language: \"kuery\" | \"lucene\"; } | undefined; })[]; } & { filter?: string | undefined; map_field_to?: string | undefined; id_type?: \"cloud\" | \"node\" | undefined; drop_last_bucket?: boolean | undefined; }" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.TSVBMetricModelCreator.$1", - "type": "string", - "tags": [], - "label": "timeField", - "description": [], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.TSVBMetricModelCreator.$2", - "type": "CompoundType", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "string | string[]" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.TSVBMetricModelCreator.$3", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.ESBasicMetricAggRT", - "type": "Object", - "tags": [], - "label": "ESBasicMetricAggRT", + "label": "InventoryModels", "description": [], "signature": [ - "RecordC", + "{ readonly host: ", + "InventoryModel", "<", - "StringC", - ", ", - "UnionC", - "<[", - "UndefinedC", - ", ", - "TypeC", - "<{ field: ", - "StringC", - "; }>]>>" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.ESDerivativeAggRT", - "type": "Object", - "tags": [], - "label": "ESDerivativeAggRT", - "description": [], - "signature": [ - "TypeC", - "<{ derivative: ", - "TypeC", - "<{ buckets_path: ", - "StringC", - "; gap_policy: ", - "KeyofC", - "<{ skip: null; insert_zeros: null; }>; unit: ", - "StringC", - "; }>; }>" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.ESSumBucketAggRT", - "type": "Object", - "tags": [], - "label": "ESSumBucketAggRT", - "description": [], - "signature": [ - "TypeC", - "<{ sum_bucket: ", - "TypeC", - "<{ buckets_path: ", - "StringC", - "; }>; }>" - ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "metricsDataAccess", - "id": "def-common.ESTermsWithAggregationRT", - "type": "Object", - "tags": [], - "label": "ESTermsWithAggregationRT", + "InventoryMetricsWithCharts", + "<{ readonly cpuUsage: ", + "LensBaseLayer", + "; readonly cpuUsageIowait: ", + "LensBaseLayer", + "; readonly cpuUsageIrq: ", + "LensBaseLayer", + "; readonly cpuUsageNice: ", + "LensBaseLayer", + "; readonly cpuUsageSoftirq: ", + "LensBaseLayer", + "; readonly cpuUsageSteal: ", + "LensBaseLayer", + "; readonly cpuUsageUser: ", + "LensBaseLayer", + "; readonly cpuUsageSystem: ", + "LensBaseLayer", + "; readonly diskIORead: ", + "LensBaseLayer", + "; readonly diskIOWrite: ", + "LensBaseLayer", + "; readonly diskReadThroughput: ", + "LensBaseLayer", + "; readonly diskWriteThroughput: ", + "LensBaseLayer", + "; readonly diskSpaceAvailability: ", + "LensBaseLayer", + "; readonly diskSpaceAvailable: ", + "LensBaseLayer", + "; readonly diskUsage: ", + "LensBaseLayer", + "; readonly diskUsageAverage: ", + "LensBaseLayer", + "; readonly hostCount: ", + "LensBaseLayer", + "; readonly logRate: ", + "LensBaseLayer", + "; readonly normalizedLoad1m: ", + "LensBaseLayer", + "; readonly load1m: ", + "LensBaseLayer", + "; readonly load5m: ", + "LensBaseLayer", + "; readonly load15m: ", + "LensBaseLayer", + "; readonly memoryUsage: ", + "LensBaseLayer", + "; readonly memoryFree: ", + "LensBaseLayer", + "; readonly memoryUsed: ", + "LensBaseLayer", + "; readonly memoryFreeExcludingCache: ", + "LensBaseLayer", + "; readonly memoryCache: ", + "LensBaseLayer", + "; readonly rx: ", + "LensBaseLayer", + "; readonly tx: ", + "LensBaseLayer", + "; }, { readonly cpu: { readonly xy: { readonly cpuUsageBreakdown: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly loadBreakdown: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly cpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly normalizedLoad1m: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; readonly metric: { readonly cpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; readonly normalizedLoad1m: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; }; }; readonly disk: { readonly xy: { readonly diskThroughputReadWrite: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskUsageByMountPoint: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskIOReadWrite: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskSpaceAvailable: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskIORead: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskIOWrite: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskReadThroughput: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly diskWriteThroughput: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; readonly metric: { readonly diskUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; }; }; readonly memory: { xy: { memoryUsageBreakdown: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; memoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; memoryFree: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; metric: { memoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; }; }; readonly network: { readonly xy: { readonly rxTx: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly rx: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly tx: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; }; readonly logs: { xy: { logRate: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; }; readonly kibernetesNode: { readonly xy: { readonly nodeCpuCapacity: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly nodeMemoryCapacity: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly nodeDiskCapacity: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly nodePodCapacity: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; }; }>>; readonly pod: ", + "InventoryModel", + "<", + "InventoryMetrics", + ">; readonly container: ", + "InventoryModel", + "<", + "InventoryMetricsWithCharts", + "<{ readonly dockerContainerCpuUsage: ", + "LensBaseLayer", + "; readonly dockerContainerMemoryUsage: ", + "LensBaseLayer", + "; readonly dockerContainerNetworkRx: ", + "LensBaseLayer", + "; readonly dockerContainerNetworkTx: ", + "LensBaseLayer", + "; readonly dockerContainerDiskIORead: ", + "LensBaseLayer", + "; readonly dockerContainerDiskIOWrite: ", + "LensBaseLayer", + "; readonly k8sContainerCpuUsage: ", + "LensBaseLayer", + "; readonly k8sContainerMemoryUsage: ", + "LensBaseLayer", + "; }, { readonly cpu: { readonly xy: { readonly dockerContainerCpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; readonly k8sContainerCpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; readonly metric: { readonly dockerContainerCpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; readonly k8sContainerCpuUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; }; }; readonly memory: { xy: { dockerContainerMemoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; k8sContainerMemoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; metric: { dockerContainerMemoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; k8sContainerMemoryUsage: { title: string; dataset?: ", + "LensDataset", + " | undefined; label?: string | undefined; filter?: string | undefined; format?: \"string\" | \"number\" | \"duration\" | \"percent\" | \"currency\" | \"bytes\" | \"bits\" | undefined; decimals?: number | undefined; normalizeByUnit?: \"m\" | \"d\" | \"h\" | \"s\" | undefined; compactValues?: boolean | undefined; randomSampling?: number | undefined; useGlobalFilter?: boolean | undefined; seriesColor?: string | undefined; value: string; chartType: \"metric\"; querySecondaryMetric?: string | undefined; queryMaxValue?: string | undefined; breakdown?: ", + "LensBreakdownConfig", + " | undefined; trendLine?: boolean | undefined; subtitle?: string | undefined; } & { id: string; }; }; }; readonly network: { xy: { dockerContainerRxTx: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; }; readonly diskIO: { xy: { dockerContainerDiskIOReadWrite: { title: string; dataset?: ", + "LensDataset", + " | undefined; chartType: \"xy\"; layers: ({ dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"series\"; breakdown?: ", + "LensBreakdownConfig", + " | undefined; xAxis: ", + "LensBreakdownConfig", + "; seriesType: \"line\" | \"area\" | \"bar\"; } | { dataset?: ", + "LensDataset", + " | undefined; yAxis: ", + "LensBaseLayer", + "[]; type: \"annotation\"; events: ({ name: string; color?: string | undefined; icon?: string | undefined; datetime: string; } | { name: string; color?: string | undefined; icon?: string | undefined; field: string; filter: string; })[]; } | ", + "LensReferenceLineLayer", + ")[]; legend?: { show?: boolean | undefined; position?: \"right\" | \"top\" | \"bottom\" | \"left\" | undefined; } | undefined; axisTitleVisibility?: { showXAxisTitle?: boolean | undefined; showYAxisTitle?: boolean | undefined; } | undefined; emphasizeFitting?: boolean | undefined; fittingFunction?: \"None\" | \"Average\" | \"Zero\" | \"Nearest\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined; yBounds?: ", + "LensYBoundsConfig", + " | undefined; } & { id: string; }; }; }; }>>; readonly awsEC2: ", + "InventoryModel", + "<", + "InventoryMetrics", + ">; readonly awsS3: ", + "InventoryModel", + "<", + "InventoryMetrics", + ">; readonly awsRDS: ", + "InventoryModel", + "<", + "InventoryMetrics", + ">; readonly awsSQS: ", + "InventoryModel", + "<", + "InventoryMetrics", + ">; }[T]" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.InventoryVisType", + "type": "Type", + "tags": [], + "label": "InventoryVisType", + "description": [], + "signature": [ + "\"line\" | \"area\" | \"bar\"" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.METRICS_EXPLORER_API_MAX_METRICS", + "type": "number", + "tags": [], + "label": "METRICS_EXPLORER_API_MAX_METRICS", + "description": [], + "signature": [ + "20" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIColumn", + "type": "Type", + "tags": [], + "label": "MetricsAPIColumn", + "description": [], + "signature": [ + "{ name: string; type: \"string\" | \"number\" | \"date\"; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIColumnType", + "type": "Type", + "tags": [], + "label": "MetricsAPIColumnType", + "description": [], + "signature": [ + "\"string\" | \"number\" | \"date\"" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIPageInfo", + "type": "Type", + "tags": [], + "label": "MetricsAPIPageInfo", + "description": [], + "signature": [ + "{ afterKey: { [x: string]: string | null; } | null | undefined; } & { interval?: number | undefined; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIRequest", + "type": "Type", + "tags": [], + "label": "MetricsAPIRequest", + "description": [], + "signature": [ + "Omit<{ timerange: { from: number; to: number; interval: string; }; indexPattern: string; metrics: { id: string; aggregations: { [key: string]: unknown; }; }[]; includeTimeseries: boolean | undefined; } & { groupBy?: (string | null | undefined)[] | undefined; groupInstance?: (string | null | undefined)[] | undefined; modules?: string[] | undefined; afterKey?: { [x: string]: string | null; } | null | undefined; limit?: number | null | undefined; filters?: { [key: string]: unknown; }[] | undefined; dropPartialBuckets?: boolean | undefined; alignDataToEnd?: boolean | undefined; }, \"metrics\"> & { metrics: ", + { + "pluginId": "metricsDataAccess", + "scope": "common", + "docId": "kibMetricsDataAccessPluginApi", + "section": "def-common.MetricsAPIMetric", + "text": "MetricsAPIMetric" + }, + "[]; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIResponse", + "type": "Type", + "tags": [], + "label": "MetricsAPIResponse", + "description": [], + "signature": [ + "{ series: ({ id: string; columns: { name: string; type: \"string\" | \"number\" | \"date\"; }[]; rows: ({ timestamp: number; } & { [x: string]: string | number | object[] | null | undefined; })[]; } & { keys?: string[] | undefined; } & { metricsets?: string[] | undefined; })[]; info: { afterKey: { [x: string]: string | null; } | null | undefined; } & { interval?: number | undefined; }; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIRow", + "type": "Type", + "tags": [], + "label": "MetricsAPIRow", + "description": [], + "signature": [ + "{ timestamp: number; } & { [x: string]: string | number | object[] | null | undefined; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPISeries", + "type": "Type", + "tags": [], + "label": "MetricsAPISeries", "description": [], "signature": [ - "Type", + "{ id: string; columns: { name: string; type: \"string\" | \"number\" | \"date\"; }[]; rows: ({ timestamp: number; } & { [x: string]: string | number | object[] | null | undefined; })[]; } & { keys?: string[] | undefined; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPITimerange", + "type": "Type", + "tags": [], + "label": "MetricsAPITimerange", + "description": [], + "signature": [ + "{ from: number; to: number; interval: string; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsUIAggregation", + "type": "Type", + "tags": [], + "label": "MetricsUIAggregation", + "description": [], + "signature": [ + "{ [x: string]: ", + "AggregationsAggregate", + "; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.podSnapshotMetricTypes", + "type": "Array", + "tags": [], + "label": "podSnapshotMetricTypes", + "description": [], + "signature": [ + "(\"memory\" | \"rx\" | \"tx\" | \"cpu\")[]" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/kubernetes/pod/metrics/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.SnapshotMetricType", + "type": "Type", + "tags": [], + "label": "SnapshotMetricType", + "description": [], + "signature": [ + "\"count\" | \"memory\" | \"custom\" | \"logRate\" | \"rx\" | \"normalizedLoad1m\" | \"memoryFree\" | \"tx\" | \"cpu\" | \"s3BucketSize\" | \"s3NumberOfObjects\" | \"s3TotalRequests\" | \"s3UploadBytes\" | \"s3DownloadBytes\" | \"cpuV2\" | \"diskLatency\" | \"diskSpaceUsage\" | \"load\" | \"memoryTotal\" | \"rxV2\" | \"txV2\" | \"diskIOReadBytes\" | \"diskIOWriteBytes\" | \"rdsLatency\" | \"rdsConnections\" | \"rdsQueriesExecuted\" | \"rdsActiveTransactions\" | \"sqsMessagesVisible\" | \"sqsMessagesDelayed\" | \"sqsMessagesEmpty\" | \"sqsMessagesSent\" | \"sqsOldestMessage\"" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.TSVBMetricModel", + "type": "Type", + "tags": [], + "label": "TSVBMetricModel", + "description": [], + "signature": [ + "{ id: \"custom\" | \"hostSystemOverview\" | \"hostCpuUsageTotal\" | \"hostCpuUsage\" | \"hostFilesystem\" | \"hostK8sOverview\" | \"hostK8sCpuCap\" | \"hostK8sDiskCap\" | \"hostK8sMemoryCap\" | \"hostK8sPodCap\" | \"hostLoad\" | \"hostMemoryUsage\" | \"hostNetworkTraffic\" | \"hostDockerOverview\" | \"hostDockerInfo\" | \"hostDockerTop5ByCpu\" | \"hostDockerTop5ByMemory\" | \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsOverview\" | \"awsCpuUtilization\" | \"awsNetworkBytes\" | \"awsNetworkPackets\" | \"awsDiskioBytes\" | \"awsDiskioOps\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\"; requires: string[]; index_pattern: string | string[]; interval: string; time_field: string; type: string; series: ({ id: string; metrics: ({ id: string; type: \"count\"; } | ({ id: string; type: \"min\" | \"max\" | \"sum\" | \"avg\" | \"count\" | \"cardinality\" | \"cumulative_sum\" | \"derivative\" | \"calculation\" | \"series_agg\" | \"positive_only\"; } & { field?: string | undefined; }) | { id: string; script: string; type: \"calculation\"; variables: { field: string; id: string; name: string; }[]; } | { id: string; field: string; unit: string; type: \"derivative\"; } | ({ id: string; type: \"percentile\"; percentiles: { id: string; value: number; }[]; } & { field?: string | undefined; }) | { id: string; function: string; type: \"series_agg\"; })[]; split_mode: string; } & { terms_field?: string | undefined; terms_size?: number | undefined; terms_order_by?: string | undefined; filter?: { query: string; language: \"kuery\" | \"lucene\"; } | undefined; })[]; } & { filter?: string | undefined; map_field_to?: string | undefined; id_type?: \"cloud\" | \"node\" | undefined; drop_last_bucket?: boolean | undefined; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.TSVBMetricModelCreator", + "type": "Type", + "tags": [], + "label": "TSVBMetricModelCreator", + "description": [], + "signature": [ + "(timeField: string, indexPattern: string | string[], interval: string) => { id: \"custom\" | \"hostSystemOverview\" | \"hostCpuUsageTotal\" | \"hostCpuUsage\" | \"hostFilesystem\" | \"hostK8sOverview\" | \"hostK8sCpuCap\" | \"hostK8sDiskCap\" | \"hostK8sMemoryCap\" | \"hostK8sPodCap\" | \"hostLoad\" | \"hostMemoryUsage\" | \"hostNetworkTraffic\" | \"hostDockerOverview\" | \"hostDockerInfo\" | \"hostDockerTop5ByCpu\" | \"hostDockerTop5ByMemory\" | \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsOverview\" | \"awsCpuUtilization\" | \"awsNetworkBytes\" | \"awsNetworkPackets\" | \"awsDiskioBytes\" | \"awsDiskioOps\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\"; requires: string[]; index_pattern: string | string[]; interval: string; time_field: string; type: string; series: ({ id: string; metrics: ({ id: string; type: \"count\"; } | ({ id: string; type: \"min\" | \"max\" | \"sum\" | \"avg\" | \"count\" | \"cardinality\" | \"cumulative_sum\" | \"derivative\" | \"calculation\" | \"series_agg\" | \"positive_only\"; } & { field?: string | undefined; }) | { id: string; script: string; type: \"calculation\"; variables: { field: string; id: string; name: string; }[]; } | { id: string; field: string; unit: string; type: \"derivative\"; } | ({ id: string; type: \"percentile\"; percentiles: { id: string; value: number; }[]; } & { field?: string | undefined; }) | { id: string; function: string; type: \"series_agg\"; })[]; split_mode: string; } & { terms_field?: string | undefined; terms_size?: number | undefined; terms_order_by?: string | undefined; filter?: { query: string; language: \"kuery\" | \"lucene\"; } | undefined; })[]; } & { filter?: string | undefined; map_field_to?: string | undefined; id_type?: \"cloud\" | \"node\" | undefined; drop_last_bucket?: boolean | undefined; }" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.TSVBMetricModelCreator.$1", + "type": "string", + "tags": [], + "label": "timeField", + "description": [], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.TSVBMetricModelCreator.$2", + "type": "CompoundType", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "string | string[]" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.TSVBMetricModelCreator.$3", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.ESBasicMetricAggRT", + "type": "Object", + "tags": [], + "label": "ESBasicMetricAggRT", + "description": [], + "signature": [ + "RecordC", "<", - "SnapshotTermsWithAggregation", + "StringC", + ", ", + "UnionC", + "<[", + "UndefinedC", ", ", - "SnapshotTermsWithAggregation", - ", unknown>" + "TypeC", + "<{ field: ", + "StringC", + "; }>]>>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.ESDerivativeAggRT", + "type": "Object", + "tags": [], + "label": "ESDerivativeAggRT", + "description": [], + "signature": [ + "TypeC", + "<{ derivative: ", + "TypeC", + "<{ buckets_path: ", + "StringC", + "; gap_policy: ", + "KeyofC", + "<{ skip: null; insert_zeros: null; }>; unit: ", + "StringC", + "; }>; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.ESSumBucketAggRT", + "type": "Object", + "tags": [], + "label": "ESSumBucketAggRT", + "description": [], + "signature": [ + "TypeC", + "<{ sum_bucket: ", + "TypeC", + "<{ buckets_path: ", + "StringC", + "; }>; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.ESTermsWithAggregationRT", + "type": "Object", + "tags": [], + "label": "ESTermsWithAggregationRT", + "description": [], + "signature": [ + "TypeC", + "<{ terms: ", + "TypeC", + "<{ field: ", + "StringC", + "; }>; aggregations: ", + "UnknownRecordC", + "; }>" ], "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", "deprecated": false, @@ -1895,146 +2751,452 @@ }, { "parentPluginId": "metricsDataAccess", - "id": "def-common.MetricsUIAggregationRT", + "id": "def-common.MetricsAPIColumnRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIColumnRT", + "description": [], + "signature": [ + "TypeC", + "<{ name: ", + "StringC", + "; type: ", + "KeyofC", + "<{ date: null; number: null; string: null; }>; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIColumnTypeRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIColumnTypeRT", + "description": [], + "signature": [ + "KeyofC", + "<{ date: null; number: null; string: null; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIMetricRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIMetricRT", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; aggregations: ", + "UnknownRecordC", + "; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIPageInfoRT", "type": "Object", "tags": [], - "label": "MetricsUIAggregationRT", + "label": "MetricsAPIPageInfoRT", "description": [], "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ afterKey: ", + "UnionC", + "<[", + "NullC", + ", ", "RecordC", "<", "StringC", ", ", "UnionC", "<[", - "RecordC", + "StringC", + ", ", + "NullC", + "]>>, ", + "UndefinedC", + "]>; }>, ", + "PartialC", + "<{ interval: ", + "NumberC", + "; }>]>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIRequestRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIRequestRT", + "description": [], + "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ timerange: ", + "TypeC", + "<{ from: ", + "NumberC", + "; to: ", + "NumberC", + "; interval: ", + "StringC", + "; }>; indexPattern: ", + "StringC", + "; metrics: ", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; aggregations: ", + "UnknownRecordC", + "; }>>; includeTimeseries: ", + "UnionC", + "<[", + "BooleanC", + ", ", + "Type", + "]>; }>, ", + "PartialC", + "<{ groupBy: ", + "ArrayC", "<", + "UnionC", + "<[", "StringC", ", ", + "NullC", + ", ", + "UndefinedC", + "]>>; groupInstance: ", + "ArrayC", + "<", "UnionC", "<[", + "StringC", + ", ", + "NullC", + ", ", "UndefinedC", + "]>>; modules: ", + "ArrayC", + "<", + "StringC", + ">; afterKey: ", + "UnionC", + "<[", + "NullC", ", ", - "TypeC", - "<{ field: ", + "RecordC", + "<", + "StringC", + ", ", + "UnionC", + "<[", "StringC", - "; }>]>>, ", + ", ", + "NullC", + "]>>]>; limit: ", + "UnionC", + "<[", + "NumberC", + ", ", + "NullC", + "]>; filters: ", + "ArrayC", + "<", + "UnknownRecordC", + ">; dropPartialBuckets: ", + "BooleanC", + "; alignDataToEnd: ", + "BooleanC", + "; }>]>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIResponseRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIResponseRT", + "description": [], + "signature": [ "TypeC", - "<{ percentiles: ", + "<{ series: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "IntersectionC", + "<[", "TypeC", - "<{ field: ", + "<{ id: ", "StringC", - "; percents: ", + "; columns: ", "ArrayC", "<", - "NumberC", - ">; }>; }>, ", "TypeC", - "<{ bucket_script: ", + "<{ name: ", + "StringC", + "; type: ", + "KeyofC", + "<{ date: null; number: null; string: null; }>; }>>; rows: ", + "ArrayC", + "<", "IntersectionC", "<[", "TypeC", - "<{ buckets_path: ", + "<{ timestamp: ", + "NumberC", + "; }>, ", "RecordC", "<", "StringC", ", ", + "UnionC", + "<[", "StringC", - ">; script: ", - "TypeC", - "<{ source: ", + ", ", + "NumberC", + ", ", + "NullC", + ", ", + "UndefinedC", + ", ", + "ArrayC", + "<", + "ObjectC", + ">]>>]>>; }>, ", + "PartialC", + "<{ keys: ", + "ArrayC", + "<", "StringC", - "; lang: ", - "KeyofC", - "<{ painless: null; expression: null; }>; }>; }>, ", + ">; }>]>, ", "PartialC", - "<{ gap_policy: ", - "KeyofC", - "<{ skip: null; insert_zeros: null; }>; }>]>; }>, ", - "TypeC", - "<{ cumulative_sum: ", - "TypeC", - "<{ buckets_path: ", + "<{ metricsets: ", + "ArrayC", + "<", "StringC", - "; }>; }>, ", - "TypeC", - "<{ derivative: ", + ">; }>]>>; info: ", + "IntersectionC", + "<[", "TypeC", - "<{ buckets_path: ", + "<{ afterKey: ", + "UnionC", + "<[", + "NullC", + ", ", + "RecordC", + "<", "StringC", - "; gap_policy: ", - "KeyofC", - "<{ skip: null; insert_zeros: null; }>; unit: ", + ", ", + "UnionC", + "<[", "StringC", - "; }>; }>, ", + ", ", + "NullC", + "]>>, ", + "UndefinedC", + "]>; }>, ", + "PartialC", + "<{ interval: ", + "NumberC", + "; }>]>; }>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIResponseSeriesRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIResponseSeriesRT", + "description": [], + "signature": [ + "IntersectionC", + "<[", + "IntersectionC", + "<[", "TypeC", - "<{ sum_bucket: ", + "<{ id: ", + "StringC", + "; columns: ", + "ArrayC", + "<", "TypeC", - "<{ buckets_path: ", + "<{ name: ", "StringC", - "; }>; }>, ", - "Type", + "; type: ", + "KeyofC", + "<{ date: null; number: null; string: null; }>; }>>; rows: ", + "ArrayC", "<", - "SnapshotTermsWithAggregation", - ", ", - "SnapshotTermsWithAggregation", - ", unknown>, ", + "IntersectionC", + "<[", "TypeC", - "<{ cardinality: ", + "<{ timestamp: ", + "NumberC", + "; }>, ", + "RecordC", + "<", + "StringC", + ", ", + "UnionC", + "<[", + "StringC", + ", ", + "NumberC", + ", ", + "NullC", + ", ", + "UndefinedC", + ", ", + "ArrayC", + "<", + "ObjectC", + ">]>>]>>; }>, ", "PartialC", - "<{ field: ", + "<{ keys: ", + "ArrayC", + "<", "StringC", - "; }>; }>, ", - "TypeC", - "<{ top_metrics: ", + ">; }>]>, ", + "PartialC", + "<{ metricsets: ", + "ArrayC", + "<", + "StringC", + ">; }>]>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPIRowRT", + "type": "Object", + "tags": [], + "label": "MetricsAPIRowRT", + "description": [], + "signature": [ "IntersectionC", "<[", "TypeC", - "<{ metrics: ", + "<{ timestamp: ", + "NumberC", + "; }>, ", + "RecordC", + "<", + "StringC", + ", ", "UnionC", "<[", + "StringC", + ", ", + "NumberC", + ", ", + "NullC", + ", ", + "UndefinedC", + ", ", "ArrayC", "<", + "ObjectC", + ">]>>]>" + ], + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "metricsDataAccess", + "id": "def-common.MetricsAPISeriesRT", + "type": "Object", + "tags": [], + "label": "MetricsAPISeriesRT", + "description": [], + "signature": [ + "IntersectionC", + "<[", "TypeC", - "<{ field: ", + "<{ id: ", "StringC", - "; }>>, ", + "; columns: ", + "ArrayC", + "<", "TypeC", - "<{ field: ", + "<{ name: ", "StringC", - "; }>]>; }>, ", - "PartialC", - "<{ size: ", + "; type: ", + "KeyofC", + "<{ date: null; number: null; string: null; }>; }>>; rows: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "TypeC", + "<{ timestamp: ", "NumberC", - "; sort: ", + "; }>, ", "RecordC", "<", "StringC", ", ", "UnionC", "<[", - "LiteralC", - "<\"desc\">, ", - "LiteralC", - "<\"asc\">]>>; }>]>; }>, ", - "TypeC", - "<{ filter: ", - "TypeC", - "<{ exists: ", - "TypeC", - "<{ field: ", "StringC", - "; }>; }>; aggs: ", - "TypeC", - "<{ period: ", - "TypeC", - "<{ max: ", - "TypeC", - "<{ field: ", + ", ", + "NumberC", + ", ", + "NullC", + ", ", + "UndefinedC", + ", ", + "ArrayC", + "<", + "ObjectC", + ">]>>]>>; }>, ", + "PartialC", + "<{ keys: ", + "ArrayC", + "<", "StringC", - "; }>; }>; }>; }>]>>" + ">; }>]>" ], - "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", + "path": "x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index c6ad47665033d..0360707eb9fe4 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 108 | 8 | 108 | 6 | +| 128 | 8 | 128 | 5 | ## Client @@ -56,6 +56,9 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- ### Functions +### Interfaces + + ### Consts, variables and types diff --git a/api_docs/ml.devdocs.json b/api_docs/ml.devdocs.json index 2667ec97d5072..8a976f079a485 100644 --- a/api_docs/ml.devdocs.json +++ b/api_docs/ml.devdocs.json @@ -1343,7 +1343,13 @@ ">; getDataFrameAnalyticsStats(analyticsId?: string | undefined): Promise<", "GetDataFrameAnalyticsStatsResponse", ">; createDataFrameAnalytics(analyticsId: string, analyticsConfig: ", - "DeepPartial", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", { "pluginId": "@kbn/ml-data-frame-analytics-utils", @@ -1373,7 +1379,13 @@ ">; jobsExist(analyticsIds: string[], allSpaces?: boolean): Promise<", "JobsExistsResponse", ">; evaluateDataFrameAnalytics(evaluateConfig: any): Promise; explainDataFrameAnalytics(jobConfig: ", - "DeepPartial", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", { "pluginId": "@kbn/ml-data-frame-analytics-utils", @@ -1387,7 +1399,13 @@ ">; startDataFrameAnalytics(analyticsId: string): Promise; stopDataFrameAnalytics(analyticsId: string, force?: boolean): Promise; getAnalyticsAuditMessages(analyticsId: string): Promise<", "JobMessage", "[]>; validateDataFrameAnalytics(analyticsConfig: ", - "DeepPartial", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.DeepPartialObject", + "text": "DeepPartialObject" + }, "<", { "pluginId": "@kbn/ml-data-frame-analytics-utils", @@ -1717,10 +1735,10 @@ "text": "ModelConfig" }, "): Promise<", - "InferenceModelConfigContainer", - ">; getAllInferenceEndpoints(): Promise<{ endpoints: ", - "InferenceModelConfigContainer", - "[]; }>; }; notifications: { findMessages(params: ", + "InferenceInferenceEndpointInfo", + ">; getAllInferenceEndpoints(): Promise<", + "InferenceGetResponse", + ">; }; notifications: { findMessages(params: ", "NotificationsQueryParams", "): Promise<", "NotificationsSearchResponse", diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index e92257dc81967..4ac951d3fcf9d 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: 2024-08-14 +date: 2024-08-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 | |-------------------|-----------|------------------------|-----------------| -| 154 | 3 | 67 | 102 | +| 154 | 3 | 67 | 101 | ## Client diff --git a/api_docs/mock_idp_plugin.mdx b/api_docs/mock_idp_plugin.mdx index 573b351ea388f..bf6178562bf88 100644 --- a/api_docs/mock_idp_plugin.mdx +++ b/api_docs/mock_idp_plugin.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mockIdpPlugin title: "mockIdpPlugin" image: https://source.unsplash.com/400x175/?github description: API docs for the mockIdpPlugin plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mockIdpPlugin'] --- import mockIdpPluginObj from './mock_idp_plugin.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 3831427b38728..4857bbdd475f5 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: 2024-08-14 +date: 2024-08-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 da5915f123d02..bb4c3c8a863be 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: 2024-08-14 +date: 2024-08-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 5910723645fd8..6157119d10d6d 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: 2024-08-14 +date: 2024-08-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 8d4c25b512f05..ace8fd60efdbc 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: 2024-08-14 +date: 2024-08-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 dc4bd53393d0c..635563244ce1d 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: 2024-08-14 +date: 2024-08-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 10a56ce8df9b5..71110305478bf 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: 2024-08-14 +date: 2024-08-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 75b56890e1f3b..9be924035f454 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -3821,6 +3821,27 @@ "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ObservabilityPublicPluginsStart.investigate", + "type": "Object", + "tags": [], + "label": "investigate", + "description": [], + "signature": [ + { + "pluginId": "investigate", + "scope": "public", + "docId": "kibInvestigatePluginApi", + "section": "def-public.InvestigatePublicStart", + "text": "InvestigatePublicStart" + }, + " | undefined" + ], + "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -5495,7 +5516,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -5531,6 +5552,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -5589,6 +5636,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -6183,7 +6232,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -6209,7 +6260,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -6455,6 +6506,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -6816,7 +6869,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -6852,6 +6905,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -6910,6 +6989,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -7504,7 +7585,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -7530,7 +7613,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -7776,6 +7859,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -8828,7 +8913,11 @@ "StringC", "; }>, ", "PartialC", - "<{ 'service.name': ", + "<{ alert_rule_parameter_time_size: ", + "StringC", + "; alert_rule_parameter_time_unit: ", + "StringC", + "; 'service.name': ", "StringC", "; 'service.environment': ", "StringC", @@ -8850,7 +8939,7 @@ "section": "def-server.ObservabilityRouteHandlerResources", "text": "ObservabilityRouteHandlerResources" }, - " & { params: { query: { alert_started_at: string; } & { 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", + " & { params: { query: { alert_started_at: string; } & { alert_rule_parameter_time_size?: string | undefined; alert_rule_parameter_time_unit?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", "AlertDetailsContextualInsight", "[]; }>; } & ", { @@ -8952,7 +9041,11 @@ "StringC", "; }>, ", "PartialC", - "<{ 'service.name': ", + "<{ alert_rule_parameter_time_size: ", + "StringC", + "; alert_rule_parameter_time_unit: ", + "StringC", + "; 'service.name': ", "StringC", "; 'service.environment': ", "StringC", @@ -8974,7 +9067,7 @@ "section": "def-server.ObservabilityRouteHandlerResources", "text": "ObservabilityRouteHandlerResources" }, - " & { params: { query: { alert_started_at: string; } & { 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", + " & { params: { query: { alert_started_at: string; } & { alert_rule_parameter_time_size?: string | undefined; alert_rule_parameter_time_unit?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", "AlertDetailsContextualInsight", "[]; }>; } & ", { @@ -9005,7 +9098,7 @@ "SearchInnerHitsResult", "> | undefined; matched_queries?: string[] | undefined; _nested?: ", "SearchNestedIdentity", - " | undefined; _ignored?: string[] | undefined; ignored_field_values?: Record | undefined; _shard?: string | undefined; _node?: string | undefined; _routing?: string | undefined; _seq_no?: number | undefined; _primary_term?: number | undefined; _version?: number | undefined; sort?: ", + " | undefined; _ignored?: string[] | undefined; ignored_field_values?: Record | undefined; _shard?: string | undefined; _node?: string | undefined; _routing?: string | undefined; _rank?: number | undefined; _seq_no?: number | undefined; _primary_term?: number | undefined; _version?: number | undefined; sort?: ", "SortResults", " | undefined; }>; find: (findParams: { query?: string | undefined; start?: string | undefined; end?: string | undefined; sloId?: string | undefined; sloInstanceId?: string | undefined; serviceName?: string | undefined; }) => Promise<{ items: { id: string | undefined; annotation: { title: string; type?: string | undefined; style?: { icon?: string | undefined; color?: string | undefined; line?: { width?: number | undefined; style?: \"dashed\" | \"solid\" | \"dotted\" | undefined; iconPosition?: \"top\" | \"bottom\" | undefined; textDecoration?: \"none\" | \"name\" | undefined; } | undefined; rect?: { fill?: \"inside\" | \"outside\" | undefined; } | undefined; } | undefined; }; '@timestamp': string; message: string; event?: ({ start: string; } & { end?: string | undefined; }) | undefined; tags?: string[] | undefined; service?: { name?: string | undefined; environment?: string | undefined; version?: string | undefined; } | undefined; monitor?: { id?: string | undefined; } | undefined; slo?: ({ id: string; } & { instanceId?: string | undefined; }) | undefined; host?: { name?: string | undefined; } | undefined; }[]; total: number; }>; delete: (deleteParams: { id: string; }) => Promise<", "DeleteByQueryResponse", @@ -10894,7 +10987,7 @@ "label": "value", "description": [], "signature": [ - "false" + "true" ], "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", "deprecated": false, @@ -12807,7 +12900,7 @@ "SearchInnerHitsResult", "> | undefined; matched_queries?: string[] | undefined; _nested?: ", "SearchNestedIdentity", - " | undefined; _ignored?: string[] | undefined; ignored_field_values?: Record | undefined; _shard?: string | undefined; _node?: string | undefined; _routing?: string | undefined; _seq_no?: number | undefined; _primary_term?: number | undefined; _version?: number | undefined; sort?: ", + " | undefined; _ignored?: string[] | undefined; ignored_field_values?: Record | undefined; _shard?: string | undefined; _node?: string | undefined; _routing?: string | undefined; _rank?: number | undefined; _seq_no?: number | undefined; _primary_term?: number | undefined; _version?: number | undefined; sort?: ", "SortResults", " | undefined; }>; find: (findParams: { query?: string | undefined; start?: string | undefined; end?: string | undefined; sloId?: string | undefined; sloInstanceId?: string | undefined; serviceName?: string | undefined; }) => Promise<{ items: { id: string | undefined; annotation: { title: string; type?: string | undefined; style?: { icon?: string | undefined; color?: string | undefined; line?: { width?: number | undefined; style?: \"dashed\" | \"solid\" | \"dotted\" | undefined; iconPosition?: \"top\" | \"bottom\" | undefined; textDecoration?: \"none\" | \"name\" | undefined; } | undefined; rect?: { fill?: \"inside\" | \"outside\" | undefined; } | undefined; } | undefined; }; '@timestamp': string; message: string; event?: ({ start: string; } & { end?: string | undefined; }) | undefined; tags?: string[] | undefined; service?: { name?: string | undefined; environment?: string | undefined; version?: string | undefined; } | undefined; monitor?: { id?: string | undefined; } | undefined; slo?: ({ id: string; } & { instanceId?: string | undefined; }) | undefined; host?: { name?: string | undefined; } | undefined; }[]; total: number; }>; delete: (deleteParams: { id: string; }) => Promise<", "DeleteByQueryResponse", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 1ff83b5149b55..582d435eca404 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 701 | 2 | 694 | 22 | +| 702 | 2 | 695 | 22 | ## Client diff --git a/api_docs/observability_a_i_assistant.devdocs.json b/api_docs/observability_a_i_assistant.devdocs.json index 974d7df93c0fe..2315816499755 100644 --- a/api_docs/observability_a_i_assistant.devdocs.json +++ b/api_docs/observability_a_i_assistant.devdocs.json @@ -1231,6 +1231,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-public.KnowledgeBaseEntry.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"user_instruction\" | \"contextual\" | undefined" + ], + "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.KnowledgeBaseEntry.public", @@ -1592,8 +1606,8 @@ "section": "def-common.Message", "text": "Message" }, - "[]; persist: boolean; disableFunctions: boolean | { except: string[]; }; signal: AbortSignal; responseLanguage?: string | undefined; instructions?: ", - "UserInstructionOrPlainText", + "[]; persist: boolean; disableFunctions: boolean | { except: string[]; }; signal: AbortSignal; instructions?: ", + "AdHocInstruction", "[] | undefined; }) => ", "Observable", "<", @@ -1724,20 +1738,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.ObservabilityAIAssistantChatService.complete.$1.responseLanguage", - "type": "string", - "tags": [], - "label": "responseLanguage", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantChatService.complete.$1.instructions", @@ -1746,7 +1746,7 @@ "label": "instructions", "description": [], "signature": [ - "UserInstructionOrPlainText", + "AdHocInstruction", "[] | undefined" ], "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", @@ -2050,7 +2050,7 @@ "label": "callApi", "description": [], "signature": [ - "(endpoint: TEndpoint, ...args: MaybeOptionalArgs<", + "(endpoint: TEndpoint, ...args: MaybeOptionalArgs<", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -2166,6 +2166,46 @@ }, ">; }[]; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", + "; \"GET /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"GET /internal/observability_ai_assistant/kb/user_instructions\"; params?: undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + ") => Promise<{ userInstructions: (", + "Instruction", + " & { public?: boolean | undefined; })[]; }>; } & ", + "ObservabilityAIAssistantRouteCreateOptions", + "; \"PUT /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"PUT /internal/observability_ai_assistant/kb/user_instructions\"; params?: ", + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; text: ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">; public: ", + "Type", + "; }>; }> | undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + " & { params: { body: { id: string; text: ", + "Branded", + "; public: boolean; }; }; }) => Promise; } & ", + "ObservabilityAIAssistantRouteCreateOptions", "; \"GET /internal/observability_ai_assistant/kb/entries\": { endpoint: \"GET /internal/observability_ai_assistant/kb/entries\"; params?: ", "TypeC", "<{ query: ", @@ -2232,7 +2272,13 @@ "LiteralC", "<\"high\">]>; is_correction: ", "Type", - "; public: ", + "; type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"contextual\">]>; public: ", "Type", "; labels: ", "RecordC", @@ -2252,7 +2298,7 @@ "section": "def-common.NonEmptyStringBrand", "text": "NonEmptyStringBrand" }, - ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", + ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; type: \"user_instruction\" | \"contextual\"; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", "; \"POST /internal/observability_ai_assistant/functions/recall\": { endpoint: \"POST /internal/observability_ai_assistant/functions/recall\"; params?: ", "TypeC", @@ -2466,8 +2512,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -2481,22 +2525,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "PartialC", "<{ body: ", "PartialC", @@ -2532,7 +2576,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -2574,8 +2618,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -2589,22 +2631,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "TypeC", "<{ body: ", "TypeC", @@ -2626,7 +2668,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -2826,6 +2868,46 @@ }, ">; }[]; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", + "; \"GET /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"GET /internal/observability_ai_assistant/kb/user_instructions\"; params?: undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + ") => Promise<{ userInstructions: (", + "Instruction", + " & { public?: boolean | undefined; })[]; }>; } & ", + "ObservabilityAIAssistantRouteCreateOptions", + "; \"PUT /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"PUT /internal/observability_ai_assistant/kb/user_instructions\"; params?: ", + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; text: ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">; public: ", + "Type", + "; }>; }> | undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + " & { params: { body: { id: string; text: ", + "Branded", + "; public: boolean; }; }; }) => Promise; } & ", + "ObservabilityAIAssistantRouteCreateOptions", "; \"GET /internal/observability_ai_assistant/kb/entries\": { endpoint: \"GET /internal/observability_ai_assistant/kb/entries\"; params?: ", "TypeC", "<{ query: ", @@ -2892,7 +2974,13 @@ "LiteralC", "<\"high\">]>; is_correction: ", "Type", - "; public: ", + "; type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"contextual\">]>; public: ", "Type", "; labels: ", "RecordC", @@ -2912,7 +3000,7 @@ "section": "def-common.NonEmptyStringBrand", "text": "NonEmptyStringBrand" }, - ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", + ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; type: \"user_instruction\" | \"contextual\"; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", "; \"POST /internal/observability_ai_assistant/functions/recall\": { endpoint: \"POST /internal/observability_ai_assistant/functions/recall\"; params?: ", "TypeC", @@ -3126,8 +3214,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -3141,22 +3227,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "PartialC", "<{ body: ", "PartialC", @@ -3192,7 +3278,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -3234,8 +3320,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -3249,22 +3333,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "TypeC", "<{ body: ", "TypeC", @@ -3286,7 +3370,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -3860,6 +3944,18 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-public.KnowledgeBaseType", + "type": "Enum", + "tags": [], + "label": "KnowledgeBaseType", + "description": [], + "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.MessageRole", @@ -3942,13 +4038,13 @@ }, { "parentPluginId": "observabilityAIAssistant", - "id": "def-public.aiAssistantResponseLanguage", + "id": "def-public.aiAssistantPreferredAIAssistantType", "type": "string", "tags": [], - "label": "aiAssistantResponseLanguage", + "label": "aiAssistantPreferredAIAssistantType", "description": [], "signature": [ - "\"observability:aiAssistantResponseLanguage\"" + "\"aiAssistant:preferredAIAssistantType\"" ], "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, @@ -4101,6 +4197,46 @@ }, ">; }[]; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", + "; \"GET /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"GET /internal/observability_ai_assistant/kb/user_instructions\"; params?: undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + ") => Promise<{ userInstructions: (", + "Instruction", + " & { public?: boolean | undefined; })[]; }>; } & ", + "ObservabilityAIAssistantRouteCreateOptions", + "; \"PUT /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"PUT /internal/observability_ai_assistant/kb/user_instructions\"; params?: ", + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; text: ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">; public: ", + "Type", + "; }>; }> | undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + " & { params: { body: { id: string; text: ", + "Branded", + "; public: boolean; }; }; }) => Promise; } & ", + "ObservabilityAIAssistantRouteCreateOptions", "; \"GET /internal/observability_ai_assistant/kb/entries\": { endpoint: \"GET /internal/observability_ai_assistant/kb/entries\"; params?: ", "TypeC", "<{ query: ", @@ -4167,7 +4303,13 @@ "LiteralC", "<\"high\">]>; is_correction: ", "Type", - "; public: ", + "; type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"contextual\">]>; public: ", "Type", "; labels: ", "RecordC", @@ -4187,7 +4329,7 @@ "section": "def-common.NonEmptyStringBrand", "text": "NonEmptyStringBrand" }, - ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", + ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; type: \"user_instruction\" | \"contextual\"; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", "; \"POST /internal/observability_ai_assistant/functions/recall\": { endpoint: \"POST /internal/observability_ai_assistant/functions/recall\"; params?: ", "TypeC", @@ -4401,8 +4543,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -4416,22 +4556,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "PartialC", "<{ body: ", "PartialC", @@ -4467,7 +4607,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -4509,8 +4649,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -4524,22 +4662,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "TypeC", "<{ body: ", "TypeC", @@ -4561,7 +4699,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -4868,21 +5006,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.LANGUAGE_OPTIONS", - "type": "Array", - "tags": [], - "label": "LANGUAGE_OPTIONS", - "description": [], - "signature": [ - "{ value: string; label: string; }[]" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantAPIClientRequestParamsOf", @@ -4999,6 +5122,46 @@ }, ">; }[]; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", + "; \"GET /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"GET /internal/observability_ai_assistant/kb/user_instructions\"; params?: undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + ") => Promise<{ userInstructions: (", + "Instruction", + " & { public?: boolean | undefined; })[]; }>; } & ", + "ObservabilityAIAssistantRouteCreateOptions", + "; \"PUT /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"PUT /internal/observability_ai_assistant/kb/user_instructions\"; params?: ", + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; text: ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">; public: ", + "Type", + "; }>; }> | undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + " & { params: { body: { id: string; text: ", + "Branded", + "; public: boolean; }; }; }) => Promise; } & ", + "ObservabilityAIAssistantRouteCreateOptions", "; \"GET /internal/observability_ai_assistant/kb/entries\": { endpoint: \"GET /internal/observability_ai_assistant/kb/entries\"; params?: ", "TypeC", "<{ query: ", @@ -5065,7 +5228,13 @@ "LiteralC", "<\"high\">]>; is_correction: ", "Type", - "; public: ", + "; type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"contextual\">]>; public: ", "Type", "; labels: ", "RecordC", @@ -5085,7 +5254,7 @@ "section": "def-common.NonEmptyStringBrand", "text": "NonEmptyStringBrand" }, - ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", + ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; type: \"user_instruction\" | \"contextual\"; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", "; \"POST /internal/observability_ai_assistant/functions/recall\": { endpoint: \"POST /internal/observability_ai_assistant/functions/recall\"; params?: ", "TypeC", @@ -5299,8 +5468,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -5314,22 +5481,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "PartialC", "<{ body: ", "PartialC", @@ -5365,7 +5532,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -5407,8 +5574,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -5422,22 +5587,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "TypeC", "<{ body: ", "TypeC", @@ -5459,7 +5624,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -5582,7 +5747,7 @@ "label": "ObservabilityAIAssistantAPIEndpoint", "description": [], "signature": [ - "\"POST /internal/observability_ai_assistant/chat\" | \"POST /internal/observability_ai_assistant/chat/recall\" | \"POST /internal/observability_ai_assistant/chat/complete\" | \"POST /api/observability_ai_assistant/chat/complete 2023-10-31\" | \"GET /internal/observability_ai_assistant/conversation/{conversationId}\" | \"POST /internal/observability_ai_assistant/conversations\" | \"POST /internal/observability_ai_assistant/conversation\" | \"PUT /internal/observability_ai_assistant/conversation/{conversationId}\" | \"PUT /internal/observability_ai_assistant/conversation/{conversationId}/title\" | \"DELETE /internal/observability_ai_assistant/conversation/{conversationId}\" | \"GET /internal/observability_ai_assistant/connectors\" | \"GET /internal/observability_ai_assistant/functions\" | \"POST /internal/observability_ai_assistant/functions/recall\" | \"POST /internal/observability_ai_assistant/functions/summarize\" | \"POST /internal/observability_ai_assistant/kb/setup\" | \"GET /internal/observability_ai_assistant/kb/status\" | \"GET /internal/observability_ai_assistant/kb/entries\" | \"POST /internal/observability_ai_assistant/kb/entries/import\" | \"POST /internal/observability_ai_assistant/kb/entries/save\" | \"DELETE /internal/observability_ai_assistant/kb/entries/{entryId}\"" + "\"POST /internal/observability_ai_assistant/chat\" | \"POST /internal/observability_ai_assistant/chat/recall\" | \"POST /internal/observability_ai_assistant/chat/complete\" | \"POST /api/observability_ai_assistant/chat/complete 2023-10-31\" | \"GET /internal/observability_ai_assistant/conversation/{conversationId}\" | \"POST /internal/observability_ai_assistant/conversations\" | \"POST /internal/observability_ai_assistant/conversation\" | \"PUT /internal/observability_ai_assistant/conversation/{conversationId}\" | \"PUT /internal/observability_ai_assistant/conversation/{conversationId}/title\" | \"DELETE /internal/observability_ai_assistant/conversation/{conversationId}\" | \"GET /internal/observability_ai_assistant/connectors\" | \"GET /internal/observability_ai_assistant/functions\" | \"POST /internal/observability_ai_assistant/functions/recall\" | \"POST /internal/observability_ai_assistant/functions/summarize\" | \"POST /internal/observability_ai_assistant/kb/setup\" | \"GET /internal/observability_ai_assistant/kb/status\" | \"GET /internal/observability_ai_assistant/kb/entries\" | \"PUT /internal/observability_ai_assistant/kb/user_instructions\" | \"GET /internal/observability_ai_assistant/kb/user_instructions\" | \"POST /internal/observability_ai_assistant/kb/entries/import\" | \"POST /internal/observability_ai_assistant/kb/entries/save\" | \"DELETE /internal/observability_ai_assistant/kb/entries/{entryId}\"" ], "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/api/index.ts", "deprecated": false, @@ -5820,21 +5985,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.DEFAULT_LANGUAGE_OPTION", - "type": "Object", - "tags": [], - "label": "DEFAULT_LANGUAGE_OPTION", - "description": [], - "signature": [ - "{ value: string; label: string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false } ], "setup": { @@ -6064,22 +6214,6 @@ } ] }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.ObservabilityAIAssistantPublicStart.useUserPreferredLanguage", - "type": "Function", - "tags": [], - "label": "useUserPreferredLanguage", - "description": [], - "signature": [ - "() => { selectedLanguage: string; getPreferredLanguage: () => string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantPublicStart.getContextualInsightMessages", @@ -6288,21 +6422,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-server.aiAssistantResponseLanguage", - "type": "string", - "tags": [], - "label": "aiAssistantResponseLanguage", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-server.aiAssistantSearchConnectorIndexPattern", @@ -6449,6 +6568,46 @@ }, ">; }[]; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", + "; \"GET /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"GET /internal/observability_ai_assistant/kb/user_instructions\"; params?: undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + ") => Promise<{ userInstructions: (", + "Instruction", + " & { public?: boolean | undefined; })[]; }>; } & ", + "ObservabilityAIAssistantRouteCreateOptions", + "; \"PUT /internal/observability_ai_assistant/kb/user_instructions\": { endpoint: \"PUT /internal/observability_ai_assistant/kb/user_instructions\"; params?: ", + "TypeC", + "<{ body: ", + "TypeC", + "<{ id: ", + "StringC", + "; text: ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">; public: ", + "Type", + "; }>; }> | undefined; handler: ({}: ", + "ObservabilityAIAssistantRouteHandlerResources", + " & { params: { body: { id: string; text: ", + "Branded", + "; public: boolean; }; }; }) => Promise; } & ", + "ObservabilityAIAssistantRouteCreateOptions", "; \"GET /internal/observability_ai_assistant/kb/entries\": { endpoint: \"GET /internal/observability_ai_assistant/kb/entries\"; params?: ", "TypeC", "<{ query: ", @@ -6515,7 +6674,13 @@ "LiteralC", "<\"high\">]>; is_correction: ", "Type", - "; public: ", + "; type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"contextual\">]>; public: ", "Type", "; labels: ", "RecordC", @@ -6535,7 +6700,7 @@ "section": "def-common.NonEmptyStringBrand", "text": "NonEmptyStringBrand" }, - ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", + ">; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; type: \"user_instruction\" | \"contextual\"; public: boolean; labels: { [x: string]: string; }; }; }; }) => Promise; } & ", "ObservabilityAIAssistantRouteCreateOptions", "; \"POST /internal/observability_ai_assistant/functions/recall\": { endpoint: \"POST /internal/observability_ai_assistant/functions/recall\"; params?: ", "TypeC", @@ -6749,8 +6914,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -6764,22 +6927,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "PartialC", "<{ body: ", "PartialC", @@ -6815,7 +6978,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -6857,8 +7020,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -6872,22 +7033,22 @@ ">; }>]>; instructions: ", "ArrayC", "<", - "UnionC", - "<[", - "StringC", - ", ", "IntersectionC", "<[", - "TypeC", + "PartialC", "<{ doc_id: ", "StringC", - "; text: ", - "StringC", "; }>, ", - "PartialC", - "<{ system: ", - "BooleanC", - "; }>]>]>>; }>]>; }>, ", + "TypeC", + "<{ text: ", + "StringC", + "; instruction_type: ", + "UnionC", + "<[", + "LiteralC", + "<\"user_instruction\">, ", + "LiteralC", + "<\"application_instruction\">]>; }>]>>; }>]>; }>, ", "TypeC", "<{ body: ", "TypeC", @@ -6909,7 +7070,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: (string | ({ doc_id: string; text: string; } & { system?: boolean | undefined; }))[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -7921,6 +8082,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-common.KnowledgeBaseEntry.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"user_instruction\" | \"contextual\" | undefined" + ], + "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.KnowledgeBaseEntry.public", @@ -8092,6 +8267,18 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-common.KnowledgeBaseType", + "type": "Enum", + "tags": [], + "label": "KnowledgeBaseType", + "description": [], + "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.MessageRole", @@ -8145,21 +8332,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.aiAssistantResponseLanguage", - "type": "string", - "tags": [], - "label": "aiAssistantResponseLanguage", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.aiAssistantSearchConnectorIndexPattern", @@ -8431,21 +8603,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.LANGUAGE_OPTIONS", - "type": "Array", - "tags": [], - "label": "LANGUAGE_OPTIONS", - "description": [], - "signature": [ - "{ value: string; label: string; }[]" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.MessageAddEvent", @@ -8602,22 +8759,6 @@ "initialIsOpen": false } ], - "objects": [ - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.DEFAULT_LANGUAGE_OPTION", - "type": "Object", - "tags": [], - "label": "DEFAULT_LANGUAGE_OPTION", - "description": [], - "signature": [ - "{ value: string; label: string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ] + "objects": [] } } \ No newline at end of file diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index cc14a02153800..4a7da59c69bcb 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 290 | 1 | 288 | 26 | +| 286 | 1 | 284 | 27 | ## Client @@ -65,9 +65,6 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai ## Common -### Objects - - ### Functions diff --git a/api_docs/observability_a_i_assistant_app.mdx b/api_docs/observability_a_i_assistant_app.mdx index 138a51511b08f..14baf68ab7485 100644 --- a/api_docs/observability_a_i_assistant_app.mdx +++ b/api_docs/observability_a_i_assistant_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistantApp title: "observabilityAIAssistantApp" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistantApp plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistantApp'] --- import observabilityAIAssistantAppObj from './observability_a_i_assistant_app.devdocs.json'; diff --git a/api_docs/observability_ai_assistant_management.mdx b/api_docs/observability_ai_assistant_management.mdx index e82be12f9baa0..8b9a2c32a5282 100644 --- a/api_docs/observability_ai_assistant_management.mdx +++ b/api_docs/observability_ai_assistant_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAiAssistantManagement title: "observabilityAiAssistantManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAiAssistantManagement plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAiAssistantManagement'] --- import observabilityAiAssistantManagementObj from './observability_ai_assistant_management.devdocs.json'; diff --git a/api_docs/observability_logs_explorer.mdx b/api_docs/observability_logs_explorer.mdx index 3269484d26d14..2c7b4a9e66168 100644 --- a/api_docs/observability_logs_explorer.mdx +++ b/api_docs/observability_logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityLogsExplorer title: "observabilityLogsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityLogsExplorer plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityLogsExplorer'] --- import observabilityLogsExplorerObj from './observability_logs_explorer.devdocs.json'; diff --git a/api_docs/observability_onboarding.mdx b/api_docs/observability_onboarding.mdx index 198fd05e4287b..5840bf8d71821 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.devdocs.json b/api_docs/observability_shared.devdocs.json index b7ce0524edb82..57a4bf6fb5ad6 100644 --- a/api_docs/observability_shared.devdocs.json +++ b/api_docs/observability_shared.devdocs.json @@ -3869,7 +3869,15 @@ "section": "def-common.AssetDetailsLocatorParams", "text": "AssetDetailsLocatorParams" }, - ") => Promise<{ app: string; path: string; state: ", + " & { state?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + }, + " | undefined; }) => Promise<{ app: string; path: string; state: ", { "pluginId": "@kbn/utility-types", "scope": "common", @@ -3886,7 +3894,7 @@ { "parentPluginId": "observabilityShared", "id": "def-common.AssetDetailsLocatorDefinition.getLocation.$1", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "params", "description": [], @@ -3897,7 +3905,16 @@ "docId": "kibObservabilitySharedPluginApi", "section": "def-common.AssetDetailsLocatorParams", "text": "AssetDetailsLocatorParams" - } + }, + " & { state?: ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + }, + " | undefined; }" ], "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/asset_details_locator.ts", "deprecated": false, @@ -4935,27 +4952,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "observabilityShared", - "id": "def-common.AssetDetailsLocatorParams.state", - "type": "Object", - "tags": [], - "label": "state", - "description": [], - "signature": [ - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.SerializableRecord", - "text": "SerializableRecord" - }, - " | undefined" - ], - "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/asset_details_locator.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "observabilityShared", "id": "def-common.AssetDetailsLocatorParams._a", @@ -4978,7 +4974,7 @@ "label": "assetDetails", "description": [], "signature": [ - "{ tabId?: string | undefined; dashboardId?: string | undefined; dateRange?: { from: string; to: string; } | undefined; } | undefined" + "{ tabId?: string | undefined; name?: string | undefined; dashboardId?: string | undefined; dateRange?: { from: string; to: string; } | undefined; alertMetric?: string | undefined; } | undefined" ], "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/asset_details_locator.ts", "deprecated": false, @@ -5373,7 +5369,7 @@ "label": "sort", "description": [], "signature": [ - "{ by: string; direction: \"desc\" | \"async\"; }" + "{ by: string; direction: \"desc\" | \"async\"; } | undefined" ], "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/inventory_locator.ts", "deprecated": false, @@ -5382,10 +5378,13 @@ { "parentPluginId": "observabilityShared", "id": "def-common.InventoryLocatorParams.timelineOpen", - "type": "boolean", + "type": "CompoundType", "tags": [], "label": "timelineOpen", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/inventory_locator.ts", "deprecated": false, "trackAdoption": false @@ -5398,7 +5397,7 @@ "label": "view", "description": [], "signature": [ - "\"map\" | \"table\"" + "\"map\" | \"table\" | undefined" ], "path": "x-pack/plugins/observability_solution/observability_shared/common/locators/infra/inventory_locator.ts", "deprecated": false, diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index 8a5b74d272132..1a75342881719 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/observability-ui](https://github.com/orgs/elastic/teams/observ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 449 | 1 | 444 | 19 | +| 448 | 1 | 443 | 19 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 1527a3db32af7..3f8c919c8232f 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: 2024-08-14 +date: 2024-08-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 b98199db50b25..eb9c1cf036374 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: 2024-08-14 +date: 2024-08-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 9b371cbcb3132..a34bf2ec6cf3f 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,25 +15,25 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 832 | 708 | 45 | +| 849 | 723 | 46 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 52242 | 241 | 39176 | 1918 | +| 52833 | 243 | 39672 | 1940 | ## Plugin Directory | Plugin name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 307 | 0 | 301 | 32 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 314 | 0 | 308 | 33 | | | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 4 | 0 | 4 | 1 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | AIOps plugin maintained by ML team. | 74 | 0 | 9 | 2 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 871 | 1 | 839 | 52 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 875 | 1 | 843 | 52 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | The user interface for Elastic APM | 29 | 0 | 29 | 119 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 74 | 0 | 74 | 1 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 93 | 0 | 93 | 0 | | | [@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. | 83 | 1 | 73 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | @@ -49,7 +49,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | The cloud security posture plugin | 14 | 0 | 2 | 2 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 39 | 0 | 30 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Content management app | 149 | 0 | 125 | 6 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 380 | 0 | 371 | 27 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 394 | 0 | 385 | 28 | | crossClusterReplication | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | | customBranding | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Enables customization of Kibana | 0 | 0 | 0 | 0 | | | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 271 | 0 | 252 | 1 | @@ -62,9 +62,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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. | 1224 | 0 | 443 | 3 | | | [@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 | 4 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin introduces the concept of data set quality, where users can easily get an overview on the data sets they have. | 10 | 0 | 10 | 5 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin introduces the concept of data set quality, where users can easily get an overview on the data sets they have. | 15 | 0 | 15 | 8 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 15 | 0 | 9 | 2 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 149 | 0 | 102 | 26 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 150 | 0 | 102 | 26 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 35 | 0 | 33 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | A stateful layer to register shared features and provide an access point to discover without a direct dependency | 16 | 0 | 15 | 2 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | APIs used to assess the quality of data in Elasticsearch indexes | 2 | 0 | 0 | 0 | @@ -99,10 +99,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 247 | 0 | 102 | 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 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes services for async usage and search of fields metadata. | 42 | 0 | 42 | 7 | -| | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 84 | 0 | 84 | 8 | +| | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 88 | 0 | 88 | 8 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 240 | 0 | 24 | 9 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Simple UI for managing files in Kibana | 3 | 0 | 3 | 0 | -| | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1357 | 5 | 1234 | 74 | +| | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1362 | 5 | 1239 | 74 | | ftrApis | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 72 | 0 | 14 | 5 | | globalSearchBar | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 0 | 0 | 0 | 0 | @@ -113,36 +113,36 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 149 | 0 | 111 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Image embeddable | 1 | 0 | 1 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 0 | -| | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 227 | 0 | 222 | 1 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 16 | 0 | 14 | 11 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions | 37 | 0 | 34 | 6 | +| | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 238 | 0 | 233 | 1 | +| | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 16 | 0 | 14 | 11 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions | 38 | 0 | 35 | 6 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 0 | | inputControlVis | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Input Control visualization to Kibana | 0 | 0 | 0 | 0 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 127 | 2 | 100 | 4 | -| | [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) | Plugin implementing the Integration Assistant API and UI | 47 | 0 | 40 | 3 | +| | [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) | Plugin implementing the Integration Assistant API and UI | 54 | 0 | 46 | 3 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | -| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 112 | 0 | 112 | 6 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 43 | 0 | 43 | 4 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 5 | 0 | 5 | 2 | | | [@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) | - | 153 | 0 | 121 | 3 | | kibanaUsageCollection | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 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. | 685 | 0 | 583 | 62 | +| | [@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. | 688 | 0 | 586 | 62 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | A dashboard panel for creating links to dashboards or external links. | 5 | 0 | 5 | 0 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 226 | 0 | 97 | 52 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 13 | 0 | 11 | 7 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin provides a LogsExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. | 117 | 4 | 117 | 22 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes the shared components and APIs to access and visualize logs. | 300 | 0 | 272 | 32 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin provides a LogsExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. | 122 | 4 | 122 | 23 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes the shared components and APIs to access and visualize logs. | 310 | 0 | 282 | 32 | | logstash | [@elastic/logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 44 | 0 | 44 | 7 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 209 | 0 | 205 | 28 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 60 | 0 | 60 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | Exposes utilities for accessing metrics data | 108 | 8 | 108 | 6 | -| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 154 | 3 | 67 | 102 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | Exposes utilities for accessing metrics data | 128 | 8 | 128 | 5 | +| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 154 | 3 | 67 | 101 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 2 | 0 | 2 | 0 | | | [@elastic/stack-monitoring](https://github.com/orgs/elastic/teams/stack-monitoring) | - | 15 | 3 | 13 | 1 | | | [@elastic/stack-monitoring](https://github.com/orgs/elastic/teams/stack-monitoring) | - | 9 | 0 | 9 | 0 | @@ -150,13 +150,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 701 | 2 | 694 | 22 | -| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 290 | 1 | 288 | 26 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 702 | 2 | 695 | 22 | +| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 286 | 1 | 284 | 27 | | | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 4 | 0 | 4 | 0 | | | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin exposes and registers observability log consumption features. | 19 | 0 | 19 | 1 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 21 | 0 | 21 | 0 | -| | [@elastic/observability-ui](https://github.com/orgs/elastic/teams/observability-ui) | - | 449 | 1 | 444 | 19 | +| | [@elastic/observability-ui](https://github.com/orgs/elastic/teams/observability-ui) | - | 448 | 1 | 443 | 19 | | | [@elastic/security-defend-workflows](https://github.com/orgs/elastic/teams/security-defend-workflows) | - | 23 | 0 | 23 | 7 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds a standardized Presentation panel which allows any forward ref component to interface with various Kibana systems. | 11 | 0 | 11 | 4 | @@ -176,13 +176,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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. | 61 | 0 | 60 | 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 | 32 | 0 | 8 | 4 | +| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | AI Assistant for Search | 6 | 0 | 6 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Plugin hosting shared features for connectors | 19 | 0 | 19 | 3 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 18 | 0 | 10 | 0 | +| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 10 | 0 | 10 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 10 | 0 | 6 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Plugin to provide access to and rendering of python notebooks for use in the persistent developer console. | 10 | 0 | 10 | 1 | -| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 15 | 0 | 9 | 1 | +| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 17 | 0 | 11 | 1 | | searchprofiler | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-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. | 447 | 0 | 231 | 1 | +| | [@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. | 448 | 0 | 231 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 192 | 0 | 123 | 33 | | | [@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. | 7 | 0 | 7 | 0 | @@ -197,7 +199,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 25 | 0 | 25 | 3 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 10 | 0 | 10 | 0 | | synthetics | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 1 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 107 | 0 | 63 | 7 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 108 | 0 | 64 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 45 | 0 | 1 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 31 | 0 | 26 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1 | 0 | 1 | 0 | @@ -206,19 +208,19 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 226 | 1 | 182 | 17 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [@elastic/kibana-localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 590 | 1 | 564 | 51 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 591 | 1 | 565 | 51 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds UI Actions service to Kibana | 156 | 0 | 110 | 9 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Extends UI Actions plugin with more functionality | 212 | 0 | 145 | 11 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains services reliant on the plugin lifecycle for the unified doc viewer component (see @kbn/unified-doc-viewer). | 15 | 0 | 10 | 3 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | The `unifiedHistogram` plugin provides UI components to create a layout including a resizable histogram and a main display. | 71 | 0 | 36 | 6 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 149 | 2 | 112 | 22 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 149 | 2 | 112 | 21 | | upgradeAssistant | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | This plugin visualizes data from Heartbeat, and integrates with other Observability solutions. | 1 | 0 | 1 | 0 | | urlDrilldown | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds drilldown implementations to Kibana | 0 | 0 | 0 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 12 | 0 | 12 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 51 | 0 | 14 | 4 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 52 | 0 | 14 | 5 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 2 | 0 | 2 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The default editor used in most aggregation-based visualizations. | 56 | 0 | 49 | 4 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The default editor used in most aggregation-based visualizations. | 70 | 0 | 63 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the gauge chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. | 7 | 0 | 7 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the heatmap implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy heatmap charts library advanced setting. | 3 | 0 | 3 | 2 | | visTypeMarkdown | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds a markdown visualization type | 0 | 0 | 0 | 0 | @@ -246,16 +248,16 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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) | - | 5 | 0 | 5 | 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) | - | 217 | 0 | 214 | 0 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 222 | 0 | 219 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 33 | 0 | 33 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 22 | 0 | 5 | 1 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 31 | 0 | 15 | 1 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 299 | 0 | 282 | 8 | | | [@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) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 18 | 0 | 18 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 4 | 0 | 4 | 0 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 51 | 0 | 51 | 9 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 201 | 0 | 201 | 31 | +| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 53 | 0 | 53 | 9 | +| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 204 | 0 | 204 | 33 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 316 | 0 | 315 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 11 | 0 | 11 | 0 | | | [@elastic/security-defend-workflows](https://github.com/orgs/elastic/teams/security-defend-workflows) | - | 3 | 0 | 3 | 0 | @@ -264,27 +266,32 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 10 | 0 | 10 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 7 | 0 | 7 | 1 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 19 | 0 | 16 | 0 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 9 | 2 | 9 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 44 | 1 | 30 | 1 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 23 | 0 | 19 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 25 | 0 | 21 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 84 | 0 | 84 | 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 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 62 | 0 | 17 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | +| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 22 | 0 | 22 | 0 | +| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 49 | 0 | 49 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 41 | 0 | 17 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | | | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 8 | 0 | 4 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 217 | 0 | 180 | 9 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 227 | 0 | 188 | 9 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 79 | 0 | 50 | 9 | | | [@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) | - | 149 | 2 | 143 | 20 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 8 | 4 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 32 | 0 | 28 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 9 | 0 | 6 | 2 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 39 | 0 | 38 | 0 | | | [@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) | - | 8 | 0 | 8 | 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) | - | 10 | 0 | 10 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 50 | 0 | 33 | 3 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 51 | 0 | 33 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 30 | 0 | 30 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 195 | 1 | 128 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 100 | 0 | 0 | 0 | @@ -474,7 +481,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 3 | 0 | 3 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 3 | 0 | 3 | 0 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 56 | 0 | 44 | 0 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 61 | 0 | 49 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 17 | 0 | 17 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 5 | 0 | 5 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | @@ -486,38 +493,39 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 102 | 0 | 86 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 15 | 0 | 9 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 38 | 2 | 33 | 0 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 133 | 0 | 106 | 1 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 136 | 0 | 109 | 1 | | | [@elastic/docs](https://github.com/orgs/elastic/teams/docs) | - | 78 | 0 | 78 | 2 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 5 | 0 | 5 | 1 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 41 | 0 | 27 | 6 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 57 | 0 | 30 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 33 | 0 | 24 | 1 | -| | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 13 | 0 | 5 | 0 | +| | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 16 | 0 | 8 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 35 | 0 | 34 | 0 | | | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 156 | 0 | 130 | 9 | -| | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 354 | 0 | 328 | 0 | -| | [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entities) | - | 37 | 0 | 37 | 0 | +| | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 346 | 0 | 320 | 0 | +| | [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entities) | - | 41 | 0 | 41 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 55 | 0 | 40 | 7 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 32 | 0 | 19 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 11 | 0 | 6 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 269 | 1 | 209 | 15 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 27 | 0 | 27 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | -| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 149 | 1 | 120 | 15 | +| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 152 | 1 | 120 | 15 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 66 | 0 | 62 | 0 | -| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 194 | 0 | 183 | 10 | +| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 196 | 0 | 184 | 10 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 40 | 0 | 40 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 52 | 0 | 52 | 1 | -| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 39 | 0 | 14 | 1 | +| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 42 | 0 | 17 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 22 | 0 | 18 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 49 | 0 | 40 | 2 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 0 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 3 | 0 | 3 | 0 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 46 | 0 | 31 | 1 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 47 | 0 | 32 | 1 | | | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 551 | 6 | 511 | 3 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 26 | 0 | 26 | 1 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 10 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 16 | 0 | 16 | 1 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 11 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 49 | 0 | 47 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 33 | 3 | 24 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 3 | 0 | 3 | 0 | @@ -531,6 +539,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 7 | 1 | 7 | 1 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 9 | 0 | 9 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 52 | 12 | 43 | 0 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 44 | 0 | 44 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 60 | 0 | 60 | 4 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 44 | 0 | 44 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 0 | 13 | 0 | @@ -543,7 +552,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 172 | 0 | 172 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 28 | 0 | 2 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 2 | 0 | 2 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 3 | 0 | 3 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 6 | 0 | 1 | 1 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 13 | 0 | 12 | 2 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 9 | 0 | 6 | 2 | @@ -552,7 +561,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 23 | 0 | 7 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 8 | 0 | 2 | 3 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 45 | 0 | 0 | 0 | -| | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 143 | 0 | 141 | 0 | +| | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 142 | 0 | 140 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 20 | 0 | 11 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 88 | 0 | 10 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 56 | 0 | 6 | 0 | @@ -586,7 +595,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 18 | 0 | 18 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 42 | 1 | 35 | 1 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 22 | 0 | 16 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 123 | 0 | 123 | 3 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 120 | 0 | 120 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 55 | 1 | 50 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 10 | 0 | 10 | 2 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 5 | 0 | 5 | 0 | @@ -639,6 +648,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 16 | 0 | 16 | 1 | | | [@elastic/security-detections-response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 128 | 0 | 125 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 35 | 0 | 34 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 76 | 0 | 76 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 3929 | 0 | 3929 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 18 | 1 | 17 | 1 | @@ -646,16 +656,20 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 20 | 0 | 18 | 1 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 50 | 0 | 25 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 66 | 0 | 63 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 25 | 0 | 24 | 7 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 35 | 0 | 25 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 7 | 0 | 7 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 118 | 0 | 59 | 0 | -| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 51 | 0 | 25 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 58 | 0 | 31 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 275 | 1 | 154 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 75 | 0 | 74 | 0 | +| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 59 | 0 | 38 | 5 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 6 | 0 | 0 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 15 | 0 | 15 | 7 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 54 | 0 | 49 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 30 | 0 | 24 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 2 | 0 | 0 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 47 | 0 | 12 | 0 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 56 | 1 | 41 | 1 | | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 92 | 0 | 70 | 6 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 341 | 1 | 337 | 32 | @@ -674,9 +688,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 120 | 0 | 116 | 0 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 51 | 0 | 46 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 69 | 0 | 64 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 35 | 0 | 34 | 0 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 38 | 0 | 38 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 3 | 0 | 3 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 24 | 0 | 24 | 0 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 26 | 0 | 26 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management @elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 7 | 1 | @@ -722,6 +736,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 15 | 0 | 4 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 8 | 0 | 8 | 4 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 2 | 2 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 16 | 0 | 6 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 182 | 0 | 182 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 20 | 0 | 12 | 0 | @@ -738,7 +753,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 28 | 0 | 12 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 8 | 0 | 8 | 0 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 72 | 0 | 55 | 0 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 74 | 0 | 55 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 15 | 0 | 15 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 2 | 0 | 2 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 39 | 0 | 25 | 1 | @@ -746,7 +761,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 42 | 0 | 28 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 57 | 0 | 48 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 9 | 0 | 8 | 0 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the unified data table which can be integrated into apps | 166 | 0 | 92 | 2 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the unified data table which can be integrated into apps | 184 | 0 | 108 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 18 | 0 | 17 | 5 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the field list and field stats which can be integrated into apps | 314 | 0 | 285 | 8 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 13 | 0 | 9 | 0 | @@ -756,10 +771,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 37 | 0 | 16 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 26 | 0 | 15 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 146 | 0 | 143 | 3 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 137 | 0 | 134 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 19 | 0 | 17 | 1 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 13 | 0 | 13 | 0 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 6 | 0 | 2 | 0 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 9 | 0 | 4 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1254 | 0 | 4 | 0 | | | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 20 | 0 | 10 | 0 | diff --git a/api_docs/presentation_panel.devdocs.json b/api_docs/presentation_panel.devdocs.json index 4b73956c37eea..15ffab0f06b91 100644 --- a/api_docs/presentation_panel.devdocs.json +++ b/api_docs/presentation_panel.devdocs.json @@ -45,7 +45,7 @@ }, "<", "PanelCompatibleComponent", - " | null>; } & { hidePanelChrome?: boolean | undefined; }) => JSX.Element" + " | null>; } & { hidePanelChrome?: boolean | undefined; }) => JSX.Element | null" ], "path": "src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx", "deprecated": false, diff --git a/api_docs/presentation_panel.mdx b/api_docs/presentation_panel.mdx index e04c4b8da4fbc..50676fdbb1a64 100644 --- a/api_docs/presentation_panel.mdx +++ b/api_docs/presentation_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationPanel title: "presentationPanel" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationPanel plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationPanel'] --- import presentationPanelObj from './presentation_panel.devdocs.json'; diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 6b58ce6a4ab9a..c9d34a56be7da 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: 2024-08-14 +date: 2024-08-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 5452cbbe4a3ad..2f26ed770b75d 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: 2024-08-14 +date: 2024-08-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 29baa2b90ca31..90728ec9714c1 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: 2024-08-14 +date: 2024-08-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 e53d58a5facce..2362fe42aeac6 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: 2024-08-14 +date: 2024-08-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 30d6d5213274b..b95daa83b6cda 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: 2024-08-14 +date: 2024-08-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 10531c2849451..5ca3cf1837623 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.devdocs.json b/api_docs/rule_registry.devdocs.json index 02bf20ed95090..36bcd64c65673 100644 --- a/api_docs/rule_registry.devdocs.json +++ b/api_docs/rule_registry.devdocs.json @@ -399,7 +399,9 @@ "section": "def-common.RuleTypeParams", "text": "RuleTypeParams" }, - " = never>({ aggs, featureIds, index, query, search_after: searchAfter, size, sort, track_total_hits: trackTotalHits, _source, runtimeMappings, }: { aggs?: object | undefined; featureIds?: string[] | undefined; index?: string | undefined; query?: object | undefined; search_after?: (string | number)[] | undefined; size?: number | undefined; sort?: ", + " = never, TAggregations = Record>({ aggs, featureIds, index, query, search_after: searchAfter, size, sort, track_total_hits: trackTotalHits, _source, runtimeMappings, }: { aggs?: object | undefined; featureIds?: string[] | undefined; index?: string | undefined; query?: object | undefined; search_after?: (string | number)[] | undefined; size?: number | undefined; sort?: ", "SortOptions", "[] | undefined; track_total_hits?: number | boolean | undefined; _source?: false | string[] | undefined; runtimeMappings?: ", "MappingRuntimeFields", @@ -413,9 +415,7 @@ "section": "def-common.MultiField", "text": "MultiField" }, - "[]; }; readonly \"kibana.alert.rule.execution.timestamp\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.parameters\": { readonly array: false; readonly type: \"flattened\"; readonly ignore_above: 4096; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.severity_improving\": { readonly type: \"boolean\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.time_range\": { readonly type: \"date_range\"; readonly format: \"epoch_millis||strict_date_optional_time\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.url\": { readonly type: \"keyword\"; readonly array: false; readonly index: false; readonly required: false; readonly ignore_above: 2048; }; readonly \"kibana.alert.workflow_assignee_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; }>>, Record>>" + "[]; }; readonly \"kibana.alert.rule.execution.timestamp\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.parameters\": { readonly array: false; readonly type: \"flattened\"; readonly ignore_above: 4096; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.severity_improving\": { readonly type: \"boolean\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.time_range\": { readonly type: \"date_range\"; readonly format: \"epoch_millis||strict_date_optional_time\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.url\": { readonly type: \"keyword\"; readonly array: false; readonly index: false; readonly required: false; readonly ignore_above: 2048; }; readonly \"kibana.alert.workflow_assignee_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; }>>, TAggregations>>" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, @@ -603,9 +603,9 @@ "section": "def-common.MultiField", "text": "MultiField" }, - "[]; }; readonly \"kibana.alert.rule.execution.timestamp\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.parameters\": { readonly array: false; readonly type: \"flattened\"; readonly ignore_above: 4096; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.severity_improving\": { readonly type: \"boolean\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.time_range\": { readonly type: \"date_range\"; readonly format: \"epoch_millis||strict_date_optional_time\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.url\": { readonly type: \"keyword\"; readonly array: false; readonly index: false; readonly required: false; readonly ignore_above: 2048; }; readonly \"kibana.alert.workflow_assignee_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; }>>, Record>>" + "[]; }; readonly \"kibana.alert.rule.execution.timestamp\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.parameters\": { readonly array: false; readonly type: \"flattened\"; readonly ignore_above: 4096; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.severity_improving\": { readonly type: \"boolean\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.time_range\": { readonly type: \"date_range\"; readonly format: \"epoch_millis||strict_date_optional_time\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.url\": { readonly type: \"keyword\"; readonly array: false; readonly index: false; readonly required: false; readonly ignore_above: 2048; }; readonly \"kibana.alert.workflow_assignee_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; }>>, { groupByFields: ", + "AggregationsMultiBucketAggregateBase", + "<{ key: string; }>; }>>" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, @@ -2221,7 +2221,7 @@ "section": "def-common.ActionGroup", "text": "ActionGroup" }, - "<\"default\">[]; schemas?: { params?: { type: \"zod\"; schema: Zod.ZodObject | Zod.ZodIntersection; } | { type: \"config-schema\"; schema: ", + "<\"default\">[]; schemas?: { params?: { type: \"zod\"; schema: any; } | { type: \"config-schema\"; schema: ", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 625b1bf3b8465..a884d2bbc9dfd 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: 2024-08-14 +date: 2024-08-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 0ecbf90f8cbd1..a83bc675efcfc 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: 2024-08-14 +date: 2024-08-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 7c7de3d255238..04ba4249f63f2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.devdocs.json b/api_docs/saved_objects_finder.devdocs.json index a5dfa604ab941..f23341ed4ab5d 100644 --- a/api_docs/saved_objects_finder.devdocs.json +++ b/api_docs/saved_objects_finder.devdocs.json @@ -549,9 +549,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 250405ae508fd..b8e84dcd4e52c 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: 2024-08-14 +date: 2024-08-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 3e3254cfec41e..c6a6ed4f277ee 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 66d0948141ad7..1cda315a00d0e 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index ecec466a995a5..8b1f6099ceda2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.devdocs.json b/api_docs/saved_search.devdocs.json index 7d4282b2565dd..60a67177b7129 100644 --- a/api_docs/saved_search.devdocs.json +++ b/api_docs/saved_search.devdocs.json @@ -182,9 +182,9 @@ ", \"description\"> & { description?: string | undefined; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]; }" @@ -304,9 +304,9 @@ ", \"description\"> & { description?: string | undefined; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]; }" @@ -422,9 +422,9 @@ "() => Promise<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", @@ -730,16 +730,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.SerializedSearchSourceFields", - "text": "SerializedSearchSourceFields" + "section": "def-common.ISearchSource", + "text": "ISearchSource" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchSource", - "text": "ISearchSource" + "section": "def-common.SerializedSearchSourceFields", + "text": "SerializedSearchSourceFields" }, ", managed: boolean, serialized?: Serialized) => ReturnType" ], @@ -804,16 +804,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.SerializedSearchSourceFields", - "text": "SerializedSearchSourceFields" + "section": "def-common.ISearchSource", + "text": "ISearchSource" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchSource", - "text": "ISearchSource" + "section": "def-common.SerializedSearchSourceFields", + "text": "SerializedSearchSourceFields" } ], "path": "src/plugins/saved_search/common/saved_searches_utils.ts", diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 318d6c464a62a..7dbbe8861c4ec 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: 2024-08-14 +date: 2024-08-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 b52cb6ce59951..2095c96e19773 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: 2024-08-14 +date: 2024-08-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 2c2a2c7641112..50e86072d25e9 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/search_assistant.devdocs.json b/api_docs/search_assistant.devdocs.json new file mode 100644 index 0000000000000..f2f5eb9bec4e8 --- /dev/null +++ b/api_docs/search_assistant.devdocs.json @@ -0,0 +1,114 @@ +{ + "id": "searchAssistant", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "searchAssistant", + "id": "def-public.SearchAssistantPluginSetup", + "type": "Interface", + "tags": [], + "label": "SearchAssistantPluginSetup", + "description": [], + "path": "x-pack/plugins/search_assistant/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "searchAssistant", + "id": "def-public.SearchAssistantPluginStart", + "type": "Interface", + "tags": [], + "label": "SearchAssistantPluginStart", + "description": [], + "path": "x-pack/plugins/search_assistant/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "searchAssistant", + "id": "def-server.SearchAssistantPluginSetup", + "type": "Interface", + "tags": [], + "label": "SearchAssistantPluginSetup", + "description": [], + "path": "x-pack/plugins/search_assistant/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "searchAssistant", + "id": "def-server.SearchAssistantPluginStart", + "type": "Interface", + "tags": [], + "label": "SearchAssistantPluginStart", + "description": [], + "path": "x-pack/plugins/search_assistant/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "searchAssistant", + "id": "def-common.PLUGIN_ID", + "type": "string", + "tags": [], + "label": "PLUGIN_ID", + "description": [], + "signature": [ + "\"searchAssistant\"" + ], + "path": "x-pack/plugins/search_assistant/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "searchAssistant", + "id": "def-common.PLUGIN_NAME", + "type": "string", + "tags": [], + "label": "PLUGIN_NAME", + "description": [], + "signature": [ + "\"searchAssistant\"" + ], + "path": "x-pack/plugins/search_assistant/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/search_assistant.mdx b/api_docs/search_assistant.mdx new file mode 100644 index 0000000000000..383be7af8fc16 --- /dev/null +++ b/api_docs/search_assistant.mdx @@ -0,0 +1,46 @@ +--- +#### +#### This 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: kibSearchAssistantPluginApi +slug: /kibana-dev-docs/api/searchAssistant +title: "searchAssistant" +image: https://source.unsplash.com/400x175/?github +description: API docs for the searchAssistant plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchAssistant'] +--- +import searchAssistantObj from './search_assistant.devdocs.json'; + +AI Assistant for Search + +Contact [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 6 | 0 | + +## Client + +### Setup + + +### Start + + +## Server + +### Setup + + +### Start + + +## Common + +### Consts, variables and types + + diff --git a/api_docs/search_connectors.mdx b/api_docs/search_connectors.mdx index 82f9a59b0db56..01875d782b57f 100644 --- a/api_docs/search_connectors.mdx +++ b/api_docs/search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchConnectors title: "searchConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the searchConnectors plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchConnectors'] --- import searchConnectorsObj from './search_connectors.devdocs.json'; diff --git a/api_docs/search_homepage.mdx b/api_docs/search_homepage.mdx index 89ad92ad515b9..81c82c27a9176 100644 --- a/api_docs/search_homepage.mdx +++ b/api_docs/search_homepage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchHomepage title: "searchHomepage" image: https://source.unsplash.com/400x175/?github description: API docs for the searchHomepage plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_indices.devdocs.json b/api_docs/search_indices.devdocs.json new file mode 100644 index 0000000000000..e79f47a7894f0 --- /dev/null +++ b/api_docs/search_indices.devdocs.json @@ -0,0 +1,171 @@ +{ + "id": "searchIndices", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "searchIndices", + "id": "def-public.SearchIndicesPluginSetup", + "type": "Interface", + "tags": [], + "label": "SearchIndicesPluginSetup", + "description": [], + "path": "x-pack/plugins/search_indices/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "searchIndices", + "id": "def-public.SearchIndicesPluginStart", + "type": "Interface", + "tags": [], + "label": "SearchIndicesPluginStart", + "description": [], + "path": "x-pack/plugins/search_indices/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "setup": { + "parentPluginId": "searchIndices", + "id": "def-server.SearchIndicesPluginSetup", + "type": "Interface", + "tags": [], + "label": "SearchIndicesPluginSetup", + "description": [], + "path": "x-pack/plugins/search_indices/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "searchIndices", + "id": "def-server.SearchIndicesPluginStart", + "type": "Interface", + "tags": [], + "label": "SearchIndicesPluginStart", + "description": [], + "path": "x-pack/plugins/search_indices/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "searchIndices", + "id": "def-common.IndicesStatusResponse", + "type": "Interface", + "tags": [], + "label": "IndicesStatusResponse", + "description": [], + "path": "x-pack/plugins/search_indices/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "searchIndices", + "id": "def-common.IndicesStatusResponse.indexNames", + "type": "Array", + "tags": [], + "label": "indexNames", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/search_indices/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "searchIndices", + "id": "def-common.UserStartPrivilegesResponse", + "type": "Interface", + "tags": [], + "label": "UserStartPrivilegesResponse", + "description": [], + "path": "x-pack/plugins/search_indices/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "searchIndices", + "id": "def-common.UserStartPrivilegesResponse.privileges", + "type": "Object", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + "{ canCreateApiKeys: boolean; canCreateIndex: boolean; }" + ], + "path": "x-pack/plugins/search_indices/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "searchIndices", + "id": "def-common.PLUGIN_ID", + "type": "string", + "tags": [], + "label": "PLUGIN_ID", + "description": [], + "signature": [ + "\"searchIndices\"" + ], + "path": "x-pack/plugins/search_indices/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "searchIndices", + "id": "def-common.PLUGIN_NAME", + "type": "string", + "tags": [], + "label": "PLUGIN_NAME", + "description": [], + "signature": [ + "\"searchIndices\"" + ], + "path": "x-pack/plugins/search_indices/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/search_indices.mdx b/api_docs/search_indices.mdx new file mode 100644 index 0000000000000..34168f89362a6 --- /dev/null +++ b/api_docs/search_indices.mdx @@ -0,0 +1,49 @@ +--- +#### +#### This 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: kibSearchIndicesPluginApi +slug: /kibana-dev-docs/api/searchIndices +title: "searchIndices" +image: https://source.unsplash.com/400x175/?github +description: API docs for the searchIndices plugin +date: 2024-08-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchIndices'] +--- +import searchIndicesObj from './search_indices.devdocs.json'; + + + +Contact [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 10 | 0 | + +## Client + +### Setup + + +### Start + + +## Server + +### Setup + + +### Start + + +## Common + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index c0c701bc2cb29..880067105aa40 100644 --- a/api_docs/search_inference_endpoints.mdx +++ b/api_docs/search_inference_endpoints.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchInferenceEndpoints title: "searchInferenceEndpoints" image: https://source.unsplash.com/400x175/?github description: API docs for the searchInferenceEndpoints plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchInferenceEndpoints'] --- import searchInferenceEndpointsObj from './search_inference_endpoints.devdocs.json'; diff --git a/api_docs/search_notebooks.mdx b/api_docs/search_notebooks.mdx index ce6429f5306d8..11f9d38b84f58 100644 --- a/api_docs/search_notebooks.mdx +++ b/api_docs/search_notebooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchNotebooks title: "searchNotebooks" image: https://source.unsplash.com/400x175/?github description: API docs for the searchNotebooks plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNotebooks'] --- import searchNotebooksObj from './search_notebooks.devdocs.json'; diff --git a/api_docs/search_playground.devdocs.json b/api_docs/search_playground.devdocs.json index 9acc1abcd944f..e5f8ac16bd1a3 100644 --- a/api_docs/search_playground.devdocs.json +++ b/api_docs/search_playground.devdocs.json @@ -245,6 +245,36 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "searchPlayground", + "id": "def-common.PLUGIN_PATH", + "type": "string", + "tags": [], + "label": "PLUGIN_PATH", + "description": [], + "signature": [ + "\"/app/search_playground\"" + ], + "path": "x-pack/plugins/search_playground/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "searchPlayground", + "id": "def-common.SEARCH_MODE_FEATURE_FLAG_ID", + "type": "string", + "tags": [], + "label": "SEARCH_MODE_FEATURE_FLAG_ID", + "description": [], + "signature": [ + "\"searchPlayground:searchModeEnabled\"" + ], + "path": "x-pack/plugins/search_playground/common/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/search_playground.mdx b/api_docs/search_playground.mdx index d88d9deced80e..9a769f783a872 100644 --- a/api_docs/search_playground.mdx +++ b/api_docs/search_playground.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchPlayground title: "searchPlayground" image: https://source.unsplash.com/400x175/?github description: API docs for the searchPlayground plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchPlayground'] --- import searchPlaygroundObj from './search_playground.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-ki | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 15 | 0 | 9 | 1 | +| 17 | 0 | 11 | 1 | ## Client diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index e7af8f38e9928..b48e22603274b 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -253,6 +253,28 @@ "path": "x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-public.AuthorizationServiceSetup.privileges", + "type": "Object", + "tags": [], + "label": "privileges", + "description": [ + "\nA set of methods to work with Kibana role privileges" + ], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-public", + "scope": "public", + "docId": "kibKbnSecurityPluginTypesPublicPluginApi", + "section": "def-public.PrivilegesAPIClientPublicContract", + "text": "PrivilegesAPIClientPublicContract" + } + ], + "path": "x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -5243,7 +5265,7 @@ "signature": [ "\"getTags\" | \"pushCase\" | \"createCase\" | \"createComment\" | \"getCase\" | \"getComment\" | \"getReporters\" | \"getUserActions\" | \"findConfigurations\" | \"updateCase\" | \"updateComment\" | \"deleteCase\" | \"deleteComment\" | \"createConfiguration\" | \"updateConfiguration\"" ], - "path": "x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6779,7 +6801,7 @@ "tags": [], "label": "RawKibanaPrivileges", "description": [], - "path": "x-pack/plugins/security/common/model/raw_kibana_privileges.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6793,7 +6815,7 @@ "signature": [ "{ [x: string]: string[]; }" ], - "path": "x-pack/plugins/security/common/model/raw_kibana_privileges.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", "deprecated": false, "trackAdoption": false }, @@ -6805,9 +6827,15 @@ "label": "features", "description": [], "signature": [ - "RawKibanaFeaturePrivileges" + { + "pluginId": "@kbn/security-authorization-core", + "scope": "server", + "docId": "kibKbnSecurityAuthorizationCorePluginApi", + "section": "def-server.RawKibanaFeaturePrivileges", + "text": "RawKibanaFeaturePrivileges" + } ], - "path": "x-pack/plugins/security/common/model/raw_kibana_privileges.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", "deprecated": false, "trackAdoption": false }, @@ -6821,7 +6849,7 @@ "signature": [ "{ [x: string]: string[]; }" ], - "path": "x-pack/plugins/security/common/model/raw_kibana_privileges.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", "deprecated": false, "trackAdoption": false }, @@ -6835,7 +6863,7 @@ "signature": [ "{ [x: string]: string[]; }" ], - "path": "x-pack/plugins/security/common/model/raw_kibana_privileges.ts", + "path": "x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 9d0917c56bf32..5ad06d1d871a2 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 447 | 0 | 231 | 1 | +| 448 | 0 | 231 | 0 | ## Client diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index d8012610139a2..9d4957972ff47 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -485,7 +485,7 @@ "\nExperimental flag needed to enable the link" ], "signature": [ - "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -565,7 +565,7 @@ "\nExperimental flag needed to disable the link. Opposite of experimentalKey" ], "signature": [ - "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -1931,7 +1931,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/types.ts", "deprecated": false, @@ -3082,7 +3082,7 @@ "\nThe security solution generic experimental features" ], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, @@ -3258,7 +3258,7 @@ "label": "ExperimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, @@ -3324,7 +3324,7 @@ "\nA list of allowed values that can be used in `xpack.securitySolution.enableExperimental`.\nThis object is then used to validate and parse the value entered." ], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: true; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: true; readonly responseActionsSentinelOneProcessesEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly responseActionScanEnabled: true; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly assistantBedrockChat: true; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly disableTimelineSaveTour: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: false; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; }" + "{ readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: true; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: true; readonly responseActionsSentinelOneProcessesEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly assistantBedrockChat: true; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly disableTimelineSaveTour: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index f9722f893a3ae..a1ad9e8443082 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/security_solution_ess.mdx b/api_docs/security_solution_ess.mdx index c89f5bf4c1360..7a7585d7f6cc8 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: 2024-08-14 +date: 2024-08-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 c5735055289b4..ce13bb0c0f255 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: 2024-08-14 +date: 2024-08-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 57e0f47313731..cc365736103c2 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: 2024-08-14 +date: 2024-08-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 6eab40e789051..3a27fcc3ef778 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: 2024-08-14 +date: 2024-08-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 0b6c069e85fd7..c6bb6d935251c 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: 2024-08-14 +date: 2024-08-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 f54b19caea4ee..24748178e20c7 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: 2024-08-14 +date: 2024-08-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 322c59f57f2d9..0bd062c95b4fe 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/slo.mdx b/api_docs/slo.mdx index 0221692963d0b..ca2de59b49cce 100644 --- a/api_docs/slo.mdx +++ b/api_docs/slo.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/slo title: "slo" image: https://source.unsplash.com/400x175/?github description: API docs for the slo plugin -date: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'slo'] --- import sloObj from './slo.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 20094174e9b8a..a36913156bfd6 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: 2024-08-14 +date: 2024-08-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 0f44754daca7f..a9ca9b751807b 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: 2024-08-14 +date: 2024-08-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 5485764131ceb..ef2b059626944 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: 2024-08-14 +date: 2024-08-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 3a20f3a8b842c..1ee5237af92c0 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.devdocs.json b/api_docs/task_manager.devdocs.json index 6ed73468daeea..8a7db40cdda12 100644 --- a/api_docs/task_manager.devdocs.json +++ b/api_docs/task_manager.devdocs.json @@ -300,7 +300,7 @@ "label": "stop", "description": [], "signature": [ - "() => void" + "() => Promise" ], "path": "x-pack/plugins/task_manager/server/plugin.ts", "deprecated": false, @@ -1464,7 +1464,13 @@ "\nAn optional definition of the cost associated with running the task." ], "signature": [ - "TaskCost", + { + "pluginId": "taskManager", + "scope": "server", + "docId": "kibTaskManagerPluginApi", + "section": "def-server.TaskCost", + "text": "TaskCost" + }, " | undefined" ], "path": "x-pack/plugins/task_manager/server/task_type_dictionary.ts", @@ -1624,6 +1630,18 @@ } ], "enums": [ + { + "parentPluginId": "taskManager", + "id": "def-server.TaskCost", + "type": "Enum", + "tags": [], + "label": "TaskCost", + "description": [], + "path": "x-pack/plugins/task_manager/server/task.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "taskManager", "id": "def-server.TaskErrorSource", diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index bd810be492ac2..81c96e40ae1ae 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.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 | |-------------------|-----------|------------------------|-----------------| -| 107 | 0 | 63 | 7 | +| 108 | 0 | 64 | 6 | ## Server diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 17e7aa6929bc0..e21e0726714d7 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.devdocs.json b/api_docs/telemetry_collection_manager.devdocs.json index 89928b629a3db..549b935636476 100644 --- a/api_docs/telemetry_collection_manager.devdocs.json +++ b/api_docs/telemetry_collection_manager.devdocs.json @@ -216,7 +216,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -252,6 +252,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -310,6 +336,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -904,7 +932,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -930,7 +960,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1176,6 +1206,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 3f41cb48619fc..ad8d152b80427 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: 2024-08-14 +date: 2024-08-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 938485f9a6877..ddfd3254cd6a0 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: 2024-08-14 +date: 2024-08-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 fa377cfc20765..ae5bd1d8b8e7b 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 7313ec0ef205b..bbe2addd3235a 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.devdocs.json b/api_docs/timelines.devdocs.json index 0d8299cd0d6d7..b932cbc25538b 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -3696,14 +3696,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/mock.ts" @@ -3816,14 +3808,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx" @@ -3924,6 +3908,14 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index b97f72b161389..aadf2e54945fe 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: 2024-08-14 +date: 2024-08-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 c918b146818b3..21ae7f2a0a8b9 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.devdocs.json b/api_docs/triggers_actions_ui.devdocs.json index 303af21b7d997..925b73c56806c 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -5065,7 +5065,7 @@ "label": "setRuleProperty", "description": [], "signature": [ - "(key: Prop, value: ", + "(key: Prop, value: ", "SanitizedRule", "[Prop] | null) => void" ], @@ -9645,7 +9645,7 @@ "label": "parseAggregationResults", "description": [], "signature": [ - "({ isCountAgg, isGroupAgg, esResult, resultLimit, sourceFieldsParams, generateSourceFieldsFromHits, }: ParseAggregationResultsOpts) => ", + "({ isCountAgg, isGroupAgg, esResult, resultLimit, sourceFieldsParams, generateSourceFieldsFromHits, termField, }: ParseAggregationResultsOpts) => ", { "pluginId": "triggersActionsUi", "scope": "common", @@ -9663,7 +9663,7 @@ "id": "def-common.parseAggregationResults.$1", "type": "Object", "tags": [], - "label": "{\n isCountAgg,\n isGroupAgg,\n esResult,\n resultLimit,\n sourceFieldsParams = [],\n generateSourceFieldsFromHits = false,\n}", + "label": "{\n isCountAgg,\n isGroupAgg,\n esResult,\n resultLimit,\n sourceFieldsParams = [],\n generateSourceFieldsFromHits = false,\n termField,\n}", "description": [], "signature": [ "ParseAggregationResultsOpts" @@ -10133,6 +10133,27 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-common.ParsedAggregationGroup.groups", + "type": "Array", + "tags": [], + "label": "groups", + "description": [], + "signature": [ + { + "pluginId": "@kbn/observability-alerting-rule-utils", + "scope": "common", + "docId": "kibKbnObservabilityAlertingRuleUtilsPluginApi", + "section": "def-common.Group", + "text": "Group" + }, + "[] | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/common/data/lib/parse_aggregation_results.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "triggersActionsUi", "id": "def-common.ParsedAggregationGroup.value", diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 67504e1a17d6f..c0fb56e2b4415 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.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 | |-------------------|-----------|------------------------|-----------------| -| 590 | 1 | 564 | 51 | +| 591 | 1 | 565 | 51 | ## Client diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index b2cc8beb5a8af..70ea44a5b54e1 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: 2024-08-14 +date: 2024-08-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 d896799e4685d..ee682e771cd3e 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: 2024-08-14 +date: 2024-08-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 9d9351b586415..aac22fcc3d72a 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: 2024-08-14 +date: 2024-08-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 a5d1345782325..1d4f5be31e4d6 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.devdocs.json b/api_docs/unified_search.devdocs.json index 0b46582c1421c..a9acfbdc11377 100644 --- a/api_docs/unified_search.devdocs.json +++ b/api_docs/unified_search.devdocs.json @@ -233,7 +233,13 @@ ], "signature": [ "React.ForwardRefExoticComponent<", - "DataViewPickerPropsExtended", + { + "pluginId": "unifiedSearch", + "scope": "public", + "docId": "kibUnifiedSearchPluginApi", + "section": "def-public.DataViewPickerProps", + "text": "DataViewPickerProps" + }, " & ", { "pluginId": "@kbn/shared-ux-utility", @@ -620,7 +626,7 @@ }, "[] | undefined; iconType?: ", "IconType", - " | undefined; showQueryInput?: boolean | undefined; dataTestSubj?: string | undefined; showSaveQuery?: boolean | undefined; customSubmitButton?: React.ReactNode; dataViewPickerOverride?: React.ReactNode; screenTitle?: string | undefined; showQueryMenu?: boolean | undefined; showFilterBar?: boolean | undefined; showDatePicker?: boolean | undefined; showAutoRefreshOnly?: boolean | undefined; additionalQueryBarMenuItems?: ", + " | undefined; showQueryInput?: boolean | undefined; dataTestSubj?: string | undefined; minRefreshInterval?: number | undefined; showSaveQuery?: boolean | undefined; customSubmitButton?: React.ReactNode; dataViewPickerOverride?: React.ReactNode; screenTitle?: string | undefined; showQueryMenu?: boolean | undefined; showFilterBar?: boolean | undefined; showDatePicker?: boolean | undefined; showAutoRefreshOnly?: boolean | undefined; additionalQueryBarMenuItems?: ", "AdditionalQueryBarMenuItems", " | undefined; filtersForSuggestions?: ", { diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 3520b2b3e94cb..cf7b573376f24 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_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 | |-------------------|-----------|------------------------|-----------------| -| 149 | 2 | 112 | 22 | +| 149 | 2 | 112 | 21 | ## Client diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index f6147dd75ebcf..47221077e8571 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.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 | |-------------------|-----------|------------------------|-----------------| -| 149 | 2 | 112 | 22 | +| 149 | 2 | 112 | 21 | ## Client diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 27d03ba36cfea..d53f7799ba24d 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: 2024-08-14 +date: 2024-08-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 bf5256bc53648..0ec70835ab6e6 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.devdocs.json b/api_docs/usage_collection.devdocs.json index 965b393222e37..04dc99f0bda52 100644 --- a/api_docs/usage_collection.devdocs.json +++ b/api_docs/usage_collection.devdocs.json @@ -483,7 +483,7 @@ "TransportRequestOptions", " | undefined): Promise<", "SearchResponse", - ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kConnector]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kProfiling]: symbol | null; [kQueryRules]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSimulate]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", "default", "; child: (opts: ", "ClientOptions", @@ -519,6 +519,32 @@ "TransportRequestOptions", " | undefined): Promise<", "BulkResponse", + ">; }; capabilities: { (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TODO", + ">; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TODO", + ", unknown>>; (this: That, params?: ", + "TODO", + " | ", + "TODO", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TODO", ">; }; cat: ", "default", "; ccr: ", @@ -577,6 +603,8 @@ "ClosePointInTimeResponse", ">; }; cluster: ", "default", + "; connector: ", + "default", "; count: { (this: That, params?: ", "CountRequest", " | ", @@ -1171,7 +1199,9 @@ "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined): Promise; }; putScript: { (this: That, params: ", + " | undefined): Promise; }; profiling: ", + "default", + "; putScript: { (this: That, params: ", "PutScriptRequest", " | ", "PutScriptRequest", @@ -1197,7 +1227,7 @@ "TransportRequestOptions", " | undefined): Promise<", "AcknowledgedResponseBase", - ">; }; queryRuleset: ", + ">; }; queryRules: ", "default", "; rankEval: { (this: That, params: ", "RankEvalRequest", @@ -1443,6 +1473,8 @@ "default", "; shutdown: ", "default", + "; simulate: ", + "default", "; slm: ", "default", "; snapshot: ", @@ -2286,6 +2318,24 @@ "trackAdoption": false, "lifecycle": "setup", "initialIsOpen": true + }, + "start": { + "parentPluginId": "usageCollection", + "id": "def-server.UsageCollectionStart", + "type": "Type", + "tags": [], + "label": "UsageCollectionStart", + "description": [ + "Plugin's start API" + ], + "signature": [ + "UsageCountersServiceStart" + ], + "path": "src/plugins/usage_collection/server/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "lifecycle": "start", + "initialIsOpen": true } }, "common": { diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 39938068cca57..7a113d4820f61 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 51 | 0 | 14 | 4 | +| 52 | 0 | 14 | 5 | ## Client @@ -42,6 +42,9 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core ### Setup +### Start + + ### Interfaces diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 92205d35c44c7..5dba909a8af17 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.devdocs.json b/api_docs/vis_default_editor.devdocs.json index 8f8b1b408ffd1..24aa865bbefc2 100644 --- a/api_docs/vis_default_editor.devdocs.json +++ b/api_docs/vis_default_editor.devdocs.json @@ -477,7 +477,15 @@ "\nDo not use this component anymore.\nPlease, use NumberInputOption in 'required_number_input.tsx'.\nIt is required for compatibility with TS 3.7.0\nThis should be removed in the future" ], "signature": [ - "({\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}: NumberInputOptionProps) => JSX.Element" + "({\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}: ", + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + ") => JSX.Element" ], "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", "deprecated": false, @@ -491,7 +499,14 @@ "label": "{\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}", "description": [], "signature": [ - "NumberInputOptionProps" + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + "" ], "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", "deprecated": false, @@ -825,6 +840,217 @@ } ], "interfaces": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps", + "type": "Interface", + "tags": [], + "label": "NumberInputOptionProps", + "description": [], + "signature": [ + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + "" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.disabled", + "type": "CompoundType", + "tags": [], + "label": "disabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.error", + "type": "CompoundType", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.isInvalid", + "type": "CompoundType", + "tags": [], + "label": "isInvalid", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.label", + "type": "CompoundType", + "tags": [], + "label": "label", + "description": [], + "signature": [ + "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.paramName", + "type": "Uncategorized", + "tags": [], + "label": "paramName", + "description": [], + "signature": [ + "ParamName" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.step", + "type": "number", + "tags": [], + "label": "step", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.value", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | \"\" | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.datatestsubj", + "type": "string", + "tags": [], + "label": "'data-test-subj'", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue", + "type": "Function", + "tags": [], + "label": "setValue", + "description": [], + "signature": [ + "(paramName: ParamName, value: number | \"\") => void" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue.$1", + "type": "Uncategorized", + "tags": [], + "label": "paramName", + "description": [], + "signature": [ + "ParamName" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue.$2", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | \"\"" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "visDefaultEditor", "id": "def-public.RangeValues", diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index aa2d08b86f98c..298ed85fe74e0 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.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 | |-------------------|-----------|------------------------|-----------------| -| 56 | 0 | 49 | 4 | +| 70 | 0 | 63 | 4 | ## Client diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 0761b8a1124b5..ff8f002ad94c5 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: 2024-08-14 +date: 2024-08-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 5e233ac6d91a5..672856eb4ddd2 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: 2024-08-14 +date: 2024-08-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 10f405d5d6ed9..dfe12ab90299e 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: 2024-08-14 +date: 2024-08-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 f07c0f1137e20..9080fa39b4721 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: 2024-08-14 +date: 2024-08-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 d6a7e55130ba3..d6d7c4b1112f4 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: 2024-08-14 +date: 2024-08-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 506ec4e0506ad..e8481e89fad53 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: 2024-08-14 +date: 2024-08-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 e5b2f89b6e9b5..c49e00825f779 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: 2024-08-14 +date: 2024-08-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 5cea6e77cec8a..0de2af428ced6 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: 2024-08-14 +date: 2024-08-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 6616b980c7ad3..5818791e9c649 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index 47f45c79e7b3c..e7df60cb03ea5 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -4320,7 +4320,7 @@ "section": "def-common.RefreshInterval", "text": "RefreshInterval" }, - "; setRefreshInterval: (refreshInterval: Partial<", + "; getMinRefreshInterval: () => number; setRefreshInterval: (refreshInterval: Partial<", { "pluginId": "data", "scope": "common", @@ -5671,9 +5671,9 @@ "(id: string) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }>" @@ -5719,17 +5719,17 @@ ">, \"contentTypeId\">) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }>" @@ -5757,9 +5757,9 @@ ">, \"contentTypeId\">" @@ -5791,17 +5791,17 @@ ", Pick<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, ", \"references\">>, \"contentTypeId\">) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }>" @@ -5829,9 +5829,9 @@ ", Pick<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, ", \"references\">>, \"contentTypeId\">" @@ -5903,9 +5903,9 @@ ", options?: object | undefined) => Promise<{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }>" diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 72a8bbd8b19bd..e33967fce9626 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: 2024-08-14 +date: 2024-08-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; diff --git a/catalog-info.yaml b/catalog-info.yaml index 47fd1049e2fed..865723fbe0976 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -119,10 +119,6 @@ spec: repository: elastic/kibana provider_settings: trigger_mode: none - schedules: - daily: - branch: main - cronline: "@daily" pipeline_file: ".buildkite/pipelines/sonarqube.yml" teams: kibana-operations: diff --git a/dev_docs/contributing/how_we_use_github.mdx b/dev_docs/contributing/how_we_use_github.mdx index 69eb3ba8351c6..4e59b59c7abeb 100644 --- a/dev_docs/contributing/how_we_use_github.mdx +++ b/dev_docs/contributing/how_we_use_github.mdx @@ -207,10 +207,11 @@ it's notable and affects our users) and which section it appears in. For example The following labels are related to backporting PRs: -- `auto-backport`: Automatically backport this PR (to the branches related to +- `backport:version`: Automatically backport this PR (to the branches related to version labels) after it's merged. Requires adding desired target versions labels. - `backport:prev-minor`: Automatically backport to one lower minor version. -- `backport:prev-major`: Automatically backport to the latest minor version of one lower major version. +- `backport:prev-major`: Automatically backport to all minor version of one lower major version. +- `backport:current-major`: Automatically backport to all minor version of the current major version. - `backport:all-open`: Automatically backport to all generally available versions. This functionally is equivalent to backport:prev-major at the time of writing. - `backport:skip`: This PR does not require backporting. - `backport`: This PR was backported (added by CI). diff --git a/dev_docs/getting_started/setting_up_a_development_env.mdx b/dev_docs/getting_started/setting_up_a_development_env.mdx index 49b745f9d0f0d..a63dfdce59b4d 100644 --- a/dev_docs/getting_started/setting_up_a_development_env.mdx +++ b/dev_docs/getting_started/setting_up_a_development_env.mdx @@ -3,8 +3,8 @@ id: kibDevTutorialSetupDevEnv slug: /kibana-dev-docs/getting-started/setup-dev-env title: Set up a Development Environment description: Learn how to setup a development environment for contributing to the Kibana repository -date: 2022-07-07 -tags: ['kibana', 'onboarding', 'dev', 'architecture', 'setup'] +date: 2024-08-09 +tags: ['kibana', 'onboarding', 'dev', 'architecture', 'setup', 'devcontainer'] --- Setting up a development environment is pretty easy. @@ -92,3 +92,28 @@ node scripts/register_git_hook ``` After the script completes the pre-commit hook will be created within the file `.git/hooks/pre-commit`. If you choose to not install it, don’t worry, we still run a quick CI check to provide feedback earliest as we can about the same checks. + +## Using the Kibana Dev Container (optional) + +Kibana also supports using a [dev container](https://containers.dev/) which can integrate with various editors and tools [(supported tools)](https://containers.dev/supporting). The dev container provides a consistent development environment across different machines and setups which is based on Ubuntu Jammy (22.04). The only prerequisite is having [Docker](https://www.docker.com/) installed locally. VS Code is the recommended editor and will be used for these instructions because it is the most mature, but it is not required. + +### Setting up the Dev Container + +1. Make a copy of `.devcontainer/.env.template` and rename it to `.devcontainer/.env`. Edit any values you're interested in. +1. There are three options for mounting the Kibana repo into the container: + - **Local Filesystem**: Clone the repo locally, or use an existing copy, and open it in VS Code. When prompted, select "Reopen in Dev Container". This uses a bind mount, allowing the container to access and modify files directly on your local filesystem. Your git credentials should be automatically mounted in the container as well. Note that Bazel will create symlinks and a cache inside the container file system. So, if switching to working on your local filesystem afterwards, you will need to bootstrap again. + - **Docker Repo Volume**: Use the `Dev Containers: Clone Repository in Named Container Volume...` command from the Command Palette (`F1`). This clones the repo into a Docker volume, isolating it from your local filesystem. You will need to configure your git credentials manually in this isolated environment. + - **Docker PR Volume**: Use the `Dev Containers: Clone GitHub Pull Request in Named Container Volume...` command from the Command Palette (`F1`). This is the same as the previous option, but can be useful for testing a PR in insolation of your local filesystem. +1. VS Code will then build the container, this will take a few minutes the first time, but subsequent builds will utilize Docker caching and be much faster. +1. Once the container is built and started, it will automatically run `yarn kbn bootstrap`. +1. You should see the Kibana repo and your terminal will be inside the container. You can develop as normal now, including running `yarn es` from inside the container. + +### Customizing the Dev Container +Installing any extra extensions or making adjustments to the OS environment inside the container will not have an effect on your local OS or VS Code installation. Editing the `devcontainer.json` or `.devcontainer/Dockerfile` should be reserved for changes to all dev environments. + +### FIPS Mode + +The dev container is pre-configured to run Kibana in FIPS mode if needed. Simply change the `.env` file to `FIPS=1` and reopen your terminal. There should be a log message in your terminal which indicates `FIPS mode enabled`. + +### Troubleshooting +- Sometimes when rebuilding the container, there will be an error message that it failed. Usually hitting retry will fix this, and is only related to VS Code trying to reconnect to the container too quickly. \ No newline at end of file diff --git a/dev_docs/operations/writing_stable_functional_tests.mdx b/dev_docs/operations/writing_stable_functional_tests.mdx index 9403b9144260d..42aadf702ba92 100644 --- a/dev_docs/operations/writing_stable_functional_tests.mdx +++ b/dev_docs/operations/writing_stable_functional_tests.mdx @@ -75,6 +75,10 @@ await testSubjects.existsOrFail('savedItemDetailPage') Even if you are very careful, the more UI automation you do the more likely you are to make a mistake and write a flaky test. If there is any way to do setup work for your test via the Kibana or Elasticsearch APIs rather than interacting with the UI, then take advantage of that opportunity to write less UI automation. +## Incorrect usage of EUI components in React code will cause a functional test failure + +For EUI to support theming and internationalization, EUI components in your React application must be wrapped in `EuiProvider` (more preferably, use the `KibanaRenderContextProvider` wrapper). The functional test runner treats EUI as a first-class citizen and will throw an error when incorrect usage of EUI is detected. However, experiencing this type of failure in a test run is unlikely: in dev mode, a toast message alerts developers of incorrect EUI usage in real-time. + ## Do you really need a functional test for this? Once you've invested a lot of time and energy into figuring out how to write functional tests well it can be tempting to use them for all sorts of things which might not justify the cost of a functional test. Make sure that your test is validating something that couldn't be validated by a series of unit tests on a component+store+API. diff --git a/dev_docs/tutorials/generating_oas_for_http_apis.mdx b/dev_docs/tutorials/generating_oas_for_http_apis.mdx index f47031887db80..19852206f8006 100644 --- a/dev_docs/tutorials/generating_oas_for_http_apis.mdx +++ b/dev_docs/tutorials/generating_oas_for_http_apis.mdx @@ -90,9 +90,17 @@ import { fooResource } from '../../schemas/v1'; // Note: this response schema is instantiated lazily to avoid creating schemas that are not needed in most cases! const fooResourceResponse = () => { return schema.object({ - id: schema.string({ maxLength: 20 }), - name: schema.string(), - createdAt: schema.string(), + id: schema.string({ + maxLength: 20, + meta: { description: 'Add a description.' } + }), + name: schema.string({ meta: { description: 'Add a description.' } }), + createdAt: schema.string({ + meta: { + description: 'Add a description.', + deprecated: true, // An indicator that the property is deprecated + }, + }), }) } @@ -106,6 +114,8 @@ function registerFooRoute(router: IRouter, docLinks: DoclinksStart) { access: 'public', summary: 'Create a foo resource' description: `A foo resource enables baz. See the following [documentation](${docLinks.links.fooResource}).`, + tags: ['oas-tag:my tag'], // Each operation must have a tag that's used to group similar endpoints in the docs + deprecated: true // An indicator that the operation is deprecated }) .addVersion({ version: '2023-10-31', diff --git a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx index 1c1224c1c858a..37322e3f55e05 100644 --- a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx +++ b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx @@ -294,6 +294,58 @@ This event will be indexed with the following structure: } ``` +#### Add custom metrics +Having `kibana:plugin_render_time` metric event is not always enough, depending on the use case you would likely need some complementary information to give some sense to the value reported by the metric (e.g. number of hosts, number of services, number of dataStreams, etc). +`kibana:plugin_render_time` metric API supports up to 9 numbered free fields that can be used to report numeric metrics that you intend to analyze. Note that they can be used for any type of numeric information you may want to report. + +We could make use of these custom metrics using the following format: + +```typescript +... + // Call onPageReady once the meaningful data has rendered and visible to the user + onPageReady({ + key1: 'datasets', + value1: 5, + key2: 'documents', + value2: 1000, + }); +... +``` + +where the `keys` will be the keys for the custom metrics we can later aggregate and analyze further. + +An event using custom metrics will be indexed with the following structure: + +```typescript +{ + "_index": "backing-ebt-kibana-browser-performance-metrics-000001", // Performance metrics are stored in a dedicated simplified index (browser \ server). + "_source": { + "timestamp": "2024-08-13T11:29:58.275Z" + "event_type": "performance_metric", // All performance events share a common event type to simplify mapping + "eventName": 'kibana:plugin_render_time', // Event name as specified when reporting it + "duration": 736, // Event duration as specified when reporting it + "meta": { + "target": '/home', + }, + "context": { // Context holds information identifying the deployment, version, application and page that generated the event + "version": "8.16.0-SNAPSHOT", + "cluster_name": "elasticsearch", + "pageName": "application:home:app", + "applicationId": "home", + "page": "app", + "entityId": "61c58ad0-3dd3-11e8-b2b9-5d5dc1715159", + "branch": "main", + ... + }, + "key1": "datasets", + "value1": 5, + "key2": "documents", + "value2": 1000, + ... + }, +} +``` + ### Development environment The metric will be delivered to the [Telemetry Staging](https://telemetry-v2-staging.elastic.dev/) cluster, alongside with the event's context. diff --git a/dev_docs/tutorials/submit_a_pull_request.mdx b/dev_docs/tutorials/submit_a_pull_request.mdx index 0402a533b2498..99033f17ebef3 100644 --- a/dev_docs/tutorials/submit_a_pull_request.mdx +++ b/dev_docs/tutorials/submit_a_pull_request.mdx @@ -55,7 +55,7 @@ If this is a new branch, you will see a link in your terminal that points you di 2. Features: Add labels for any relevant feature areas, e.g. `Feature:Development` 3. Team: Most PRs should have at least one `Team:` label. Add labels for teams that should follow or are responsible for the pull request. 4. Release Note: Add `release_note:skip` if this pull request should not automatically get added to release notes for Kibana - 5. Auto Backport: Add `auto-backport` if you'd like your pull request automatically backported to all labeled versions. + 5. Auto Backport: Add `backport:version` if you'd like your pull request automatically backported to all labeled versions. 6. Submit the pull request. If it's not quite ready for review, it can also be submitted as a Draft pull request. ![Screenshot of Compare and pull request header](../assets/pr_header.png) diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index d58ba5b97832f..c0c8d6ff5b934 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -74,9 +74,56 @@ Review important information about the {kib} 8.x releases. [[release-notes-8.15.0]] == {kib} 8.15.0 - For information about the {kib} 8.15.0 release, review the following information. +The 8.15.0 release includes the following known issues. + +[float] +[[known-issues-8.15.0]] +=== Known issues + +[discrete] +[[known-178114]] +.Kibana fails to start when processing YAML configuration keys that contain dotted notation in objects in arrays +[%collapsible] +==== +*Details* + +In 8.15.1, We fixed a bug when processing YAML configuration keys that contain dotted notation in objects in arrays. +This can manifest as a validation error causing Kibana to not start. + +For more information, refer to {kibana-pull}190590[#190590]. +==== + +[discrete] +[[known-187823]] +.Connectors require update due to Microsoft Teams product retirement +[%collapsible] +==== +*Details* + +The original method for configuring incoming webhooks in Microsoft Teams is being retired. +Refer to https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/[Retirement of Office 365 connectors within Microsoft Teams] and {kibana-issue}187823[#187823]. + +*Impact* + +If you used the *Incoming Webhook* app in Microsoft Teams to generate a webhook URL for a <>, it will stop working in December 2024. + +*Workaround* + +Use the *Workflows* app in Microsoft Teams to create a new webhook URL, as described in <>. +Update your Microsoft Teams connector to use the new URL before the end of December 2024. +==== + +[discrete] +[[known-189283]] +.Incorrect index errors related to inference endpoints +[%collapsible] +==== +*Details* + +In 8.15.1, we fixed a UI bug where an index error about the `semantic_text` field would be incorrectly displayed when the inference endpoint was configured and available. + +You can ignore this error if you've confirmed that the inference endpoint is configured and the model is deployed. + +This bug is fixed in {kibana-pull}189283[#189283]. +==== + [float] [[deprecations-8.15.0]] === Deprecations diff --git a/docs/action-type-template.asciidoc b/docs/action-type-template.asciidoc index 9bd61039712b3..b9d7ca3c6326c 100644 --- a/docs/action-type-template.asciidoc +++ b/docs/action-type-template.asciidoc @@ -36,8 +36,7 @@ Add preconfigured settings for this connector type in alert-action-settings.asci [[-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. +You can test connectors as you're creating or editing the connector in {kib}. actions have the following properties. diff --git a/docs/api/actions-and-connectors.asciidoc b/docs/api/actions-and-connectors.asciidoc index 68e89c5eecaf6..2ab848e900d46 100644 --- a/docs/api/actions-and-connectors.asciidoc +++ b/docs/api/actions-and-connectors.asciidoc @@ -1,39 +1,7 @@ [[actions-and-connectors-api]] == Action and connector APIs -The following connector APIs are available: - -* <> to retrieve a single connector by ID - -* <> to retrieve all connectors - -* <> to retrieve a list of all connector types - -* <> to create connectors - -* <> to update the attributes for an existing connector - -* <> to execute a connector by ID - -* <> to delete a connector by ID - -For deprecated APIs, refer to <>. - For information about the actions and connectors that {kib} supports, refer to <>. -include::actions-and-connectors/create.asciidoc[leveloffset=+1] -include::actions-and-connectors/delete.asciidoc[leveloffset=+1] -include::actions-and-connectors/get.asciidoc[leveloffset=+1] -include::actions-and-connectors/get_all.asciidoc[leveloffset=+1] -include::actions-and-connectors/list.asciidoc[leveloffset=+1] -include::actions-and-connectors/execute.asciidoc[leveloffset=+1] -include::actions-and-connectors/update.asciidoc[leveloffset=+1] -include::actions-and-connectors/legacy/index.asciidoc[] -include::actions-and-connectors/legacy/get.asciidoc[] -include::actions-and-connectors/legacy/get_all.asciidoc[] -include::actions-and-connectors/legacy/list.asciidoc[] -include::actions-and-connectors/legacy/create.asciidoc[] -include::actions-and-connectors/legacy/update.asciidoc[] -include::actions-and-connectors/legacy/execute.asciidoc[] -include::actions-and-connectors/legacy/delete.asciidoc[] +For the latest API details, refer to {api-kibana}/group/endpoint-connectors[connector APIs]. diff --git a/docs/api/actions-and-connectors/create.asciidoc b/docs/api/actions-and-connectors/create.asciidoc deleted file mode 100644 index 55168ecf796ca..0000000000000 --- a/docs/api/actions-and-connectors/create.asciidoc +++ /dev/null @@ -1,653 +0,0 @@ -[[create-connector-api]] -== Create connector API -++++ -Create connector -++++ - -Creates a connector. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[[create-connector-api-request]] -=== {api-request-title} - -`POST :/api/actions/connector` - -`POST :/s//api/actions/connector` - -=== {api-prereq-title} - -You must have `all` privileges for the *{connectors-feature}* feature in the -*Management* section of the <>. - -[[create-connector-api-path-params]] -=== {api-path-parms-title} - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided - in the URL, the default space is used. - -[role="child_attributes"] -[[create-connector-api-request-body]] -=== {api-request-body-title} - -`config`:: -(Required^*^, object) The configuration for the connector. Configuration properties -vary depending on the connector type. For example: -+ --- -// tag::connector-config[] -.Config properties -[%collapsible%open] -==== - -.{ibm-r} connectors -[%collapsible%open] -===== -`apiUrl`:: -(Required, string) The {ibm-r} instance URL. - -`orgId`:: -(Required, string) The {ibm-r} organization ID. - -For more information, refer to <>. -===== - -.Index connectors -[%collapsible%open] -===== - -`executionTimeField`:: -(Optional, string) Specifies a field that will contain the time the alert -condition was detected. The default value is `null`. - -`index`:: -(Required, string) The {es} index to be written to. - -`refresh`:: -(Optional, boolean) The {ref}/docs-refresh.html[refresh] policy for the write -request. The default value is `false`. - -For more information, refer to <>. -===== - -.{jira} connectors -[%collapsible%open] -===== - -`apiUrl`:: -(Required, string) The {jira} instance URL. - -`projectKey`:: -(Required, string) The {jira} project key. - -For more information, refer to <>. -===== - -.Opsgenie connectors -[%collapsible%open] -===== - -`apiUrl`:: -(Required, string) The Opsgenie URL. For example, `https://api.opsgenie.com` or -`https://api.eu.opsgenie.com`. If you are using the `xpack.actions.allowedHosts` -setting, make sure the hostname is added to the allowed hosts. - -For more information, refer to <>. -===== - -.{sn-itom}, {sn-itsm}, and {sn-sir} connectors -[%collapsible%open] -===== -`apiUrl`:: -(Required, string) The {sn} instance URL. - -`clientId`:: -(Required^*^, string) The client ID assigned to your OAuth application. This -property is required when `isOAuth` is `true`. - -`isOAuth`:: -(Optional, string) The type of authentication to use. The default value is -`false`, which means basic authentication is used instead of open authorization -(OAuth). - -`jwtKeyId`:: -(Required^*^, string) The key identifier assigned to the JWT verifier map of -your OAuth application. This property is required when `isOAuth` is `true`. - -`userIdentifierValue`:: -(Required^*^, string) The identifier to use for OAuth authentication. This -identifier should be the user field you selected when you created an OAuth -JWT API endpoint for external clients in your {sn} instance. For example, if -the selected user field is `Email`, the user identifier should be the user's -email address. This property is required when `isOAuth` is `true`. - -`usesTableApi`:: -(Optional, boolean) Determines whether the connector uses the Table API or the -Import Set API. This property is supported only for {sn-itsm} and {sn-sir} -connectors. The default value is `true`. -+ -NOTE: If this property is set to false, the Elastic application should be -installed in {sn}. -===== - -.{swimlane} connectors -[%collapsible%open] -===== -`apiUrl`:: -(Required, string) The {swimlane} instance URL. - -`appId`:: -(Required, string) The {swimlane} application ID. - -`connectorType`:: -(Required, String) The type of the connector. Valid values are: `all`, `alerts`, `cases`. - -`mappings`:: -(Optional, object) The field mapping. -+ -.Mappings properties -[%collapsible%open] -====== - -`alertIdConfig`::: -(Optional, object) Mapping for the alert ID. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`caseIdConfig`::: -(Optional, object) Mapping for the case ID. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`caseNameConfig`::: -(Optional, object) Mapping for the case name. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`commentsConfig`::: -(Optional, object) Mapping for the case comments. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`descriptionConfig`::: -(Optional, object) Mapping for the case description. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`ruleNameConfig`::: -(Optional, object) Mapping for the name of the alert's rule. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -`severityConfig`::: -(Optional, object) Mapping for the severity. - -`fieldType`:::: -(Required, string) The type of the field in {swimlane}. - -`id`:::: -(Required, string) The id of the field in {swimlane}. - -`key`:::: -(Required, string) The key of the field in {swimlane}. - -`name`:::: -(Required, string) The name of the field in {swimlane}. - -====== -For more information, refer to <>. -===== - -.{webhook-cm} connectors -[%collapsible%open] -===== - -`createCommentJson`:: -(Optional, string) A JSON payload sent to the create comment URL to create a -case comment. You can use variables to add Kibana Cases data to the payload. The -required variable is `case.comment`. For example: -+ -[source,json] ----- -{ - "body": {{{case.comment}}} -} ----- -+ -NOTE: Due to Mustache template variables (the text enclosed in triple braces, -for example, `{{{case.title}}}`), the JSON is not validated when you create the -connector. The JSON is validated once the Mustache variables have been placed -when the REST method runs. Manually ensure that the JSON is valid, -disregarding the Mustache variables, so the later validation will pass. - -`createCommentMethod`:: -(Optional, string) The REST API HTTP request method to create a case comment in -the third-party system. Valid values are either `patch`, `post`, and `put`. The -default value is `put`. - -`createCommentUrl`:: -(Optional, string) The REST API URL to create a case comment by ID in the -third-party system. You can use a variable to add the external system ID to the -URL. If you are using the `xpack.actions.allowedHosts` setting, make sure the -hostname is added to the allowed hosts. For example: -+ -[source,text] ----- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment ----- - -`createIncidentJson`:: -(Required, string) A JSON payload sent to the create case URL to create a case. You -can use variables to add case data to the payload. Required variables are -`case.title` and `case.description`. For example: -+ -[source,json] ----- -{ - "fields": { - "summary": {{{case.title}}}, - "description": {{{case.description}}}, - "labels": {{{case.tags}}} - } -} ----- -+ -NOTE: Due to Mustache template variables (which is the text enclosed in triple -braces, for example, `{{{case.title}}}`), the JSON is not validated when you -create the connector. The JSON is validated after the Mustache variables have -been placed when REST method runs. Manually ensure that the JSON is valid to -avoid future validation errors; disregard Mustache variables during your review. - -`createIncidentMethod`:: -(Optional, string) The REST API HTTP request method to create a case in the -third-party system. Valid values are `patch`, `post`, and `put`. The default -value is `post`. - -`createIncidentResponseKey`:: -(Required, string) The JSON key in the create case response that contains the -external case ID. - -`createIncidentUrl`:: -(Required, string) The REST API URL to create a case in the third-party system. -If you are using the `xpack.actions.allowedHosts` setting, make sure the -hostname is added to the allowed hosts. - -`getIncidentResponseExternalTitleKey`:: -(Required, string) The JSON key in get case response that contains the external -case title. - -`getIncidentUrl`:: -(Required, string) The REST API URL to get the case by ID from the third-party -system. If you are using the `xpack.actions.allowedHosts` setting, make sure the -hostname is added to the allowed hosts. You can use a variable to add the -external system ID to the URL. For example: -+ -[source,text] ----- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} ----- -+ -NOTE: Due to Mustache template variables (the text enclosed in triple braces, -for example, `{{{case.title}}}`), the JSON is not validated when you create the -connector. The JSON is validated after the Mustache variables have been placed -when REST method runs. Manually ensure that the JSON is valid, disregarding the -Mustache variables, so the later validation will pass. - -`hasAuth`:: -(Optional, boolean) If true, a username and password for login type authentication -must be provided. The default value is `true`. - -`headers`:: -(Optional, string) A set of key-value pairs sent as headers with the request -URLs for the create case, update case, get case, and create comment methods. - -`updateIncidentJson`:: -(Required, string) The JSON payload sent to the update case URL to update the -case. You can use variables to add Kibana Cases data to the payload. Required -variables are `case.title` and `case.description`. For example: -+ -[source,json] ----- -{ - "fields": { - "summary": {{{case.title}}}, - "description": {{{case.description}}}, - "labels": {{{case.tags}}} - } -} ----- -+ -NOTE: Due to Mustache template variables (which is the text enclosed in triple -braces, for example, `{{{case.title}}}`), the JSON is not validated when you -create the connector. The JSON is validated after the Mustache variables have -been placed when REST method runs. Manually ensure that the JSON is valid to -avoid future validation errors; disregard Mustache variables during your review. - -`updateIncidentMethod`:: -(Optional, string) The REST API HTTP request method to update the case in the -third-party system. Valid values are `patch`, `post`, and `put`. The default -value is `put`. - -`updateIncidentUrl`:: -(Required, string) The REST API URL to update the case by ID in the third-party -system. You can use a variable to add the external system ID to the URL. If you -are using the `xpack.actions.allowedHosts` setting, make sure the hostname is -added to the allowed hosts. For example: -+ -[source,text] ----- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} ----- - -`viewIncidentUrl`:: -(Required, string) The URL to view the case in the external system. You can use -variables to add the external system ID or external system title to the URL.For example: -+ -[source,text] ----- -https://testing-jira.atlassian.net/browse/{{{external.system.title}}} ----- - -For more information, refer to <>. -===== - -This object is not required for server log connectors. - -For more configuration properties, refer to <>. -==== -// end::connector-config[] --- - -`connector_type_id`:: -(Required, string) The connector type ID for the connector. For example, -`.cases-webhook`, `.index`, `.jira`, `.opsgenie`, `.server-log`, or `.servicenow-itom`. - -`name`:: -(Required, string) The display name for the connector. - -`secrets`:: -(Required^*^, object) The secrets configuration for the connector. Secrets -configuration properties vary depending on the connector type. For information -about the secrets configuration properties, refer to <>. -+ --- -WARNING: Remember these values. You must provide them each time you call the <> API. - -// tag::connector-secrets[] -.Secrets properties -[%collapsible%open] -==== - -.{ibm-r} connectors -[%collapsible%open] -===== -`apiKeyId`:: -(Required, string) The authentication key ID for HTTP Basic authentication. - -`apiKeySecret`:: -(Required, string) The authentication key secret for HTTP Basic authentication. -===== - -.{jira} connectors -[%collapsible%open] -===== -`apiToken`:: -(Required, string) The {jira} API authentication token for HTTP basic -authentication. - -`email`:: -(Required, string) The account email for HTTP Basic authentication. -===== - -.Opsgenie connectors -[%collapsible%open] -===== -`apiKey`:: -(Required, string) The Opsgenie API authentication key for HTTP Basic -authentication. -===== - -.{sn-itom}, {sn-itsm}, and {sn-sir} connectors -[%collapsible%open] -===== -`clientSecret`:: -(Required^*^, string) The client secret assigned to your OAuth application. This -property is required when `isOAuth` is `true`. - -`password`:: -(Required^*^, string) The password for HTTP basic authentication. This property -is required when `isOAuth` is `false`. - -`privateKey`:: -(Required^*^, string) The RSA private key that you created for use in {sn}. This -property is required when `isOAuth` is `true`. - -privateKeyPassword:: -(Required^*^, string) The password for the RSA private key. This property is -required when `isOAuth` is `true` and you set a password on your private key. - -`username`:: -(Required^*^, string) The username for HTTP basic authentication. This property -is required when `isOAuth` is `false`. - -===== - -.{swimlane} connectors -[%collapsible%open] -===== -`apiToken`:: -(string) {swimlane} API authentication token. -===== - -.{webhook-cm} connectors -[%collapsible%open] -===== -`password`:: -(Optional, string) The password for HTTP basic authentication. - -`user`:: -(Optional, string) The username for HTTP basic authentication. -===== -This object is not required for index or server log connectors. -==== -// end::connector-secrets[] --- - -[[create-connector-api-request-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[create-connector-api-example]] -=== {api-examples-title} - -Create an index connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector -{ - "name": "my-connector", - "connector_type_id": ".index", - "config": { - "index": "test-index" - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false -} --------------------------------------------------- - -Create a {jira} connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector -{ - "name": "my-jira-connector", - "connector_type_id": ".jira", - "config": { - "apiUrl": "https://elastic.atlassian.net", - "projectKey": "ES" - }, - "secrets": { - "email": "myEmail", - "apiToken": "myToken" - } -} --------------------------------------------------- -// KIBANA - -Create an {ibm-r} connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector -{ - "name": "my-resilient-connector", - "connector_type_id": ".resilient", - "config": { - "apiUrl": "https://elastic.resilient.net", - "orgId": "201" - }, - "secrets": { - "apiKeyId": "myKey", - "apiKeySecret": "myToken" - } -} --------------------------------------------------- -// KIBANA - -Create an {sn-itom} connector that uses open authorization: - -[source,sh] --------------------------------------------------- -POST api/actions/connector -{ - "name": "my-itom-connector", - "connector_type_id": ".servicenow-itom", - "config": { - "apiUrl": "https://exmaple.service-now.com/", - "clientId": "abcdefghijklmnopqrstuvwxyzabcdef", - "isOAuth": "true", - "jwtKeyId": "fedcbazyxwvutsrqponmlkjihgfedcba", - "userIdentifierValue": "testuser@email.com" - }, - "secrets": { - "clientSecret": "secretsecret", - "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nprivatekeyhere\n-----END RSA PRIVATE KEY-----" - } -} --------------------------------------------------- -// KIBANA - -Create a {swimlane} connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector -{ - "name":"my-swimlane-connector", - "connector_type_id": ".swimlane", - "config":{ - "connectorType":"all", - "mappings":{ - "ruleNameConfig":{ - "id":"b6fst", - "name":"Alert Name", - "key":"alert-name", - "fieldType":"text" - } - }, - "appId":"myAppID", - "apiUrl":"https://myswimlaneinstance.com" - }, - "secrets":{ - "apiToken":"myToken" - } -} --------------------------------------------------- -// KIBANA \ No newline at end of file diff --git a/docs/api/actions-and-connectors/delete.asciidoc b/docs/api/actions-and-connectors/delete.asciidoc deleted file mode 100644 index 81619cdf26b5c..0000000000000 --- a/docs/api/actions-and-connectors/delete.asciidoc +++ /dev/null @@ -1,56 +0,0 @@ -[[delete-connector-api]] -== Delete connector API -++++ -Delete connector -++++ - -Deletes an connector by ID. - -WARNING: When you delete a connector, _it cannot be recovered_. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[discrete] -[[delete-connector-api-request]] -=== {api-request-title} - -`DELETE :/api/actions/connector/` - -`DELETE :/s//api/actions/connector/` - -[discrete] -=== {api-prereq-title} - -You must have `all` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -[discrete] -[[delete-connector-api-path-params]] -=== {api-path-parms-title} - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[discrete] -[[delete-connector-api-response-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[discrete] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -DELETE api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad --------------------------------------------------- -// KIBANA diff --git a/docs/api/actions-and-connectors/execute.asciidoc b/docs/api/actions-and-connectors/execute.asciidoc deleted file mode 100644 index d820b5e2e122c..0000000000000 --- a/docs/api/actions-and-connectors/execute.asciidoc +++ /dev/null @@ -1,865 +0,0 @@ -[[execute-connector-api]] -== Run connector API -++++ -Run connector -++++ - -Runs a connector by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[[execute-connector-api-request]] -=== {api-request-title} - -`POST :/api/actions/connector//_execute` - -`POST :/s//api/actions/connector//_execute` - -[[execute-connector-api-prereq]] -=== {api-prereq-title} - -You must have `read` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -If you use an index connector, you must also have `all`, `create`, `index`, or -`write` {ref}/security-privileges.html[indices privileges]. - -[[execute-connector-api-desc]] -=== {api-description-title} - -You can use this API to test an <> that -involves interaction with Kibana services or integrations with third-party -systems. - -[[execute-connector-api-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The ID of the connector. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[role="child_attributes"] -[[execute-connector-api-request-body]] -=== {api-request-body-title} - -`params`:: -(Required, object) The parameters of the connector. Parameter properties vary -depending on the connector type. For information about the parameter properties, -refer to <>. -+ --- -.`Params` properties -[%collapsible%open] -==== - -.Email connectors -[%collapsible%open] -===== -`bcc`:: -(Optional, array of strings) A list of "blind carbon copy" email addresses. -Addresses can be specified in `user@host-name` format or in name `` format. - -`cc`:: -(Optional, array of strings) A list of "carbon copy" email addresses. -Addresses can be specified in `user@host-name` format or in name `` format. - -`message`:: -(Required, string) The email message text. Markdown format is supported. - -`subject`:: -(Required, string) The subject line of the email. - -`to`:: -(Required^*^, array of strings) -A list of email addresses. -Addresses can be specified in `user@host-name` format or in name `` format. -There must be at least one recipient in `to`, `cc`, or `bcc`. - -For more information, refer to <>. -===== - -.Index connectors -[%collapsible%open] -===== -`documents`:: -(Required, array of objects) The documents to index in JSON format. - -For more information, refer to <>. -===== - -.Jira connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. Valid values include: `fieldsByIssueType`, -`getFields`, `getIncident`, `issue`, `issues`, `issueTypes`, and `pushToService`. - -`subActionParams`:: -(Required^*^, object) The set of configuration properties, which vary depending -on the `subAction` value. This object is not required when `subAction` is -`getFields` or `issueTypes`. -+ -.Properties when `subAction` is `fieldsByIssueType` -[%collapsible%open] -====== -`id`::: -(Required, string) The Jira issue type identifier. For example, `10024`. -====== -+ -.Properties when `subAction` is `getIncident` -[%collapsible%open] -====== -`externalId`::: -(Required, string) The Jira issue identifier. For example, `71778`. -====== -+ -.Properties when `subAction` is `issue` -[%collapsible%open] -====== -`id`::: -(Required, string) The Jira issue identifier. For example, `71778`. -====== -+ -.Properties when `subAction` is `issues` -[%collapsible%open] -====== -`title`::: -(Required, string) The title of the Jira issue. -====== -+ -.Properties when `subAction` is `pushToService` -[%collapsible%open] -====== -`comments`::: -(Optional, array of objects) Additional information that is sent to Jira. -+ -.Properties of `comments` -[%collapsible%open] -======= -`comment`:::: -(string) A comment related to the incident. For example, describe how to -troubleshoot the issue. - -`commentId`:::: -(integer) A unique identifier for the comment. -======= - -`incident`::: -(Required, object) Information necessary to create or update a Jira incident. -+ -.Properties of `incident` -[%collapsible%open] -======= -`description`:::: -(Optional, string) The details about the incident. - -`externalId`:::: -(Optional, string) The Jira issue identifier. If present, the incident is -updated. Otherwise, a new incident is created. - -`labels`:::: -(Optional, array of strings) The labels for the incident. For example, -`["LABEL1"]`. NOTE: Labels cannot contain spaces. - -`issueType`:::: -(Optional, integer) The type of incident. For example, `10006`. To obtain the -list of valid values, set `subAction` to `issueTypes`. - -`parent`:::: -(Optional, string) The ID or key of the parent issue. Applies only to `Sub-task` -types of issues. - -`priority`:::: -(Optional, string) The incident priority level. For example, `Lowest`. - -`summary`:::: -(Required, string) A summary of the incident. - -`title`:::: -(Optional, string) A title for the incident, used for searching the contents of -the knowledge base. -======= -====== - -For more information, refer to <>. -===== - -.{opsgenie} connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. Valid values include: `createAlert` and -`closeAlert`. - -`subActionParams`:: -(Required, object) The set of configuration properties, which vary depending on -the `subAction` value. -+ -.Properties when `subAction` is `createAlert` -[%collapsible%open] -====== -`actions`:::: -(Optional, array of strings) The custom actions available to the alert. - -`alias`:::: -(Optional, string) The unique identifier used for alert deduplication in {opsgenie}. - -`description`:::: -(Optional, string) A description that provides detailed information about the alert. - -`details`:::: -(Optional, object) The custom properties of the alert. For example: -`{"key1":"value1","key2":"value2"}`. - -`entity`:::: -(Optional, string) The domain of the alert. For example, the application or server -name. - -`message`:::: -(Required, string) The alert message. - -`note`:::: -(Optional, string) Additional information for the alert. - -`priority`:::: -(Optional, string) The priority level for the alert. Valid values are: `P1`, -`P2`, `P3`, `P4`, and `P5`. - -`responders`:::: -(Optional, array of objects) The entities to receive notifications about the -alert. If `type` is `user`, either `id` or `username` is required. If `type` is -`team`, either `id` or `name` is required. -+ -.Properties of `responders` objects -[%collapsible%open] -======= -`id`:::: -(Required^*^, string) The identifier for the entity. - -`name`:::: -(Required^*^, string) The name of the entity. - -`type`:::: -(Required, string) Valid values are `escalation`, `schedule`, `team`, and `user`. - -`username`:::: -(Required^*^, string) A valid email address for the user. -======= - -`source`:::: -(Optional, string) The display name for the source of the alert. - -`tags`:::: -(Optional, array of strings) The tags for the alert. - -`user`:::: -(Optional, string) The display name for the owner. - -`visibleTo`:::: -(Optional, array of objects) The teams and users that the alert will be visible -to without sending a notification. Only one of `id`, `name`, or `username` is -required. -+ -.Properties of `visibleTo` objects -[%collapsible%open] -======= -`id`:::: -(Required^*^, string) The identifier for the entity. - -`name`:::: -(Required^*^, string) The name of the entity. - -`type`:::: -(Required, string) Valid values are `team` and `user`. - -`username`:::: -(Required^*^, string) The user name. This property is required only when the -`type` is `user`. -======= -====== -+ -.Properties when `subAction` is `closeAlert` -[%collapsible%open] -====== -`alias`:::: -(Required, string) The unique identifier used for alert deduplication in {opsgenie}. -The alias must match the value used when creating the alert. - -`note`:::: -(Optional, string) Additional information for the alert. - -`source`:::: -(Optional, string) The display name for the source of the alert. - -`user`:::: -(Optional, string) The display name for the owner. -====== - -For more information, refer to <>. -===== - - -.{sn-itom} connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. Valid values include: `addEvent` and -`getChoices`. - -`subActionParams`:: -(Required^*^, object) The set of configuration properties, which vary depending -on the `subAction` value. -+ -.Properties when `subAction` is `addEvent` -[%collapsible%open] -====== -`additional_info`:::: -(Optional, string) Additional information about the event. - -`description`:::: -(Optional, string) The details about the event. - -`event_class`:::: -(Optional, string) A specific instance of the source. - -`message_key`:::: -(Optional, string) All actions sharing this key are associated with the same -{sn} alert. The default value is `:`. - -`metric_name`:::: -(Optional, string) The name of the metric. - -`node`:::: -(Optional, string) The host that the event was triggered for. - -`resource`:::: -(Optional, string) The name of the resource. - -`severity`:::: -(Optional, string) The severity of the event. - -`source`:::: -(Optional, string) The name of the event source type. - -`time_of_event`:::: -(Optional, string) The time of the event. - -`type`:::: -(Optional, string) The type of event. -====== -+ -.Properties when `subAction` is `getChoices` -[%collapsible%open] -====== -`fields`:::: -(Required, array of strings) An array of fields. For example, `["severity"]`. -====== -===== - -.{sn-itsm} connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. Valid values include: `getFields`, -`getIncident`, `getChoices`, and `pushToService`. - -`subActionParams`:: -(Required^*^, object) The set of configuration properties, which vary depending -on the `subAction` value. This object is not required when `subAction` is -`getFields`. -+ -.Properties when `subAction` is `getChoices` -[%collapsible%open] -====== -`fields`:::: -(Required, array of strings) An array of fields. For example, `["category","impact"]`. -====== -+ -.Properties when `subAction` is `getIncident` -[%collapsible%open] -====== -`externalId`:::: -(Required, string) The {sn-itsm} issue identifier. -====== -+ -.Properties when `subAction` is `pushToService` -[%collapsible%open] -====== -`comments`::: -(Optional, array of objects) Additional information that is sent to {sn-itsm}. -+ -.Properties of `comments` -[%collapsible%open] -======= -`comment`:::: -(string) A comment related to the incident. For example, describe how to -troubleshoot the issue. - -`commentId`:::: -(integer) A unique identifier for the comment. - -//// -version:::: -(string) TBD -//// -======= - -`incident`::: -(Required, object) Information necessary to create or update a {sn-itsm} incident. -+ -.Properties of `incident` -[%collapsible%open] -======= -`category`:::: -(Optional, string) The category of the incident. - -`correlation_display`:::: -(Optional, string) A descriptive label of the alert for correlation purposes in -{sn}. - -`correlation_id`:::: -(Optional, string) The correlation identifier for the security incident. -Connectors using the same correlation ID are associated with the same {sn} -incident. This value determines whether a new {sn} incident is created or an -existing one is updated. Modifying this value is optional; if not modified, the -rule ID and alert ID are combined as `{{ruleID}}:{{alert ID}}` to form the -correlation ID value in {sn}. The maximum character length for this value is 100 -characters. -+ -NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures -that {sn} creates a separate incident record for every generated alert that uses -a unique alert ID. If the rule generates multiple alerts that use the same alert -IDs, {sn} creates and continually updates a single incident record for the alert. - -`description`:::: -(Optional, string) The details about the incident. - -`externalId`:::: -(Optional, string) The {sn-itsm} issue identifier. If present, the incident is -updated. Otherwise, a new incident is created. - -`impact`:::: -(Optional, string) The impact in {sn-itsm}. - -`severity`:::: -(Optional, string) The severity of the incident. - -`short_description`:::: -(Required, string) A short description for the incident, used for searching the -contents of the knowledge base. - -`subcategory`:::: -(Optional, string) The subcategory in {sn-itsm}. - -`urgency`:::: -(Optional, string) The urgency in {sn-itsm}. -======= -====== -===== - -.{sn-sir} connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. Valid values include: `getFields`, -`getIncident`, `getChoices`, and `pushToService`. - -`subActionParams`:: -(Required^*^, object) The set of configuration properties, which vary depending -on the `subAction` value. This object is not required when `subAction` is -`getFields`. -+ -.Properties when `subAction` is `getChoices` -[%collapsible%open] -====== -`fields`:::: -(Required, array of strings) An array of fields. For example, `["priority","category"]`. -====== -+ -.Properties when `subAction` is `getIncident` -[%collapsible%open] -====== -`externalId`:::: -(Required, string) The {sn-sir} issue identifier. -====== -+ -.Properties when `subAction` is `pushToService` -[%collapsible%open] -====== -`comments`::: -(Optional, array of objects) Additional information that is sent to {sn-sir}. -+ -.Properties of `comments` -[%collapsible%open] -======= -`comment`:::: -(string) A comment related to the incident. For example, describe how to -troubleshoot the issue. - -`commentId`:::: -(integer) A unique identifier for the comment. - -//// -`version`:::: -(string) TBD -//// -======= - -`incident`::: -(Required, object) Information necessary to create or update a {sn-sir} incident. -+ -.Properties of `incident` -[%collapsible%open] -======= -`category`:::: -(Optional, string) The category of the incident. - -`correlation_display`:::: -(Optional, string) A descriptive label of the alert for correlation purposes in -{sn}. - -`correlation_id`:::: -(Optional, string) The correlation identifier for the security incident. -Connectors using the same correlation ID are associated with the same {sn} -incident. This value determines whether a new {sn} incident is created or an -existing one is updated. Modifying this value is optional; if not modified, the -rule ID and alert ID are combined as `{{ruleID}}:{{alert ID}}` to form the -correlation ID value in {sn}. The maximum character length for this value is 100 -characters. -+ -NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures that -{sn} creates a separate incident record for every generated alert that uses a -unique alert ID. If the rule generates multiple alerts that use the same alert -IDs, {sn} creates and continually updates a single incident record for the alert. - -`description`:::: -(Optional, string) The details about the incident. - -`dest_ip`:::: -(Optional, string or array of strings) A list of destination IP addresses related -to the security incident. The IPs are added as observables to the security incident. - -`externalId`:::: -(Optional, string) The {sn-sir} issue identifier. If present, the incident is -updated. Otherwise, a new incident is created. - -`malware_hash`:::: -(Optional, string or array of strings) A list of malware hashes related to the -security incident. The hashes are added as observables to the security incident. - -`malware_url`:::: -(Optional, string or array of strings) A list of malware URLs related to the -security incident. The URLs are added as observables to the security incident. - -`priority`:::: -(Optional, string) The priority of the incident. - -`short_description`:::: -(Required, string) A short description for the incident, used for searching the -contents of the knowledge base. - -`source_ip`:::: -(Optional, string or array of strings) A list of source IP addresses related to -the security incident. The IPs are added as observables to the security incident. - -`subcategory`:::: -(Optional, string) The subcategory of the incident. -======= -====== -===== - -.Server log connectors -[%collapsible%open] -===== -`level`:: -(Optional, string) The log level of the message: `trace`, `debug`, `info`, -`warn`, `error`, or `fatal`. Defaults to `info`. - -`message`:: -(Required, string) The message to log. -===== - -.Slack connectors -[%collapsible%open] -===== -`message`:: -(Required^*^, string) The Slack message text, which cannot contain Markdown, images, or other advanced formatting. -It is applicable only when the connector type is `.slack`. - -`subAction`:: -(Required^*^, string) The action to test. -It is applicable only when the connector type is `.slack_api`. -Valid values include: `postMessage`, `validChannelId`. -====== - -`subActionParams`:: -(Required, object) The set of configuration properties, which vary depending -on the `subAction` value. -+ -.Properties when `subAction` is `postMessage` -[%collapsible%open] -======= -`channelIds`::: -(Optional, array of strings) The Slack channel identifier, which must be one of the allowed channels in the connector configuration. - -`channels`::: -(Optional, array of strings) -The name of a channel that your Slack app has access to. deprecated:[8.12.0] - -`text`::: -(Optional, string) The Slack message text, which cannot contain Markdown, images, or other advanced formatting. -======= -+ -.Properties when `subAction` is `validChannelId` -[%collapsible%open] -======= -`channelId`::: -(Required, string) The Slack channel identifier. For example, `C123ABC456`. -======= -====== -===== - -.{swimlane} connectors -[%collapsible%open] -===== -`subAction`:: -(Required, string) The action to test. It must be `pushToService`. - -`subActionParams`:: -(Required, object) The set of configuration properties. -+ -.Properties of `subActionParams` -[%collapsible%open] -====== -`comments`::: -(Optional, array of objects) Additional information that is sent to {swimlane}. -+ -.Properties of `comments` objects -[%collapsible%open] -======= -comment:::: -(string) A comment related to the incident. For example, describe how to -troubleshoot the issue. - -commentId:::: -(integer) A unique identifier for the comment. - -======= - -`incident`::: -(Required, object) Information necessary to create or update a {swimlane} incident. -+ -.Properties of `incident` -[%collapsible%open] -======= -`alertId`:::: -(Optional, string) The alert identifier. - -`caseId`:::: -(Optional, string) The case identifier for the incident. - -`caseName`:::: -(Optional, string) The case name for the incident. - -`description`:::: -(Optional, string) The description of the incident. - -`ruleName`:::: -(Optional, string) The rule name. - -`severity`:::: -(Optional, string) The severity of the incident. -======= -====== -===== -==== --- - -[[execute-connector-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[execute-connector-api-example]] -=== {api-examples-title} - -Run an index connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute -{ - "params": { - "documents": [ - { - "id": "test_doc_id", - "name": "test_doc_name", - "message": "hello, world" - } - ] - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "status": "ok", - "data": { - "took": 10, - "errors": false, - "items": [ - { - "index": { - "_index": "test-index", - "_id": "iKyijHcBKCsmXNFrQe3T", - "_version": 1, - "result": "created", - "_shards": { - "total": 2, - "successful": 1, - "failed": 0 - }, - "_seq_no": 0, - "_primary_term": 1, - "status": 201 - } - } - ] - }, - "connector_id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad" -} --------------------------------------------------- - -Run a server log connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector/7fc7b9a0-ecc9-11ec-8736-e7d63118c907/_execute -{ - "params": { - "level": "warn", - "message": "Test warning message" - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{"status":"ok","connector_id":"7fc7b9a0-ecc9-11ec-8736-e7d63118c907"} --------------------------------------------------- - -Retrieve the list of issue types for a Jira connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector/b3aad810-edbe-11ec-82d1-11348ecbf4a6/_execute -{ - "params": { - "subAction": "issueTypes" - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "status":"ok", - "data":[ - {"id":"10024","name":"Improvement"},{"id":"10006","name":"Task"}, - {"id":"10007","name":"Sub-task"},{"id":"10025","name":"New Feature"}, - {"id":"10023","name":"Bug"},{"id":"10000","name":"Epic"} - ], - "connector_id":"b3aad810-edbe-11ec-82d1-11348ecbf4a6" -} --------------------------------------------------- - -Create then update a {swimlane} incident: -[source,sh] --------------------------------------------------- -POST api/actions/connector/a4746470-2f94-11ed-b0e0-87533c532698/_execute -{ - "params":{ - "subAction":"pushToService", - "subActionParams":{ - "incident":{ - "description":"Description of the incident", - "caseName":"Case name", - "caseId":"1000" - }, - "comments":[ - {"commentId":"1","comment":"A comment about the incident"} - ] - } - } -} - -POST api/actions/connector/a4746470-2f94-11ed-b0e0-87533c532698/_execute -{ - "params":{ - "subAction":"pushToService", - "subActionParams":{ - "incident":{ - "caseId":"1000", - "caseName":"A new case name" - } - } - } -} --------------------------------------------------- -// KIBANA - -Retrieve the list of choices for a {sn-itom} connector: - -[source,sh] --------------------------------------------------- -POST api/actions/connector/9d9be270-2fd2-11ed-b0e0-87533c532698/_execute -{ - "params": { - "subAction": "getChoices", - "subActionParams": { - "fields": [ "severity","urgency" ] - } - } -} --------------------------------------------------- -// KIBANA - -The API returns the severity and urgency choices, for example: - -[source,sh] --------------------------------------------------- -{ - "status": "ok", - "data":[ - {"dependent_value":"","label":"Critical","value":"1","element":"severity"}, - {"dependent_value":"","label":"Major","value":"2","element":"severity"}, - {"dependent_value":"","label":"Minor","value":"3","element":"severity"}, - {"dependent_value":"","label":"Warning","value":"4","element":"severity"}, - {"dependent_value":"","label":"OK","value":"5","element":"severity"}, - {"dependent_value":"","label":"Clear","value":"0","element":"severity"}, - {"dependent_value":"","label":"1 - High","value":"1","element":"urgency"}, - {"dependent_value":"","label":"2 - Medium","value":"2","element":"urgency"}, - {"dependent_value":"","label":"3 - Low","value":"3","element":"urgency"}], - "connector_id":"9d9be270-2fd2-11ed-b0e0-87533c532698" -} --------------------------------------------------- - diff --git a/docs/api/actions-and-connectors/get.asciidoc b/docs/api/actions-and-connectors/get.asciidoc deleted file mode 100644 index 92414babd1638..0000000000000 --- a/docs/api/actions-and-connectors/get.asciidoc +++ /dev/null @@ -1,74 +0,0 @@ -[[get-connector-api]] -== Get connector API -++++ -Get connector -++++ - -Retrieves a connector by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[discrete] -[[get-connector-api-request]] -=== {api-request-title} - -`GET :/api/actions/connector/` - -`GET :/s//api/actions/connector/` - -[discrete] -=== {api-prereq-title} - -You must have `read` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -[discrete] -[[get-connector-api-params]] -=== {api-path-parms-title} - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[discrete] -[[get-connector-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[discrete] -[[get-connector-api-example]] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false -} --------------------------------------------------- \ No newline at end of file diff --git a/docs/api/actions-and-connectors/get_all.asciidoc b/docs/api/actions-and-connectors/get_all.asciidoc deleted file mode 100644 index ba2cab86b654f..0000000000000 --- a/docs/api/actions-and-connectors/get_all.asciidoc +++ /dev/null @@ -1,84 +0,0 @@ -[[get-all-connectors-api]] -== Get all connectors API -++++ -Get all connectors -++++ - -Retrieves all connectors. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[discrete] -[[get-all-connectors-api-request]] -=== {api-request-title} - -`GET :/api/actions/connectors` - -`GET :/s//api/actions/connectors` - -[discrete] -=== {api-prereq-title} - -You must have `read` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -[discrete] -[[get-all-connectors-api-path-params]] -=== {api-path-parms-title} - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[discrete] -[[get-all-connectors-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[discrete] -[[get-all-connectors-api-example]] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/actions/connectors --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": "preconfigured-mail-connector", - "connector_type_id": ".email", - "name": "email: preconfigured-mail-connector", - "is_preconfigured": true, - "is_deprecated": false, - "referenced_by_count": 0 <1> - }, - { - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false, - "referenced_by_count": 3 - } -] --------------------------------------------------- - -<1> `referenced_by_count` indicates the number of saved objects that reference the connector. This value is not calculated if `is_preconfigured` is `true`. \ No newline at end of file diff --git a/docs/api/actions-and-connectors/legacy/create.asciidoc b/docs/api/actions-and-connectors/legacy/create.asciidoc deleted file mode 100644 index 5b5b71b1d6daa..0000000000000 --- a/docs/api/actions-and-connectors/legacy/create.asciidoc +++ /dev/null @@ -1,82 +0,0 @@ -[[actions-and-connectors-legacy-api-create]] -==== Legacy Create connector API -++++ -Legacy Create connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Creates a connector. - -[[actions-and-connectors-legacy-api-create-request]] -===== Request - -`POST :/api/actions/action` - -`POST :/s//api/actions/action` - -[[actions-and-connectors-legacy-api-create-path-params]] -===== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-create-request-body]] -===== Request body - -`name`:: - (Required, string) The display name for the connector. - -`actionTypeId`:: - (Required, string) The connector type ID for the connector. - -`config`:: - (Required, object) The configuration for the connector. Configuration properties vary depending on - the connector type. For information about the configuration properties, refer to <>. - -`secrets`:: - (Required, object) The secrets configuration for the connector. Secrets configuration properties vary - depending on the connector type. For information about the secrets configuration properties, refer to <>. -+ -WARNING: Remember these values. You must provide them each time you call the <> API. - -[[actions-and-connectors-legacy-api-create-request-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-create-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X POST api/actions/action -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "name": "my-connector", - "actionTypeId": ".index", - "config": { - "index": "test-index" - } -}' --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "actionTypeId": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "isPreconfigured": false, - "isDeprecated": false, - "isMissingSecrets": false -} --------------------------------------------------- diff --git a/docs/api/actions-and-connectors/legacy/delete.asciidoc b/docs/api/actions-and-connectors/legacy/delete.asciidoc deleted file mode 100644 index 9ec2c0d392a96..0000000000000 --- a/docs/api/actions-and-connectors/legacy/delete.asciidoc +++ /dev/null @@ -1,41 +0,0 @@ -[[actions-and-connectors-legacy-api-delete]] -==== Legacy Delete connector API -++++ -Legacy Delete connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Deletes a connector by ID. - -WARNING: When you delete an connector, _it cannot be recovered_. - -[[actions-and-connectors-legacy-api-delete-request]] -===== Request - -`DELETE :/api/actions/action/` - -`DELETE :/s//api/actions/action/` - -[[actions-and-connectors-legacy-api-delete-path-params]] -===== Path parameters - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-delete-response-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X DELETE api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad --------------------------------------------------- -// KIBANA diff --git a/docs/api/actions-and-connectors/legacy/execute.asciidoc b/docs/api/actions-and-connectors/legacy/execute.asciidoc deleted file mode 100644 index f01aa1585b192..0000000000000 --- a/docs/api/actions-and-connectors/legacy/execute.asciidoc +++ /dev/null @@ -1,90 +0,0 @@ -[[actions-and-connectors-legacy-api-execute]] -==== Legacy Execute connector API -++++ -Legacy Execute connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Executes a connector by ID. - -[[actions-and-connectors-legacy-api-execute-request]] -===== Request - -`POST :/api/actions/action//_execute` - -`POST :/s//api/actions/action//_execute` - -[[actions-and-connectors-legacy-api-execute-params]] -===== Path parameters - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-execute-request-body]] -===== Request body - -`params`:: - (Required, object) The parameters of the connector. Parameter properties vary depending on - the connector type. For information about the parameter properties, refer to <>. - -[[actions-and-connectors-legacy-api-execute-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-execute-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X POST api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "params": { - "documents": [ - { - "id": "test_doc_id", - "name": "test_doc_name", - "message": "hello, world" - } - ] - } -}' --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "status": "ok", - "data": { - "took": 197, - "errors": false, - "items": [ - { - "index": { - "_index": "updated-index", - "_id": "iKyijHcBKCsmXNFrQe3T", - "_version": 1, - "result": "created", - "_shards": { - "total": 2, - "successful": 1, - "failed": 0 - }, - "_seq_no": 0, - "_primary_term": 1, - "status": 201 - } - } - ] - }, - "actionId": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad" -} --------------------------------------------------- diff --git a/docs/api/actions-and-connectors/legacy/get.asciidoc b/docs/api/actions-and-connectors/legacy/get.asciidoc deleted file mode 100644 index d6554d606a286..0000000000000 --- a/docs/api/actions-and-connectors/legacy/get.asciidoc +++ /dev/null @@ -1,59 +0,0 @@ -[[actions-and-connectors-legacy-api-get]] -==== Legacy Get connector API -++++ -Legacy Get connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieves a connector by ID. - -[[actions-and-connectors-legacy-api-get-request]] -===== Request - -`GET :/api/actions/action/` - -`GET :/s//api/actions/action/` - -[[actions-and-connectors-legacy-api-get-params]] -===== Path parameters - -`id`:: - (Required, string) The ID of the action. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-get-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-get-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X GET api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "actionTypeId": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "isPreconfigured": false, - "isDeprecated": false, - "isMissingSecrets": false -} --------------------------------------------------- diff --git a/docs/api/actions-and-connectors/legacy/get_all.asciidoc b/docs/api/actions-and-connectors/legacy/get_all.asciidoc deleted file mode 100644 index 9e52b6883ec11..0000000000000 --- a/docs/api/actions-and-connectors/legacy/get_all.asciidoc +++ /dev/null @@ -1,65 +0,0 @@ -[[actions-and-connectors-legacy-api-get-all]] -==== Legacy Get all connector API -++++ -Legacy Get all connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieves all connectors. - -[[actions-and-connectors-legacy-api-get-all-request]] -===== Request - -`GET :/api/actions` - -`GET :/s//api/actions` - -[[actions-and-connectors-legacy-api-get-all-path-params]] -===== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-get-all-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-get-all-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X GET api/actions --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": "preconfigured-mail-action", - "actionTypeId": ".email", - "name": "email: preconfigured-mail-action", - "isPreconfigured": true, - "isDeprecated": false - }, - { - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "actionTypeId": ".index", - "name": "my-action", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "isPreconfigured": false, - "isDeprecated": false, - "isMissingSecrets": false - } -] --------------------------------------------------- diff --git a/docs/api/actions-and-connectors/legacy/index.asciidoc b/docs/api/actions-and-connectors/legacy/index.asciidoc deleted file mode 100644 index 66ecb2ed31119..0000000000000 --- a/docs/api/actions-and-connectors/legacy/index.asciidoc +++ /dev/null @@ -1,4 +0,0 @@ -[[actions-and-connectors-legacy-apis]] -=== Deprecated 7.x APIs - -These APIs are deprecated and will be removed in a future release. diff --git a/docs/api/actions-and-connectors/legacy/list.asciidoc b/docs/api/actions-and-connectors/legacy/list.asciidoc deleted file mode 100644 index d78838dcbe974..0000000000000 --- a/docs/api/actions-and-connectors/legacy/list.asciidoc +++ /dev/null @@ -1,69 +0,0 @@ -[[actions-and-connectors-legacy-api-list]] -==== Legacy List connector types API -++++ -Legacy List all connector types -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieves a list of all connector types. - -[[actions-and-connectors-legacy-api-list-request]] -===== Request - -`GET :/api/actions/list_action_types` - -`GET :/s//api/actions/list_action_types` - -[[actions-and-connectors-legacy-api-list-path-params]] -===== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-list-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-list-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X GET api/actions/list_action_types --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": ".email", <1> - "name": "Email", <2> - "minimumLicenseRequired": "gold", <3> - "enabled": false, <4> - "enabledInConfig": true, <5> - "enabledInLicense": false <6> - }, - { - "id": ".index", - "name": "Index", - "minimumLicenseRequired": "basic", - "enabled": true, - "enabledInConfig": true, - "enabledInLicense": true - } -] --------------------------------------------------- - - -<1> `id` - The unique ID of the connector type. -<2> `name` - The name of the connector type. -<3> `minimumLicenseRequired` - The license required to use the connector type. -<4> `enabled` - Specifies if the connector type is enabled or disabled in {kib}. -<5> `enabledInConfig` - Specifies if the connector type is enabled or enabled in the {kib} .yml file. -<6> `enabledInLicense` - Specifies if the connector type is enabled or disabled in the license. diff --git a/docs/api/actions-and-connectors/legacy/update.asciidoc b/docs/api/actions-and-connectors/legacy/update.asciidoc deleted file mode 100644 index 1e6a4e71c8b81..0000000000000 --- a/docs/api/actions-and-connectors/legacy/update.asciidoc +++ /dev/null @@ -1,77 +0,0 @@ -[[actions-and-connectors-legacy-api-update]] -==== Legacy Update connector API -++++ -Legacy Update connector -++++ - -deprecated::[7.13.0,Use <> instead.] - -Updates the attributes for an existing connector. - -[[actions-and-connectors-legacy-api-update-request]] -===== Request - -`PUT :/api/actions/action/` - -`PUT :/s//api/actions/action/` - -[[actions-and-connectors-legacy-api-update-params]] -===== Path parameters - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[actions-and-connectors-legacy-api-update-request-body]] -===== Request body - -`name`:: - (Required, string) The new name of the connector. - -`config`:: - (Required, object) The new connector configuration. Configuration properties vary depending on the connector type. For information about the configuration properties, refer to <>. - -`secrets`:: - (Required, object) The updated secrets configuration for the connector. Secrets properties vary depending on the connector type. For information about the secrets configuration properties, refer to <>. - -[[actions-and-connectors-legacy-api-update-codes]] -===== Response code - -`200`:: - Indicates a successful call. - -[[actions-and-connectors-legacy-api-update-example]] -===== Example - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "name": "updated-connector", - "config": { - "index": "updated-index" - } -}' --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "actionTypeId": ".index", - "name": "updated-connector", - "config": { - "index": "updated-index", - "refresh": false, - "executionTimeField": null - }, - "isPreconfigured": false, - "isDeprecated": false, - "isMissingSecrets": false -} --------------------------------------------------- diff --git a/docs/api/actions-and-connectors/list.asciidoc b/docs/api/actions-and-connectors/list.asciidoc deleted file mode 100644 index e978f75d36c1f..0000000000000 --- a/docs/api/actions-and-connectors/list.asciidoc +++ /dev/null @@ -1,88 +0,0 @@ -[[list-connector-types-api]] -== List connector types API -++++ -List all connector types -++++ - -Retrieves a list of all connector types. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[[list-connector-types-api-request]] -=== {api-request-title} - -`GET :/api/actions/connector_types` - -`GET :/s//api/actions/connector_types` - - -[discrete] -=== {api-prereq-title} - -You do not need any <> to -run this API. - -[[list-connector-types-api-path-params]] -=== {api-path-parms-title} - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[list-connector-types-api-query-params]] -=== {api-query-parms-title} - -`feature_id`:: -(Optional, string) Filters list of connector types to those that support the feature id. - -[[list-connector-types-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[list-connector-types-api-example]] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/actions/connector_types --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": ".email", <1> - "name": "Email", <2> - "minimum_license_required": "gold", <3> - "enabled": false, <4> - "enabled_in_config": true, <5> - "enabled_in_license": true, <6> - "supported_feature_ids": ["alerting"] <7> - }, - { - "id": ".index", - "name": "Index", - "minimum_license_required": "basic", - "enabled": true, - "enabled_in_config": true, - "enabled_in_license": true, - "supported_feature_ids": ["alerting"] - }, - ... -] --------------------------------------------------- -<1> `id` - The unique ID of the connector type. -<2> `name` - The name of the connector type. -<3> `minimum_license_required` - The license required to use the connector type. -<4> `enabled` - Specifies if the connector type is enabled or disabled in {kib}. -<5> `enabled_in_config` - Specifies if the connector type is enabled or enabled in the {kib} `.yml` file. -<6> `enabled_in_license` - Specifies if the connector type is enabled or disabled in the license. -<7> `supported_feature_ids` - Specifies which Kibana features this connector type supports. \ No newline at end of file diff --git a/docs/api/actions-and-connectors/update.asciidoc b/docs/api/actions-and-connectors/update.asciidoc deleted file mode 100644 index 7fe3d85ad0ca7..0000000000000 --- a/docs/api/actions-and-connectors/update.asciidoc +++ /dev/null @@ -1,101 +0,0 @@ -[[update-connector-api]] -== Update connector API -++++ -Update connector -++++ - -Updates the attributes for a connector. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[open API specification]. -==== - -[[update-connector-api-request]] -=== {api-request-title} - -`PUT :/api/actions/connector/` - -`PUT :/s//api/actions/connector/` - -[discrete] -=== {api-prereq-title} - -You must have `all` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -[[update-connector-api-params]] -=== {api-path-parms-title} - -`id`:: - (Required, string) The ID of the connector. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[role="child_attributes"] -[[update-connector-api-request-body]] -=== {api-request-body-title} - -`config`:: -(Required, object) The new connector configuration. Configuration properties -vary depending on the connector type. For example: -+ --- -include::create.asciidoc[tag=connector-config] --- - -`name`:: -(Required, string) The new name of the connector. - -`secrets`:: -(Required^*^, object) The updated secrets configuration for the connector. Secrets -properties vary depending on the connector type. For information about the -secrets configuration properties, refer to -<>. -+ --- -include::create.asciidoc[tag=connector-secrets] --- - -[[update-connector-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[update-connector-api-example]] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -PUT api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad -{ - "name": "updated-connector", - "config": { - "index": "updated-index" - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "updated-connector", - "config": { - "index": "updated-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false -} --------------------------------------------------- diff --git a/docs/api/alerting.asciidoc b/docs/api/alerting.asciidoc index e5a8d641da553..777e3b12b581f 100644 --- a/docs/api/alerting.asciidoc +++ b/docs/api/alerting.asciidoc @@ -1,47 +1,4 @@ [[alerting-apis]] == Alerting APIs -The following APIs are available for Alerting. - -* <> to create a rule - -* <> to update the attributes for existing rules - -* <> to retrieve a single rule by ID - -* <> to permanently remove a rule - -* <> to retrieve a paginated set of rules by condition - -* <> to retrieve a list of rule types - -* <> to enable a single rule by ID - -* <> to disable a single rule by ID - -* <> to mute alert for a single rule by ID - -* <> to unmute alert for a single rule by ID - -* <> to mute all alerts for a single rule by ID - -* <> to unmute all alerts for a single rule by ID - -* <> to retrieve the health of the Alerting framework - -For deprecated APIs, refer to <>. - -include::alerting/create_rule.asciidoc[leveloffset=+1] -include::alerting/delete_rule.asciidoc[leveloffset=+1] -include::alerting/disable_rule.asciidoc[leveloffset=+1] -include::alerting/enable_rule.asciidoc[leveloffset=+1] -include::alerting/find_rules.asciidoc[leveloffset=+1] -include::alerting/health.asciidoc[leveloffset=+1] -include::alerting/get_rules.asciidoc[leveloffset=+1] -include::alerting/list_rule_types.asciidoc[leveloffset=+1] -include::alerting/update_rule.asciidoc[leveloffset=+1] -include::alerting/mute_all_alerts.asciidoc[leveloffset=+1] -include::alerting/mute_alert.asciidoc[leveloffset=+1] -include::alerting/unmute_all_alerts.asciidoc[leveloffset=+1] -include::alerting/unmute_alert.asciidoc[leveloffset=+1] -include::alerting/legacy/index.asciidoc[] +For the latest details, refer to {api-kibana}/group/endpoint-alerting[alerting APIs]. diff --git a/docs/api/alerting/create_rule.asciidoc b/docs/api/alerting/create_rule.asciidoc deleted file mode 100644 index faac08b2b613e..0000000000000 --- a/docs/api/alerting/create_rule.asciidoc +++ /dev/null @@ -1,229 +0,0 @@ -[[create-rule-api]] -== Create rule API -++++ -Create rule -++++ - -Create {kib} rules. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[create-rule-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule/` - -`POST :/s//api/alerting/rule/` - - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rules you're creating. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. If the rule has `actions`, -you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -[[create-rule-api-path-params]] -=== {api-path-parms-title} - -``:: -(Optional, string) Specifies a UUID v1 or v4 to use instead of a randomly -generated ID. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[role="child_attributes"] -[[create-rule-api-request-body]] -=== {api-request-body-title} - -`actions`:: -(Optional, object array) An array of action objects. -+ -.Properties of the action objects: -[%collapsible%open] -===== - -`group`::: -(Required, string) Grouping actions is recommended for escalations for different -types of alerts. If you don't need this, set this value to `default`. - -`id`::: -(Required, string) The ID of the connector saved object, which you can obtain by -using <>. - -`params`::: -(Required, object) The map to the `params` that the -<> will receive. ` params` are handled as Mustache -templates and passed a default set of context. -===== - -`consumer`:: -(Required, string) The name of the application or feature that owns the rule. -For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, -`ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. - -`enabled`:: -(Optional, boolean) Indicates if you want to run the rule on an interval basis -after it is created. - -`name`:: -(Required, string) The name of the rule. While this name does not have to be -unique, a distinctive name can help you identify a rule. - -`notify_when`:: -(Required, string) Defines how often alerts generate actions. Valid values are: -+ --- - -* `onActionGroupChange`: Actions run when the alert status changes. -* `onActiveAlert`: Actions run when the alert becomes active and at each check -interval while the rule conditions are met. -* `onThrottleInterval`: Actions run when the alert becomes active and at the -interval specified in the `throttle` property while the rule conditions are met. - --- - -`params`:: -(Required, object) The parameters to pass to the rule type executor `params` -value. This will also validate against the rule type params validator, if defined. - -`rule_type_id`:: -(Required, string) The ID of the rule type that you want to call when the rule -is scheduled to run. For example, `.es-query`, `.index-threshold`, -`logs.alert.document.count`, `monitoring_alert_cluster_health`, -`siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. For more -information, refer to <>. - -`schedule`:: -(Required, object) The check interval, which specifies how frequently the rule -conditions are checked. The interval must be specified in seconds, minutes, -hours or days. For example: `{ "interval": "10s" }`, `{ "interval": "5m" }`, -`{ "interval": "1h" }`, or `{ "interval": "1d" }`. - -`tags`:: -(Optional, string array) A list of tag names that are applied to a rule. - -`throttle`:: -(Optional, string) Defines how often an alert generates repeated actions. -This custom action interval must be specified in seconds, minutes, hours, or -days. For example, `10m` or `1h`. This property is used only if `notify_when` -is `onThrottleInterval`. - -[[create-rule-api-request-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[create-rule-api-example]] -=== {api-examples-title} - -Create an <> that has actions -associated with a server log connector: - -[source,sh] --------------------------------------------------- -POST api/alerting/rule -{ - "params":{ - "aggType":"avg", - "termSize":6, - "thresholdComparator":">", - "timeWindowSize":5, - "timeWindowUnit":"m", - "groupBy":"top", - "threshold":[ - 1000 - ], - "index":[ - ".test-index" - ], - "timeField":"@timestamp", - "aggField":"sheet.version", - "termField":"name.keyword" - }, - "consumer":"alerts", - "rule_type_id":".index-threshold", - "schedule":{ - "interval":"1m" - }, - "actions":[ - { - "id":"dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2", - "group":"threshold met", - "params":{ - "level":"info", - "message":"Rule '{{rule.name}}' is active for group '{{context.group}}':\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" - } - } - ], - "tags":[ - "cpu" - ], - "notify_when":"onActionGroupChange", - "name":"my alert" -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "41893910-6bca-11eb-9e0d-85d233e3ee35", - "consumer": "alerts", - "tags": ["cpu"], - "name": "my alert", - "enabled": true, - "throttle": null, - "schedule": {"interval": "1m"}, - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [1000], - "index": [".test-index"], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" - }, - "rule_type_id": ".index-threshold", - "scheduled_task_id": "425b0800-6bca-11eb-9e0d-85d233e3ee35", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2022-06-08T17:20:31.632Z", - "updated_at": "2022-06-08T17:20:31.632Z", - "api_key_owner": "elastic", - "notify_when": "onActionGroupChange", - "mute_all": false, - "muted_alert_ids": [], - "execution_status": { - "last_execution_date": "2022-06-08T17:20:31.632Z", - "status": "pending" - }, - "actions": [ - { - "group": "threshold met", - "id": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" - }, - "connector_type_id": ".server-log" - } - ] -} --------------------------------------------------- diff --git a/docs/api/alerting/delete_rule.asciidoc b/docs/api/alerting/delete_rule.asciidoc deleted file mode 100644 index 220b4dfa9ece4..0000000000000 --- a/docs/api/alerting/delete_rule.asciidoc +++ /dev/null @@ -1,54 +0,0 @@ -[[delete-rule-api]] -== Delete rule API -++++ -Delete rule -++++ - -Permanently removes a rule. - -WARNING: After you delete a rule, you cannot recover it. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[delete-rule-api-request]] -=== {api-request-title} - -`DELETE :/api/alerting/rule/` - -`DELETE :/s//api/alerting/rule/` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule you're deleting. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* or *{ml-app}* -features, *{observability}*, or *Security* features. For more details, refer to -<>. - -[[delete-rule-api-path-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The identifier of the rule that you want to remove. - -`space_id`:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[[delete-rule-api-response-codes]] -=== {api-response-codes-title} - -`204`:: -Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -DELETE api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35 --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/disable_rule.asciidoc b/docs/api/alerting/disable_rule.asciidoc deleted file mode 100644 index 8f370072a689c..0000000000000 --- a/docs/api/alerting/disable_rule.asciidoc +++ /dev/null @@ -1,53 +0,0 @@ -[[disable-rule-api]] -== Disable rule API -++++ -Disable rule -++++ - -Disable a rule. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[disable-rule-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//_disable` - -`POST :/s//api/alerting/rule//_disable` - - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, -the *Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. For more details, refer to -<>. - -[[disable-rule-api-path-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The ID of the rule that you want to disable. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[disable-rule-api-response-codes]] -=== {api-response-codes-title} - -`204`:: -Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_disable --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/enable_rule.asciidoc b/docs/api/alerting/enable_rule.asciidoc deleted file mode 100644 index ba04d0147944a..0000000000000 --- a/docs/api/alerting/enable_rule.asciidoc +++ /dev/null @@ -1,52 +0,0 @@ -[[enable-rule-api]] -== Enable rule API -++++ -Enable rule -++++ - -Enable a rule. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[enable-rule-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//_enable` - -`POST :/s//api/alerting/rule//_enable` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. For more details, refer to -<>. - -[[enable-rule-api-path-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The ID of the rule that you want to enable. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[enable-rule-api-response-codes]] -=== {api-response-codes-title} - -`204`:: -Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_enable --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/find_rules.asciidoc b/docs/api/alerting/find_rules.asciidoc deleted file mode 100644 index a9a9ee225db7e..0000000000000 --- a/docs/api/alerting/find_rules.asciidoc +++ /dev/null @@ -1,167 +0,0 @@ -[[find-rules-api]] -== Find rules API -++++ -Find rules -++++ - -Retrieve a paginated set of rules based on condition. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[find-rules-api-request]] -=== {api-request-title} - -`GET :/api/alerting/rules/_find` - -`GET :/s//api/alerting/rules/_find` - -=== {api-prereq-title} - -You must have `read` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rules you're seeking. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. To find rules associated -with the *{stack-monitor-app}* feature, use the `monitoring_user` built-in role. - -For more details, refer to <>. - -=== {api-description-title} - -As rules change in {kib}, the results on each page of the response also change. -Use the find API for traditional paginated results, but avoid using it to export -large amounts of data. - -NOTE: Rule `params` are stored as a {ref}/flattened.html[flattened field type] -and analyzed as keywords. - -[[find-rules-api-path-params]] -=== {api-path-parms-title} - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[find-rules-api-query-params]] -=== {api-query-parms-title} - -`default_search_operator`:: -(Optional, string) The operator to use for the `simple_query_string`. The -default is 'OR'. - -`fields`:: -(Optional, array of strings) The fields to return in the `attributes` key of the -response. - -`filter`:: -(Optional, string) A <> string that you filter with an -attribute from your saved object. It should look like -`savedObjectType.attributes.title: "myTitle"`. However, If you used a direct -attribute of a saved object, such as `updatedAt`, you will have to define your -filter, for example, `savedObjectType.updatedAt > 2018-12-22`. - -`has_reference`:: -(Optional, object) Filters the rules that have a relation with the reference -objects with the specific "type" and "ID". - -`page`:: -(Optional, number) The page number. - -`per_page`:: -(Optional, number) The number of rules to return per page. - -`search`:: -(Optional, string) An {es} -{ref}/query-dsl-simple-query-string-query.html[simple_query_string] query that -filters the rules in the response. - -`search_fields`:: -(Optional, array or string) The fields to perform the `simple_query_string` -parsed query against. - -`sort_field`:: -(Optional, string) Sorts the response. Could be a rule field returned in the -`attributes` key of the response. - -`sort_order`:: -(Optional, string) Sort direction, either `asc` or `desc`. - -[[find-rules-api-request-codes]] -=== {api-response-codes-title} - -`200`:: -Indicates a successful call. - -=== {api-examples-title} - -Find rules with names that start with `my`: - -[source,sh] --------------------------------------------------- -GET api/alerting/rules/_find?search_fields=name&search=my* --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "page": 1, - "total": 1, - "per_page": 10, - "data": [{ - "id": "b530fed0-74f5-11ed-9801-35303b735aef", - "name": "cluster_health_rule", - "consumer": "alerts", - "enabled": true, - "tags": ["cluster","health"], - "throttle": null, - "schedule": {"interval":"1m"}, - "params": {}, - "rule_type_id": "monitoring_alert_cluster_health", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2022-12-05T23:36:58.284Z", - "updated_at": "2022-12-05T23:36:58.284Z", - "api_key_owner": "elastic", - "notify_when": "onActiveAlert", - "mute_all": false, - "muted_alert_ids": [], - "scheduled_task_id": "b530fed0-74f5-11ed-9801-35303b735aef", - "execution_status": { - "status": "ok", - "last_execution_date": "2022-12-06T00:09:31.882Z", - "last_duration": 42 - }, - "actions": [{ - "group": "default", - "id": "9dca3e00-74f5-11ed-9801-35303b735aef", - "params": { - "level": "info", - "message": "{{context.internalFullMessage}}" - }, - "connector_type_id": ".server-log" - }], - "last_run":{ - "alerts_count": {"new": 0,"ignored": 0,"recovered": 0,"active": 0}, - "outcome_msg": null, - "warning": null, - "outcome": "succeeded" - }, - "next_run": "2022-12-06T00:10:31.811Z" - }] -} --------------------------------------------------- - -For parameters that accept multiple values (such as `fields`), repeat the -query parameter for each value: - -[source,sh] --------------------------------------------------- -GET api/alerting/rules/_find?fields=id&fields=name --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/get_rules.asciidoc b/docs/api/alerting/get_rules.asciidoc deleted file mode 100644 index ff60d5bad52d1..0000000000000 --- a/docs/api/alerting/get_rules.asciidoc +++ /dev/null @@ -1,123 +0,0 @@ -[[get-rule-api]] -== Get rule API -++++ -Get rule -++++ - -Retrieve a rule by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[get-rule-api-request]] -=== {api-request-title} - -`GET :/api/alerting/rule/` - -`GET :/s//api/alerting/rule/` - -=== {api-prereq-title} - -You must have `read` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rules you're seeking. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. To get rules associated -with the *{stack-monitor-app}* feature, use the `monitoring_user` built-in role. - -For more details, refer to <>. - -[[get-rule-api-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The identifier of the rule to retrieve. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[get-rule-api-codes]] -=== {api-response-codes-title} - -`200`:: -Indicates a successful call. - -[[get-rule-api-example]] -=== {api-examples-title} - -Retrieve the rule object with the ID `41893910-6bca-11eb-9e0d-85d233e3ee35`: - -[source,sh] --------------------------------------------------- -GET api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35 --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id":"31697a40-7b36-11ed-aa79-f742c05329b2", - "consumer":"alerts", - "tags":["cpu"], - "name":"my alert", - "enabled":true, - "throttle":null, - "schedule":{ - "interval":"1m" - }, - "params":{ - "aggType":"avg", - "termSize":6, - "thresholdComparator":">", - "timeWindowSize":5, - "timeWindowUnit":"m", - "groupBy":"top", - "threshold":[1000], - "index":["test-index"], - "timeField":"@timestamp", - "aggField":"sheet.version", - "termField":"name.keyword" - }, - "rule_type_id":".index-threshold", - "created_by":"elastic", - "updated_by":"elastic", - "created_at":"2022-12-13T22:33:41.163Z", - "updated_at":"2022-12-13T22:33:41.163Z", - "api_key_owner":"elastic", - "notify_when":"onActionGroupChange", - "muted_alert_ids":[], - "mute_all":false, - "scheduled_task_id":"31697a40-7b36-11ed-aa79-f742c05329b2", - "execution_status":{ - "status":"ok", - "last_execution_date":"2022-12-13T22:33:44.388Z", - "last_duration":83 - }, - "actions":[{ - "group":"threshold met", - "id":"1007a0c0-7a6e-11ed-89d5-abec321c0def", - "params":{ - "level":"info", - "message":"Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" - }, - "connector_type_id":".server-log" - }], - "last_run":{ - "alerts_count":{ - "new":0, - "ignored":0, - "recovered":0, - "active":0 - }, - "outcome_msg":null, - "warning":null, - "outcome":"succeeded" - }, - "next_run":"2022-12-13T22:34:44.314Z" -} --------------------------------------------------- diff --git a/docs/api/alerting/health.asciidoc b/docs/api/alerting/health.asciidoc deleted file mode 100644 index cd9d1c9449a82..0000000000000 --- a/docs/api/alerting/health.asciidoc +++ /dev/null @@ -1,83 +0,0 @@ -[[get-alerting-framework-health-api]] -== Get alerting framework health API -++++ -Get alerting framework health -++++ - -Retrieve the health status of the alerting framework. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[get-alerting-framework-health-api-request]] -=== {api-request-title} - -`GET :/api/alerting/_health` - -`GET :/s//api/alerting/_health` - -=== {api-prereq-title} - -You must have `read` privileges for the *Management* > *Stack Rules* feature or -for at least one of the *Analytics* > *Discover*, *Analytics* > *{ml-app}*, -*{observability}*, or *Security* features. - -[[get-alerting-framework-health-api-params]] -=== {api-path-parms-title} - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[get-alerting-framework-health-api-codes]] -=== {api-response-codes-title} - -`200`:: -Indicates a successful call. - -[[get-alerting-framework-health-api-example]] -=== {api-examples-title} - -Retrieve the health status of the alerting framework: - -[source,sh] --------------------------------------------------- -GET api/alerting/_health --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "is_sufficiently_secure":true, <1> - "has_permanent_encryption_key":true, <2> - "alerting_framework_health":{ <3> - "decryption_health":{ - "status":"ok", - "timestamp":"2022-06-21T21:46:15.023Z" - }, - "execution_health":{ - "status":"ok", - "timestamp":"2022-06-21T21:46:15.023Z" - }, - "read_health":{ - "status":"ok", - "timestamp":"2022-06-21T21:46:15.023Z" - } - } -} --------------------------------------------------- -<1> `is_sufficiently_secure` is `false` when security is enabled, but TLS is not. -<2> `has_permanent_encryption_key` is `false` when the encrypted saved object -plugin does not have a permanent encryption key. -<3> `alerting_framework_health` has three substates that identify the health of -the alerting framework: `decryption_health`, `execution_health`, and -`read_health`. `decryption_health` returns the timestamp and status of the rule -decryption: `ok`, `warn` or `error`. `execution_health` returns the timestamp -and status of the rule execution: `ok`, `warn` or `error`. `read_health` returns -the timestamp and status of the rule reading events: `ok`, `warn` or `error`. diff --git a/docs/api/alerting/legacy/create.asciidoc b/docs/api/alerting/legacy/create.asciidoc deleted file mode 100644 index 18594b0b67f4b..0000000000000 --- a/docs/api/alerting/legacy/create.asciidoc +++ /dev/null @@ -1,202 +0,0 @@ -[[alerts-api-create]] -=== Legacy create alert API -++++ -Legacy create alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Create {kib} alerts. - -[[alerts-api-create-request]] -==== Request - -`POST :/api/alerts/alert/` - -`POST :/s//api/alerts/alert/` - -[[alerts-api-create-path-params]] -==== Path parameters - -``:: - (Optional, string) Specifies a UUID v1 or v4 to use instead of a randomly generated ID. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-create-request-body]] -==== Request body - -`name`:: - (Required, string) A name to reference and search. - -`tags`:: - (Optional, string array) A list of keywords to reference and search. - -`alertTypeId`:: - (Required, string) The ID of the alert type that you want to call when the alert is scheduled to run. - -`schedule`:: - (Required, object) The schedule specifying when this alert should be run, using one of the available schedule formats specified under -+ -._Schedule Formats_. -[%collapsible%open] -===== -A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule. - -We currently support the _Interval format_ which specifies the interval in seconds, minutes, hours or days at which the alert should execute. -Example: `{ interval: "10s" }`, `{ interval: "5m" }`, `{ interval: "1h" }`, `{ interval: "1d" }`. - -There are plans to support multiple other schedule formats in the near future. -===== - -`throttle`:: - (Optional, string) How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a `schedule` of 1 minute stays in a triggered state for 90 minutes, setting a `throttle` of `10m` or `1h` will prevent it from sending 90 notifications during this period. - -`notifyWhen`:: - (Required, string) The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval`. - -`enabled`:: - (Optional, boolean) Indicates if you want to run the alert on an interval basis after it is created. - -`consumer`:: - (Required, string) The name of the application that owns the alert. This name has to match the Kibana Feature name, as that dictates the required RBAC privileges. - -`params`:: - (Required, object) The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. - -`actions`:: - (Optional, object array) An array of the following action objects. -+ -.Properties of the action objects: -[%collapsible%open] -===== - `group`::: - (Required, string) Grouping actions is recommended for escalations for different types of alert instances. If you don't need this, set this value to `default`. - - `id`::: - (Required, string) The ID of the action saved object to execute. - - `actionTypeId`::: - (Required, string) The ID of the <>. - - `params`::: - (Required, object) The map to the `params` that the <> will receive. ` params` are handled as Mustache templates and passed a default set of context. -===== - - -[[alerts-api-create-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[alerts-api-create-example]] -==== Example - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "params":{ - "aggType":"avg", - "termSize":6, - "thresholdComparator":">", - "timeWindowSize":5, - "timeWindowUnit":"m", - "groupBy":"top", - "threshold":[ - 1000 - ], - "index":[ - ".test-index" - ], - "timeField":"@timestamp", - "aggField":"sheet.version", - "termField":"name.keyword" - }, - "consumer":"alerts", - "alertTypeId":".index-threshold", - "schedule":{ - "interval":"1m" - }, - "actions":[ - { - "id":"dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2", - "actionTypeId":".server-log", - "group":"threshold met", - "params":{ - "level":"info", - "message":"Rule '{{rule.name}}' is active for group '{{context.group}}':\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" - } - } - ], - "tags":[ - "cpu" - ], - "notifyWhen":"onActionGroupChange", - "name":"my alert" -}' --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "41893910-6bca-11eb-9e0d-85d233e3ee35", - "notifyWhen": "onActionGroupChange", - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [ - 1000 - ], - "index": [ - ".kibana" - ], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" - }, - "consumer": "alerts", - "alertTypeId": ".index-threshold", - "schedule": { - "interval": "1m" - }, - "actions": [ - { - "actionTypeId": ".server-log", - "group": "threshold met", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" - }, - "id": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" - } - ], - "tags": [ - "cpu" - ], - "name": "my alert", - "enabled": true, - "throttle": null, - "apiKeyOwner": "elastic", - "createdBy": "elastic", - "updatedBy": "elastic", - "muteAll": false, - "mutedInstanceIds": [], - "updatedAt": "2021-02-10T18:03:19.961Z", - "createdAt": "2021-02-10T18:03:19.961Z", - "scheduledTaskId": "425b0800-6bca-11eb-9e0d-85d233e3ee35", - "executionStatus": { - "lastExecutionDate": "2021-02-10T18:03:19.966Z", - "status": "pending" - } -} --------------------------------------------------- diff --git a/docs/api/alerting/legacy/delete.asciidoc b/docs/api/alerting/legacy/delete.asciidoc deleted file mode 100644 index 2af420f2bc34e..0000000000000 --- a/docs/api/alerting/legacy/delete.asciidoc +++ /dev/null @@ -1,43 +0,0 @@ -[[alerts-api-delete]] -=== Legacy delete alert API -++++ -Legacy delete alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Permanently remove an alert. - -WARNING: Once you delete an alert, you cannot recover it. - -[[alerts-api-delete-request]] -==== Request - -`DELETE :/api/alerts/alert/` - -`DELETE :/s//api/alerts/alert/` - -[[alerts-api-delete-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert that you want to remove. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-delete-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Delete an alert with ID: - -[source,sh] --------------------------------------------------- -$ curl -X DELETE api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35 --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/disable.asciidoc b/docs/api/alerting/legacy/disable.asciidoc deleted file mode 100644 index 1a9b928bfba78..0000000000000 --- a/docs/api/alerting/legacy/disable.asciidoc +++ /dev/null @@ -1,41 +0,0 @@ -[[alerts-api-disable]] -=== Legacy disable alert API -++++ -Legacy disable alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Disable an alert. - -[[alerts-api-disable-request]] -==== Request - -`POST :/api/alerts/alert//_disable` - -`POST :/s//api/alerts/alert//_disable` - -[[alerts-api-disable-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert that you want to disable. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-disable-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Disable an alert with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/_disable --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/enable.asciidoc b/docs/api/alerting/legacy/enable.asciidoc deleted file mode 100644 index da4b466d6fda4..0000000000000 --- a/docs/api/alerting/legacy/enable.asciidoc +++ /dev/null @@ -1,41 +0,0 @@ -[[alerts-api-enable]] -=== Legacy enable alert API -++++ -Legacy enable alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Enable an alert. - -[[alerts-api-enable-request]] -==== Request - -`POST :/api/alerts/alert//_enable` - -`POST :/s//api/alerts/alert//_enable` - -[[alerts-api-enable-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert that you want to enable. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-enable-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Enable an alert with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/_enable --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/find.asciidoc b/docs/api/alerting/legacy/find.asciidoc deleted file mode 100644 index 7c493e9c8eb5b..0000000000000 --- a/docs/api/alerting/legacy/find.asciidoc +++ /dev/null @@ -1,129 +0,0 @@ -[[alerts-api-find]] -=== Legacy find alerts API -++++ -Legacy find alerts -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieve a paginated set of alerts based on condition. - -NOTE: As alerts change in {kib}, the results on each page of the response also -change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data. - -[[alerts-api-find-request]] -==== Request - -`GET :/api/alerts/_find` - -`GET :/s//api/alerts/_find` - -[[alerts-api-find-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-find-query-params]] -==== Query Parameters - -NOTE: Alert `params` are stored as a {ref}/flattened.html[flattened field type] and analyzed as keywords. - -`per_page`:: - (Optional, number) The number of alerts to return per page. - -`page`:: - (Optional, number) The page number. - -`search`:: - (Optional, string) An Elasticsearch {ref}/query-dsl-simple-query-string-query.html[simple_query_string] query that filters the alerts in the response. - -`default_search_operator`:: - (Optional, string) The operator to use for the `simple_query_string`. The default is 'OR'. - -`search_fields`:: - (Optional, array|string) The fields to perform the `simple_query_string` parsed query against. - -`fields`:: - (Optional, array|string) The fields to return in the `attributes` key of the response. - -`sort_field`:: - (Optional, string) Sorts the response. Could be an alert fields returned in the `attributes` key of the response. - -`sort_order`:: - (Optional, string) Sort direction, either `asc` or `desc`. - -`has_reference`:: - (Optional, object) Filters the alerts that have a relations with the reference objects with the specific "type" and "ID". - -`filter`:: - (Optional, string) A <> string that you filter with an attribute from your saved object. - It should look like savedObjectType.attributes.title: "myTitle". However, If you used a direct attribute of a saved object, such as `updatedAt`, - you will have to define your filter, for example, savedObjectType.updatedAt > 2018-12-22. - -[[alerts-api-find-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Examples - -Find alerts with names that start with `my`: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/alerts/_find?search_fields=name&search=my* --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "page": 1, - "perPage": 10, - "total": 1, - "data": [ - { - "id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35", - "notifyWhen": "onActionGroupChange", - "params": { - "aggType": "avg", - }, - "consumer": "alerts", - "alertTypeId": "test.alert.type", - "schedule": { - "interval": "1m" - }, - "actions": [], - "tags": [], - "name": "test alert", - "enabled": true, - "throttle": null, - "apiKeyOwner": "elastic", - "createdBy": "elastic", - "updatedBy": "elastic", - "muteAll": false, - "mutedInstanceIds": [], - "updatedAt": "2021-02-10T05:37:19.086Z", - "createdAt": "2021-02-10T05:37:19.086Z", - "scheduledTaskId": "0b092d90-6b62-11eb-9e0d-85d233e3ee35", - "executionStatus": { - "lastExecutionDate": "2021-02-10T17:55:14.262Z", - "status": "ok" - } - }, - ] -} --------------------------------------------------- - -For parameters that accept multiple values (e.g. `fields`), repeat the -query parameter for each value: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/alerts/_find?fields=id&fields=name --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/get.asciidoc b/docs/api/alerting/legacy/get.asciidoc deleted file mode 100644 index ee0f52f51005a..0000000000000 --- a/docs/api/alerting/legacy/get.asciidoc +++ /dev/null @@ -1,77 +0,0 @@ -[[alerts-api-get]] -=== Legacy get alert API -++++ -Legacy get alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieve an alert by ID. - -[[alerts-api-get-request]] -==== Request - -`GET :/api/alerts/alert/` - -`GET :/s//api/alerts/alert/` - -[[alerts-api-get-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert to retrieve. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-get-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[alerts-api-get-example]] -==== Example - -Retrieve the alert object with the ID `41893910-6bca-11eb-9e0d-85d233e3ee35`: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35 --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35", - "notifyWhen": "onActionGroupChange", - "params": { - "aggType": "avg", - }, - "consumer": "alerts", - "alertTypeId": "test.alert.type", - "schedule": { - "interval": "1m" - }, - "actions": [], - "tags": [], - "name": "test alert", - "enabled": true, - "throttle": null, - "apiKeyOwner": "elastic", - "createdBy": "elastic", - "updatedBy": "elastic", - "muteAll": false, - "mutedInstanceIds": [], - "updatedAt": "2021-02-10T05:37:19.086Z", - "createdAt": "2021-02-10T05:37:19.086Z", - "scheduledTaskId": "0b092d90-6b62-11eb-9e0d-85d233e3ee35", - "executionStatus": { - "lastExecutionDate": "2021-02-10T17:55:14.262Z", - "status": "ok" - } -} --------------------------------------------------- diff --git a/docs/api/alerting/legacy/health.asciidoc b/docs/api/alerting/legacy/health.asciidoc deleted file mode 100644 index de051f5eeedbb..0000000000000 --- a/docs/api/alerting/legacy/health.asciidoc +++ /dev/null @@ -1,95 +0,0 @@ -[[alerts-api-health]] -=== Legacy get Alerting framework health API -++++ -Legacy get Alerting framework health -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieve the health status of the Alerting framework. - -[[alerts-api-health-request]] -==== Request - -`GET :/api/alerts/_health` - -`GET :/s//api/alerts/_health` - -[[alerts-api-health-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-health-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[alerts-api-health-example]] -==== Example - -Retrieve the health status of the Alerting framework: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/alerts/_health --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "isSufficientlySecure":true, - "hasPermanentEncryptionKey":true, - "alertingFrameworkHealth":{ - "decryptionHealth":{ - "status":"ok", - "timestamp":"2021-02-10T23:35:04.949Z" - }, - "executionHealth":{ - "status":"ok", - "timestamp":"2021-02-10T23:35:04.949Z" - }, - "readHealth":{ - "status":"ok", - "timestamp":"2021-02-10T23:35:04.949Z" - } - } -} --------------------------------------------------- - -The health API response contains the following properties: - -[cols="2*<"] -|=== - -| `isSufficientlySecure` -| Returns `false` if security is enabled, but TLS is not. - -| `hasPermanentEncryptionKey` -| Return the state `false` if Encrypted Saved Object plugin has not a permanent encryption Key. - -| `alertingFrameworkHealth` -| This state property has three substates that identify the health of the alerting framework API: `decryptionHealth`, `executionHealth`, and `readHealth`. - -|=== - -`alertingFrameworkHealth` consists of the following properties: - -[cols="2*<"] -|=== - -| `decryptionHealth` -| Returns the timestamp and status of the alert decryption: `ok`, `warn` or `error` . - -| `executionHealth` -| Returns the timestamp and status of the alert execution: `ok`, `warn` or `error`. - -| `readHealth` -| Returns the timestamp and status of the alert reading events: `ok`, `warn` or `error`. - -|=== diff --git a/docs/api/alerting/legacy/index.asciidoc b/docs/api/alerting/legacy/index.asciidoc deleted file mode 100644 index 48f37c06ff543..0000000000000 --- a/docs/api/alerting/legacy/index.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -[[alerts-api]] -=== Deprecated 7.x APIs - -These APIs are deprecated and will be removed in a future release. - -include::create.asciidoc[leveloffset=+1] -include::delete.asciidoc[leveloffset=+1] -include::disable.asciidoc[leveloffset=+1] -include::enable.asciidoc[leveloffset=+1] -include::find.asciidoc[leveloffset=+1] -include::get.asciidoc[leveloffset=+1] -include::health.asciidoc[leveloffset=+1] -include::list.asciidoc[leveloffset=+1] -include::mute.asciidoc[leveloffset=+1] -include::mute_all.asciidoc[leveloffset=+1] -include::unmute.asciidoc[leveloffset=+1] -include::unmute_all.asciidoc[leveloffset=+1] -include::update.asciidoc[leveloffset=+1] \ No newline at end of file diff --git a/docs/api/alerting/legacy/list.asciidoc b/docs/api/alerting/legacy/list.asciidoc deleted file mode 100644 index 07307797c4223..0000000000000 --- a/docs/api/alerting/legacy/list.asciidoc +++ /dev/null @@ -1,141 +0,0 @@ -[[alerts-api-list]] -=== Legacy list alert types API -++++ -Legacy list all alert types -++++ - -deprecated::[7.13.0,Use <> instead.] - -Retrieve a list of all alert types. - -[[alerts-api-list-request]] -==== Request - -`GET :/api/alerts/list_alert_types` - -`GET :/s//api/alerts/list_alert_types` - -[[alerts-api-list-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-list-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[alerts-api-list-example]] -==== Example - -[source,sh] --------------------------------------------------- -$ curl -X GET api/alerts/list_alert_types --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id":".index-threshold", - "name":"Index threshold", - "actionGroups":[ - { - "id":"threshold met", - "name":"Threshold met" - }, - { - "id":"recovered", - "name":"Recovered" - } - ], - "recoveryActionGroup":{ - "id":"recovered", - "name":"Recovered" - }, - "defaultActionGroupId":"threshold met", - "actionVariables":{ - "context":[ - { - "name":"message", - "description":"A pre-constructed message for the alert." - }, - ], - "state":[], - "params":[ - { - "name":"threshold", - "description":"An array of values to use as the threshold; 'between' and 'notBetween' require two values, the others require one." - }, - { - "name":"index", - "description":"index" - }, - ] - }, - "producer":"stackAlerts", - "minimumLicenseRequired":"basic", - "isExportable":true, - "enabledInLicense":true, - "authorizedConsumers":{ - "alerts":{ - "read":true, - "all":true - }, - "stackAlerts":{ - "read":true, - "all":true - }, - "uptime":{ - "read":true, - "all":true - } - } - } -] --------------------------------------------------- - -Each alert type contains the following properties: - -[cols="2*<"] -|=== - -| `name` -| The descriptive name of the alert type. - -| `id` -| The unique ID of the alert type. - -| `minimumLicenseRequired` -| The license required to use the alert type. - -| `isExportable` -| Whether the rule type is exportable through the Saved Objects Management UI. - -| `enabledInLicense` -| Whether the alert type is enabled or disabled based on the license. - -| `actionGroups` -| An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert `actions` validation will use this configuration to ensure that groups are valid. Use `kbn-i18n` to translate the names of the action group when registering the alert type. - -| `recoveryActionGroup` -| An action group to use when an alert instance goes from an active state, to an inactive one. Do not specify this action group under the `actionGroups` property. If `recoveryActionGroup` is not specified, the default `recovered` action group is used. - -| `defaultActionGroupId` -| The default ID for the alert type group. - -| `actionVariables` -| An explicit list of action variables that the alert type makes available via context and state in action parameter templates, and a short human readable description. The Alert UI will use this information to prompt users for these variables in action parameter editors. Use `kbn-i18n` to translate the descriptions. - -| `producer` -| The ID of the application producing this alert type. - -| `authorizedConsumers` -| The list of the plugins IDs that have access to the alert type. - -|=== diff --git a/docs/api/alerting/legacy/mute.asciidoc b/docs/api/alerting/legacy/mute.asciidoc deleted file mode 100644 index cf7adc446a2fd..0000000000000 --- a/docs/api/alerting/legacy/mute.asciidoc +++ /dev/null @@ -1,44 +0,0 @@ -[[alerts-api-mute]] -=== Legacy mute alert instance API -++++ -Legacy mute alert instance -++++ - -deprecated::[7.13.0,Use <> instead.] - -Mute an alert instance. - -[[alerts-api-mute-request]] -==== Request - -`POST :/api/alerts/alert//alert_instance//_mute` - -`POST :/s//api/alerts/alert//alert_instance//_mute` - -[[alerts-api-mute-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert whose instance you want to mute. - -`alert_instance_id`:: - (Required, string) The ID of the alert instance that you want to mute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-mute-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Mute alert instance with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/alert_instance/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_mute --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/mute_all.asciidoc b/docs/api/alerting/legacy/mute_all.asciidoc deleted file mode 100644 index bc865480340e2..0000000000000 --- a/docs/api/alerting/legacy/mute_all.asciidoc +++ /dev/null @@ -1,41 +0,0 @@ -[[alerts-api-mute-all]] -=== Legacy mute all alert instances API -++++ -Legacy mute all alert instances -++++ - -deprecated::[7.13.0,Use <> instead.] - -Mute all alert instances. - -[[alerts-api-mute-all-request]] -==== Request - -`POST :/api/alerts/alert//_mute_all` - -`POST :/s//api/alerts/alert//_mute_all` - -[[alerts-api-mute-all-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert whose instances you want to mute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-mute-all-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Mute all alert instances with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/_mute_all --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/unmute.asciidoc b/docs/api/alerting/legacy/unmute.asciidoc deleted file mode 100644 index 300cf71b57a01..0000000000000 --- a/docs/api/alerting/legacy/unmute.asciidoc +++ /dev/null @@ -1,44 +0,0 @@ -[[alerts-api-unmute]] -=== Legacy unmute alert instance API -++++ -Legacy unmute alert instance -++++ - -deprecated::[7.13.0,Use <> instead.] - -Unmute an alert instance. - -[[alerts-api-unmute-request]] -==== Request - -`POST :/api/alerts/alert//alert_instance//_unmute` - -`POST :/s//api/alerts/alert//alert_instance//_unmute` - -[[alerts-api-unmute-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert whose instance you want to mute.. - -`alert_instance_id`:: - (Required, string) The ID of the alert instance that you want to unmute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-unmute-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Unmute alert instance with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/alert_instance/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_unmute --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/unmute_all.asciidoc b/docs/api/alerting/legacy/unmute_all.asciidoc deleted file mode 100644 index 3b0a7afe5f44d..0000000000000 --- a/docs/api/alerting/legacy/unmute_all.asciidoc +++ /dev/null @@ -1,41 +0,0 @@ -[[alerts-api-unmute-all]] -=== Legacy unmute all alert instances API -++++ -Legacy unmute all alert instances -++++ - -deprecated::[7.13.0,Use <> instead.] - -Unmute all alert instances. - -[[alerts-api-unmute-all-request]] -==== Request - -`POST :/api/alerts/alert//_unmute_all` - -`POST :/s//api/alerts/alert//_unmute_all` - -[[alerts-api-unmute-all-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert whose instances you want to unmute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-unmute-all-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Unmute all alert instances with ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35/_unmute_all --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/legacy/update.asciidoc b/docs/api/alerting/legacy/update.asciidoc deleted file mode 100644 index b9cce995660e6..0000000000000 --- a/docs/api/alerting/legacy/update.asciidoc +++ /dev/null @@ -1,141 +0,0 @@ -[[alerts-api-update]] -=== Legacy update alert API -++++ -Legacy update alert -++++ - -deprecated::[7.13.0,Use <> instead.] - -Update the attributes for an existing alert. - -[[alerts-api-update-request]] -==== Request - -`PUT :/api/alerts/alert/` - -`PUT :/s//api/alerts/alert/` - -[[alerts-api-update-path-params]] -==== Path parameters - -`id`:: - (Required, string) The ID of the alert that you want to update. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[alerts-api-update-request-body]] -==== Request body - -`name`:: - (Required, string) A name to reference and search. - -`tags`:: - (Optional, string array) A list of keywords to reference and search. - -`schedule`:: - (Required, object) When to run this alert. Use one of the available schedule formats. -+ -._Schedule Formats_. -[%collapsible%open] -===== -A schedule uses a key: value format. {kib} currently supports the _Interval format_ , which specifies the interval in seconds, minutes, hours, or days at which to execute the alert. - -Example: `{ interval: "10s" }`, `{ interval: "5m" }`, `{ interval: "1h" }`, `{ interval: "1d" }`. - -===== - -`throttle`:: - (Optional, string) How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a `schedule` of 1 minute stays in a triggered state for 90 minutes, setting a `throttle` of `10m` or `1h` will prevent it from sending 90 notifications during this period. - -`notifyWhen`:: - (Required, string) The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval`. - -`params`:: - (Required, object) The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined. - -`actions`:: - (Optional, object array) An array of the following action objects. -+ -.Properties of the action objects: -[%collapsible%open] -===== - `group`::: - (Required, string) Grouping actions is recommended for escalations for different types of alert instances. If you don't need this, set the value to `default`. - - `id`::: - (Required, string) The ID of the action that saved object executes. - - `actionTypeId`::: - (Required, string) The id of the <>. - - `params`::: - (Required, object) The map to the `params` that the <> will receive. `params` are handled as Mustache templates and passed a default set of context. -===== - - -[[alerts-api-update-errors-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[alerts-api-update-example]] -==== Example - -Update an alert with ID `ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74` with a different name: - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/alerts/alert/ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - -{ - "notifyWhen": "onActionGroupChange", - "params": { - "aggType": "avg", - }, - "schedule": { - "interval": "1m" - }, - "actions": [], - "tags": [], - "name": "new name", - "throttle": null, -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74", - "notifyWhen": "onActionGroupChange", - "params": { - "aggType": "avg", - }, - "consumer": "alerts", - "alertTypeId": "test.alert.type", - "schedule": { - "interval": "1m" - }, - "actions": [], - "tags": [], - "name": "new name", - "enabled": true, - "throttle": null, - "apiKeyOwner": "elastic", - "createdBy": "elastic", - "updatedBy": "elastic", - "muteAll": false, - "mutedInstanceIds": [], - "updatedAt": "2021-02-10T05:37:19.086Z", - "createdAt": "2021-02-10T05:37:19.086Z", - "scheduledTaskId": "0b092d90-6b62-11eb-9e0d-85d233e3ee35", - "executionStatus": { - "lastExecutionDate": "2021-02-10T17:55:14.262Z", - "status": "ok" - } -} --------------------------------------------------- diff --git a/docs/api/alerting/list_rule_types.asciidoc b/docs/api/alerting/list_rule_types.asciidoc deleted file mode 100644 index e7a7c1ad14063..0000000000000 --- a/docs/api/alerting/list_rule_types.asciidoc +++ /dev/null @@ -1,205 +0,0 @@ -[[list-rule-types-api]] -== Get rule types API -++++ -Get rule types -++++ - -Retrieve a list of rule types that the user is authorized to access. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - - -[[list-rule-types-api-request]] -=== {api-request-title} - -`GET :/api/alerting/rule_types` - -`GET :/s//api/alerting/rule_types` - -=== {api-prereq-title} - -If you have `read` privileges for one or more {kib} features, the API response -contains information about the appropriate rule types. For example, there are -rule types associated with the *Management* > *Stack Rules* feature, -*Analytics* > *Discover* and *{ml-app}* features, *{observability}*, and -*Security* features. To get rule types associated with the -*{stack-monitor-app}* feature, use the `monitoring_user` built-in role. - -For more details, refer to <>. - -=== {api-description-title} - -Each rule type includes a list of authorized consumer features. For each feature, -users are authorized to perform either `read` or `all` operations on rules of -that type. This enables you to determine which rule types you can read, create, -or modify. If you want to create or edit a rule in {kib}, some rule types are -limited to specific features and apps. - -[[list-rule-types-api-params]] -=== {api-path-parms-title} - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[[list-rule-types-response]] -=== {api-response-body-title} - -Each rule type has the following properties in the API response: - -`action_groups`:: -(array of objects) An explicit list of groups for which the rule type can -schedule actions, each with the action group's unique ID and human readable name. -Rule `actions` validation uses this configuration to ensure that groups are -valid. - -`action_variables`:: -(object) A list of action variables that the rule type makes available via -context and state in action parameter templates, and a short human readable -description. When you create a rule in {kib}, it uses this information to prompt -you for these variables in action parameter editors. - -`alerts`:: -(object) Details about alerts as data documents for this rule type, including any custom mappings. - -`authorized_consumers`:: -(object) The list of the plugins IDs that have access to the rule type. - -`category`:: -(string) The rule category, which is used by features such as category-specific maintenance windows. - -`default_action_group_id`:: -(string) The default ID for the rule type group. - -`does_set_recovery_context`:: -(boolean) Indicates whether the rule passes context variables to its recovery -action. - -`enabled_in_license`:: -(boolean) Indicates whether the rule type is enabled or disabled based on the -subscription. - -`has_alerts_mappings`:: -(boolean) Indicates whether the rule type has custom mappings for the alert data. - -// `has_fields_for_a_a_d`:: TBD - -`id`:: -(string) The unique identifier for the rule type. - -`is_exportable`:: -(boolean) Indicates whether the rule type is exportable in *{stack-manage-app}* -> *Saved Objects*. - -`minimum_license_required`:: -(string) The {subscriptions}[subscriptions] required to use the rule type. - -`name`:: -(string) The descriptive name of the rule type. - -`producer`:: -(string) An identifier for the application that produces this rule type. - -`recovery_action_group`:: -(object) An action group to use when an alert goes from an active state to an -inactive one. - -[[list-rule-types-api-codes]] -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[list-rule-types-api-example]] -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/alerting/rule_types --------------------------------------------------- -// KIBANA - -For example, if you have `read` privileges for the {observability} {logs-app}, -the API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id":"logs.alert.document.count", - "name":"Log threshold", - "category": "observability", - "producer":"logs", - "alerts": { - "context": "observability.logs", - "mappings": { - "fieldMap": { - "kibana.alert.evaluation.threshold": { - "type": "scaled_float", - "scaling_factor": 100, - "required": false - }, - "kibana.alert.evaluation.value": { - "type": "scaled_float", - "scaling_factor": 100, - "required": false - }, - ... - } - }, - "useEcs": true, - "useLegacyAlerts": true - }, - "enabled_in_license":true, - "recovery_action_group":{ - "id":"recovered", - "name":"Recovered" - }, - "action_groups":[ - { - "id":"logs.threshold.fired", - "name":"Fired" - }, - { - "id":"recovered", - "name":"Recovered" - } - ], - "default_action_group_id":"logs.threshold.fired", - "minimum_license_required":"basic", - "is_exportable":true, - "rule_task_timeout":"5m", - "action_variables":{ - "context":[ - { - "name":"timestamp", - "description":"UTC timestamp of when the alert was triggered" - }, - { - "name":"matchingDocuments", - "description":"The number of log entries that matched the conditions provided" - }, - { - "name":"conditions", - "description":"The conditions that log entries needed to fulfill" - }, - ... - ], - "state":[], - "params":[] - }, - "authorized_consumers":{ - "logs":{"read":true,"all":false}, - "alerts":{"read":true,"all":false} - }, - "does_set_recovery_context":true, - "has_alerts_mappings": true, - "has_fields_for_a_a_d": true - }, - .... -] --------------------------------------------------- diff --git a/docs/api/alerting/mute_alert.asciidoc b/docs/api/alerting/mute_alert.asciidoc deleted file mode 100644 index ad6d87848dfee..0000000000000 --- a/docs/api/alerting/mute_alert.asciidoc +++ /dev/null @@ -1,56 +0,0 @@ -[[mute-alert-api]] -== Mute alert API -++++ -Mute alert -++++ - -Mute an alert. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[mute-alert-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//alert//_mute` - -`POST :/s//api/alerting/rule//alert//_mute` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. If the rule has `actions`, -you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -[[mute-alert-api-path-params]] -=== {api-path-parms-title} - -`alert_id`:: - (Required, string) The ID of the alert that you want to mute. The `alert_id` is generated by the rule and might be any arbitrary string. - -`rule_id`:: - (Required, string) The ID of the rule whose alert you want to mute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[mute-alert-api-response-codes]] -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/alert/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_mute --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/mute_all_alerts.asciidoc b/docs/api/alerting/mute_all_alerts.asciidoc deleted file mode 100644 index b33d337d473ca..0000000000000 --- a/docs/api/alerting/mute_all_alerts.asciidoc +++ /dev/null @@ -1,58 +0,0 @@ -[[mute-all-alerts-api]] -== Mute all alerts API -++++ -Mute all alerts -++++ - -Mute all alerts. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[mute-all-alerts-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//_mute_all` - -`POST :/s//api/alerting/rule//_mute_all` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. If the rule has `actions`, -you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -=== {api-description-title} - -This API snoozes the notifications for the rule indefinitely. The rule checks -continue to occur but alerts will not trigger any actions. - -[[mute-all-alerts-api-path-params]] -=== {api-path-parms-title} - -`id`:: - (Required, string) The ID of the rule whose alerts you want to mute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[mute-all-alerts-api-response-codes]] -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_mute_all --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/unmute_alert.asciidoc b/docs/api/alerting/unmute_alert.asciidoc deleted file mode 100644 index 81bb641b259f9..0000000000000 --- a/docs/api/alerting/unmute_alert.asciidoc +++ /dev/null @@ -1,56 +0,0 @@ -[[unmute-alert-api]] -== Unmute alert API -++++ -Unmute alert -++++ - -Unmute an alert. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[unmute-alert-api-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//alert//_unmute` - -`POST :/s//api/alerting/rule//alert//_unmute` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. If the rule has `actions`, -you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -[[unmute-alert-api-path-params]] -=== {api-path-parms-title} - -`alert_id`:: - (Required, string) The ID of the alert that you want to unmute. The `alert_id` is generated by the rule and might be any arbitrary string. - -`rule_id`:: - (Required, string) The ID of the rule whose alert you want to mute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[unmute-alert-api-response-codes]] -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/alert/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_unmute --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/unmute_all_alerts.asciidoc b/docs/api/alerting/unmute_all_alerts.asciidoc deleted file mode 100644 index 0594727c71268..0000000000000 --- a/docs/api/alerting/unmute_all_alerts.asciidoc +++ /dev/null @@ -1,58 +0,0 @@ -[[unmute-all-alerts-api]] -== Unmute all alerts API -++++ -Unmute all alerts -++++ - -Unmute all alerts. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[unmute-all-alerts-api-all-request]] -=== {api-request-title} - -`POST :/api/alerting/rule//_unmute_all` - -`POST :/s//api/alerting/rule//_unmute_all` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, and *Security* features. If the rule has `actions`, -you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -=== {api-description-title} - -If the rule has its notifications snoozed indefinitely, this API cancels the -snooze. - -[[unmute-all-alerts-api-path-params]] -=== {api-path-parms-title} - -`id`:: - (Required, string) The ID of the rule whose alerts you want to unmute. - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[unmute-all-alerts-api-response-codes]] -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_unmute_all --------------------------------------------------- -// KIBANA diff --git a/docs/api/alerting/update_rule.asciidoc b/docs/api/alerting/update_rule.asciidoc deleted file mode 100644 index 124adc79582fe..0000000000000 --- a/docs/api/alerting/update_rule.asciidoc +++ /dev/null @@ -1,197 +0,0 @@ -[[update-rule-api]] -== Update rule API -++++ -Update rule -++++ - -Update the attributes for an existing rule. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. -==== - -[[update-rule-api-request]] -=== {api-request-title} - -`PUT :/api/alerting/rule/` - -`PUT :/s//api/alerting/rule/` - -=== {api-prereq-title} - -You must have `all` privileges for the appropriate {kib} features, depending on -the `consumer` and `rule_type_id` of the rule you're updating. For example, the -*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}* -features, *{observability}*, or *Security* features. If the rule has -`actions`, you must also have `read` privileges for the *Management* > -*{connectors-feature}* feature. For more details, refer to -<>. - -[[update-rule-api-path-params]] -=== {api-path-parms-title} - -`id`:: -(Required, string) The ID of the rule that you want to update. - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL, the default space is used. - -[role="child_attributes"] -[[update-rule-api-request-body]] -=== {api-request-body-title} - -`actions`:: -(Optional, object array) An array of action objects. The default value is an -empty array (`[]`). -+ -.Properties of the action objects: -[%collapsible%open] -===== -`group`::: -(Required, string) Grouping actions is recommended for escalations for different -types of alerts. If you don't need this, set the value to `default`. - -`id`::: -(Required, string) The identifier of the action. - -`params`::: -(Required, object) The map to the `params` that the -<> will receive. The `params` are handled as -Mustache templates and passed a default set of context. -===== - -`name`:: -(Required, string) A name to reference and search. - -`notify_when`:: -(Required, string) The condition for throttling the notification: -`onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval`. - -`params`:: -(Required, object) The parameters to pass to the rule type executor `params` -value. This will also validate against the rule type params validator, if defined. - -`schedule`:: -(Required, object) When to run this rule. Use one of the available schedule formats. -+ -.Schedule formats -[%collapsible%open] -===== -A schedule uses a `key: value` format. {kib} currently supports the -_interval format_, which specifies the interval in seconds, minutes, hours, or -days at which to run the rule. For example: `{ "interval": "10s" }`, -`{ "interval": "5m" }`, `{ "interval": "1h" }`, or `{ "interval": "1d" }`. - -===== - -`tags`:: -(Optional, string array) A list of keywords to reference and search. The default -value is an empty array (`[]`). - -`throttle`:: -(Optional, string) How often this rule should fire the same actions. This will -prevent the rule from sending out the same notification over and over. For -example, if a rule with a `schedule` of 1 minute stays in a triggered state for -90 minutes, setting a `throttle` of `10m` or `1h` will prevent it from sending -90 notifications during this period. The default value is `null`. - -[[update-rule-api-response-codes]] -=== {api-response-codes-title} - -`200`:: -Indicates a successful call. - -[[update-rule-api-example]] -=== {api-examples-title} - -Update an index threshold rule with ID `ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74`: - -[source,sh] --------------------------------------------------- -PUT api/alerting/rule/ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 -{ - "notify_when": "onActionGroupChange", - "params": { - "index":[".test-index"], - "timeField":"@timestamp", - "groupBy":"top", - "aggType":"avg", - "timeWindowSize":5, - "timeWindowUnit":"m", - "thresholdComparator":">", - "threshold":[1000], - "aggField":"sheet.version", - "termField":"name.keyword", - "termSize":6 - }, - "schedule": { - "interval": "1m" - }, - "actions": [], - "tags": [], - "name": "new name", - "throttle": null -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74", - "consumer": "alerts", - "tags": [], - "name": "new name", - "enabled": true, - "throttle": null, - "schedule": { - "interval": "1m" - }, - "params": { - "index": [".updated-index"], - "timeField": "@timestamp", - "groupBy": "top", - "aggType": "avg", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "thresholdComparator": ">", - "threshold": [1000], - "aggField": "sheet.version", - "termField": "name.keyword", - "termSize": 6 - }, - "api_key_owner": "elastic", - "created_by": "elastic", - "updated_by": "elastic", - "rule_type_id": ".index-threshold", - "scheduled_task_id": "4c5eda00-e74f-11ec-b72f-5b18752ff9ea", - "created_at": "2022-12-12T22:43:20.578Z", - "updated_at": "2022-12-12T22:44:21.783Z", - "notify_when": "onActionGroupChange", - "mute_all": false, - "muted_alert_ids": [], - "execution_status": { - "status": "ok", - "last_execution_date": "2022-12-12T22:43:21.723Z", - "last_duration": 125 - }, - "actions":[], - "last_run":{ - "alerts_count": { - "new": 0, - "ignored": 0, - "recovered": 0, - "active": 0 - }, - "outcome_msg" :null, - "warning": null, - "outcome": "succeeded" - }, - "next_run": "2022-12-12T22:44:21.653Z" -} --------------------------------------------------- diff --git a/docs/api/cases.asciidoc b/docs/api/cases.asciidoc index 4caef82f3207b..1798a44ac825e 100644 --- a/docs/api/cases.asciidoc +++ b/docs/api/cases.asciidoc @@ -1,57 +1,4 @@ [[cases-api]] == Cases APIs -You can create, manage, configure, and send cases to external systems with -these APIs: - -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> - -//ADD -include::cases/cases-api-add-comment.asciidoc[leveloffset=+1] -//CREATE -include::cases/cases-api-create.asciidoc[leveloffset=+1] -//DELETE -include::cases/cases-api-delete-cases.asciidoc[leveloffset=+1] -include::cases/cases-api-delete-comments.asciidoc[leveloffset=+1] -//FIND -include::cases/cases-api-find-case-activity.asciidoc[leveloffset=+1] -include::cases/cases-api-find-cases.asciidoc[leveloffset=+1] -include::cases/cases-api-find-connectors.asciidoc[leveloffset=+1] -//GET -include::cases/cases-api-get-alerts.asciidoc[leveloffset=+1] -include::cases/cases-api-get-case-activity.asciidoc[leveloffset=+1] -include::cases/cases-api-get-case.asciidoc[leveloffset=+1] -include::cases/cases-api-get-status.asciidoc[leveloffset=+1] -include::cases/cases-api-get-cases-by-alert.asciidoc[leveloffset=+1] -include::cases/cases-api-get-comments.asciidoc[leveloffset=+1] -include::cases/cases-api-get-configuration.asciidoc[leveloffset=+1] -include::cases/cases-api-get-reporters.asciidoc[leveloffset=+1] -include::cases/cases-api-get-tags.asciidoc[leveloffset=+1] -//PUSH -include::cases/cases-api-push.asciidoc[leveloffset=+1] -//SET -include::cases/cases-api-set-configuration.asciidoc[leveloffset=+1] -//UPDATE -include::cases/cases-api-update.asciidoc[leveloffset=+1] -include::cases/cases-api-update-comment.asciidoc[leveloffset=+1] -include::cases/cases-api-update-configuration.asciidoc[leveloffset=+1] +For the latest details, refer to {api-kibana}/group/endpoint-cases[case APIs]. diff --git a/docs/api/cases/cases-api-add-comment.asciidoc b/docs/api/cases/cases-api-add-comment.asciidoc deleted file mode 100644 index 28b8959d5a017..0000000000000 --- a/docs/api/cases/cases-api-add-comment.asciidoc +++ /dev/null @@ -1,182 +0,0 @@ -[[cases-api-add-comment]] -== Add comment to case API -++++ -Add comment -++++ - -Adds a comment or alert to a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`POST :/api/cases//comments` - -`POST :/s//api/cases//comments` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case you're updating. - -=== {api-description-title} - -NOTE: Each case can have a maximum of 1,000 alerts. - -=== {api-path-parms-title} - -``:: -(Required,string) The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== {api-request-body-title} - -`alertId`:: -(Required*, string or array of strings) The alert identifiers. It is required -only when `type` is `alert`. You can use an array of strings to add multiple -alerts to a case, provided that they all relate to the same rule; `index` must -also be an array with the same length or number of elements. Adding multiple -alerts in this manner is recommended rather than calling the API multiple times. -preview:[] - -`comment`:: -(Required*, string) The new comment. It is required only when `type` is `user`. - -`index`:: -(Required*, string or array of strings) The alert indices. It is required only -when `type` is `alert`. If you are adding multiple alerts to a case, use an array -of strings; the position of each index name in the array must match the position -of the corresponding alert identifier in the `alertId` array. preview:[] - -`owner`:: -(Required, string) The application that owns the case. Valid values are: -`cases`, `observability`, or `securitySolution`. - -`rule`:: -(Required*, object) The rule that is associated with the alerts. It is required -only when `type` is `alert`. preview:[] -+ -.Properties of `rule` -[%collapsible%open] -==== -`id`:: -(Required, string) The rule identifier. preview:[] - -`name`:: -(Required, string) The rule name. preview:[] - -==== - -`type`:: -(Required, string) The comment type, which must be `user` or `alert`. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Add a comment to case ID `293f1bc0-74f6-11ea-b83a-553aecdb28b6`: - -[source,sh] --------------------------------------------------- -POST api/cases/293f1bc0-74f6-11ea-b83a-553aecdb28b6/comments -{ - "type": "user", - "comment": "A new comment.", - "owner": "cases" -} --------------------------------------------------- -// KIBANA - -The API returns details about the case and its comments. For example: - -[source,json] --------------------------------------------------- -{ - "comments":[ - { - "id": "8af6ac20-74f6-11ea-b83a-553aecdb28b6", - "version": "WzIwNDMxLDFd", - "type": "user", - "owner": "cases", - "comment": "A new comment.", - "created_at": "2022-03-24T00:49:47.716Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "pushed_at": null, - "pushed_by": null, - "updated_at": null, - "updated_by": null - } - ], - "totalAlerts": 0, - "id": "293f1bc0-74f6-11ea-b83a-553aecdb28b6", - "version": "WzIzMzgsMV0=", - "totalComment": 1, - "title": "Case title 1", - "tags": ["tag 1"], - "description": "A case description.", - "settings": { - "syncAlerts": false - }, - "owner": "cases", - "duration": null, - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-03-24T00:37:03.906Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "status": "open", - "updated_at": "2022-03-24T00:49:47.716Z", - "updated_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "connector": { - "id": "none", - "name": "none", - "type": ".none", - "fields": null - }, - "external_service": null -} --------------------------------------------------- - -Add an alert to the case: - -[source,sh] --------------------------------------------------- -POST api/cases/293f1bc0-74f6-11ea-b83a-553aecdb28b6/comments -{ - "alertId": "6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42", - "index": ".internal.alerts-security.alerts-default-000001", - "type": "alert", - "owner": "cases", - "rule": { - "id":"94d80550-aaf4-11ec-985f-97e55adae8b9", - "name":"security_rule" - } -} --------------------------------------------------- -// KIBANA diff --git a/docs/api/cases/cases-api-create.asciidoc b/docs/api/cases/cases-api-create.asciidoc deleted file mode 100644 index 2145acd360532..0000000000000 --- a/docs/api/cases/cases-api-create.asciidoc +++ /dev/null @@ -1,259 +0,0 @@ -[[cases-api-create]] -== Create case API -++++ -Create case -++++ - -Creates a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`POST :/api/cases` - -`POST :/s//api/cases` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case you're creating. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== {api-request-body-title} - -`assignees`:: -(Optional, array of objects) Array containing users that are assigned to the case. -+ -.Properties of assignee objects -[%collapsible%open] -===== -`uid`:: -(Required, string) A unique identifier for the user profile. These identifiers -can be found by using the -{ref}/security-api-suggest-user-profile.html[suggest user profile API]. -===== - -`connector`:: -(Required, object) An object that contains the connector configuration. -+ -.Properties of `connector` -[%collapsible%open] -==== -`fields`:: -(Required, object) An object containing the connector fields. To create a case -without a connector, specify `null`. If you want to omit any individual field, -specify `null` as its value. -+ -.Properties of `fields` -[%collapsible%open] -===== -For {ibm-r} connectors, specify: - -`issueTypes`::: -(Required, array of strings) The type of the incident. - -`severityCode`::: -(Required, string) The severity code of the incident. - -For {jira} connectors, specify: - -`issueType`::: -(Required, string) The type of the issue. - -`parent`::: -(Required, string) The key of the parent issue, when the issue type is `Sub-task`. - -`priority`::: -(Required, string) The priority of the issue. - -For {sn-itsm} connectors, specify: - -`category`::: -(Required, string) The category of the incident. - -`impact`::: -(Required, string) The effect an incident had on business. - -`severity`::: -(Required, string) The severity of the incident. - -`subcategory`::: -(Required, string) The subcategory of the incident. - -`urgency`::: -(Required, string) The extent to which the incident resolution can be delayed. - -For {sn-sir} connectors, specify: - -`category`::: -(Required, string) The category of the incident. - -`destIp`::: -(Required, string) A comma separated list of destination IPs. - -`malwareHash`::: -(Required, string) A comma separated list of malware hashes. - -`malwareUrl`::: -(Required, string) A comma separated list of malware URLs. - -`priority`::: -(Required, string) The priority of the incident. - -`sourceIp`::: -(Required, string) A comma separated list of source IPs. - -`subcategory`::: -(Required, string) The subcategory of the incident. - -For {swimlane} connectors, specify: - -`caseId`::: -(Required, string) The case ID. - -For {webhook-cm} connectors, specify `null`. -===== - -`id`:: -(Required, string) The identifier for the connector. To create a case without a -connector, use `none`. To retrieve connector IDs, use -<>. - -`name`:: -(Required, string) The name of the connector. To create a case without a -connector, use `none`. - -`type`:: -(Required, string) The type of the connector. Valid values are: `.cases-webhook`, -`.jira`, `.none`, `.resilient`,`.servicenow`, `.servicenow-sir`, and `.swimlane`. -To create a case without a connector, use `.none`. - -==== - -`description`:: -(Required, string) The description for the case. - -`owner`:: -(Required, string) The application that owns the case. Valid values are: -`cases`, `observability`, or `securitySolution`. This value affects -whether the case is visible in the {stack-manage-app}, {observability}, or -{security-app}. - -`settings`:: -(Required, object) -An object that contains the case settings. -+ -.Properties of `settings` -[%collapsible%open] -==== -`syncAlerts`:: -(Required, boolean) Turns alert syncing on or off. -==== - -`severity`:: -(Optional,string) The severity of the case. Valid values are: `critical`, `high`, -`low`, and `medium`. - -`tags`:: -(Required, string array) The words and phrases that help -categorize cases. It can be an empty array. - -`title`:: -(Required, string) A title for the case. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -POST api/cases -{ - "description": "A case description.", - "title": "Case title 1", - "tags": [ "tag 1" ], - "connector": { - "id": "131d4448-abe0-4789-939d-8ef60680b498", - "name": "My connector", - "type": ".jira", - "fields": { - "issueType": "10006", - "priority": "High", - "parent": null - } - }, - "settings": { - "syncAlerts": true - }, - "owner": "cases" -} --------------------------------------------------- -// KIBANA - -The API returns a JSON object that includes the user who created the case and -the case identifier, version, and creation time. For example: - -[source,json] --------------------------------------------------- -{ - "id": "66b9aa00-94fa-11ea-9f74-e7e108796192", <1> - "version": "WzUzMiwxXQ==", - "comments": [], - "totalComment": 0, - "totalAlerts": 0, - "title": "Case title 1", - "tags": [ "tag 1" ], - "assignees": [], - "settings": { - "syncAlerts": true - }, - "owner": "cases", - "description": "A case description.", - "duration": null, - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-05-13T09:16:17.416Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "status": "open", - "updated_at": null, - "updated_by": null, - "connector": { - "id": "131d4448-abe0-4789-939d-8ef60680b498", <2> - "name": "My connector", - "type": ".jira", - "fields": { - "issueType": "10006", - "parent": null, - "priority": "High" - } - }, - "external_service": null <3> -} --------------------------------------------------- - -<1> The case identifier is also its saved object ID (`savedObjectId`), which is -used when pushing cases to external systems. -<2> The default connector used to push cases to external services. -<3> The `external_service` object stores information about the incident after it -is pushed to an external incident management system. \ No newline at end of file diff --git a/docs/api/cases/cases-api-delete-cases.asciidoc b/docs/api/cases/cases-api-delete-cases.asciidoc deleted file mode 100644 index abf518d212095..0000000000000 --- a/docs/api/cases/cases-api-delete-cases.asciidoc +++ /dev/null @@ -1,58 +0,0 @@ -[[cases-api-delete-cases]] -== Delete cases API -++++ -Delete cases -++++ - -Deletes one or more cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`DELETE :/api/cases?ids=["",""]` - -`DELETE :/s//api/cases?ids=["",""]` - -=== {api-prereq-title} - -You must have `read` or `all` privileges and the `delete` sub-feature privilege -for the *Cases* feature in the *Management*, *{observability}*, or *Security* -section of the <>, depending -on the `owner` of the cases you're deleting. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`ids`:: -(Required, string) The cases that you want to remove. To retrieve case IDs, use -<>. -+ -NOTE: All non-ASCII characters must be URL encoded. - -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -Delete cases with these IDs: - -* `2e3a54f0-6754-11ea-a1c2-e3a8bc9f7aca` -* `40b9a450-66a0-11ea-be1b-2bd3fef48984` - -[source,console] --------------------------------------------------- -DELETE api/cases?ids=%5B%222e3a54f0-6754-11ea-a1c2-e3a8bc9f7aca%22%2C%2240b9a450-66a0-11ea-be1b-2bd3fef48984%22%5D --------------------------------------------------- -// KIBANA diff --git a/docs/api/cases/cases-api-delete-comments.asciidoc b/docs/api/cases/cases-api-delete-comments.asciidoc deleted file mode 100644 index dc8fe0e120574..0000000000000 --- a/docs/api/cases/cases-api-delete-comments.asciidoc +++ /dev/null @@ -1,69 +0,0 @@ -[[cases-api-delete-comments]] -== Delete comments from case API -++++ -Delete comments -++++ - -Deletes one or all comments and alerts from a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`DELETE :/api/cases//comments` - -`DELETE :/api/cases//comments/` - -`DELETE :/s//api/cases//comments` - -`DELETE :/s//api/cases//comments/` - -=== {api-prereq-title} - -You must have `read` or `all` privileges and the `delete` sub-feature privilege -for the *Cases* feature in the *Management*, *{observability}*, or *Security* -section of the <>, depending -on the `owner` of the cases you're updating. - -=== {api-path-parms-title} - -``:: -(Required, string) The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Optional, string) The identifier for the comment. To retrieve comment IDs, use -<> or <>. If it is not specified, all -comments are deleted. - -:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -=== {api-examples-title} - -Delete all comments from case ID `9c235210-6834-11ea-a78c-6ffb38a34414`: - -[source,console] --------------------------------------------------- -DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments --------------------------------------------------- -// KIBANA - -Delete comment ID `71ec1870-725b-11ea-a0b2-c51ea50a58e2` from case ID -`a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: - -[source,sh] --------------------------------------------------- -DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments/71ec1870-725b-11ea-a0b2-c51ea50a58e2 --------------------------------------------------- -// KIBANA diff --git a/docs/api/cases/cases-api-find-case-activity.asciidoc b/docs/api/cases/cases-api-find-case-activity.asciidoc deleted file mode 100644 index d15e2a8bea9d5..0000000000000 --- a/docs/api/cases/cases-api-find-case-activity.asciidoc +++ /dev/null @@ -1,20 +0,0 @@ -[[cases-api-find-case-activity]] -== Find case activity API -++++ -Find case activity -++++ - -Finds user activity for a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases//user_actions/_find` - -`GET :/s//api/cases//user_actions/_find` - diff --git a/docs/api/cases/cases-api-find-cases.asciidoc b/docs/api/cases/cases-api-find-cases.asciidoc deleted file mode 100644 index 4a791a8ddb9d3..0000000000000 --- a/docs/api/cases/cases-api-find-cases.asciidoc +++ /dev/null @@ -1,171 +0,0 @@ -[[cases-api-find-cases]] -== Find cases API -++++ -Find cases -++++ - -Retrieves a paginated subset of cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases/_find` - -`GET :/s//api/cases/_find` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're seeking. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`assignees`:: -(Optional, string or array of strings) Filters the returned cases by assignees. -Valid values are `none` or unique identifiers for the user profiles. These -identifiers can be found by using the -{ref}/security-api-suggest-user-profile.html[suggest user profile API]. - -`defaultSearchOperator`:: -(Optional, string) The default operator to use for the `simple_query_string`. -Defaults to `OR`. - -`from`:: -(Optional, string) Returns only cases that were created after a specific date. The date must be specified as a <> data range or date match expression. preview:[] - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved cases to -a specific set of applications. Valid values are: `cases`, `observability`, -and `securitySolution`. If this parameter is omitted, the response contains all -cases that the user has access to read. - -`page`:: -(Optional, integer) The page number to return. Defaults to `1`. - -`perPage`:: -(Optional, integer) The number of rules to return per page. Defaults to `20`. - -`reporters`:: -(Optional, string or array of strings) Filters the returned cases by the -reporter's `username`. - -`search`:: -(Optional, string) An {es} -{ref}/query-dsl-simple-query-string-query.html[simple_query_string] query that -filters the objects in the response. - -`searchFields`:: -(Optional, string or array of strings) The fields to perform the -`simple_query_string` parsed query against. - -`severity`:: -(Optional,string) The severity of the case. Valid values are: `critical`, `high`, -`low`, and `medium`. - -`sortField`:: -(Optional, string) Determines which field is used to sort the results, -`createdAt` or `updatedAt`. Defaults to `createdAt`. -+ -NOTE: Even though the JSON case object uses `created_at` and `updated_at` -fields, you must use `createdAt` and `updatedAt` fields in the URL -query. - -`sortOrder`:: -(Optional, string) Determines the sort order, which can be `desc` or `asc`. -Defaults to `desc`. - -`status`:: -(Optional, string) Filters the returned cases by state, which can be `open`, -`in-progress`, or `closed`. - -`tags`:: -(Optional, string or array of strings) Filters the returned cases by tags. - -`to`:: -(Optional, string) Returns only cases that were created before a specific date. The date must be specified as a <> data range or date match expression. preview:[] - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Retrieve the first five cases with the `tag-1` tag, in ascending order by -last update time: - -[source,sh] --------------------------------------------------- -GET api/cases/_find?page=1&perPage=5&sortField=updatedAt&sortOrder=asc&tags=tag-1 --------------------------------------------------- -// KIBANA - -The API returns a JSON object listing the retrieved cases. For example: - -[source,json] --------------------------------------------------- -{ - "page": 1, - "per_page": 5, - "total": 1, - "cases": [ - { - "id": "abed3a70-71bd-11ea-a0b2-c51ea50a58e2", - "version": "WzExMCwxXQ==", - "comments": [], - "totalComment": 1, - "totalAlerts": 0, - "title": "Case title", - "tags": [ "tag-1" ], - "description": "Case description", - "settings": { "syncAlerts": true }, - "owner": "securitySolution", - "duration": null, <1> - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-05-12T00:16:36.371Z", - "created_by": { - "email": "jdoe@email.com", - "full_name": "Jane Doe", - "username": "jdoe" - }, - "status": "open", - "updated_at": "2022-05-12T00:27:58.162Z", - "updated_by": { - "email": "jsmith@email.com", - "full_name": "Joe Smith", - "username": "jsmith" - }, - "assignees": [], - "connector": { - "id": "none", - "name": "none", - "type": ".none", - "fields": null - }, - "external_service": null - } - ], - "count_open_cases": 1, - "count_in_progress_cases":0, - "count_closed_cases": 0 -} --------------------------------------------------- -<1> Duration represents the elapsed time from the creation of the case to its -closure (in seconds). If the case has not been closed, the duration is set to -`null`. If the case was closed after less than half a second, the duration is -rounded down to zero. \ No newline at end of file diff --git a/docs/api/cases/cases-api-find-connectors.asciidoc b/docs/api/cases/cases-api-find-connectors.asciidoc deleted file mode 100644 index 7dac2f6f2e823..0000000000000 --- a/docs/api/cases/cases-api-find-connectors.asciidoc +++ /dev/null @@ -1,67 +0,0 @@ -[[cases-api-find-connectors]] -== Find connectors API -++++ -Find connectors -++++ - -Retrieves information about <>. - -In particular, only the connectors that are supported for use in cases are -returned. Refer to the list of supported external incident management systems in -<>. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases/configure/connectors/_find` - -`GET :/s//api/cases/configure/connectors/_find` - -=== {api-prereq-title} - -You must have `read` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/cases/configure/connectors/_find --------------------------------------------------- -// KIBANA - -The API returns a JSON object describing the connectors and their settings: - -[source,json] --------------------------------------------------- -[{ - "id":"61787f53-4eee-4741-8df6-8fe84fa616f7", - "actionTypeId": ".jira", - "name":"my-Jira", - "isMissingSecrets":false, - "config": { - "apiUrl":"https://elastic.atlassian.net/", - "projectKey":"ES" - }, - "isPreconfigured":false, - "isDeprecated": false, - "referencedByCount":0 -}] --------------------------------------------------- \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-alerts.asciidoc b/docs/api/cases/cases-api-get-alerts.asciidoc deleted file mode 100644 index fea5b5f9a7354..0000000000000 --- a/docs/api/cases/cases-api-get-alerts.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -[[cases-api-get-alerts]] -== Get alerts attached to case API -++++ -Get alerts -++++ - -preview::[] - -Gets all alerts attached to a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases//alerts` - -`GET :/s//api/cases//alerts` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're seeking. - -=== {api-path-parms-title} - -``:: -(Required, string) The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Return all alerts attached to case `a8b26350-0c55-11ed-918a-2d2edf3e58bc`: - -[source,sh] --------------------------------------------------- -GET api/cases/a8b26350-0c55-11ed-918a-2d2edf3e58bc/alerts --------------------------------------------------- -// KIBANA - -The API returns a JSON array listing the alerts. For example: - -[source,json] --------------------------------------------------- -[ - { - "id": "f6a7d0c3-d52d-432c-b2e6-447cd7fce04d", - "index": ".alerts-observability.logs.alerts-default", - "attached_at": "2022-07-25T20:09:40.963Z" - } -] --------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-case-activity.asciidoc b/docs/api/cases/cases-api-get-case-activity.asciidoc deleted file mode 100644 index 2baa19ebf6985..0000000000000 --- a/docs/api/cases/cases-api-get-case-activity.asciidoc +++ /dev/null @@ -1,111 +0,0 @@ -[[cases-api-get-case-activity]] -== Get case activity API -++++ -Get case activity -++++ - -Returns all user activity for a case. - -deprecated::[8.1.0,Use <> instead.] - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases//user_actions` - -`GET :/s//api/cases//user_actions` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case you're seeking. - -=== {api-path-parms-title} - -``:: -(Required, string) An identifier for the case to retrieve. Use -<> to retrieve case IDs. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Gets all activity for case ID `22df07d0-03b1-11ed-920c-974bfa104448`: - -[source,sh] --------------------------------------------------- -GET api/cases/22df07d0-03b1-11ed-920c-974bfa104448/user_actions --------------------------------------------------- -// KIBANA - -The API returns a JSON object with all the activity for the case. For example: - -[source,json] --------------------------------------------------- -[ - { - "created_at":"2022-07-14T20:11:24.947Z", - "created_by":{ - "username":"elastic", - "email":null, - "full_name":null - }, - "owner":"cases", - "action":"create", - "payload":{ - "description":"A case description", - "title":"Case title 1", - "tags":["tag 1"], - "connector":{ - "name":"none", - "type":".none", - "fields":null, - "id":"none" - }, - "settings":{"syncAlerts":true}, - "owner":"cases", - "severity":"low", - "status":"open" - }, - "type":"create_case", - "action_id":"22fd3e30-03b1-11ed-920c-974bfa104448", - "case_id":"22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id":null - }, - { - "created_at":"2022-07-14T20:12:53.354Z", - "created_by":{ - "username":"elastic", - "email":null, - "full_name":null - }, - "owner":"cases", - "action":"create", - "payload":{ - "comment":{ - "type":"user", - "owner":"cases", - "comment":"A new comment" - } - }, - "type":"comment", - "action_id":"57af14a0-03b1-11ed-920c-974bfa104448", - "case_id":"22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id":"578608d0-03b1-11ed-920c-974bfa104448" - } -] --------------------------------------------------- \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-case.asciidoc b/docs/api/cases/cases-api-get-case.asciidoc deleted file mode 100644 index fe2b4c54b85e5..0000000000000 --- a/docs/api/cases/cases-api-get-case.asciidoc +++ /dev/null @@ -1,103 +0,0 @@ -[[cases-api-get-case]] -== Get case API -++++ -Get case -++++ - -Returns information about a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases/` - -`GET :/s//api/cases/` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case you're seeking. - -=== {api-path-parms-title} - -``:: -(Required, string) An identifier for the case to retrieve. Use -<> to retrieve case IDs. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`includeComments`:: -(Optional, boolean) Determines whether case comments are returned. Defaults to -`true`. deprecated:[8.1.0, "The `includeComments` query parameter is deprecated and will be removed in a future release."] - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Returns case ID `31cdada0-02c1-11ed-85f2-4f7c222ca2fa`: - -[source,sh] --------------------------------------------------- -GET api/cases/31cdada0-02c1-11ed-85f2-4f7c222ca2fa --------------------------------------------------- -// KIBANA - -The API returns a JSON object with the retrieved case. For example: - -[source,json] --------------------------------------------------- -{ - "id":"31cdada0-02c1-11ed-85f2-4f7c222ca2fa", - "version":"WzM2LDFd", - "comments":[{ - "id":"2134c1d0-02c2-11ed-85f2-4f7c222ca2fa", - "version":"WzM3LDFd", - "type":"user", - "owner":"cases", - "comment":"A new comment", - "created_at":"2022-07-13T15:40:32.335Z", - "created_by":{"email":null,"full_name":null,"username":"elastic"}, - "pushed_at":null, - "pushed_by":null, - "updated_at":null, - "updated_by":null - }], - "totalComment":1, - "totalAlerts":0, - "title":"Case title 1", - "tags":["tag 1"], - "settings":{"syncAlerts":true}, - "owner":"cases", - "description":"A case description", - "duration":null, <1> - "severity":"low", - "closed_at":null, - "closed_by":null, - "created_at":"2022-07-13T15:33:50.604Z", - "created_by":{"username":"elastic","email":null,"full_name":null}, - "status":"open", - "updated_at":"2022-07-13T15:40:32.335Z", - "updated_by":{"full_name":null,"email":null,"username":"elastic"}, - "assignees":[{"uid":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"}], - "connector":{"id":"none","name":"none","type":".none","fields":null}, - "external_service":null -} --------------------------------------------------- -<1> Duration represents the elapsed time from the creation of the case to its -closure (in seconds). If the case has not been closed, the duration is set to -`null`. If the case was closed after less than half a second, the duration is -rounded down to zero. \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-cases-by-alert.asciidoc b/docs/api/cases/cases-api-get-cases-by-alert.asciidoc deleted file mode 100644 index 47a0c5973830a..0000000000000 --- a/docs/api/cases/cases-api-get-cases-by-alert.asciidoc +++ /dev/null @@ -1,75 +0,0 @@ -[[cases-api-get-cases-by-alert]] -== Get cases by alert API -++++ -Get cases by alert -++++ - -preview::[] - -Returns the cases associated with a specific alert. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - - -=== {api-request-title} - -`GET :/api/cases/alerts/` - -`GET :/s//api/cases/alerts/` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're seeking. - -=== {api-path-parms-title} - -``:: -(Required, string) The alert identifier. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved cases to -a specific set of applications. Valid values are: `cases`, `observability`, -and `securitySolution`. If this parameter is omitted, the response contains all -cases that the user has access to read. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Return cases associated with the alert ID -`09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540`: - -[source,sh] --------------------------------------------------- -GET api/cases/alerts/09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 --------------------------------------------------- -// KIBANA - -The API returns a JSON array containing the identifier and title of the cases. -For example: - -[source,json] --------------------------------------------------- -[ - { - "id": "06116b80-e1c3-11ec-be9b-9b1838238ee6", - "title":"security_case" - } -] --------------------------------------------------- \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-comments.asciidoc b/docs/api/cases/cases-api-get-comments.asciidoc deleted file mode 100644 index fb0e497f4ebf1..0000000000000 --- a/docs/api/cases/cases-api-get-comments.asciidoc +++ /dev/null @@ -1,86 +0,0 @@ -[[cases-api-get-comments]] -== Get comments API -++++ -Get comments -++++ - -Gets a comment or all comments for a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases//comments/` - -`GET :/s//api/cases//comments/` - -`GET :/api/cases//comments` deprecated:[8.1.0] - -`GET :/s//api/cases//comments` deprecated:[8.1.0] - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases with the comments you're seeking. - -=== {api-path-parms-title} - -``:: -(Required, string) The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Optional, string) The identifier for the comment. To retrieve comment IDs, use -<>. -+ -If it is not specified, all comments are retrieved. -deprecated:[8.1.0,The comment identifier will no longer be optional.] - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Retrieves comment ID `8048b460-fe2b-11ec-b15d-779a7c8bbcc3` from case ID -`ecbf8a20-fe2a-11ec-b15d-779a7c8bbcc3`: - -[source,sh] --------------------------------------------------- -GET api/cases/ecbf8a20-fe2a-11ec-b15d-779a7c8bbcc3/comments/8048b460-fe2b-11ec-b15d-779a7c8bbcc3 --------------------------------------------------- -// KIBANA - -The API returns the requested comment JSON object. For example: - -[source,json] --------------------------------------------------- -{ - "id":"8048b460-fe2b-11ec-b15d-779a7c8bbcc3", - "version":"WzIzLDFd", - "type":"user", - "owner":"cases", - "comment":"A new comment", - "created_at":"2022-07-07T19:32:13.104Z", - "created_by":{ - "email":null, - "full_name":null, - "username":"elastic" - }, - "pushed_at":null, - "pushed_by":null, - "updated_at":null, - "updated_by":null -} --------------------------------------------------- \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-configuration.asciidoc b/docs/api/cases/cases-api-get-configuration.asciidoc deleted file mode 100644 index e78eaa634f716..0000000000000 --- a/docs/api/cases/cases-api-get-configuration.asciidoc +++ /dev/null @@ -1,101 +0,0 @@ -[[cases-get-configuration]] -== Get case configuration API -++++ -Get configuration -++++ - -Retrieves external connection details, such as the closure type and -default connector for cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases/configure` - -`GET :/s//api/cases/configure` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case configuration. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved -details to a specific set of applications. Valid values are: `cases`, -`observability`, and `securitySolution`. If this parameter is omitted, the -response contains information for all applications that the user has access to -read. - -=== Response code - -`200`:: - Indicates a successful call. - -=== Example - -[source,sh] --------------------------------------------------- -GET api/cases/configure?owner=cases --------------------------------------------------- -// KIBANA - -The API returns the following type of information: - -[source,json] --------------------------------------------------- -[ - { - "closure_type": "close-by-user", - "owner": "cases", - "created_at": "2022-06-01T17:07:17.767Z", - "created_by": { - "email": "null", - "full_name": "null", - "username": "elastic" - }, - "updated_at": null, - "updated_by": null, - "connector": { - "id": "131d4448-abe0-4789-939d-8ef60680b498", - "name": "my-jira-connector", - "type": ".jira", - "fields": null - }, - "mappings": [ - { - "source": "title", - "target": "summary", - "action_type": "overwrite" - }, - { - "source": "description", - "target": "description", - "action_type": "overwrite" - }, - { - "source": "comments", - "target": "comments", - "action_type": "append" - } - ], - "version": "WzE3NywxXQ==", - "error": null, - "id": "7349772f-421a-4de3-b8bb-2d9b22ccee30" - } -] --------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-reporters.asciidoc b/docs/api/cases/cases-api-get-reporters.asciidoc deleted file mode 100644 index 48f373c65986a..0000000000000 --- a/docs/api/cases/cases-api-get-reporters.asciidoc +++ /dev/null @@ -1,67 +0,0 @@ -[[cases-api-get-reporters]] -== Get reporters API -++++ -Get reporters -++++ - -Returns information about the users who opened cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - - -=== {api-request-title} - -`GET :/api/cases/reporters` - -`GET :/s/api/cases/reporters` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases. - -=== {api-description-title} - -The API returns information about the users as they existed at the time of the -case creation, including their name, full name, and email address. If any of -those details change thereafter or if a user is deleted, the information -returned by this API is unchanged. - -=== {api-query-parms-title} - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved reporters -to a specific set of applications. If this parameter is omitted, the response -will contain all reporters from cases that the user has access to read. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Returns all case reporters: - -[source,sh] --------------------------------------------------- -GET api/cases/reporters --------------------------------------------------- -// KIBANA - -The API returns a JSON object with the retrieved reporters. For example: - -[source,json] --------------------------------------------------- -[ - {"username":"elastic","full_name":null,"email":null}, - {"username":"user1","full_name":"User 1","email":"user1@elastic.co"}, - {"username":"user2","full_name":"User 2","email":"user2@elastic.co"} -] --------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-status.asciidoc b/docs/api/cases/cases-api-get-status.asciidoc deleted file mode 100644 index ce9205febae5a..0000000000000 --- a/docs/api/cases/cases-api-get-status.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -[[cases-api-get-status]] -== Get case status API -++++ -Get case status -++++ - -Returns the number of cases that are open, closed, and in progress. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -deprecated::[8.1.0] - -=== {api-request-title} - -`GET :/api/cases/status` - -`GET :/s//api/cases/status` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're seeking. - -=== {api-path-parms-title} - -:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved case -statistics to a specific set of applications. Valid values are: `cases`, -`observability`, and `securitySolution`. If this parameter is omitted, the -response contains all cases that the user has access to read. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/cases/status --------------------------------------------------- -// KIBANA - -The API returns the following type of information: - -[source,json] --------------------------------------------------- -{ - "count_open_cases": 27, - "count_in_progress_cases": 50, - "count_closed_cases": 1198, -} --------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-tags.asciidoc b/docs/api/cases/cases-api-get-tags.asciidoc deleted file mode 100644 index 993c7d88f538a..0000000000000 --- a/docs/api/cases/cases-api-get-tags.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -[[cases-api-get-tag]] -== Get tags API -++++ -Get tags -++++ - -Aggregates and returns a list of case tags. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`GET :/api/cases/tags` - -`GET :/s//api/cases/tags` - -=== {api-prereq-title} - -You must have `read` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're seeking. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-query-parms-title} - -`owner`:: -(Optional, string or array of strings) A filter to limit the retrieved tags to a -specific set of applications. Valid values are: `cases`, `observability`, and -`securitySolution`. If this parameter is omitted, the response contains tags -from all cases that the user has access to read. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -[source,sh] --------------------------------------------------- -GET api/cases/tags --------------------------------------------------- -// KIBANA - -The API returns a JSON object with tags from all the cases that the user has -access to read. For example: - -[source,json] --------------------------------------------------- -[ - "observability", - "security", - "tag 1", - "tag 2" -] --------------------------------------------------- diff --git a/docs/api/cases/cases-api-push.asciidoc b/docs/api/cases/cases-api-push.asciidoc deleted file mode 100644 index e3bf2464d19b7..0000000000000 --- a/docs/api/cases/cases-api-push.asciidoc +++ /dev/null @@ -1,120 +0,0 @@ -[[cases-api-push]] -== Push case API -++++ -Push case -++++ - -Pushes a case to an external service. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`POST :/api/cases//connector//_push` - -`POST :/s//api/cases//connector//_push` - -=== {api-prereq-title} - -You must have `all` privileges for the *{connectors-feature}* feature in the -*Management* section of the -<>. You must also have `all` -privileges for the *Cases* feature in the *Management*, *{observability}*, or -*Security* section of the {kib} feature privileges, depending on the -`owner` of the case you're pushing. - -=== {api-path-parms-title} - -``:: -(Required, string) The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Required, string) The identifier for the connector. To retrieve connector IDs, -use <>. - -:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Push the case to an external service: - -[source,sh] --------------------------------------------------- -POST api/cases/b917f300-0ed9-11ed-bd18-65557fe66949/connector/09f8c0b0-0eda-11ed-bd18-65557fe66949/_push -{} --------------------------------------------------- -// KIBANA - -The API returns a JSON object representing the pushed case. For example: - -[source,json] --------------------------------------------------- -{ - "id": "b917f300-0ed9-11ed-bd18-65557fe66949", - "version": "WzE3NjgsM10=", - "comments": [], - "totalComment": 0, - "totalAlerts": 0, - "description": "A case description.", - "title": "Case title 1", - "tags": [ - "tag 1" - ], - "settings": { - "syncAlerts": true - }, - "owner": "cases", - "duration": null, - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-07-29T00:59:39.444Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null - }, - "status": "open", - "updated_at": "2022-07-29T01:20:58.436Z", - "updated_by": { - "username": "elastic", - "full_name": null, - "email": null - }, - "connector": { - "id": "09f8c0b0-0eda-11ed-bd18-65557fe66949", - "name": "My connector", - "type": ".jira", - "fields": { - "issueType": "10006", - "parent": null, - "priority": "Low" - } - }, - "external_service": { - "pushed_at": "2022-07-29T01:20:58.436Z", - "pushed_by": { - "username": "elastic", - "full_name": null, - "email": null - }, - "connector_name": "My connector", - "external_id": "71926", - "external_title": "ES-554", - "external_url": "https://cases.jira.com", - "connector_id": "09f8c0b0-0eda-11ed-bd18-65557fe66949" - } -} --------------------------------------------------- diff --git a/docs/api/cases/cases-api-set-configuration.asciidoc b/docs/api/cases/cases-api-set-configuration.asciidoc deleted file mode 100644 index 6941dd05427d0..0000000000000 --- a/docs/api/cases/cases-api-set-configuration.asciidoc +++ /dev/null @@ -1,170 +0,0 @@ -[[cases-api-set-configuration]] -== Set case configuration API -++++ -Set configuration -++++ - -Sets external connection details, such as the closure type and -default connector for cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`POST :/api/cases/configure` - -`POST :/s//api/cases/configure` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case configuration. - -=== {api-description-title} - -Connectors are used to interface with external systems. You must create a -connector before you can use it in your cases. Refer to <>. - -If you set a default connector, it is automatically selected when you create -cases in {kib}. If you use the <>, however, -you must still specify all of the connector details. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== {api-request-body-title} - -`closure_type`:: -(Required, string) Specifies whether a case is automatically closed when it is -pushed to external systems. -+ --- -Valid values are: - -* `close-by-pushing`: Cases are automatically closed when they are pushed. -* `close-by-user`: Cases are not automatically closed. --- - -`connector`:: -(Required, object) An object that contains the connector configuration. -+ -.Properties of `connector` -[%collapsible%open] -==== -`fields`:: -(Required, object) An object that contains the connector fields. -+ --- -TIP: The fields specified in the case configuration are not used and are not -propagated to individual cases, therefore it is recommended to set it to `null`. --- - -`id`:: -(Required, string) The identifier for the connector. If you do not want a -default connector, use `none`. To retrieve connector IDs, use -<>. - -`name`:: -(Required, string) The name of the connector. If you do not want a default -connector, use `none`. To retrieve connector names, use -<>. - -`type`:: -(Required, string) The type of the connector. Valid values are: `.cases-webhook`, -`.jira`, `.none`, `.resilient`,`.servicenow`, `.servicenow-sir`, and `.swimlane`. -==== - -`owner`:: -(Required, string) The application that owns the case configuration. Valid -values are: `cases`, `observability`, or `securitySolution`. This value affects -whether you're setting case configuration details for {stack-manage-app}, -{observability}, or {security-app}. - -`settings`:: -(Optional, object) -An object that contains the case settings. -+ -.Properties of `settings` -[%collapsible%open] -==== -`syncAlerts`:: -(Required, boolean) Turns alert syncing on or off. -==== - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Sets the closure type and default connector for cases in **{stack-manage-app}**: - -[source,sh] --------------------------------------------------- -POST api/cases/configure -{ - "owner": "cases", - "connector": { - "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6", - "name": "my-jira-connector", - "type": ".jira", - "fields": null, - }, - "closure_type": "close-by-user" -} --------------------------------------------------- - -The API returns the following response: - -[source,json] --------------------------------------------------- -{ - "closure_type": "close-by-user", - "owner": "cases", - "created_at": "2022-06-01T17:07:17.767Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null - }, - "updated_at": null, - "updated_by": null, - "connector": { - "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6", - "name": "my-jira-connector", - "type": ".jira", - "fields": null - }, - "mappings": [ - { - "source": "title", - "target": "summary", - "action_type": "overwrite" - }, - { - "source": "description", - "target": "description", - "action_type": "overwrite" - }, - { - "source": "comments", - "target": "comments", - "action_type": "append" - } - ], - "version": "WzIwNzMsMV0=", - "error": null, - "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" -} --------------------------------------------------- diff --git a/docs/api/cases/cases-api-update-comment.asciidoc b/docs/api/cases/cases-api-update-comment.asciidoc deleted file mode 100644 index fc8d97e779fd0..0000000000000 --- a/docs/api/cases/cases-api-update-comment.asciidoc +++ /dev/null @@ -1,197 +0,0 @@ -[[cases-api-update-comment]] -== Update case comment API -++++ -Update comment -++++ - -Updates a comment or alert in a case. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`PATCH :/api/cases//comments` - -`PATCH :/s//api/cases//comments` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case you're updating. - -=== {api-path-parms-title} - -``:: -The identifier for the case. To retrieve case IDs, use -<>. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== {api-request-body-title} - -`alertId`:: -(Required*, string or array of strings) The alert identifiers. It is -required only when `type` is `alert`. If you are adding multiple alerts to a -case, use an array of strings; `index` must also be an array with the same -length or number of elements in that case. Addings multiple alerts in this manner -is recommended rather than calling the API multiple times. - -`comment`:: -(Required*, string) The updated comment. It is required only when `type` is -`user`. - -`id`:: -(Required, string) The identifier for the comment. To retrieve comment IDs, use -<>. - -`index`:: -(Required*, string or array of strings) The alert indices. It is required only -when `type` is `alert`. If you are adding multiple alerts to a case, use an -array of strings; `alertId` must also be an array with the same length or number -of elements. preview:[] - -`owner`:: -(Required, string) The application that owns the case. It can be `cases`, -`observability`, or `securitySolution`. -+ -NOTE: You cannot change the owner of a comment. - -`rule`:: -(Required*, object) -The rule that is associated with the alert. It is required only when `type` is -`alert`. preview:[] -+ -.Properties of `rule` -[%collapsible%open] -==== -`id`:: -(Required, string) The rule identifier. preview:[] - -`name`:: -(Required, string) The rule name. preview:[] - -==== - -`type`:: -(Required, string) The comment type, which must be `user` or `alert`. -+ -NOTE: You cannot change the comment type. - -`version`:: -(Required, string) The current comment version. To retrieve version values, use -<>. - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Update comment ID `8af6ac20-74f6-11ea-b83a-553aecdb28b6` (associated with case -ID `293f1bc0-74f6-11ea-b83a-553aecdb28b6`): - -[source,sh] --------------------------------------------------- -PATCH api/cases/293f1bc0-74f6-11ea-b83a-553aecdb28b6/comments -{ - "id": "8af6ac20-74f6-11ea-b83a-553aecdb28b6", - "version": "Wzk1LDFd", - "type": "user", - "comment": "An updated comment." -} --------------------------------------------------- -// KIBANA - -The API returns details about the case and its comments. For example: - -[source,json] --------------------------------------------------- -{ - "comments":[{ - "id": "8af6ac20-74f6-11ea-b83a-553aecdb28b6", - "version": "WzIwNjM3LDFd", - "comment": "An updated comment.", - "type": "user", - "owner": "cases", - "created_at": "2022-03-24T00:37:10.832Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "pushed_at": null, - "pushed_by": null, - "updated_at": "2022-03-24T01:27:06.210Z", - "updated_by": { - "email": null, - "full_name": null, - "username": "elastic" - } - } - ], - "totalAlerts": 0, - "id": "293f1bc0-74f6-11ea-b83a-553aecdb28b6", - "version": "WzIwNjM2LDFd", - "totalComment": 1, - "title": "Case title 1", - "tags": ["tag 1"], - "description": "A case description.", - "settings": {"syncAlerts":false}, - "owner": "cases", - "duration": null, - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-03-24T00:37:03.906Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "status": "open", - "updated_at": "2022-03-24T01:27:06.210Z", - "updated_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "connector": { - "id": "none", - "name": "none", - "type": ".none", - "fields": null - }, - "external_service": null -} --------------------------------------------------- - -Update an alert in the case: - -[source,sh] --------------------------------------------------- -PATCH api/cases/293f1bc0-74f6-11ea-b83a-553aecdb28b6/comments -{ - "id": "73362370-ab1a-11ec-985f-97e55adae8b9", - "version": "WzMwNDgsMV0=", - "type": "alert", - "owner": "cases", - "alertId": "c8789278659fdf88b7bf7709b90a082be070d0ba4c23c9c4b552e476c2a667c4", - "index": ".internal.alerts-security.alerts-default-000001", - "rule": - { - "id":"94d80550-aaf4-11ec-985f-97e55adae8b9", - "name":"security_rule" - } -} --------------------------------------------------- -// KIBANA diff --git a/docs/api/cases/cases-api-update-configuration.asciidoc b/docs/api/cases/cases-api-update-configuration.asciidoc deleted file mode 100644 index 57c803eb53bde..0000000000000 --- a/docs/api/cases/cases-api-update-configuration.asciidoc +++ /dev/null @@ -1,136 +0,0 @@ -[[cases-api-update-configuration]] -== Update case configuration API -++++ -Update configuration -++++ - -Updates external connection details, such as the closure type and default -connector for cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`PATCH :/api/cases/configure/` - -`PATCH :/s//api/cases/configure/` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the case configuration. - -=== {api-description-title} - -Connectors are used to interface with external systems. You must create a -connector before you can it in your cases. Refer to <>. - -=== {api-path-parms-title} - -``:: -The identifier for the configuration. To retrieve the configuration IDs, use -<>. - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== Request body - -`closure_type`:: -(Optional, string) Determines whether a case is automatically closed when it is -pushed to external systems. Valid values are: -+ --- -* `close-by-pushing`: Cases are automatically closed when they -are pushed. -* `close-by-user`: Cases are not automatically closed. --- - -`connector`:: -(Optional, object) An object that contains the connector configuration. -+ -.Properties of `connector` -[%collapsible%open] -==== -`fields`:: -(Required, object) An object that contains the connector fields. -+ --- -TIP: The fields specified in the case configuration are not used and are not -propagated to individual cases, therefore it is recommended to set it to `null`. --- - -`id`:: -(Required, string) The identifier for the connector. To retrieve connector IDs, -use <>. - -`name`:: -(Required, string) The name of the connector. - -`type`:: -(Required, string) The type of the connector. Valid values are: `.cases-webhook`, -`.jira`, `.none`, `.resilient`,`.servicenow`, `.servicenow-sir`, and `.swimlane`. -==== - -`version`:: -(Required, string) The version of the connector. To retrieve the version value, -use <>. - -=== Response code - -`200`:: - Indicates a successful call. - -=== Example - -Change the closure type configuration option: - -[source,sh] --------------------------------------------------- -PATCH api/cases/configure/3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9 -{ - "closure_type": "close-by-pushing", - "version": "WzIwMiwxXQ==" -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,json] --------------------------------------------------- -{ - "closure_type": "close-by-pushing", - "owner": "cases", - "created_at": "2022-06-01T17:07:17.767Z", - "created_by": { - "email": "null", - "full_name": "null", - "username": "elastic" - }, - "updated_at": "2022-06-01T19:58:48.169Z", - "updated_by": { - "email": "null", - "full_name": "null", - "username": "elastic" - }, - "connector": { - "id": "none", - "name": "none", - "type": ".none", - "fields": null - }, - "mappings": [], - "version": "WzkwNiw1XQ==", - "error": null, - "id": "3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9" -} --------------------------------------------------- diff --git a/docs/api/cases/cases-api-update.asciidoc b/docs/api/cases/cases-api-update.asciidoc deleted file mode 100644 index 46c5ac7763600..0000000000000 --- a/docs/api/cases/cases-api-update.asciidoc +++ /dev/null @@ -1,289 +0,0 @@ -[[cases-api-update]] -== Update cases API -++++ -Update cases -++++ - -Updates one or more cases. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. -==== - -=== {api-request-title} - -`PATCH :/api/cases` - -`PATCH :/s//api/cases` - -=== {api-prereq-title} - -You must have `all` privileges for the *Cases* feature in the *Management*, -*{observability}*, or *Security* section of the -<>, depending on the -`owner` of the cases you're updating. - -=== {api-path-parms-title} - -``:: -(Optional, string) An identifier for the space. If it is not specified, the -default space is used. - -[role="child_attributes"] -=== {api-request-body-title} - -`cases`:: -(Required, array of objects) Array containing one or more case objects. -+ -.Properties of `cases` objects -[%collapsible%open] -==== - -`assignees`:: -(Optional, array of objects) Array containing users that are assigned to the case. -+ -.Properties of assignee objects -[%collapsible%open] -===== -`uid`:: -(Required, string) A unique identifier for the user profile. These identifiers -can be found by using the -{ref}/security-api-suggest-user-profile.html[suggest user profile API]. -===== - -`connector`:: -(Optional, object) An object that contains the connector configuration. -+ -.Properties of `connector` -[%collapsible%open] -===== -`fields`:: -(Required, object) An object containing the connector fields. To remove the -connector, specify `null`. If you want to omit any individual field, specify -`null` as its value. -+ -.Properties of `fields` -[%collapsible%open] -======= -For {ibm-r} connectors, specify: - -`issueTypes`::: -(Required, array of strings) The issue types of the issue. - -`severityCode`::: -(Required, string) The severity code of the issue. - -For {jira} connectors, specify: - -`issueType`::: -(Required, string) The issue type of the issue. - -`parent`::: -(Required, string) The key of the parent issue, when the issue type is -`Sub-task`. - -`priority`::: -(Required, string) The priority of the issue. - -For {sn-itsm} connectors, specify: - -`category`::: -(Required, string) The category of the incident. - -`impact`::: -(Required, string) The effect an incident had on business. - -`severity`::: -(Required, string) The severity of the incident. - -`subcategory`::: -(Required, string) The subcategory of the incident. - -`urgency`::: -(Required, string) The extent to which the incident resolution can be delayed. - -For {sn-sir} connectors, specify: - -`category`::: -(Required, string) The category of the incident. - -`destIp`::: -(Required, string) A comma separated list of destination IPs. - -`malwareHash`::: -(Required, string) A comma separated list of malware hashes. - -`malwareUrl`::: -(Required, string) A comma separated list of malware URLs. - -`priority`::: -(Required, string) The priority of the incident. - -`sourceIp`::: -(Required, string) A comma separated list of source IPs. - -`subcategory`::: -(Required, string) The subcategory of the incident. - -For {swimlane} connectors, specify: - -`caseId`::: -(Required, string) The identifier for the case. - -For {webhook-cm} connectors, specify `null`. -======= - -`id`:: -(Required, string) The identifier for the connector. To remove the connector, -use `none`. To retrieve connector IDs, use <>). - -`name`:: -(Required, string) The name of the connector. To remove the connector, use -`none`. - -`type`:: -(Required, string) The type of the connector. Valid values are: `.cases-webhook`, -`.jira`, `.none`, `.resilient`,`.servicenow`, `.servicenow-sir`, and `.swimlane`. -To remove the connector, use `.none`. - -===== - -`description`:: -(Optional, string) The updated case description. - -`id`:: -(Required, string) The identifier for the case. - -`settings`:: -(Optional, object) -An object that contains the case settings. -+ -.Properties of `settings` -[%collapsible%open] -===== -`syncAlerts`:: -(Required, boolean) Turn on or off synching with alerts. -===== - -`severity`:: -(Optional,string) The severity of the case. Valid values are: `critical`, `high`, -`low`, and `medium`. - -`status`:: -(Optional, string) The case status. Valid values are: `closed`, `in-progress`, -and `open`. - -`tags`:: -(Optional, string array) The words and phrases that help categorize cases. - -`title`:: -(Optional, string) A title for the case. - -`version`:: -(Required, string) The current version of the case. To determine this value, use -<> or <>. -==== - -=== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -=== {api-examples-title} - -Update the description, tags, and connector of case ID -`a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: - -[source,sh] --------------------------------------------------- -PATCH api/cases -{ - "cases": [ - { - "id": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2", - "version": "WzIzLDFd", - "connector": { - "id": "131d4448-abe0-4789-939d-8ef60680b498", - "name": "My connector", - "type": ".jira", - "fields": { - "issueType": "10006", - "priority": null, - "parent": null - } - }, - "description": "A new description.", - "tags": [ "tag-1", "tag-2" ], - "assignees": [], - "settings": { - "syncAlerts": true - } - } - ] -} --------------------------------------------------- -// KIBANA - -The API returns the updated case with a new `version` value. For example: - -[source,json] --------------------------------------------------- -[ - { - "id": "66b9aa00-94fa-11ea-9f74-e7e108796192", - "version": "WzU0OCwxXQ==", - "comments": [], - "totalComment": 0, - "totalAlerts": 0, - "title": "Case title 1", - "tags": [ "tag-1", "tag-2" ], - "settings": { - "syncAlerts": true - }, - "owner": "cases", - "description": "A new description.", - "duration": null, - "severity": "low", - "closed_at": null, - "closed_by": null, - "created_at": "2022-05-13T09:16:17.416Z", - "created_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "status": "open", - "updated_at": "2022-05-13T09:48:33.043Z", - "updated_by": { - "email": null, - "full_name": null, - "username": "elastic" - }, - "connector": { - "id": "131d4448-abe0-4789-939d-8ef60680b498", - "name": "My connector", - "type": ".jira", - "fields": { - "issueType": "10006", - "parent": null, - "priority": null, - } - }, - "external_service": { - "external_title": "IS-4", - "pushed_by": { - "full_name": null, - "email": null, - "username": "elastic" - }, - "external_url": "https://hms.atlassian.net/browse/IS-4", - "pushed_at": "2022-05-13T09:20:40.672Z", - "connector_id": "05da469f-1fde-4058-99a3-91e4807e2de8", - "external_id": "10003", - "connector_name": "Jira" - } - } -] --------------------------------------------------- diff --git a/docs/api/dashboard-api.asciidoc b/docs/api/dashboard-api.asciidoc index e8d0a829d178d..60df46b899f14 100644 --- a/docs/api/dashboard-api.asciidoc +++ b/docs/api/dashboard-api.asciidoc @@ -1,7 +1,7 @@ [[dashboard-api]] == Import and export dashboard APIs -deprecated::[7.15.0,Both of these APIs have been deprecated in favor of <> and <>.] +deprecated::[7.15.0,Both of these APIs have been deprecated in favor of the {api-kibana}/group/endpoint-saved-objects[saved objects API].] Import and export dashboards with the corresponding saved objects, such as visualizations, saved searches, and data views. diff --git a/docs/api/dashboard/export-dashboard.asciidoc b/docs/api/dashboard/export-dashboard.asciidoc index 3a20eff0a54d2..675834a0f5561 100644 --- a/docs/api/dashboard/export-dashboard.asciidoc +++ b/docs/api/dashboard/export-dashboard.asciidoc @@ -4,7 +4,7 @@ Export dashboard ++++ -deprecated::[7.15.0,Use <> instead.] +deprecated::[7.15.0,Use the {api-kibana}/group/endpoint-saved-objects[saved objects API] instead.] Export dashboards and corresponding saved objects. diff --git a/docs/api/dashboard/import-dashboard.asciidoc b/docs/api/dashboard/import-dashboard.asciidoc index e4817d6cb7ee9..e4bdb3abce989 100644 --- a/docs/api/dashboard/import-dashboard.asciidoc +++ b/docs/api/dashboard/import-dashboard.asciidoc @@ -4,7 +4,7 @@ Import dashboard ++++ -deprecated::[7.15.0,Use <> instead.] +deprecated::[7.15.0,Use the {api-kibana}/group/endpoint-saved-objects[saved objects API] instead.] Import dashboards and corresponding saved objects. diff --git a/docs/api/data-views.asciidoc b/docs/api/data-views.asciidoc index 918101ebb0031..62d1546bdfd45 100644 --- a/docs/api/data-views.asciidoc +++ b/docs/api/data-views.asciidoc @@ -3,46 +3,10 @@ Manage data views, formerly known as {kib} index patterns. +For the latest details, refer to {api-kibana}/group/endpoint-data-views[data view APIs]. + WARNING: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions. WARNING: Use the data views APIs for managing data views instead of lower-level <>. -The following data views APIs are available: - -* Data views - ** <> to retrieve a list of data views - ** <> to retrieve a single data view - ** <> to create data view - ** <> to partially updated data view - ** <> to delete a data view - ** <> to preview a data view reference swap - ** <> to perform a data view reference swap -* Default data views - ** <> to retrieve a default data view - ** <> to set a default data view -* Fields - ** <> to change field metadata, such as `count`, `customLabel` and `format` -* Runtime fields - ** <> to retrieve a runtime field - ** <> to create a runtime field - ** <> to create or update a runtime field - ** <> to partially update an existing runtime field - ** <> to delete a runtime field - -include::data-views/get-all.asciidoc[] -include::data-views/get.asciidoc[] -include::data-views/create.asciidoc[] -include::data-views/update.asciidoc[] -include::data-views/delete.asciidoc[] -include::data-views/swap_references_preview.asciidoc[] -include::data-views/swap_references.asciidoc[] -include::data-views/default-get.asciidoc[] -include::data-views/default-set.asciidoc[] -include::data-views/update-fields.asciidoc[] -include::data-views/runtime-fields/get.asciidoc[] -include::data-views/runtime-fields/create.asciidoc[] -include::data-views/runtime-fields/upsert.asciidoc[] -include::data-views/runtime-fields/update.asciidoc[] -include::data-views/runtime-fields/delete.asciidoc[] - diff --git a/docs/api/data-views/create.asciidoc b/docs/api/data-views/create.asciidoc deleted file mode 100644 index 4a91d957abf12..0000000000000 --- a/docs/api/data-views/create.asciidoc +++ /dev/null @@ -1,264 +0,0 @@ -[[data-views-api-create]] -=== Create data view API -++++ -Create data view -++++ - -Create data views. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-create-request]] -==== Request - -`POST :/api/data_views/data_view` - -`POST :/s//api/data_views/data_view` - - -[[data-views-api-create-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - - -[[data-views-api-create-body-params]] -==== Request body - -`override`:: (Optional, boolean) Overrides an existing data view if a -data view with the provided title already exists. The default is `false`. - -`data_view`:: (Required, object) The data view object. All fields are optional. - - -[[data-views-api-create-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - - -[[data-views-api-create-example]] -==== Examples - -To explore the data in the `logstash-*` indices, create a {data-source}: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view -{ - "data_view": { - "title": "logstash-*", - "name": "My Logstash Data View" - } -} --------------------------------------------------- -// KIBANA - -To create custom field formats, use the `data_view.fieldFormats` property: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view -{ - "data_view": { - "title": "logstash-*", - "name": "My Logstash data view 2", - "fieldFormats": { - "event_time": { - "id": "date_nanos" - }, - "machine.ram": { - "id": "number", - "params": { - "pattern": "0,0.[000] b" - } - } - } - } -} --------------------------------------------------- -// KIBANA - -To create custom labels, use the `data_view.fieldAttrs` property: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view -{ - "data_view": { - "title": "logstash-*", - "name": "My Logstash data view 3", - "fieldAttrs": { - "utc_time": { - "customLabel": "Time (UTC)" - } - } - } -} --------------------------------------------------- -// KIBANA - -To create a {data-source} with {ref}/runtime-search-request.html[runtime fields], use the `data_view.runtimeFieldMap` property: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view -{ - "data_view": { - "title": "logstash-*", - "name": "My Logstash data view 3", - "runtimeFieldMap": { - "runtime_shape_name": { - "type": "keyword", - "script": { - "source": "emit(doc['shape_name'].value)" - } - } - } - } -} --------------------------------------------------- -// KIBANA - -To create {data-sources} based on {ref}/xpack-rollup.html[rollup indices], use the `data_view.type` and `data_view.typeMeta` properties : - -deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.'] - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view -{ - "data_view": { - "title": "logstash-*", - "name": "My Logstash rollup data view", - "type": "rollup", - "typeMeta": { - "params": { - "rollup_index": "rollup_logstash" - }, - "aggs": { - "terms": { - "geo.dest": { "agg": "terms" }, - "extension.keyword": { "agg": "terms" }, - "geo.src": { "agg": "terms" }, - "machine.os.keyword": { "agg": "terms" } - }, - "date_histogram": { - "@timestamp": { - "agg": "date_histogram", - "fixed_interval": "20m", - "delay": "10m", - "time_zone": "UTC" - } - }, - "avg": { - "memory": { "agg": "avg" }, - "bytes": { "agg": "avg" } - }, - "max": { "memory": { "agg": "max" } }, - "min": { "memory": { "agg": "min" } }, - "sum": { "memory": { "agg": "sum" } }, - "value_count": { "memory": { "agg": "value_count" } }, - "histogram": { - "machine.ram": { - "agg": "histogram", - "interval": 5 - } - } - } - } - } -} --------------------------------------------------- -// KIBANA - -The API returns the {data-source} object: - -[source,sh] --------------------------------------------------- -{ - "data_view": {...} -} --------------------------------------------------- - - -[[data-views-api-properties]] - -==== Properties of the `data_view` object: - -`title`:: -(Optional, string) Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards -(`*`). - -`name`:: -(Optional, string) The {data-source} name. - -`id`:: -(Optional, string) Saved object ID. - -`type`:: -(Optional, string) When set to `rollup`, identifies the rollup {data-sources}. - -`typeMeta`:: -(Optional, object) When you use rollup indices, contains the field list for the rollup -{data-source} API endpoints. -+ -.Properties of the typeMeta objects: -[%collapsible%open] -===== -`aggs`::: -(Required, object) A map of rollup restrictions by aggregation type and field name. - -`params`::: -(Required, object) Properties for retrieving rollup fields. -===== - -`timeFieldName`:: -(Optional, string) Timestamp field name, which you use for time-based {data-sources}. - -`sourceFilters`:: -(Optional, string[]) Array of field names you want to filter out in <>. - -`fieldAttrs`:: -(Optional, object) Map of field attributes by field name. -+ -.Properties of the fieldAttrs[fieldName] objects: -[%collapsible%open] -===== -`customLabel`:: -(Optional, string) Custom label for the field. - -`customDescription`:: -(Optional, string) Custom description for the field. Max length is 300 characters. - -`count`:: -(Optional, number) Popularity count for the field. -===== - -`runtimeFieldMap`:: -(Optional, object) Map of runtime field definitions by field name. -+ -.Properties of the runtimeFieldMap[fieldName] objects: -[%collapsible%open] -===== -`type`::: -(Required, string) Mapping type of the runtime field. For more information, check {ref}/mapping-types.html[Field data types]. - -`script.source`::: -(Required, string) Script of the runtime field. -===== - -`fieldFormats`:: -(Optional, object) Map of field formats by field name. - -`allowNoIndex`:: -(Optional, boolean) Allows the {data-source} saved object to exist before the data is available. - -`namespaces`:: -(Optional, string[]) Array of {kibana-ref}/xpack-spaces.html[space] IDs for sharing the {data-source} between multiple spaces. diff --git a/docs/api/data-views/default-get.asciidoc b/docs/api/data-views/default-get.asciidoc deleted file mode 100644 index acb3472ba6bc5..0000000000000 --- a/docs/api/data-views/default-get.asciidoc +++ /dev/null @@ -1,65 +0,0 @@ -[[data-views-api-default-get]] -=== Get default data view API -++++ -Get default data view -++++ - -Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-default-get-request]] -==== Request - -`GET :/api/data_views/default` - -`GET :/s//api/data_views/default` - - -[[data-views-api-default-get-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - - -[[data-views-api-default-get-codes]] -==== Response code - -`200`:: -Indicates a successful call. - - -[[data-views-api-default-get-example]] -==== Example - -Retrieve the default data view id: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/data_views/default --------------------------------------------------- -// KIBANA - -The API returns an ID of a default data view: - -[source,sh] --------------------------------------------------- -{ - "data_view_id": "..." -} --------------------------------------------------- - -In case there is no default data view, the API returns: - -[source,sh] --------------------------------------------------- -{ - "data_view_id": null -} --------------------------------------------------- - diff --git a/docs/api/data-views/default-set.asciidoc b/docs/api/data-views/default-set.asciidoc deleted file mode 100644 index 747e8021985a4..0000000000000 --- a/docs/api/data-views/default-set.asciidoc +++ /dev/null @@ -1,93 +0,0 @@ -[[data-views-api-default-set]] -=== Set default data view API -++++ -Set default data view -++++ - -Set a default data view ID. Kibana UI will use the default data view unless user picks a different one. -The API doesn't validate if given `data_view_id` is a valid id. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-default-set-request]] -==== Request - -`POST :/api/data_views/default` - -`POST :/s//api/data_views/default` - - -[[data-views-api-default-set-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - - -[[data-views-api-default-set-body]] -==== Request body - -`data_view_id`:: (Required, `string` or `null`) Sets a default data view id. Use `null` to unset a default data view. - -`force`:: (Optional, boolean) Updates existing default data view id. The default is `false`. - - - -[[data-views-api-default-set-codes]] -==== Response code - -`200`:: -Indicates a successful call. - - -[[data-views-api-default-set-example]] -==== Example - -Set the default data view id if none is set: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/default -{ - "data_view_id": "..." -} --------------------------------------------------- -// KIBANA - - -Upsert the default data view: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/default -{ - "data_view_id": "...", - "force": true -} --------------------------------------------------- -// KIBANA - -Unset the default data view: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/default -{ - "data_view_id": null, - "force": true -} --------------------------------------------------- -// KIBANA - -The API returns: - -[source,sh] --------------------------------------------------- -{ - "acknowledged": true -} --------------------------------------------------- diff --git a/docs/api/data-views/delete.asciidoc b/docs/api/data-views/delete.asciidoc deleted file mode 100644 index a79e8fe12a417..0000000000000 --- a/docs/api/data-views/delete.asciidoc +++ /dev/null @@ -1,50 +0,0 @@ -[[data-views-api-delete]] -=== Delete data view API -++++ -Delete data view -++++ - -Delete data views. - -WARNING: Once you delete a data view, _it cannot be recovered_. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-delete-request]] -==== Request - -`DELETE :/api/data_views/data_view/` - -`DELETE :/s//api/data_views/data_view/` - - -[[data-views-api-delete-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`id`:: - (Required, string) The ID of the data view you want to delete. - - -[[data-views-api-delete-response-codes]] -==== Response code - -`200`:: - Indicates that data view is deleted. Returns an empty response body. - - -==== Example - -Delete a data view object with the `my-view` ID: - -[source,sh] --------------------------------------------------- -$ curl -X DELETE api/data_views/data_view/my-view --------------------------------------------------- -// KIBANA diff --git a/docs/api/data-views/get-all.asciidoc b/docs/api/data-views/get-all.asciidoc deleted file mode 100644 index a4e30b1951495..0000000000000 --- a/docs/api/data-views/get-all.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -[[data-views-api-get-all]] -=== Get all data views API -++++ -Get all data views -++++ - -Retrieve a list of all data views. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - - -[[data-views-api-get-all-request]] -==== Request - -`GET :/api/data_views` - -`GET :/s//api/data_views` - - -[[data-views-api-get-all-codes]] -==== Response code - -`200`:: -Indicates a successful call. - - -[[data-views-api-get-all-example]] -==== Example - -Retrieve the list of data views: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/data_views --------------------------------------------------- -// KIBANA - -The API returns a list of data views: - -[source,sh] --------------------------------------------------- -{ - "data_view": [ - { - "id": "e9e024f0-d098-11ec-bbe9-c753adcb34bc", - "namespaces": [ - "default" - ], - "title": "tmp*", - "type": "rollup", - "typeMeta": {} - }, - { - "id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "namespaces": [ - "default" - ], - "title": "kibana_sample_data_logs" - } - ] -} --------------------------------------------------- diff --git a/docs/api/data-views/get.asciidoc b/docs/api/data-views/get.asciidoc deleted file mode 100644 index 50d186fa557be..0000000000000 --- a/docs/api/data-views/get.asciidoc +++ /dev/null @@ -1,74 +0,0 @@ -[[data-views-api-get]] -=== Get data view API -++++ -Get data view -++++ - -Retrieve a single data view by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-get-request]] -==== Request - -`GET :/api/data_views/data_view/` - -`GET :/s//api/data_views/data_view/` - - -[[data-views-api-get-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`id`:: -(Required, string) The ID of the data view you want to retrieve. - - -[[data-views-api-get-codes]] -==== Response code - -`200`:: -Indicates a successful call. - -`404`:: -The specified data view and ID doesn't exist. - - -[[data-views-api-get-example]] -==== Example - -Retrieve the data view object with the `my-view` ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/data_views/data_view/my-view --------------------------------------------------- -// KIBANA - -The API returns a data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": { - "id": "my-view", - "version": "...", - "title": "...", - "type": "...", - "timeFieldName": "...", - "sourceFilters": [], - "fields": {}, - "typeMeta": {}, - "fieldFormats": {}, - "fieldAttrs": {}, - "runtimeFieldMap" {}, - "allowNoIndex: "..." - } -} --------------------------------------------------- diff --git a/docs/api/data-views/runtime-fields/create.asciidoc b/docs/api/data-views/runtime-fields/create.asciidoc deleted file mode 100644 index 93db449e43434..0000000000000 --- a/docs/api/data-views/runtime-fields/create.asciidoc +++ /dev/null @@ -1,61 +0,0 @@ -[[data-views-runtime-field-api-create]] -=== Create runtime field API -++++ -Create runtime field -++++ - -Create a runtime field - -[[data-views-runtime-field-create-request]] -==== Request - -`POST :/api/data_views/data_view//runtime_field` - -`POST :/s//api/data_views/data_view//runtime_field` - -[[data-views-runtime-field-create-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`data_view_id`:: -(Required, string) The ID of the data view. - -[[data-views-runtime-field-create-body]] -==== Request body - -`name`:: (Required, string) The name for a runtime field. - -`runtimeField`:: (Required, object) The runtime field definition object. - - -[[data-views-runtime-field-create-example]] -==== Examples - -Create a runtime field on a data view: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view//runtime_field -{ - "name": "runtimeFoo", - "runtimeField": { - "type": "long", - "script": { - "source": "emit(doc["foo"].value)" - } - } -} --------------------------------------------------- -// KIBANA - -The API returns created runtime field object array and updated data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": {...}, - "fields": [...] -} --------------------------------------------------- diff --git a/docs/api/data-views/runtime-fields/delete.asciidoc b/docs/api/data-views/runtime-fields/delete.asciidoc deleted file mode 100644 index 8c6e2fa186106..0000000000000 --- a/docs/api/data-views/runtime-fields/delete.asciidoc +++ /dev/null @@ -1,39 +0,0 @@ -[[data-views-runtime-field-api-delete]] -=== Delete runtime field API -++++ -Delete runtime field -++++ - -Delete a runtime field from a data view. - -[[data-views-runtime-field-api-delete-request]] -==== Request - -`DELETE :/api/data_views/data_view//runtime_field/` - -`DELETE :/s//api/data_views/data_view//runtime_field/` - - -[[data-views-runtime-field-api-delete-path-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`data_view_id`:: -(Required, string) The ID of the data view your want to delete a runtime field from. - -`name`:: -(Required, string) The name of the runtime field you want to delete. - - - -==== Example - -Delete a runtime field from a data view: - -[source,sh] --------------------------------------------------- -$ curl -X DELETE api/data_views/data_view//runtime_field/ --------------------------------------------------- -// KIBANA diff --git a/docs/api/data-views/runtime-fields/get.asciidoc b/docs/api/data-views/runtime-fields/get.asciidoc deleted file mode 100644 index b472e8ebb4305..0000000000000 --- a/docs/api/data-views/runtime-fields/get.asciidoc +++ /dev/null @@ -1,59 +0,0 @@ -[[data-views-runtime-field-api-get]] -=== Get runtime field API -++++ -Get runtime field -++++ - -Get a runtime field - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-runtime-field-get-request]] -==== Request - -`GET :/api/data_views/data_view//runtime_field/` - -`GET :/s//api/data_views/data_view//runtime_field/` - - -[[data-views-runtime-field-get-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`data_view_id`:: -(Required, string) The ID of the data view. - -`name`:: -(Required, string) The name of the runtime field you want to retrieve. - - -[[data-views-runtime-field-get-example]] -==== Example - -Retrieve a runtime field named `foo` of data view with the `my-view` ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/data_views/data_view/my-view/runtime_field/foo --------------------------------------------------- -// KIBANA - -The API returns a runtime `field` object array, and a `runtimeField` definition object: - -[source,sh] --------------------------------------------------- -{ - "fields": [ - ... - ], - "runtimeField": { - ... - } -} --------------------------------------------------- diff --git a/docs/api/data-views/runtime-fields/update.asciidoc b/docs/api/data-views/runtime-fields/update.asciidoc deleted file mode 100644 index ad37d5b59af5a..0000000000000 --- a/docs/api/data-views/runtime-fields/update.asciidoc +++ /dev/null @@ -1,71 +0,0 @@ -[[data-views-runtime-field-api-update]] -=== Update runtime field API -++++ -Update runtime field -++++ - -Update an existing runtime field - - -[[data-views-runtime-field-update-request]] -==== Request - -`POST :/api/data_views/data_view//runtime_field/` - -`POST :/s//api/data_views/data_view//runtime_field/` - - -[[data-views-runtime-field-update-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`data_view_id`:: -(Required, string) The ID of the data view. - -`name`:: -(Required, string) The name of the runtime field you want to update. - - -[[data-views-runtime-field-update-body]] -==== Request body - -`runtimeField`:: (Required, object) The runtime field definition object. - -You can update following fields: - -* `type` -* `script` - - - - -[[data-views-runtime-field-update-example]] -==== Examples - -Update an existing runtime field on a data view: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view//runtime_field/ -{ - "runtimeField": { - "script": { - "source": "emit(doc["bar"].value)" - } - } -} --------------------------------------------------- -// KIBANA - -The API returns updated runtime field object array and updated data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": {...}, - "fields": [...] -} --------------------------------------------------- - diff --git a/docs/api/data-views/runtime-fields/upsert.asciidoc b/docs/api/data-views/runtime-fields/upsert.asciidoc deleted file mode 100644 index e0d587649ff4e..0000000000000 --- a/docs/api/data-views/runtime-fields/upsert.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -[[data-views-runtime-field-api-upsert]] -=== Upsert runtime field API -++++ -Upsert runtime field -++++ - -Create or update an existing runtime field - - -[[data-views-runtime-field-upsert-request]] -==== Request - -`PUT :/api/data_views/data_view//runtime_field` - -`PUT :/s//api/data_views/data_view//runtime_field` - - -[[data-views-runtime-field-upsert-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`data_view_id`:: -(Required, string) The ID of the data view. - - -[[data-views-runtime-field-upsert-body]] -==== Request body - -`name`:: (Required, string) The name for a new runtime field or a name of an existing runtime field. - -`runtimeField`:: (Required, object) The runtime field definition object. - - - -[[data-views-runtime-field-upsert-example]] -==== Examples - -Create or update an existing runtime field on a data view: - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/data_views/data_view//runtime_field -{ - "name": "runtimeFoo", - "runtimeField": { - "type": "long", - "script": { - "source": "emit(doc["foo"].value)" - } - } -} --------------------------------------------------- -// KIBANA - -The API returns created or updated runtime field object array and updated data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": {...}, - "fields": [...] -} --------------------------------------------------- - diff --git a/docs/api/data-views/swap_references.asciidoc b/docs/api/data-views/swap_references.asciidoc deleted file mode 100644 index 26f6f9aada21a..0000000000000 --- a/docs/api/data-views/swap_references.asciidoc +++ /dev/null @@ -1,84 +0,0 @@ -[[data-views-api-swap-references]] -=== Swap references data view API -++++ -Swap references -++++ - -Swap saved object references - -[WARNING] -==== -Misuse can break large numbers of saved objects! Practicing with a backup is recommended. -==== - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-swap-references-request]] -==== Request - -`POST :/api/data_views/swap_references` - -`POST :/s//api/data_views/swap_references` - - -[[data-views-api-swap-references-request-body]] -==== Request body - -`fromId`:: -(Required, string) Saved object reference to change. - -`toId`:: -(Required, string) New saved object reference value to replace the old. - -`delete`:: - (Optional, boolean) Deletes referenced saved object if all references are removed. - -`fromType`:: - (Optional, string) Specify the type of the saved object reference to alter. Default is `index-pattern` for data view. - -`forId`:: -(Optional, string or string[]) Limit the affected saved objects to one or more by IDs. - -`forType`:: - (Optional, string) Limit the affected saved objects by type. - -[[data-views-api-swap-references-errors-codes]] -==== Response code - -`200`:: -Indicates a successful call. - -[[data-views-api-swap-references-example]] -==== Examples - -Swap references to data view id "abcd-efg" with "xyz-123": - -[source,sh] --------------------------------------------------- -$ curl -X api/data_views/swap_references -{ - "fromId" : "abcd-efg", - "toId" : "xyz-123", - "delete" : true // optional, removes data view which is no longer referenced -} - --------------------------------------------------- -// KIBANA - -The API returns a list of affected saved objects: - -[source,sh] --------------------------------------------------- -{ - result: [{ id: "123", type: "visualization" }], - deleteStatus: { - remainingRefs: 0, - deletePerformed: true - } -} --------------------------------------------------- - diff --git a/docs/api/data-views/swap_references_preview.asciidoc b/docs/api/data-views/swap_references_preview.asciidoc deleted file mode 100644 index 16581045aaa35..0000000000000 --- a/docs/api/data-views/swap_references_preview.asciidoc +++ /dev/null @@ -1,74 +0,0 @@ -[[data-views-api-swap-references-preview]] -=== Swap references preview data view API -++++ -Swap references preview -++++ - -Swap saved object references preview - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-swap-references-preview-request]] -==== Request - -`POST :/api/data_views/swap_references/_preview` - -`POST :/s//api/data_views/swap_references/_preview` - - -[[data-views-api-swap-references-preview-request-body]] -==== Request body - -`fromId`:: -(Required, string) Saved object reference to change. - -`toId`:: -(Required, string) New saved object reference value to replace the old. - -`delete`:: - (Optional, boolean) Deletes referenced saved object if all references are removed. - -`fromType`:: - (Optional, string) Specify the type of the saved object reference to alter. Default is `index-pattern` for data view. - -`forId`:: -(Optional, string or string[]) Limit the affected saved objects to one or more by IDs. - -`forType`:: - (Optional, string) Limit the affected saved objects by type. - -[[data-views-api-swap-references-preview-errors-codes]] -==== Response code - -`200`:: -Indicates a successful call. - -[[data-views-api-swap-references-preview-example]] -==== Examples - -Preview swapping references to data view id "abcd-efg" with "xyz-123": - -[source,sh] --------------------------------------------------- -$ curl -X api/data_views/swap_references/_preview -{ - "fromId" : "abcd-efg", - "toId" : "xyz-123" -} - --------------------------------------------------- -// KIBANA - -The API returns a list of affected saved objects: - -[source,sh] --------------------------------------------------- -{ - result: [{ id: "123", type: "visualization" }], -} --------------------------------------------------- - diff --git a/docs/api/data-views/update-fields.asciidoc b/docs/api/data-views/update-fields.asciidoc deleted file mode 100644 index 4821262d1dda8..0000000000000 --- a/docs/api/data-views/update-fields.asciidoc +++ /dev/null @@ -1,154 +0,0 @@ -[[data-views-fields-api-update]] -=== Update data view fields API -++++ -Update data view fields metadata -++++ - -Update fields presentation metadata, such as `count`, -`customLabel`, `customDescription`, and `format`. You can update multiple fields in one request. Updates -are merged with persisted metadata. To remove existing metadata, specify `null` as the value. - - -[[data-views-fields-api-update-request]] -==== Request - -`POST :/api/data_views/data_view//fields` - -`POST :/s//api/data_views/data_view//fields` - - -[[data-views-fields-api-update-path-params]] -==== Path parameters - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`id`:: -(Required, string) The ID of the data view fields you want to update. - - -[[data-views-fields-api-update-request-body]] -==== Request body - -`fields`:: -(Required, object) the field object - - - -[[data-views-fields-api-update-errors-codes]] -==== Response code - -`200`:: -Indicates a successful call. - - -[[data-views-fields-api-update-example]] -==== Examples - -Set popularity `count` for field `foo`: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view/fields -{ - "fields": { - "foo": { - "count": 123 - } - } -} --------------------------------------------------- -// KIBANA - -Change a simple field format: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view/fields -{ - "fields": { - "foo": { - "format": { - "id": "bytes" - } - } - } -} --------------------------------------------------- -// KIBANA - -Change a complex field format: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view/fields -{ - "fields": { - "foo": { - "format": { - "id": "static_lookup", - "params": { - "lookupEntries": [ - { - "key": "1", - "value": "100" - }, - { - "key": "2", - "value": "200" - } - ], - "unknownKeyValue": "5000" - } - } - } - } -} --------------------------------------------------- -// KIBANA - -Update multiple metadata fields in one request: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view/fields -{ - "fields": { - "foo": { - "count": 123, - "customLabel": "Foo" - }, - "bar": { - "customLabel": "Bar", - "customDescription": "Bar Custom description" - } - } -} --------------------------------------------------- -// KIBANA - -Use `null` value to delete metadata: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-pattern/fields -{ - "fields": { - "foo": { - "customLabel": null - } - } -} --------------------------------------------------- -// KIBANA - -The endpoint returns the updated data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": { - - } -} --------------------------------------------------- diff --git a/docs/api/data-views/update.asciidoc b/docs/api/data-views/update.asciidoc deleted file mode 100644 index e1ad5908b8d93..0000000000000 --- a/docs/api/data-views/update.asciidoc +++ /dev/null @@ -1,125 +0,0 @@ -[[data-views-api-update]] -=== Update data view API -++++ -Update data view -++++ - -Update part of an data view. Only the specified fields are updated in the -data view. Unspecified fields stay as they are persisted. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification]. -==== - -[[data-views-api-update-request]] -==== Request - -`POST :/api/data_views/data_view/` - -`POST :/s//api/data_views/data_view/` - - -[[data-views-api-update-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`id`:: - (Required, string) The ID of the data view you want to update. - - -[[data-views-api-update-request-body]] -==== Request body - -`refresh_fields`:: (Optional, boolean) Reloads the data view fields after -the data view is updated. The default is `false`. - -`data_view`:: - (Required, object) The data view fields you want to update. -+ - -You can partially update the following fields: - -* `title` -* `name` -* `timeFieldName` -* `fields` -* `sourceFilters` -* `fieldFormatMap` -* `type` -* `typeMeta` - - -[[data-views-api-update-errors-codes]] -==== Response code - -`200`:: - Indicates a successful call. - - -[[data-views-api-update-example]] -==== Examples - -Update a title of the `` data view: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view -{ - "data_view": { - "title": "some-other-view-*" - } -} --------------------------------------------------- -// KIBANA - -Customize the update behavior: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view -{ - "refresh_fields": true, - "data_view": { - "fields": {} - } -} --------------------------------------------------- -// KIBANA - - -All update fields are optional, but you can specify the following fields: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/data_views/data_view/my-view -{ - "data_view": { - "title": "...", - "name": "...", - "timeFieldName": "...", - "sourceFilters": [], - "fieldFormats": {}, - "type": "...", - "typeMeta": {}, - "fields": {}, - "runtimeFieldMap": {} - } -} --------------------------------------------------- -// KIBANA - -The API returns the updated data view object: - -[source,sh] --------------------------------------------------- -{ - "data_view": { - - } -} --------------------------------------------------- - diff --git a/docs/api/index-patterns/create.asciidoc b/docs/api/index-patterns/create.asciidoc index 0e91254336456..21b03ab4bb294 100644 --- a/docs/api/index-patterns/create.asciidoc +++ b/docs/api/index-patterns/create.asciidoc @@ -4,7 +4,7 @@ Create index pattern ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Create {kib} index patterns. diff --git a/docs/api/index-patterns/default-get.asciidoc b/docs/api/index-patterns/default-get.asciidoc index fb27ef000c6a0..f000d09188c87 100644 --- a/docs/api/index-patterns/default-get.asciidoc +++ b/docs/api/index-patterns/default-get.asciidoc @@ -4,7 +4,7 @@ Get default index pattern ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Retrieve a default index pattern ID. Kibana UI uses default index pattern unless user picks a different one. diff --git a/docs/api/index-patterns/default-set.asciidoc b/docs/api/index-patterns/default-set.asciidoc index 3a9e91001d36e..0df2be0bcd16b 100644 --- a/docs/api/index-patterns/default-set.asciidoc +++ b/docs/api/index-patterns/default-set.asciidoc @@ -4,7 +4,7 @@ Set default index pattern ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Set a default index pattern ID. Kibana UI will use default index pattern unless user picks a different one. The API doesn't validate if given `index_pattern_id` is a valid id. diff --git a/docs/api/index-patterns/get.asciidoc b/docs/api/index-patterns/get.asciidoc index 3ae3eb4a84eb5..d627a3efe4a1c 100644 --- a/docs/api/index-patterns/get.asciidoc +++ b/docs/api/index-patterns/get.asciidoc @@ -4,7 +4,7 @@ Get index pattern ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Retrieve a single {kib} index pattern by ID. diff --git a/docs/api/index-patterns/runtime-fields/create.asciidoc b/docs/api/index-patterns/runtime-fields/create.asciidoc index bd50a5a66dcb6..f1d1182bb83ac 100644 --- a/docs/api/index-patterns/runtime-fields/create.asciidoc +++ b/docs/api/index-patterns/runtime-fields/create.asciidoc @@ -4,7 +4,7 @@ Create runtime field ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Create a runtime field diff --git a/docs/api/index-patterns/runtime-fields/delete.asciidoc b/docs/api/index-patterns/runtime-fields/delete.asciidoc index 838954abe8b3f..5eac2058ecea7 100644 --- a/docs/api/index-patterns/runtime-fields/delete.asciidoc +++ b/docs/api/index-patterns/runtime-fields/delete.asciidoc @@ -4,7 +4,7 @@ Delete runtime field ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API]instead.] experimental[] Delete a runtime field from an index pattern. diff --git a/docs/api/index-patterns/runtime-fields/get.asciidoc b/docs/api/index-patterns/runtime-fields/get.asciidoc index 155267fa40e44..f087ee3e4c650 100644 --- a/docs/api/index-patterns/runtime-fields/get.asciidoc +++ b/docs/api/index-patterns/runtime-fields/get.asciidoc @@ -4,7 +4,7 @@ Get runtime field ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Get a runtime field diff --git a/docs/api/index-patterns/runtime-fields/update.asciidoc b/docs/api/index-patterns/runtime-fields/update.asciidoc index 9879b8b457329..5862e9a33cf20 100644 --- a/docs/api/index-patterns/runtime-fields/update.asciidoc +++ b/docs/api/index-patterns/runtime-fields/update.asciidoc @@ -4,7 +4,7 @@ Update runtime field ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Update an existing runtime field diff --git a/docs/api/index-patterns/runtime-fields/upsert.asciidoc b/docs/api/index-patterns/runtime-fields/upsert.asciidoc index cd15f8c63b5d8..b62ba4cd57659 100644 --- a/docs/api/index-patterns/runtime-fields/upsert.asciidoc +++ b/docs/api/index-patterns/runtime-fields/upsert.asciidoc @@ -4,7 +4,7 @@ Upsert runtime field ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Create or update an existing runtime field diff --git a/docs/api/index-patterns/update-fields.asciidoc b/docs/api/index-patterns/update-fields.asciidoc index e2655d557e929..78cc6c80ae79b 100644 --- a/docs/api/index-patterns/update-fields.asciidoc +++ b/docs/api/index-patterns/update-fields.asciidoc @@ -4,7 +4,7 @@ Update index pattern fields metadata ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Update fields presentation metadata, such as `count`, `customLabel`, and `format`. You can update multiple fields in one request. Updates diff --git a/docs/api/index-patterns/update.asciidoc b/docs/api/index-patterns/update.asciidoc index 809c01500b7f9..7c7b5f913e6d0 100644 --- a/docs/api/index-patterns/update.asciidoc +++ b/docs/api/index-patterns/update.asciidoc @@ -4,7 +4,7 @@ Update index pattern ++++ -deprecated::[8.0.0,Use <> instead.] +deprecated::[8.0.0,Use the {api-kibana}/group/endpoint-data-views[data views API] instead.] experimental[] Update part of an index pattern. Only the specified fields are updated in the index pattern. Unspecified fields stay as they are persisted. diff --git a/docs/api/machine-learning.asciidoc b/docs/api/machine-learning.asciidoc index 265896e6340df..33abb719da9f0 100644 --- a/docs/api/machine-learning.asciidoc +++ b/docs/api/machine-learning.asciidoc @@ -1,11 +1,4 @@ [[machine-learning-api]] == {ml-cap} APIs -//Manage {kib} saved objects, including dashboards, visualizations, and more. - -The following {ml} API is available: - -* <> -//to retrieve a single {kib} saved object by ID - -include::machine-learning/sync.asciidoc[] +For the latest details, refer to {api-kibana}/group/endpoint-ml[machine learning APIs]. diff --git a/docs/api/machine-learning/sync.asciidoc b/docs/api/machine-learning/sync.asciidoc deleted file mode 100644 index bd65ce56dd5d1..0000000000000 --- a/docs/api/machine-learning/sync.asciidoc +++ /dev/null @@ -1,95 +0,0 @@ -[[machine-learning-api-sync]] -=== Sync {ml} saved objects API -++++ -Sync {ml} saved objects -++++ - -Synchronizes {kib} saved objects for {ml} jobs and trained models. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/x-pack/plugins/ml/common/openapi[open API specification]. -==== - -[[machine-learning-api-sync-request]] -==== {api-request-title} - -`GET :/api/ml/saved_objects/sync` - -`GET :/s//api/ml/saved_objects/sync` - -[[machine-learning-api-sync-prereq]] -==== {api-prereq-title} - -You must have `all` privileges for the *Machine Learning* feature in the *Analytics* section of the -<>. - -[[machine-learning-api-sync-desc]] -==== {api-description-title} - -This API runs automatically when you start {kib} and periodically thereafter. - -[[machine-learning-api-sync-path-params]] -==== {api-path-parms-title} - -`space_id`:: -(Optional, string) An identifier for the space. If `space_id` is not provided in -the URL the default space is used. - -[[machine-learning-api-sync-query-params]] -==== {api-query-parms-title} - -`simulate`:: -(Optional, boolean) When `true`, simulates the synchronization by only returning -the list actions that _would_ be performed. - -[[machine-learning-api-sync-response-body]] -==== {api-response-body-title} - -`datafeedsAdded`:: -(array) If a saved object for an {anomaly-job} is missing a {dfeed} identifier, -it is added. This list contains the {dfeed} identifiers and indicates whether -the synchronization was successful. - -`datafeedsRemoved`:: -(array) If a saved object for an anomaly detection job references a datafeed -that no longer exists, it is deleted. This list contains the {dfeed} identifiers -and indicates whether the synchronization was successful. - -`savedObjectsCreated`:: -(array) If saved objects are missing for {ml} jobs or trained models, they are -created. This list contains the job and model identifiers and indicates whether -the synchronization was successful. - -`savedObjectsDeleted`:: -(array) If saved objects exist for {ml} jobs or trained models that no longer -exist, they are deleted. This list contains the job and model identifiers and -indicates whether the synchronization was successful. - -[[machine-learning-api-sync-codes]] -==== {api-response-codes-title} - -`200`:: - Indicates a successful call. - -[[machine-learning-api-sync-example]] -==== {api-examples-title} - -Retrieve the list of {ml} saved objects that require synchronization: - -[source,sh] --------------------------------------------------- -GET api/ml/saved_objects/sync?simulate=true --------------------------------------------------- -// KIBANA - -If there are two jobs that need to be synchronized, for example, the API returns -the following response: - -[source,sh] --------------------------------------------------- -{"savedObjectsCreated":{"anomaly_detector":{"myjob1":{"success":true},"myjob2":{"success":true}}},"savedObjectsDeleted":{},"datafeedsAdded":{},"datafeedsRemoved":{}} --------------------------------------------------- - -To perform the synchronization, re-run the API and omit the `simulate` parameter. \ No newline at end of file diff --git a/docs/api/role-management/put-bulk.asciidoc b/docs/api/role-management/put-bulk.asciidoc index e41b836e26357..a11de47167e05 100644 --- a/docs/api/role-management/put-bulk.asciidoc +++ b/docs/api/role-management/put-bulk.asciidoc @@ -189,7 +189,7 @@ Grant full access to all features in the Default space for `my_kibana_role_1` an [source,sh] -------------------------------------------------- -$ curl -X PUT api/security/role +$ curl -X POST api/security/roles { "roles": { "my_kibana_role_1": { diff --git a/docs/api/saved-objects.asciidoc b/docs/api/saved-objects.asciidoc index c2f630c91cdb8..b8e7f00f54872 100644 --- a/docs/api/saved-objects.asciidoc +++ b/docs/api/saved-objects.asciidoc @@ -3,56 +3,7 @@ Manage {kib} saved objects, including dashboards, visualizations, and more. +For the latest details, refer to the {api-kibana}/group/endpoint-saved-objects[saved object API]. + WARNING: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions. - -The following saved objects APIs are available: - -* <> to retrieve sets of saved objects that you want to import into {kib} - -* <> to create sets of {kib} saved objects from a file created by the export API - -* <> to resolve errors from the import API - -* <> to rotate the encryption key for encrypted saved objects - -deprecated::[8.7.0,Use <> for managing data views] - -* <> to retrieve a single {kib} saved object by ID - -* <> to retrieve a single {kib} saved object by ID, using any legacy URL alias if it exists - -* <> to retrieve multiple {kib} saved objects by ID - -* <> to retrieve multiple {kib} saved objects by ID, using any legacy URL aliases if they exist - -* <> to retrieve a paginated set of {kib} saved objects by various conditions - -* <> to create {kib} saved objects - -* <> to create multiple {kib} saved objects - -* <> to update the attributes for existing {kib} saved objects - -* <> to update the attributes for multiple existing {kib} saved objects - -* <> to remove {kib} saved objects - -* <> to remove multiple {kib} saved objects - -include::saved-objects/export.asciidoc[] -include::saved-objects/import.asciidoc[] -include::saved-objects/resolve_import_errors.asciidoc[] -include::saved-objects/rotate_encryption_key.asciidoc[] -include::saved-objects/get.asciidoc[] -include::saved-objects/bulk_get.asciidoc[] -include::saved-objects/find.asciidoc[] -include::saved-objects/create.asciidoc[] -include::saved-objects/bulk_create.asciidoc[] -include::saved-objects/update.asciidoc[] -include::saved-objects/bulk_update.asciidoc[] -include::saved-objects/delete.asciidoc[] -include::saved-objects/bulk_delete.asciidoc[] -include::saved-objects/resolve.asciidoc[] -include::saved-objects/bulk_resolve.asciidoc[] - diff --git a/docs/api/saved-objects/bulk_create.asciidoc b/docs/api/saved-objects/bulk_create.asciidoc deleted file mode 100644 index 1e56735fa52a2..0000000000000 --- a/docs/api/saved-objects/bulk_create.asciidoc +++ /dev/null @@ -1,149 +0,0 @@ -[[saved-objects-api-bulk-create]] -=== Bulk create saved objects API -++++ -Bulk create saved objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Create multiple {kib} saved objects. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-bulk-create-request]] -==== Request - -`POST :/api/saved_objects/_bulk_create` - -`POST :/s//api/saved_objects/_bulk_create` - - -[[saved-objects-api-bulk-create-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL the default space is used. - -[[saved-objects-api-bulk-create-query-params]] -==== Query parameters - -`overwrite`:: - (Optional, boolean) When `true`, overwrites the document with the same ID. - -[[saved-objects-api-bulk-create-request-body]] -==== Request body - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`. - -`id`:: - (Optional, string) Specifies an ID instead of using a randomly generated ID. - -`attributes`:: - (Required, object) The data that you want to create. - -`references`:: - (Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects in the referenced object. To refer to the other saved object, use `name` in the attributes. Never use `id` to refer to the other saved object. `id` can be automatically updated during migrations, import, or export. - -`initialNamespaces`:: - (Optional, string array) Identifiers for the <> in which this object is created. If this is provided, the - object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space - (default behavior). -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, including -the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only be -used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - -`version`:: - (Optional, number) Specifies the version. - -[[saved-objects-api-bulk-create-response-body]] -==== Response body - -`saved_objects`:: - (array) Top-level property the contains objects that represent the response for each of the requested objects. The order of the objects in the response is identical to the order of the objects in the request. - -Saved objects that are unable to persist are replaced with an error object. - -[[saved-objects-api-bulk-create-codes]] -==== Response code - -`200`:: - Indicates a successful call. Note, this HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. See the example below for details. - -[[saved-objects-api-bulk-create-example]] -==== Example - -Create a {data-source} with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_bulk_create -[ - { - "type": "index-pattern", - "id": "my-pattern", - "attributes": { - "title": "my-pattern-*" - } - }, - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab", - "attributes": { - "title": "Look at my dashboard" - } - } -] --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "saved_objects": [ - { - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } - }, - { - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab", - "type": "dashboard", - "error": { - "statusCode": 409, - "message": "Saved object [dashboard/be3733a0-9efe-11e7-acb3-3dab96693fab] conflict" - } - } - ] -} --------------------------------------------------- - -There is already a saved object with the `my-dashboard` ID, so only the {data-source} is created. - -[[saved-objects-api-bulk-create-conflict-errors]] -==== Conflict errors - -Starting in {kib} 8.0, saved objects can exist in multiple spaces. As a result, you may encounter different types of conflict errors when -attempting to create an object: - -* *Regular conflict*: This is a 409 error without any metadata. It means an object of that type/ID already exists. This can be - overridden by using the `overwrite: true` option. -* *Unresolvable conflict*: This is a 409 error with `isNotOverwritable: true` in its metadata. It means an object of that type/ID already - exists in a different space, and it cannot be overridden with the given parameters. To successfully overwrite this object, you must do so - in at least one space where it exists. You can specify that using the `space_id` path parameter _or_ the `initialNamespaces` parameter. -* *Alias conflict*: This is a 409 error with a `spacesWithConflictingAliases` string array in its metadata. It means a conflicting - <> for this type/ID exists in the space(s) where you attempted to create this object. A conflicting - legacy URL alias is one that points to a different type/ID. To successfully create this object, you need to first use the - <> API to disable the problematic legacy URL alias(es). diff --git a/docs/api/saved-objects/bulk_delete.asciidoc b/docs/api/saved-objects/bulk_delete.asciidoc deleted file mode 100644 index dc1c218467a65..0000000000000 --- a/docs/api/saved-objects/bulk_delete.asciidoc +++ /dev/null @@ -1,115 +0,0 @@ -[[saved-objects-api-bulk-delete]] -=== Bulk delete object API -++++ -Bulk delete objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Remove multiple {kib} saved objects. - -WARNING: Once you delete a saved object, _it cannot be recovered_. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -==== Request - -`POST :/api/saved_objects/_bulk_delete` - -`POST :/s//api/saved_objects/_bulk_delete` - -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -==== Request body - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The object ID to remove. - -==== Query parameters - -`force`:: - (Optional, boolean) When true, force delete objects that exist in multiple namespaces. Note that the option applies to the whole request. Use the <> to specify per-object delete behavior. -+ -TIP: Use this if you attempted to delete objects and received an HTTP 400 error with the following message: _"Unable to delete saved object that exists in multiple namespaces, use the `force` option to delete it anyway"_ -+ -WARNING: When you bulk delete objects that exist in multiple namespaces, the API also deletes <> that reference the object. These requests are batched to minimise the impact but they can place a heavy load on {kib}. Make sure you limit the number of objects that exist in multiple namespaces in a single bulk delete operation. - -==== Response code -`200`:: - Indicates a successful call. Note, this HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. Refer to the example below for details. - -==== Response body - -`statuses`:: - (array) Top-level property that contains objects that represent the response for each of the requested objects. The order of the objects in the response is identical to the order of the objects in the request. - -Saved objects that cannot be removed will include an error object. - -==== Example - -Delete three saved objects, where one of them does not exist and one exists in multiple namespaces: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_bulk_delete -[ - { - type: 'visualization', - id: 'not an id', - }, - { - type: 'dashboard', - id: 'be3733a0-9efe-11e7-acb3-3dab96693fab', - { - type: 'index-pattern', - id: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', - } -] --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "statuses": [ - { - "success": false, - "id": "not an id", - "type": "visualization", - "error": { - "statusCode": 404, - "error": "Not Found", - "message": "Saved object [visualization/not an id] not found", - }, - }, - { - "success": true, - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab", - "type": "dashboard", - }, - { - "success": false, - "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", - "type": "index-pattern", - "error": { - "statusCode": 400, - "error": "Bad Request", - "message": "Unable to delete saved object id: d3d7af60-4c81-11e8-b3d7-01146121b73d, type: index-pattern that exists in multiple namespaces, use the \"force\" option to delete all saved objects: Bad Request", - }, - } - ] -} --------------------------------------------------- diff --git a/docs/api/saved-objects/bulk_get.asciidoc b/docs/api/saved-objects/bulk_get.asciidoc deleted file mode 100644 index 9807d7b499400..0000000000000 --- a/docs/api/saved-objects/bulk_get.asciidoc +++ /dev/null @@ -1,114 +0,0 @@ -[[saved-objects-api-bulk-get]] -=== Bulk get objects API -++++ -Bulk get objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Retrieve multiple {kib} saved objects by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-bulk-get-request]] -==== Request - -`POST :/api/saved_objects/_bulk_get` - -`POST :/s//api/saved_objects/_bulk_get` - -[[saved-objects-api-bulk-get-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-bulk-get-request-body]] -==== Request Body - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) ID of the retrieved object. The ID includes the {kib} unique identifier or a custom identifier. - -`fields`:: - (Optional, array) The fields to return in the `attributes` key of the object response. - -`namespaces`:: - (Optional, string array) Identifiers for the <> in which to search for this object. If this is provided, the object - is searched for only in the explicitly defined spaces. If this is not provided, the object is searched for in the current space (default - behavior). -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, including -the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only be -used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - -[[saved-objects-api-bulk-get-response-body]] -==== Response body - -`saved_objects`:: - (array) Top-level property containing objects that represent the response for each of the requested objects. The order of the objects in the response is identical to the order of the objects in the request. - -Saved objects that are unable to persist are replaced with an error object. - -[[saved-objects-api-bulk-get-body-codes]] -==== Response code - -`200`:: - Indicates a successful call. Note, this HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. See the example below for details. - -[[saved-objects-api-bulk-get-body-example]] -==== Example - -Retrieve a {data-source} with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_bulk_get -[ - { - "type": "index-pattern", - "id": "my-pattern" - }, - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab" - } -] --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "saved_objects": [ - { - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "error": { - "statusCode": 404, - "message": "Not found" - } - } - ] -} --------------------------------------------------- - -Only the {data-source} exists. diff --git a/docs/api/saved-objects/bulk_resolve.asciidoc b/docs/api/saved-objects/bulk_resolve.asciidoc deleted file mode 100644 index 6908b0f7b7dd0..0000000000000 --- a/docs/api/saved-objects/bulk_resolve.asciidoc +++ /dev/null @@ -1,196 +0,0 @@ -[[saved-objects-api-bulk-resolve]] -=== Bulk resolve objects API -++++ -Bulk resolve objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Retrieve multiple {kib} saved objects by ID, using any legacy URL aliases if they exist. - -Under certain circumstances, when Kibana is upgraded, saved object migrations may necessitate regenerating some object IDs to enable new -features. When an object's ID is regenerated, a legacy URL alias is created for that object, preserving its old ID. In such a scenario, that -object can be retrieved via the Bulk Resolve API using either its new ID or its old ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-bulk-resolve-request]] -==== Request - -`POST :/api/saved_objects/_bulk_resolve` - -`POST :/s//api/saved_objects/_bulk_resolve` - -[[saved-objects-api-bulk-resolve-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-bulk-resolve-request-body]] -==== Request Body - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) ID of the retrieved object. The ID includes the {kib} unique identifier or a custom identifier. - -[[saved-objects-api-bulk-resolve-response-body]] -==== Response body - -`resolved_objects`:: - (array) Top-level property containing objects that represent the response for each of the requested objects. The order of the objects in the response is identical to the order of the objects in the request. - -Saved objects that {kib} fails to find are replaced with an error object and an "exactMatch" outcome. The rationale behind the outcome is -that "exactMatch" is the default outcome, and the outcome only changes if an alias is found. This behavior is unique to `_bulk_resolve`; the -<> will return only an HTTP error instead. - -[[saved-objects-api-bulk-resolve-body-codes]] -==== Response code - -`200`:: - Indicates a successful call. Note, this HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. See the example below for details. - -[[saved-objects-api-bulk-resolve-body-example]] -==== Example - -Retrieve an index pattern with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_bulk_resolve -[ - { - "type": "index-pattern", - "id": "my-pattern" - }, - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab" - } -] --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "resolved_objects": [ - { - "saved_object": { - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } - }, - "outcome": "exactMatch" - }, - { - "saved_object": { - "id": "my-dashboard", - "type": "dashboard", - "error": { - "statusCode": 404, - "message": "Not found" - } - }, - "outcome": "exactMatch" - } - ] -} --------------------------------------------------- - -Only the index pattern exists, the dashboard was not found. - -[NOTE] -==== -In addition to `saved_object`, several fields can be returned: - -* `outcome` (required string) -- One of the following values: - - `"exactMatch"` -- One document exactly matched the given ID. - - `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than - the given ID. - - `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the - `saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID. -* `alias_target_id` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the - `alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID. -* `alias_purpose` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the - `alias_purpose` field. This indicates why the alias was created, and it can be used to change the client behavior accordingly. One of the - following values: `"savedObjectConversion"`, `"savedObjectImport"` - -Client-side code uses these fields to behave differently depending on the `outcome` -- <>. -==== - -Retrieve a dashboard object in the `testspace` by ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET s/testspace/api/saved_objects/resolve/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "resolved_objects": [ - { - "saved_object": { - "id": "7adfa750-4c81-11e8-b3d7-01146121b73d", - "type": "dashboard", - "updated_at": "2019-07-23T00:11:07.059Z", - "version": "WzQ0LDFd", - "attributes": { - "title": "[Flights] Global Flight Dashboard", - "hits": 0, - "description": "Analyze mock flight data for ES-Air, Logstash Airways, Kibana Airlines and JetBeats", - "panelsJSON": "[ . . . ]", - "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", - "version": 1, - "timeRestore": true, - "timeTo": "now", - "timeFrom": "now-24h", - "refreshInterval": { - "display": "15 minutes", - "pause": false, - "section": 2, - "value": 900000 - }, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" - } - }, - "references": [ - { - "name": "panel_0", - "type": "visualization", - "id": "aeb212e0-4c84-11e8-b3d7-01146121b73d" - }, - . . . - { - "name": "panel_18", - "type": "visualization", - "id": "ed78a660-53a0-11e8-acbd-0be0ad9d822b" - } - ], - "migrationVersion": { - "dashboard": "7.0.0" - } - }, - "outcome": "conflict", - "alias_target_id": "05becb88-e214-439a-a2ac-15fc783b5d01" - } - ] -} --------------------------------------------------- diff --git a/docs/api/saved-objects/bulk_update.asciidoc b/docs/api/saved-objects/bulk_update.asciidoc deleted file mode 100644 index dfc16f87c9d4c..0000000000000 --- a/docs/api/saved-objects/bulk_update.asciidoc +++ /dev/null @@ -1,120 +0,0 @@ -[[saved-objects-api-bulk-update]] -=== Bulk update object API -++++ -Bulk update objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Update the attributes for multiple existing {kib} saved objects. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-bulk-update-request]] -==== Request - -`PUT :/api/saved_objects/_bulk_update` - -`PUT :/s//api/saved_objects/_bulk_update` - -[[saved-objects-api-bulk-update-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-bulk-update-request-body]] -==== Request body - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The object ID to update. - -`attributes`:: - (Required, object) The data to persist. -+ -WARNING: When you update, attributes are not validated, which allows you to pass arbitrary and ill-formed data into the API and break {kib}. Make sure any data that you send to the API is properly formed. - -`references`:: - (Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects this object references. To refer to the other saved object, use `name` in the attributes, but never the `id`, which automatically updates during migrations or import/export. - -`version`:: - (Optional, number) Ensures the version matches that of the persisted object. - -`namespace`:: (Optional, string) Identifier for the space in which to update this object. If this is defined, it will supersede the space ID that is in the URL. - -[[saved-objects-api-bulk-update-codes]] -==== Response code - -`200`:: - Indicates a successful call. Note, this HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. Refer to the example below for details. - -[[saved-objects-api-bulk-update-example]] -==== Example - -Update three saved objects, where one of them does not exist: - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/saved_objects/_bulk_update -[ - { - type: 'visualization', - id: 'not an id', - attributes: { - title: 'An existing visualization', - }, - }, - { - type: 'dashboard', - id: 'be3733a0-9efe-11e7-acb3-3dab96693fab', - attributes: { - title: 'An existing dashboard', - }, - { - type: 'index-pattern', - id: 'logstash-*', - attributes: { title: 'my-logstash-pattern' } - } -] --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "type": "visualization", - "id": "not an id", - "error": { - "statusCode": 404, - "error": "Not Found", - "message": "Saved object [visualization/not an id] not found", - }, - }, - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab", - "version": 2, - "attributes": { - "title": "An existing dashboard", - }, - }, - { - "type": "index-pattern", - "id": "logstash-*", - "attributes": { - "title": "my-logstash-pattern", - } - } -] --------------------------------------------------- diff --git a/docs/api/saved-objects/create.asciidoc b/docs/api/saved-objects/create.asciidoc deleted file mode 100644 index 154a58bb72025..0000000000000 --- a/docs/api/saved-objects/create.asciidoc +++ /dev/null @@ -1,114 +0,0 @@ -[[saved-objects-api-create]] -=== Create saved objects API -++++ -Create saved objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Create {kib} saved objects. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-create-request]] -==== Request - -`POST :/api/saved_objects/` - -`POST :/api/saved_objects//` - -`POST :/s//api/saved_objects/` - -`POST :/s//api/saved_objects//` - -[[saved-objects-api-create-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -``:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`. - -``:: - (Optional, string) Specifies an ID instead of using a randomly generated ID. - -[[saved-objects-api-create-query-params]] -==== Query parameters - -`overwrite`:: - (Optional, boolean) When true, overwrites the document with the same ID. - -[[saved-objects-api-create-request-body]] -==== Request body - -`attributes`:: - (Required, object) The data that you want to create. -+ -WARNING: When you create saved objects, attributes are not validated, which allows you to pass -arbitrary and ill-formed data into the API that can break {kib}. Make sure -any data that you send to the API is properly formed. - -`references`:: - (Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects that this object references. Use `name` in attributes to refer to the other saved object, but never the `id`, which can update automatically during migrations or import/export. - -`initialNamespaces`:: - (Optional, string array) Identifiers for the <> in which this object is created. If this is provided, the - object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space - (default behavior). -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, including -the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only be -used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'): this option cannot be used. - -[[saved-objects-api-create-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -`409`:: - Indicates a <>. - -[[saved-objects-api-create-example]] -==== Example - -[source,sh] --------------------------------------------------- -$ curl -X POST api/index_patterns/index-pattern/my-pattern -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "attributes": { - "title": "my-pattern-*" - } -}' --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "my-pattern", <1> - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } -} --------------------------------------------------- - -<1> When `my-pattern` is unspecified in the path, a unique ID is automatically generated. - -[[saved-objects-api-create-conflict-errors]] -==== Conflict errors - -Starting in {kib} 8.0, saved objects can exist in multiple spaces. As a result, you may encounter different types of conflict errors when -attempting to create an object. If you encounter a 409 error that cannot be overridden by using the `overwrite: true` option, you are likely -hitting a different type of conflict error. The Create API response is limited and does not include additional metadata. You can get more -details about this error by using the <> instead. diff --git a/docs/api/saved-objects/delete.asciidoc b/docs/api/saved-objects/delete.asciidoc deleted file mode 100644 index 6a335ae3323d0..0000000000000 --- a/docs/api/saved-objects/delete.asciidoc +++ /dev/null @@ -1,60 +0,0 @@ -[[saved-objects-api-delete]] -=== Delete object API -++++ -Delete object -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Remove {kib} saved objects. - -WARNING: Once you delete a saved object, _it cannot be recovered_. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-delete-request]] -==== Request - -`DELETE :/api/saved_objects//` - -`DELETE :/s//api/saved_objects//` - -[[saved-objects-api-delete-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The object ID that you want to remove. - -[[saved-objects-api-delete-query-params]] -==== Query parameters - -`force`:: - (Optional, boolean) When true, forces an object to be deleted if it exists in multiple namespaces. -+ -TIP: Use this if you attempted to delete an object and received an HTTP 400 error with the following message: _"Unable to delete saved object that exists in multiple namespaces, use the `force` option to delete it anyway"_ - -[[saved-objects-api-delete-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Example - -Delete a {data-source} object with the `my-pattern` ID: - -[source,sh] --------------------------------------------------- -$ curl -X DELETE api/index_patterns/index-pattern/my-pattern --------------------------------------------------- -// KIBANA diff --git a/docs/api/saved-objects/export.asciidoc b/docs/api/saved-objects/export.asciidoc deleted file mode 100644 index 237e54af3444b..0000000000000 --- a/docs/api/saved-objects/export.asciidoc +++ /dev/null @@ -1,142 +0,0 @@ -[[saved-objects-api-export]] -=== Export objects API -++++ -Export objects -++++ - -experimental[] Retrieve sets of saved objects that you want to import into {kib}. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-export-request]] -==== Request - -`POST :/api/saved_objects/_export` - -`POST :/s//api/saved_objects/_export` - -[[saved-objects-api-export-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-export-request-request-body]] -==== Request body - -`type`:: - (Optional, array|string) The saved object types to include in the export. Use `*` to export all the types. - -`objects`:: - (Optional, array) A list of objects to export. - -`includeReferencesDeep`:: - (Optional, boolean) Includes all of the referenced objects in the exported objects. - -`excludeExportDetails`:: - (Optional, boolean) Do not add export details entry at the end of the stream. - -TIP: You must include `type` or `objects` in the request body. - -NOTE: The <> configuration setting -limits the number of saved objects which may be exported. - -[[saved-objects-api-export-request-response-body]] -==== Response body - -The format of the response body is newline delimited JSON. Each exported object is exported as a valid JSON record and separated by the newline character '\n'. - -When `excludeExportDetails=false` (the default) we append an export result details record at the end of the file after all the saved object records. The export result details object has the following format: - -[source,json] --------------------------------------------------- -{ - "exportedCount": 27, - "missingRefCount": 2, - "missingReferences": [ - { "id": "an-id", "type": "visualisation"}, - { "id": "another-id", "type": "index-pattern"} - ] -} --------------------------------------------------- - -[[export-objects-api-create-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[ssaved-objects-api-create-example]] -==== Examples - -Export all {data-source} saved objects: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "type": "index-pattern" -}' --------------------------------------------------- -// KIBANA - -Export all {data-source} saved objects and exclude the export summary from the stream: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "type": "index-pattern", - "excludeExportDetails": true -}' --------------------------------------------------- -// KIBANA - -Export a specific saved object: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "objects": [ - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab" - } - ] -}' --------------------------------------------------- -// KIBANA - -Export a specific saved object and it's related objects: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "objects": [ - { - "type": "dashboard", - "id": "be3733a0-9efe-11e7-acb3-3dab96693fab" - } - ], - "includeReferencesDeep": true -}' --------------------------------------------------- -// KIBANA - -Export all exportable saved objects and their related objects: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' -{ - "type": "*", - "includeReferencesDeep": true -}' --------------------------------------------------- -// KIBANA \ No newline at end of file diff --git a/docs/api/saved-objects/find.asciidoc b/docs/api/saved-objects/find.asciidoc deleted file mode 100644 index 8efc20cb11a90..0000000000000 --- a/docs/api/saved-objects/find.asciidoc +++ /dev/null @@ -1,127 +0,0 @@ -[[saved-objects-api-find]] -=== Find objects API -++++ -Find objects -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Retrieve a paginated set of {kib} saved objects by various conditions. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-find-request]] -==== Request - -`GET :/api/saved_objects/_find` - -`GET :/s//api/saved_objects/_find` - -[[saved-objects-api-find-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-find-query-params]] -==== Query Parameters - -`type`:: - (Required, array|string) The saved object types to include in the export. - -`per_page`:: - (Optional, number) The number of objects to return per page. - -`page`:: - (Optional, number) The page of objects to return. - -`search`:: - (Optional, string) An Elasticsearch {ref}/query-dsl-simple-query-string-query.html[simple_query_string] query that filters the objects in the response. - -`default_search_operator`:: - (Optional, string) The default operator to use for the `simple_query_string`. - -`search_fields`:: - (Optional, array|string) The fields to perform the `simple_query_string` parsed query against. - -`fields`:: - (Optional, array|string) The fields to return in the `attributes` key of the response. - -`sort_field`:: - (Optional, string) Sorts the response. Includes "root" and "type" fields. "root" fields exist for all saved objects, such as "updated_at". - "type" fields are specific to an object type, such as fields returned in the `attributes` key of the response. When a single type is - defined in the `type` parameter, the "root" and "type" fields are allowed, and validity checks are made in that order. When multiple types - are defined in the `type` parameter, only "root" fields are allowed. - -`has_reference`:: - (Optional, object) Filters to objects that have a relationship with the type and ID combination. - -`has_reference_operator`:: - (Optional, string) The operator to use for the `has_reference` parameter. Either `OR` or `AND`. Defaults to `OR`. - -`has_no_reference`:: - (Optional, object) Filters to objects that do not have a relationship with the type and ID combination. - -`has_no_reference_operator`:: - (Optional, string) The operator to use for the `has_no_reference` parameter. Either `OR` or `AND`. Defaults to `OR`. - -`filter`:: - (Optional, string) The filter is a KQL string with the caveat that if you filter with an attribute from your saved object type, - it should look like that: `savedObjectType.attributes.title: "myTitle"`. However, If you use a root attribute of a saved - object such as `updated_at`, you will have to define your filter like that: `savedObjectType.updated_at > 2018-12-22`. - -`aggs`:: - (Optional, string) **experimental** An aggregation structure, serialized as a string. The field format is similar to `filter`, meaning - that to use a saved object type attribute in the aggregation, the `savedObjectType.attributes.title`: "myTitle"` format - must be used. For root fields, the syntax is `savedObjectType.rootField` - -NOTE: As objects change in {kib}, the results on each page of the response also -change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data. - -[[saved-objects-api-find-request-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -==== Examples - -Find {data-sources} with titles that start with `my`: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/saved_objects/_find?type=index-pattern&search_fields=title&search=my* --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "total": 1, - "data": [ - { - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } - } - ] -} --------------------------------------------------- - -For parameters that accept multiple values (e.g. `fields`), repeat the -query parameter for each value: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/saved_objects/_find?fields=id&fields=title --------------------------------------------------- -// KIBANA diff --git a/docs/api/saved-objects/get.asciidoc b/docs/api/saved-objects/get.asciidoc deleted file mode 100644 index 2e7a5f949832b..0000000000000 --- a/docs/api/saved-objects/get.asciidoc +++ /dev/null @@ -1,122 +0,0 @@ -[[saved-objects-api-get]] -=== Get object API -++++ -Get object -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Retrieve a single {kib} saved object by ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-get-request]] -==== Request - -`GET :/api/saved_objects//` - -`GET :/s//api/saved_objects//` - -[[saved-objects-api-get-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The ID of the object to retrieve. - -[[saved-objects-api-get-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[saved-objects-api-get-example]] -==== Example - -Retrieve the {data-source} object with the `my-pattern` ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/index_patterns/index-pattern/my-pattern --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } -} --------------------------------------------------- - -Retrieve a dashboard object in the `testspace` by ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET s/testspace/api/saved_objects/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "7adfa750-4c81-11e8-b3d7-01146121b73d", - "type": "dashboard", - "updated_at": "2019-07-23T00:11:07.059Z", - "version": "WzQ0LDFd", - "attributes": { - "title": "[Flights] Global Flight Dashboard", - "hits": 0, - "description": "Analyze mock flight data for ES-Air, Logstash Airways, Kibana Airlines and JetBeats", - "panelsJSON": "[ . . . ]", - "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", - "version": 1, - "timeRestore": true, - "timeTo": "now", - "timeFrom": "now-24h", - "refreshInterval": { - "display": "15 minutes", - "pause": false, - "section": 2, - "value": 900000 - }, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" - } - }, - "references": [ - { - "name": "panel_0", - "type": "visualization", - "id": "aeb212e0-4c84-11e8-b3d7-01146121b73d" - }, - . . . - { - "name": "panel_18", - "type": "visualization", - "id": "ed78a660-53a0-11e8-acbd-0be0ad9d822b" - } - ], - "migrationVersion": { - "dashboard": "7.0.0" - } -} --------------------------------------------------- diff --git a/docs/api/saved-objects/import.asciidoc b/docs/api/saved-objects/import.asciidoc deleted file mode 100644 index 85a03c8b1a3a3..0000000000000 --- a/docs/api/saved-objects/import.asciidoc +++ /dev/null @@ -1,399 +0,0 @@ -[[saved-objects-api-import]] -=== Import objects API -++++ -Import objects -++++ - -experimental[] Create sets of {kib} saved objects from a file created by the export API. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -==== Compatibility across versions -Saved objects can only be imported into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: - -|======= -| Exporting version | Importing version | Compatible? -| 6.7.x | 6.8.x | Yes -| 6.x.x | 7.x.x | Yes -| 7.x.x | 8.x.x | Yes -| 7.1.x | 7.15.x | Yes -| 7.x.x | 6.x.x | No -| 7.15.x | 7.1.x | No -| 6.x.x | 8.x.x | No -|======= - -[[saved-objects-api-import-request]] -==== Request - -`POST :/api/saved_objects/_import` - -`POST :/s//api/saved_objects/_import` - -[[saved-objects-api-import-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the <>. If `space_id` is not provided in the URL, the default space is used. - -[[saved-objects-api-import-query-params]] -==== Query parameters - -`createNewCopies`:: - (Optional, boolean) Creates copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict - errors are avoided. -+ -NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options. - -`overwrite`:: - (Optional, boolean) Overwrites saved objects when they already exist. When used, potential conflict errors are automatically resolved by - overwriting the destination object. -+ -NOTE: This option cannot be used with the `createNewCopies` option. - -`compatibilityMode`:: - (Optional, boolean) Applies various adjustments to the saved objects that are being imported to maintain compatibility between different {kib} - versions. Use this option only if you encounter issues with imported saved objects. -+ -NOTE: This option cannot be used with the `createNewCopies` option. - -[[saved-objects-api-import-request-body]] -==== Request body - -The request body must include the multipart/form-data type. - -`file`:: - A file exported using the export API. -+ -NOTE: The <> configuration setting -limits the number of saved objects which may be included in this file. Similarly, the -<> setting limits the overall -size of the file that can be imported. - -[[saved-objects-api-import-response-body]] -==== Response body - -`success`:: - (boolean) Indicates when the import was successfully completed. When set to `false`, some objects may not have been created. For - additional information, refer to the `errors` and `successResults` properties. - -`successCount`:: - (number) Indicates the number of successfully imported records. - -`errors`:: - (Optional, array) Indicates the import was unsuccessful and specifies the objects that failed to import. -+ -NOTE: One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and -`conflict` error). - -`successResults`:: - (Optional, array) Indicates the objects that are successfully imported, with any metadata if applicable. -+ -NOTE: Objects are only created when all resolvable errors are addressed, including conflicts and missing references. For information on how -to resolve errors, refer to the <>. - -[[saved-objects-api-import-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[saved-objects-api-import-example]] -==== Examples - -[[saved-objects-api-import-example-1]] -===== Successful import with `createNewCopies` enabled - -Import a {data-source} and dashboard: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_import?createNewCopies=true -H "kbn-xsrf: true" --form file=@file.ndjson --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": true, - "successCount": 2, - "successResults": [ - { - "id": "my-pattern", - "type": "index-pattern", - "destinationId": "4aba3770-0d04-45e1-9e34-4cf0fd2165ae", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "destinationId": "c31d1eca-9bc0-4a81-b5f9-30c442824c48", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates a successful import, and both objects are created. Since these objects are created as new copies, each entry in the -`successResults` array includes a `destinationId` attribute. - -[[saved-objects-api-import-example-2]] -===== Successful import with `createNewCopies` disabled - -Import a {data-source} and dashboard: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": true, - "successCount": 2, - "successResults": [ - { - "id": "my-pattern", - "type": "index-pattern", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates a successful import, and both objects are created. - -[[saved-objects-api-import-example-3]] -===== Failed import with conflict errors - -Import a {data-source}, visualization, *Canvas* workpad, and dashboard that include saved objects: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}} -{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"}} -{"type":"canvas-workpad","id":"my-canvas","attributes":{"name":"Look at my canvas"}} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": false, - "successCount": 1, - "errors": [ - { - "id": "my-pattern", - "type": "index-pattern", - "title": "my-pattern-*", - "error": { - "type": "conflict" - }, - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-visualization", - "type": "my-vis", - "title": "Look at my visualization", - "error": { - "type": "conflict", - "destinationId": "another-vis" - }, - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "title": "Look at my canvas", - "error": { - "type": "ambiguous_conflict", - "destinations": [ - { - "id": "another-canvas", - "title": "Look at another canvas", - "updatedAt": "2020-07-08T16:36:32.377Z" - }, - { - "id": "yet-another-canvas", - "title": "Look at yet another canvas", - "updatedAt": "2020-07-05T12:29:54.849Z" - } - ] - }, - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - } - ], - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates an unsuccessful import because the {data-source}, visualization, *Canvas* workpad, and dashboard resulted in a conflict -error: - -* A {data-source} with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object, -or skip the object. - -* A visualization with a different ID, but the same origin already exists, which resulted in a conflict error. The `destinationId` field -contains the `id` of the other visualization, which caused the conflict. The behavior is added to make sure that new objects that can be -shared between <> behave in a similar way as legacy non-shareable objects. When a shareable object is exported and then -imported into a new space, it retains its origin so that the conflicts are encountered as expected. To resolve, overwrite the specified -destination object, or skip the object. - -* Two *Canvas* workpads with different IDs, but the same origin, already exist, which resulted in a conflict error. The `destinations` array -describes the other workpads which caused the conflict. When a shareable object is exported, imported into a new space, then shared to -another space where an object of the same origin exists, the conflict error occurs. To resolve, pick a destination object to overwrite, or -skip the object. - -Objects are created when the error is resolved using the <>. - -[[saved-objects-api-import-example-4]] -===== Failed import with missing reference errors - -Import a visualization and dashboard when the {data-source} for the visualization doesn't exist: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"my-pattern-*"}]} -{"type":"search","id":"my-search","attributes":{"title":"Look at my search"},"references":[{"name":"ref_0","type":"index-pattern","id":"another-pattern-*"}]} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"},"references":[{"name":"ref_0","type":"visualization","id":"my-vis"},{"name":"ref_1","type":"search","id":"my-search"}]} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": false, - "successCount": 1, - "errors": [ - { - "id": "my-vis", - "type": "visualization", - "title": "Look at my visualization", - "error": { - "type": "missing_references", - "references": [ - { - "type": "index-pattern", - "id": "my-pattern-*" - } - ] - }, - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-search", - "type": "search", - "title": "Look at my search", - "error": { - "type": "missing_references", - "references": [ - { - "type": "index-pattern", - "id": "another-pattern-*" - } - ] - }, - "meta": { - "icon": "searchApp", - "title": "Look at my search" - } - } - ], - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates an unsuccessful import because the visualization and search resulted in a missing references error. - -Objects are created when the errors are resolved using the <>. diff --git a/docs/api/saved-objects/resolve.asciidoc b/docs/api/saved-objects/resolve.asciidoc deleted file mode 100644 index 7d9176145fbcc..0000000000000 --- a/docs/api/saved-objects/resolve.asciidoc +++ /dev/null @@ -1,152 +0,0 @@ -[[saved-objects-api-resolve]] -=== Resolve object API -++++ -Resolve object -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Retrieve a single {kib} saved object by ID, using any legacy URL alias if it exists. - -Under certain circumstances, when Kibana is upgraded, saved object migrations may necessitate regenerating some object IDs to enable new -features. When an object's ID is regenerated, a legacy URL alias is created for that object, preserving its old ID. In such a scenario, that -object can be retrieved via the Resolve API using either its new ID or its old ID. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-resolve-request]] -==== Request - -`GET :/api/saved_objects/resolve//` - -`GET :/s//api/saved_objects/resolve//` - -[[saved-objects-api-resolve-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The ID of the object to retrieve. - -[[saved-objects-api-resolve-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[saved-objects-api-resolve-example]] -==== Example - -Retrieve the {data-source} object with the `my-pattern` ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/saved_objects/resolve/index-pattern/my-pattern --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "saved_object": { - "id": "my-pattern", - "type": "index-pattern", - "version": 1, - "attributes": { - "title": "my-pattern-*" - } - }, - "outcome": "exactMatch" -} --------------------------------------------------- - -[NOTE] -==== -In addition to `saved_object`, several fields can be returned: - -* `outcome` (required string) -- One of the following values: - - `"exactMatch"` -- One document exactly matched the given ID. - - `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than - the given ID. - - `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the - `saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID. -* `alias_target_id` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the - `alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID. -* `alias_purpose` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the - `alias_purpose` field. This indicates why the alias was created, and it can be used to change the client behavior accordingly. One of the - following values: `"savedObjectConversion"`, `"savedObjectImport"` - -Client-side code uses these fields to behave differently depending on the `outcome` -- <>. -==== - -Retrieve a dashboard object in the `testspace` by ID: - -[source,sh] --------------------------------------------------- -$ curl -X GET s/testspace/api/saved_objects/resolve/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "saved_object": { - "id": "7adfa750-4c81-11e8-b3d7-01146121b73d", - "type": "dashboard", - "updated_at": "2019-07-23T00:11:07.059Z", - "version": "WzQ0LDFd", - "attributes": { - "title": "[Flights] Global Flight Dashboard", - "hits": 0, - "description": "Analyze mock flight data for ES-Air, Logstash Airways, Kibana Airlines and JetBeats", - "panelsJSON": "[ . . . ]", - "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", - "version": 1, - "timeRestore": true, - "timeTo": "now", - "timeFrom": "now-24h", - "refreshInterval": { - "display": "15 minutes", - "pause": false, - "section": 2, - "value": 900000 - }, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" - } - }, - "references": [ - { - "name": "panel_0", - "type": "visualization", - "id": "aeb212e0-4c84-11e8-b3d7-01146121b73d" - }, - . . . - { - "name": "panel_18", - "type": "visualization", - "id": "ed78a660-53a0-11e8-acbd-0be0ad9d822b" - } - ], - "migrationVersion": { - "dashboard": "7.0.0" - } - }, - "outcome": "conflict", - "alias_target_id": "05becb88-e214-439a-a2ac-15fc783b5d01" -} --------------------------------------------------- diff --git a/docs/api/saved-objects/resolve_import_errors.asciidoc b/docs/api/saved-objects/resolve_import_errors.asciidoc deleted file mode 100644 index f537eaa1d4de5..0000000000000 --- a/docs/api/saved-objects/resolve_import_errors.asciidoc +++ /dev/null @@ -1,245 +0,0 @@ -[[saved-objects-api-resolve-import-errors]] -=== Resolve import errors API -++++ -Resolve import errors -++++ - -experimental[] Resolve errors from the <>. - -To resolve errors, you can: - -* Retry certain saved objects - -* Overwrite specific saved objects - -* Change references to different saved objects - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-resolve-import-errors-request]] -==== Request - -`POST :/api/saved_objects/_resolve_import_errors` - -`POST :/s//api/saved_objects/_resolve_import_errors` - -[[saved-objects-api-resolve-import-errors-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the <>. When `space_id` is unspecified in the URL, the default space is used. - -[[saved-objects-api-resolve-import-errors-query-params]] -==== Query parameters - -`createNewCopies`:: - (Optional, boolean) Creates copies of the saved objects, regenerates each object ID, and resets the origin. When enabled during the - initial import, also enable when resolving import errors. - -`compatibilityMode`:: - (Optional, boolean) Applies various adjustments to the saved objects that are being imported to maintain compatibility between different {kib} - versions. When enabled during the initial import, also enable when resolving import errors. -+ -NOTE: This option cannot be used with the `createNewCopies` option. - -[[saved-objects-api-resolve-import-errors-request-body]] -==== Request body - -The request body must include the multipart/form-data type. - -`file`:: - The same file given to the import API. - -`retries`:: - (Required, array) The retry operations, which can specify how to resolve different types of errors. -+ -.Properties of `` -[%collapsible%open] -===== - `type`::: - (Required, string) The saved object type. - `id`::: - (Required, string) The saved object ID. - `overwrite`::: - (Optional, boolean) When set to `true`, the source object overwrites the conflicting destination object. When set to `false`, does - nothing. - `destinationId`::: - (Optional, string) Specifies the destination ID that the imported object should have, if different from the current ID. - `replaceReferences`::: - (Optional, array) A list of `type`, `from`, and `to` used to change the object references. - `ignoreMissingReferences`::: - (Optional, boolean) When set to `true`, ignores missing reference errors. When set to `false`, does nothing. -===== - -[[saved-objects-api-resolve-import-errors-response-body]] -==== Response body - -`success`:: - (boolean) Indicates a successful import. When set to `false`, some objects may not have been created. For additional information, refer to - the `errors` and `successResults` properties. - -`successCount`:: - (number) Indicates the number of successfully resolved records. - -`errors`:: - (Optional, array) Specifies the objects that failed to resolve. -+ -NOTE: One object can result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a -`conflict` error. - -`successResults`:: - (Optional, array) Indicates the objects that are successfully imported, with any metadata if applicable. -+ -NOTE: Objects are only created when all resolvable errors are addressed, including conflict and missing references. To resolve errors, refer -to the <>. - -[[saved-objects-api-resolve-import-errors-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[saved-objects-api-resolve-import-errors-example]] -==== Examples - -[[saved-objects-api-resolve-import-errors-example-1]] -===== Resolve conflict errors - -This example builds upon the <>. - -Resolve conflict errors for a {data-source}, visualization, and *Canvas* workpad by overwriting the existing saved objects: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"index-pattern","id":"my-pattern","overwrite":true},{"type":"visualization","id":"my-vis","overwrite":true,"destinationId":"another-vis"},{"type":"canvas","id":"my-canvas","overwrite":true,"destinationId":"yet-another-canvas"},{"type":"dashboard","id":"my-dashboard"}]' --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}} -{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"}} -{"type":"canvas-workpad","id":"my-canvas","attributes":{"name":"Look at my canvas"}} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": true, - "successCount": 4, - "successResults": [ - { - "id": "my-pattern", - "type": "index-pattern", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-vis", - "type": "visualization", - "destinationId": "another-vis", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "destinationId": "yet-another-canvas", - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates a successful import, and all four objects were created. - -TIP: If a prior import attempt resulted in resolvable errors, you must include a retry for each object you want to import, including any -that were returned in the `successResults` array. In this example, we retried importing the dashboard accordingly. - -[[saved-objects-api-resolve-import-errors-example-2]] -===== Resolve missing reference errors - -This example builds upon the <>. - -Resolve a missing reference error for a visualization by replacing the {data-source} with another, and resolve a missing reference error for -a search by ignoring it: - -[source,sh] --------------------------------------------------- -$ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"my-pattern-*","to":"existing-pattern"}]},{"type":"search","id":"my-search","ignoreMissingReferences":true},{"type":"dashboard","id":"my-dashboard"}]' --------------------------------------------------- -// KIBANA - -The `file.ndjson` file contains the following: - -[source,sh] --------------------------------------------------- -{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"my-pattern-*"}]} -{"type":"search","id":"my-search","attributes":{"title":"Look at my search"},"references":[{"name":"ref_0","type":"index-pattern","id":"another-pattern-*"}]} -{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"},"references":[{"name":"ref_0","type":"visualization","id":"my-vis"}]} --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "success": true, - "successCount": 3, - "successResults": [ - { - "id": "my-vis", - "type": "visualization", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-search", - "type": "search", - "meta": { - "icon": "searchApp", - "title": "Look at my search" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] -} --------------------------------------------------- - -The result indicates a successful import, and all three objects were created. - -TIP: If a prior import attempt resulted in resolvable errors, you must include a retry for each object you want to import, including any -that were returned in the `successResults` array. In this example, we retried importing the dashboard accordingly. diff --git a/docs/api/saved-objects/rotate_encryption_key.asciidoc b/docs/api/saved-objects/rotate_encryption_key.asciidoc deleted file mode 100644 index 8b45ee7175599..0000000000000 --- a/docs/api/saved-objects/rotate_encryption_key.asciidoc +++ /dev/null @@ -1,116 +0,0 @@ -[role="xpack"] -[[saved-objects-api-rotate-encryption-key]] -=== Rotate encryption key API -++++ -Rotate encryption key -++++ - -experimental[] Rotate the encryption key for encrypted saved objects. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -If a saved object cannot be decrypted using the primary encryption key, then {kib} will attempt to decrypt it using the specified <>. In most of the cases this overhead is negligible, but if you're dealing with a large number of saved objects and experiencing performance issues, you may want to rotate the encryption key. - -[IMPORTANT] -============================================================================ -Bulk key rotation can consume a considerable amount of resources and hence only user with a `superuser` role can trigger it. -============================================================================ - -[[saved-objects-api-rotate-encryption-key-request]] -==== Request - -`POST :/api/encrypted_saved_objects/_rotate_key` - -[[saved-objects-api-rotate-encryption-key-request-query-params]] -==== Query parameters - -`type`:: -(Optional, string) Limits encryption key rotation only to the saved objects with the specified type. By default, {kib} tries to rotate the encryption key for all saved object types that may contain encrypted attributes. - -`batch_size`:: -(Optional, number) Specifies a maximum number of saved objects that {kib} can process in a single batch. Bulk key rotation is an iterative process since {kib} may not be able to fetch and process all required saved objects in one go and splits processing into consequent batches. By default, the batch size is 10000, which is also a maximum allowed value. - -[[saved-objects-api-rotate-encryption-key-response-body]] -==== Response body - -`total`:: -(number) Indicates the total number of _all_ encrypted saved objects (optionally filtered by the requested `type`), regardless of the key {kib} used for encryption. - -`successful`:: -(number) Indicates the total number of _all_ encrypted saved objects (optionally filtered by the requested `type`), regardless of the key {kib} used for encryption. -+ -NOTE: In most cases, `total` will be greater than `successful` even if `failed` is zero. The reason is that {kib} may not need or may not be able to rotate encryption keys for all encrypted saved objects. - -`failed`:: -(number) Indicates the number of the saved objects that were still encrypted with one of the old encryption keys that {kib} failed to re-encrypt with the primary key. - -[[saved-objects-api-rotate-encryption-key-response-codes]] -==== Response code - -`200`:: -Indicates a successful call. - -`400`:: -Indicates that either query parameters are wrong or <> aren't configured. - -`429`:: -Indicates that key rotation is already in progress. - -[[saved-objects-api-rotate-encryption-key-example]] -==== Examples - -[[saved-objects-api-rotate-encryption-key-example-1]] -===== Encryption key rotation with default parameters - -[source,sh] --------------------------------------------------- -$ curl -X POST /api/encrypted_saved_objects/_rotate_key --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "total": 1000, - "successful": 300, - "failed": 0 -} --------------------------------------------------- - -The result indicates that the encryption key was successfully rotated for 300 out of 1000 saved objects with encrypted attributes, and 700 of the saved objects either didn't require key rotation, or were encrypted with an unknown encryption key. - -[[saved-objects-api-rotate-encryption-key-example-2]] -===== Encryption key rotation for the specific type with reduce batch size - -[IMPORTANT] -============================================================================ -Default parameters are optimized for speed. Change the parameters only when necessary. However, if you're experiencing any issues with this API, you may want to decrease a batch size or rotate the encryption keys for the specific types only. In this case, you may need to run key rotation multiple times in a row. -============================================================================ - -In this example, key rotation is performed for all saved objects with the `alert` type in batches of 5000. - -[source,sh] --------------------------------------------------- -$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batch_size=5000 --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "total": 100, - "successful": 100, - "failed": 0 -} --------------------------------------------------- - -The result indicates that the encryption key was successfully rotated for all 100 saved objects with the `alert` type. - diff --git a/docs/api/saved-objects/update.asciidoc b/docs/api/saved-objects/update.asciidoc deleted file mode 100644 index 28e8956edb528..0000000000000 --- a/docs/api/saved-objects/update.asciidoc +++ /dev/null @@ -1,97 +0,0 @@ -[[saved-objects-api-update]] -=== Update object API -++++ -Update object -++++ - -deprecated::[8.7.0, To be removed in an upcoming version] - -Update the attributes for existing {kib} saved objects. - -[NOTE] -==== -For the most up-to-date API details, refer to the -{kib-repo}/tree/{branch}/packages/core/saved-objects/docs/openapi[open API specification]. -==== - -[[saved-objects-api-update-request]] -==== Request - -`PUT :/api/saved_objects//` - -`PUT :/s//api/saved_objects//` - -[[saved-objects-api-update-path-params]] -==== Path parameters - -`space_id`:: - (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. - -`type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. - -`id`:: - (Required, string) The object ID to update. - -[[saved-objects-api-update-request-body]] -==== Request body - -`attributes`:: - (Required, object) The data to persist. -+ -WARNING: When you update, attributes are not validated, which allows you to pass arbitrary and ill-formed data into the API and break {kib}. Make sure any data that you send to the API is properly formed. - -`references`:: - (Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects this object references. To refer to the other saved object, use `name` in the attributes, but never the `id`, which automatically updates during migrations or import/export. - -`upsert`:: - (Optional, object) If specified, will create the document with the given upsert attributes if it doesn't exist. - -[[saved-objects-api-update-errors-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -`404`:: - Indicates the object was not found. - -`409`:: - Indicates a <>. - -[[saved-objects-api-update-example]] -==== Example - -Update an existing {data-source} object,`my-pattern`, with a different title: - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/index_patterns/index-pattern/my-pattern -{ - "attributes": { - "title": "some-other-pattern-*" - } -} --------------------------------------------------- -// KIBANA - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "my-pattern", - "type": "index-pattern", - "version": 2, - "attributes": { - "title": "some-other-pattern-*" - } -} --------------------------------------------------- - -[[saved-objects-api-update-conflict-errors]] -==== Conflict errors - -Starting in {kib} 8.0, saved objects can exist in multiple spaces. As a result, you may encounter a 409 *alias conflict* error when using -the `upsert` option. The Update API response is limited and does not include additional metadata. You can get more details about this error -by using the <> instead. diff --git a/docs/developer/contributing/development-functional-tests.asciidoc b/docs/developer/contributing/development-functional-tests.asciidoc index 23d43480eb090..88163ebb6804b 100644 --- a/docs/developer/contributing/development-functional-tests.asciidoc +++ b/docs/developer/contributing/development-functional-tests.asciidoc @@ -203,7 +203,7 @@ Tests should run at the positive security boundary condition, meaning that they The functional UI tests now default to logging in with a user named `test_user` and the roles of this user can be changed dynamically without logging in and out. -In order to achieve this a new service was introduced called `createTestUserService` (see `test/common/services/security/test_user.ts`). The purpose of this test user service is to create roles defined in the test config files and setRoles() or restoreDefaults(). +In order to achieve this a new service was introduced called `createTestUserService` (see `packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts`). The purpose of this test user service is to create roles defined in the test config files and setRoles() or restoreDefaults(). An example of how to set the role like how its defined below: @@ -366,14 +366,14 @@ await testSubjects.click(‘containerButton’); ** `find.allByCssSelector()` **retry:**::: -// * Source: {kibana-blob}test/common/services/retry/retry.ts[test/common/services/retry/retry.ts] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/retry/retry.ts[packages/kbn-ftr-common-functional-services/services/retry/retry.ts] * Helpers for retrying operations * Popular methods: ** `retry.try(fn, onFailureBlock)` - Execute `fn` in a loop until it succeeds or the default timeout elapses. The optional `onFailureBlock` is executed before each retry attempt. ** `retry.tryForTime(ms, fn, onFailureBlock)` - Execute `fn` in a loop until it succeeds or `ms` milliseconds elapses. The optional `onFailureBlock` is executed before each retry attempt. **kibanaServer:**::: -// * Source: {kibana-blob}test/common/services/kibana_server/kibana_server.js[test/common/services/kibana_server/kibana_server.js] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts[packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts] * Helpers for interacting with {kib}'s server * Commonly used methods: ** `kibanaServer.uiSettings.update()` @@ -381,7 +381,7 @@ await testSubjects.click(‘containerButton’); ** `kibanaServer.status.getOverallState()` **esArchiver:**::: -// * Source: {kibana-blob}test/common/services/es_archiver.ts[test/common/services/es_archiver.ts] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/es_archiver.ts[packages/kbn-ftr-common-functional-services/services/es_archiver.ts] * Load/unload archives created with the `esArchiver` * Popular methods: ** `esArchiver.load(path)` @@ -393,7 +393,7 @@ Full list of services that are used in functional tests can be found here: {kiba **Low-level utilities:**::: * es -// ** Source: {kibana-blob}test/common/services/es.ts[test/common/services/es.ts] +// ** Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/es.ts[packages/kbn-ftr-common-functional-services/services/es.ts] ** {es} client ** Higher level options: `kibanaServer.uiSettings` or `esArchiver` * remote diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index e51f77d096adf..1f4f516e59167 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -571,7 +571,7 @@ security and spaces filtering. |{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/entity_manager/README.md[entityManager] -|This plugin provides access to observed asset data, such as information about hosts, pods, containers, services, and more. +|This plugin provides access to observed entity data, such as information about hosts, pods, containers, services, and more. |{kib-repo}blob/{branch}/x-pack/plugins/event_log/README.md[eventLog] @@ -795,6 +795,10 @@ Elastic. It uses Chromium and Puppeteer underneath to run the browser in headless mode. +|{kib-repo}blob/{branch}/x-pack/plugins/search_assistant/README.md[searchAssistant] +|This holds the Search AI Assistant which targets Search users and Serverless Elasticsearch. + + |{kib-repo}blob/{branch}/x-pack/plugins/search_connectors/README.mdx[searchConnectors] |This plugin contains common assets and endpoints for the use of connectors in Kibana. Primarily used by the enterprise_search and serverless_search plugins. @@ -803,6 +807,10 @@ It uses Chromium and Puppeteer underneath to run the browser in headless mode. |The Search Homepage is a shared homepage for elasticsearch users. +|{kib-repo}blob/{branch}/x-pack/plugins/search_indices/README.mdx[searchIndices] +|The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions. + + |{kib-repo}blob/{branch}/x-pack/plugins/search_inference_endpoints/README.md[searchInferenceEndpoints] |The Inference Endpoints is a tool used to manage inference endpoints diff --git a/docs/management/connectors/action-types/bedrock.asciidoc b/docs/management/connectors/action-types/bedrock.asciidoc index ab08e697daa53..8f0728a034615 100644 --- a/docs/management/connectors/action-types/bedrock.asciidoc +++ b/docs/management/connectors/action-types/bedrock.asciidoc @@ -9,7 +9,7 @@ :frontmatter-tags-user-goals: [configure] -The {bedrock} connector uses https://github.com/axios/axios[axios] to send a POST request to {bedrock}. The connector uses the <> to send the request. +The {bedrock} connector uses https://github.com/axios/axios[axios] to send a POST request to {bedrock}. [float] [[define-bedrock-ui]] @@ -37,8 +37,7 @@ Secret:: The secret for authentication. [[bedrock-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/bedrock-params.png[{bedrock} params test] diff --git a/docs/management/connectors/action-types/cases-webhook.asciidoc b/docs/management/connectors/action-types/cases-webhook.asciidoc index 3d5bfecffcb3b..e68b820101b8f 100644 --- a/docs/management/connectors/action-types/cases-webhook.asciidoc +++ b/docs/management/connectors/action-types/cases-webhook.asciidoc @@ -192,8 +192,7 @@ The username for HTTP basic authentication. [[cases-webhook-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/cases-webhook-test.gif[{webhook-cm} params test] diff --git a/docs/management/connectors/action-types/d3security.asciidoc b/docs/management/connectors/action-types/d3security.asciidoc index 76152365f76cd..5eb23cc356a95 100644 --- a/docs/management/connectors/action-types/d3security.asciidoc +++ b/docs/management/connectors/action-types/d3security.asciidoc @@ -8,7 +8,7 @@ :frontmatter-tags-content-type: [how-to] :frontmatter-tags-user-goals: [configure] -The D3 Security connector uses https://github.com/axios/axios[axios] to send a POST request to a D3 Security endpoint. The connector uses the <> to send the request. You can use the connector for rule actions. +The D3 Security connector uses https://github.com/axios/axios[axios] to send a POST request to a D3 Security endpoint. You can use the connector for rule actions. To create this connector, you must first configure a webhook key in your D3 SOAR environment. For configuration tips, refer to <>. @@ -35,8 +35,7 @@ Token:: The D3 Security token. [[d3security-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/d3security-params-test.png[D3 Security params test] diff --git a/docs/management/connectors/action-types/gemini.asciidoc b/docs/management/connectors/action-types/gemini.asciidoc index 610fb4ad48f15..2371015975d92 100644 --- a/docs/management/connectors/action-types/gemini.asciidoc +++ b/docs/management/connectors/action-types/gemini.asciidoc @@ -9,7 +9,7 @@ :frontmatter-tags-user-goals: [configure] -The {gemini} connector uses https://github.com/axios/axios[axios] to send a POST request to {gemini}. The connector uses the <> to send the request. +The {gemini} connector uses https://github.com/axios/axios[axios] to send a POST request to {gemini}. [float] [[define-gemini-ui]] @@ -38,8 +38,7 @@ Credentials JSON:: The GCP service account JSON file for authentication. [[gemini-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/gemini-params.png[{gemini} params test] diff --git a/docs/management/connectors/action-types/jira.asciidoc b/docs/management/connectors/action-types/jira.asciidoc index abff601184c58..906a2945d82de 100644 --- a/docs/management/connectors/action-types/jira.asciidoc +++ b/docs/management/connectors/action-types/jira.asciidoc @@ -43,8 +43,7 @@ API token:: Jira API authentication token for HTTP Basic authentication. [[jira-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/jira-params-test.png[Jira params test] diff --git a/docs/management/connectors/action-types/openai.asciidoc b/docs/management/connectors/action-types/openai.asciidoc index 968f5a1e30f3a..9b468d7ca09bc 100644 --- a/docs/management/connectors/action-types/openai.asciidoc +++ b/docs/management/connectors/action-types/openai.asciidoc @@ -9,8 +9,7 @@ :frontmatter-tags-user-goals: [configure] -The OpenAI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. The connector uses the <> to send the request. - +The OpenAI connector uses https://github.com/axios/axios[axios] to send a POST request to an OpenAI provider, either OpenAI or Azure OpenAI. [float] [[define-gen-ai-ui]] === Create connectors in {kib} @@ -48,8 +47,7 @@ API key:: The OpenAI or Azure OpenAI API key for authentication. [[gen-ai-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/gen-ai-params-test.png[OpenAI params test] diff --git a/docs/management/connectors/action-types/servicenow-itom.asciidoc b/docs/management/connectors/action-types/servicenow-itom.asciidoc index 2dc6266745336..3cf64f7cc3b06 100644 --- a/docs/management/connectors/action-types/servicenow-itom.asciidoc +++ b/docs/management/connectors/action-types/servicenow-itom.asciidoc @@ -61,8 +61,7 @@ The username for HTTP basic authentication. [[servicenow-itom-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/servicenow-itom-params-test.png[{sn-itom} params test] diff --git a/docs/management/connectors/action-types/servicenow-sir.asciidoc b/docs/management/connectors/action-types/servicenow-sir.asciidoc index da2b37dc1f558..164fe70a6d55b 100644 --- a/docs/management/connectors/action-types/servicenow-sir.asciidoc +++ b/docs/management/connectors/action-types/servicenow-sir.asciidoc @@ -61,8 +61,7 @@ The username for HTTP basic authentication. [[servicenow-sir-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/servicenow-sir-params-test.png[{sn-sir} params test] diff --git a/docs/management/connectors/action-types/swimlane.asciidoc b/docs/management/connectors/action-types/swimlane.asciidoc index 227846c7539f3..368ca9f5ecfdf 100644 --- a/docs/management/connectors/action-types/swimlane.asciidoc +++ b/docs/management/connectors/action-types/swimlane.asciidoc @@ -35,8 +35,7 @@ API token:: Swimlane API authentication token for HTTP basic authentication. [[swimlane-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/swimlane-params-test.png[Swimlane params test] diff --git a/docs/management/connectors/action-types/teams.asciidoc b/docs/management/connectors/action-types/teams.asciidoc index 174b0173cb08a..13c34d793913b 100644 --- a/docs/management/connectors/action-types/teams.asciidoc +++ b/docs/management/connectors/action-types/teams.asciidoc @@ -8,7 +8,7 @@ :frontmatter-tags-content-type: [how-to] :frontmatter-tags-user-goals: [configure] -The Microsoft Teams connector uses https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook[Incoming Webhooks]. +The Microsoft Teams connector uses a webhook to send notifications. [float] [[define-teams-ui]] @@ -19,6 +19,7 @@ or as needed when you're creating a rule. For example: [role="screenshot"] image::management/connectors/images/teams-connector.png[Teams connector] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. [float] [[teams-connector-configuration]] @@ -27,21 +28,21 @@ image::management/connectors/images/teams-connector.png[Teams connector] Microsoft Teams connectors have the following configuration properties: Name:: The name of the connector. -Webhook URL:: The URL of the incoming webhook. See https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook#add-an-incoming-webhook-to-a-teams-channel[Add Incoming Webhooks] for instructions on generating this URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. +Webhook URL:: The URL of the incoming webhook. Refer to <>. If you are using the <> setting, make sure the hostname is added to the allowed hosts. [float] [[teams-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/teams-params-test.png[Teams params test] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. Microsoft Teams actions have the following properties. -Message:: The message text, converted to the `text` field in the Webhook JSON payload. Currently only the text field is supported. Markdown, images, and other advanced formatting are not yet supported. +Message:: The message text. Markdown, images, and other advanced formatting are not yet supported. [float] [[teams-connector-networking-configuration]] @@ -51,19 +52,40 @@ Use the <> to customize connecto [float] [[configuring-teams]] -=== Configure a Microsoft Teams account +=== Configure Microsoft Teams -You need a https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook[Microsoft Teams webhook URL] to -configure a Microsoft Teams action. To create a webhook -URL, add the **Incoming Webhook App** through the Microsoft Teams console: +Microsoft 365 connectors are being https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/[retired]; you must use the *Workflows* app to create a webhook URL. +For example: -. Log in to http://teams.microsoft.com[teams.microsoft.com] as a team administrator. -. Navigate to the Apps directory, search for and select the *Incoming Webhook* app. -. Choose _Add to team_ and select a team and channel for the app. -. Enter a name for your webhook and (optionally) upload a custom icon. +. Go to the *Workflows* app in Teams and select the *Create* tab. +. Create a workflow from a blank template. + -image::images/teams-add-webhook-integration.png[] -. Click *Create*. -. Copy the generated webhook URL so you can paste it into your Teams connector form. +-- +NOTE: You cannot use the "Post to a channel when a webhook request is received" template; it does not work with the Microsoft Teams connector. +-- +. Add a trigger as the first step in the workflow. Search for webhook triggers and select *When a Teams webhook request is received*. Set *Who can trigger the flow?* to `Anyone`. +. Add *Post message in a chat or channel* as the second step in the workflow. +.. Set *Post as* to `Flow bot`. +.. Set *Post in* to `Channel`. +.. Set *Team* and *Channel* to the appropriate values for where you want the message displayed. + -image::images/teams-copy-webhook-url.png[] +-- +NOTE: Per https://learn.microsoft.com/en-us/power-automate/teams/send-a-message-in-teams#known-issues-and-limitations, you cannot use a private channel. +-- +.. Set the *Message* to `@{triggerBody()?['text']}`. ++ +-- +Alternatively, you can add a *Parse JSON* step before the *Post message in a chat or channel* step in the workflow. Set the *Content* to `Body` and the *Schema* to the following value: + +```json +{ + "type": "object", + "properties": { + "text": { + "type": "string" + } + } +} +``` +-- +. Save the workflow and copy the HTTP POST URL from the first step. This is the URL required by the Microsoft Teams connector. \ No newline at end of file diff --git a/docs/management/connectors/action-types/thehive.asciidoc b/docs/management/connectors/action-types/thehive.asciidoc index 9ee6a2e4325c1..302bd142031ee 100644 --- a/docs/management/connectors/action-types/thehive.asciidoc +++ b/docs/management/connectors/action-types/thehive.asciidoc @@ -36,8 +36,7 @@ API Key:: TheHive API key for authentication. [[TheHive-action-configuration]] === Test connectors -You can test connectors for creating a case or an alert with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/thehive-params-case-test.png[TheHive case params test] diff --git a/docs/management/connectors/action-types/tines.asciidoc b/docs/management/connectors/action-types/tines.asciidoc index c9888ab7b9087..6f219f2aa4572 100644 --- a/docs/management/connectors/action-types/tines.asciidoc +++ b/docs/management/connectors/action-types/tines.asciidoc @@ -35,8 +35,7 @@ API Token:: A Tines API token created by the user. For more information, refer [[tines-action-parameters]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/tines-params-test.png[Tines params test] diff --git a/docs/management/connectors/action-types/torq.asciidoc b/docs/management/connectors/action-types/torq.asciidoc index 7b4b9712adcb9..cac39ae6799bd 100644 --- a/docs/management/connectors/action-types/torq.asciidoc +++ b/docs/management/connectors/action-types/torq.asciidoc @@ -35,8 +35,7 @@ Torq authentication header secret:: Secret of the webhook authentication header. [[torq-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/torq-connector-test.png[Torq connector test] diff --git a/docs/management/connectors/action-types/webhook.asciidoc b/docs/management/connectors/action-types/webhook.asciidoc index d9a4dd43daeaf..eda17fdcc319a 100644 --- a/docs/management/connectors/action-types/webhook.asciidoc +++ b/docs/management/connectors/action-types/webhook.asciidoc @@ -55,8 +55,7 @@ Controls the certificate verification. [[webhook-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/webhook-params-test.png[Webhook params test] diff --git a/docs/management/connectors/action-types/xmatters.asciidoc b/docs/management/connectors/action-types/xmatters.asciidoc index ebc230bf0b39b..f3e1fa3c2b634 100644 --- a/docs/management/connectors/action-types/xmatters.asciidoc +++ b/docs/management/connectors/action-types/xmatters.asciidoc @@ -44,8 +44,7 @@ Password:: Password for HTTP basic authentication. [[xmatters-action-configuration]] === Test connectors -You can test connectors with the <> or -as you're creating or editing the connector in {kib}. For example: +You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/xmatters-params-test.png[xMatters params test] diff --git a/docs/management/connectors/images/teams-add-webhook-integration.png b/docs/management/connectors/images/teams-add-webhook-integration.png deleted file mode 100644 index a2d070cb33743..0000000000000 Binary files a/docs/management/connectors/images/teams-add-webhook-integration.png and /dev/null differ diff --git a/docs/management/connectors/images/teams-connector.png b/docs/management/connectors/images/teams-connector.png index 4b9112db28474..3164bd4be7438 100644 Binary files a/docs/management/connectors/images/teams-connector.png and b/docs/management/connectors/images/teams-connector.png differ diff --git a/docs/management/connectors/images/teams-copy-webhook-url.png b/docs/management/connectors/images/teams-copy-webhook-url.png deleted file mode 100644 index adb455c64cbf0..0000000000000 Binary files a/docs/management/connectors/images/teams-copy-webhook-url.png and /dev/null differ diff --git a/docs/management/connectors/images/teams-params-test.png b/docs/management/connectors/images/teams-params-test.png index 01efb84ae60d4..60bf87394bb68 100644 Binary files a/docs/management/connectors/images/teams-params-test.png and b/docs/management/connectors/images/teams-params-test.png differ diff --git a/docs/management/connectors/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc index b7ae9feac2d6f..8f9536331bb1c 100644 --- a/docs/management/connectors/pre-configured-connectors.asciidoc +++ b/docs/management/connectors/pre-configured-connectors.asciidoc @@ -513,14 +513,19 @@ xpack.actions.preconfigured: jwtKeyId: fedcbazyxwvutsrqponmlkjihgfedcba <4> secrets: clientSecret: secretsecret <5> - privateKey: -----BEGIN RSA PRIVATE KEY-----\nprivatekeyhere\n-----END RSA PRIVATE KEY----- <6> + privateKey: | <6> + -----BEGIN RSA PRIVATE KEY----- + MIIE... + KAgD... + ... multiple lines of key data ... + -----END RSA PRIVATE KEY----- -- <1> Specifies whether the connector uses basic or OAuth authentication. <2> The user identifier. <3> The client identifier assigned to your OAuth application. <4> The key identifier assigned to the JWT verifier map of your OAuth application. <5> The client secret assigned to your OAuth application. -<6> The RSA private key. If it has a password, you must also provide `privateKeyPassword`. +<6> The RSA private key in multiline format. If it has a password, you must also provide `privateKeyPassword`. [float] [[preconfigured-servicenow-configuration]] @@ -563,14 +568,19 @@ xpack.actions.preconfigured: jwtKeyId: fedcbazyxwvutsrqponmlkjihgfedcba <4> secrets: clientSecret: secretsecret <5> - privateKey: -----BEGIN RSA PRIVATE KEY-----\nprivatekeyhere\n-----END RSA PRIVATE KEY----- <6> + privateKey: | <6> + -----BEGIN RSA PRIVATE KEY----- + MIIE... + KAgD... + ... multiple lines of key data ... + -----END RSA PRIVATE KEY----- -- <1> Specifies whether the connector uses basic or OAuth authentication. <2> The user identifier. <3> The client identifier assigned to your OAuth application. <4> The key ID assigned to the JWT verifier map of your OAuth application. <5> The client secret assigned to the OAuth application. -<6> The RSA private key. If it has a password, you must also provide `privateKeyPassword`. +<6> The RSA private key in multiline format. If it has a password, you must also provide `privateKeyPassword`. [float] [[preconfigured-servicenow-sir-configuration]] @@ -613,14 +623,19 @@ xpack.actions.preconfigured: jwtKeyId: fedcbazyxwvutsrqponmlkjihgfedcba <4> secrets: clientSecret: secretsecret <5> - privateKey: -----BEGIN RSA PRIVATE KEY-----\nprivatekeyhere\n-----END RSA PRIVATE KEY----- <6> + privateKey: | <6> + -----BEGIN RSA PRIVATE KEY----- + MIIE... + KAgD... + ... multiple lines of key data ... + -----END RSA PRIVATE KEY----- -- <1> Specifies whether the connector uses basic or OAuth authentication. <2> The user identifier. <3> The client identifier assigned to the OAuth application. <4> The key ID assigned to the JWT verifier map of your OAuth application. <5> The client secret assigned to the OAuth application. -<6> The RSA private key. If it has a password, you must also specify +<6> The RSA private key in multiline format. If it has a password, you must also specify `privateKeyPassword`. diff --git a/docs/management/maintenance-windows/maintenance-windows.asciidoc b/docs/management/maintenance-windows/maintenance-windows.asciidoc index 559151c060ed2..590f9d8da8838 100644 --- a/docs/management/maintenance-windows/maintenance-windows.asciidoc +++ b/docs/management/maintenance-windows/maintenance-windows.asciidoc @@ -46,7 +46,7 @@ image::images/create-maintenance-window.png[The Create Maintenance Window user i By default, maintenance windows affect all categories of rules. The category-specific maintenance window options alter this behavior. -For the definitive list of rule types in each category, refer to the <>. +For the definitive list of rule types in each category, refer to the {api-kibana}/group/endpoint-alerting[get rule types API]. If you turn on *Filter alerts*, you can use KQL to filter the alerts affected by the maintenance window: diff --git a/docs/management/managing-saved-objects.asciidoc b/docs/management/managing-saved-objects.asciidoc index 7fccd6c6c93f7..df96721205d59 100644 --- a/docs/management/managing-saved-objects.asciidoc +++ b/docs/management/managing-saved-objects.asciidoc @@ -41,8 +41,7 @@ Use import and export to move objects between different {kib} instances. These actions are useful when you have multiple environments for development and production. Import and export also work well when you have a large number of objects to update and want to batch the process. -{kib} also provides <> and -<> APIs to automate this process. +{kib} also provides import and export {api-kibana}/group/endpoint-saved-objects[saved objects APIs] to automate this process. [float] diff --git a/docs/management/saved-objects/saved-object-ids.asciidoc b/docs/management/saved-objects/saved-object-ids.asciidoc index 97ab0daa95343..181bf6ee97b03 100644 --- a/docs/management/saved-objects/saved-object-ids.asciidoc +++ b/docs/management/saved-objects/saved-object-ids.asciidoc @@ -77,13 +77,12 @@ be broken. For more information, refer to {kibana-ref-all}/8.0/release-notes-8.0 If you are using the saved objects APIs directly, you should be aware of these changes: -WARNING: Some of the saved objects APIs are deprecated in 8.7.0. For more information, refer to the <> +WARNING: Some of the saved objects APIs are deprecated in 8.7.0. For more information, refer to the <> -* When using the <> or <> API, you may encounter - <> that **cannot** be overridden using the `overwrite: true` +* When using the create or bulk create API, you may encounter conflict errors that **cannot** be overridden using the `overwrite: true` option. This can occur if there is already a saved object with this ID in a _different_ space, or if there is a legacy URL alias for this ID in the same space. -* When using the <> or <> API, objects can potentially be +* When using the import or copy to space API, objects can potentially be created with a different ID as described above. -* When using the <> API, if the saved object exists in multiple spaces, it can only be deleted by using the - <>. +* When using the delete API, if the saved object exists in multiple spaces, it can only be deleted by using the + `force` option. diff --git a/docs/maps/connect-to-ems.asciidoc b/docs/maps/connect-to-ems.asciidoc index 879d4846ef3f1..e41d544d64e4d 100644 --- a/docs/maps/connect-to-ems.asciidoc +++ b/docs/maps/connect-to-ems.asciidoc @@ -1,6 +1,6 @@ :ems: Elastic Maps Service -:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8 -:ems-docker-image: {ems-docker-repo}:{version} +:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server +:ems-docker-image: {ems-docker-repo}:{version}-amd64 :ems-headers-url: https://deployment-host [[maps-connect-to-ems]] @@ -195,7 +195,7 @@ One way to configure {hosted-ems} is to provide `elastic-maps-server.yml` via bi -------------------------------------------- version: '2' services: - {hosted-ems}: + ems-server: image: {ems-docker-image} volumes: - ./elastic-maps-server.yml:/usr/src/app/server/config/elastic-maps-server.yml @@ -214,7 +214,7 @@ These variables can be set with +docker-compose+ like this: ---------------------------------------------------------- version: '2' services: - {hosted-ems}: + ems-server: image: {ems-docker-image} environment: ELASTICSEARCH_HOST: http://elasticsearch.example.org diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index 06a2fc7886b58..5ffdbbcf76831 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -765,3 +765,372 @@ Refer to {observability-guide}/apm-agent-key-api.html[APM agent Key API]. Refer to {observability-guide}/apm-app-troubleshooting.html[Troubleshooting]. :!apm-docs-move-notice: + +[role="exclude",id="saved-objects-api-export"] +== Export objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-import"] +== Import objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-bulk-create"] +== Bulk create saved objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-bulk-delete"] +== Bulk delete object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-bulk-get"] +== Bulk get objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-bulk-resolve"] +== Bulk resolve objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-bulk-update"] +== Bulk update object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-create"] +== Create saved objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-delete"] +== Delete object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-find"] +== Find objects API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-get"] +== Get object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-resolve-import-errors"] +== Resolve import errors API + +[role="exclude",id="saved-objects-api-resolve"] +== Resolve object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-rotate-encryption-key"] +== Rotate encryption key API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="saved-objects-api-update"] +== Update object API + +Refer to {api-kibana}/group/endpoint-saved-objects[saved objects API]. + +[role="exclude",id="data-views-api-get-all"] +== Get all data views API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-runtime-field-api-create"] +== Create runtime field API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-runtime-field-api-delete"] +== Delete runtime field API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-runtime-field-api-get"] +== Get runtime field API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-runtime-field-api-update"] +== Update runtime field API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-runtime-field-api-upsert"] +== Upsert runtime field API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-create"] +== Create data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-default-get"] +== Get default data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-default-set"] +== Set default data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-delete"] +== Delete data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-get"] +== Get data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-swap-references-preview"] +== Swap references preview data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-swap-references"] +== Swap references data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-fields-api-update"] +== Update data view fields API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="data-views-api-update"] +== Update data view API + +Refer to {api-kibana}/group/endpoint-data-views[data views API]. + +[role="exclude",id="create-rule-api"] +== Create rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="delete-rule-api"] +== Delete rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="disable-rule-api"] +== Disable rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="enable-rule-api"] +== Enable rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="find-rules-api"] +== Find rules API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="get-rule-api"] +== Get rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="get-alerting-framework-health-api"] +== Get alerting framework health API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="list-rule-types-api"] +== Get rule types API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="mute-alert-api"] +== Mute alert API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="mute-all-alerts-api"] +== Mute all alerts API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="unmute-alert-api"] +== Unmute alert API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="unmute-all-alerts-api"] +== Unmute all alerts API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="update-rule-api"] +== Update rule API + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="alerts-api"] +== Deprecated 7.x APIs + +Refer to {api-kibana}/group/endpoint-alerting[alerting API]. + +[role="exclude",id="update-connector-api"] +== Update connector API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="list-connector-types-api"] +== List connector types API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="get-connector-api"] +== Get connector API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="get-all-connectors-api"] +== Get all connectors API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="execute-connector-api"] +== Run connector API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="delete-connector-api"] +== Delete connector API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="create-connector-api"] +== Create connector API + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="actions-and-connectors-legacy-apis"] +== Deprecated 7.x APIs + +Refer to {api-kibana}/group/endpoint-connectors[connectors API]. + +[role="exclude",id="cases-api-add-comment"] +== Add comment to case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-create"] +== Create case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-delete-cases"] +== Delete cases API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-delete-comments"] +== Delete comments from case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-find-case-activity"] +== Find case activity API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-find-cases"] +== Find cases API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-find-connectors"] +== Find connectors API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-alerts"] +== Get alerts attached to case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-case-activity"] +== Get case activity API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-case"] +== Get case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-cases-by-alert"] +== Get cases by alert API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-comments"] +== Get comments API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-get-configuration"] +== Get case configuration API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-reporters"] +== Get reporters API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-status"] +== Get case status API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-get-tag"] +== Get tags API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-push"] +== Push case API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-set-configuration"] +== Set case configuration API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-update-comment"] +== Update case comment API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-update-configuration"] +== Update case configuration API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="cases-api-update"] +== Update cases API + +Refer to {api-kibana}/group/endpoint-cases[cases API]. + +[role="exclude",id="machine-learning-api-sync"] +== Sync {ml} saved objects API + +Refer to {api-kibana}/group/endpoint-ml[machine learning APIs]. + diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index d41871917c4a1..c688f933b0ff1 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -67,7 +67,9 @@ xpack.actions.customHostSettings: certificateAuthoritiesFiles: [ 'one.crt' ] certificateAuthoritiesData: | -----BEGIN CERTIFICATE----- - ... multiple lines of certificate data here ... + MIIDTD... + CwUAMD... + ... multiple lines of certificate data ... -----END CERTIFICATE----- smtp: requireTLS: true @@ -125,9 +127,8 @@ A file name or list of file names of PEM-encoded certificate files to use to validate the server. `xpack.actions.customHostSettings[n].ssl.certificateAuthoritiesData` {ess-icon}:: -The contents of a PEM-encoded certificate file, or multiple files appended -into a single string. This configuration can be used for environments where -the files cannot be made available. +The contents of one or more PEM-encoded certificate files in multiline format. +This configuration can be used for environments where the files cannot be made available. [[action-config-email-domain-allowlist]] `xpack.actions.email.domain_allowlist` {ess-icon}:: A list of allowed email domains which can be used with the email connector. When this setting is not used, all email domains are allowed. When this setting is used, if any email is attempted to be sent that (a) includes an addressee with an email domain that is not in the allowlist, or (b) includes a from address domain that is not in the allowlist, it will fail with a message indicating the email is not allowed. diff --git a/docs/settings/apm-settings.asciidoc b/docs/settings/apm-settings.asciidoc index 3cd04a4ff3733..901988cf67c29 100644 --- a/docs/settings/apm-settings.asciidoc +++ b/docs/settings/apm-settings.asciidoc @@ -82,19 +82,19 @@ Sets a `fixed_interval` for date histograms in metrics aggregations. Defaults to Set to `false` to disable cloud APM migrations. Defaults to `true`. `xpack.apm.indices.error` {ess-icon}:: -Matcher for all error indices. Defaults to `logs-apm*,apm-*`. +Matcher for all error indices. Defaults to `logs-apm*,apm-*,traces-*.otel-*`. `xpack.apm.indices.onboarding` {ess-icon}:: Matcher for all onboarding indices. Defaults to `apm-*`. `xpack.apm.indices.span` {ess-icon}:: -Matcher for all span indices. Defaults to `traces-apm*,apm-*`. +Matcher for all span indices. Defaults to `traces-apm*,apm-*,traces-*.otel-*`. `xpack.apm.indices.transaction` {ess-icon}:: -Matcher for all transaction indices. Defaults to `traces-apm*,apm-*`. +Matcher for all transaction indices. Defaults to `traces-apm*,apm-*,traces-*.otel-*`. `xpack.apm.indices.metric` {ess-icon}:: -Matcher for all metrics indices. Defaults to `metrics-apm*,apm-*`. +Matcher for all metrics indices. Defaults to `metrics-apm*,apm-*,metrics-*.otel-*`. `xpack.apm.indices.sourcemap` {ess-icon}:: Matcher for all source map indices. Defaults to `apm-*`. diff --git a/docs/setup/configuring-reporting.asciidoc b/docs/setup/configuring-reporting.asciidoc index 946ec1145d010..041012c8dba85 100644 --- a/docs/setup/configuring-reporting.asciidoc +++ b/docs/setup/configuring-reporting.asciidoc @@ -214,13 +214,13 @@ If using PNG/PDF {report-features}, make sure the {kib} server operating system If you are using RHEL operating systems, install the following packages: -* `ipa-gothic-fonts` * `xorg-x11-fonts-100dpi` * `xorg-x11-fonts-75dpi` * `xorg-x11-utils` * `xorg-x11-fonts-cyrillic` * `xorg-x11-fonts-Type1` * `xorg-x11-fonts-misc` +* `vlgothic-fonts` * `fontconfig` * `freetype` diff --git a/docs/setup/install/targz.asciidoc b/docs/setup/install/targz.asciidoc index 2dd6058106a56..8560b9a0102dd 100644 --- a/docs/setup/install/targz.asciidoc +++ b/docs/setup/install/targz.asciidoc @@ -15,6 +15,10 @@ link:/downloads/kibana[Download Kibana] page. Other versions can be found on the link:/downloads/past-releases[Past Releases page]. +[NOTE] +==== +macOS is supported for development purposes only and is not covered under the support SLA for link:https://www.elastic.co/support/matrix#kibana[production-supported operating systems]. +==== [[install-linux64]] ==== Download and install the Linux 64-bit package diff --git a/docs/setup/upgrade/resolving-migration-failures.asciidoc b/docs/setup/upgrade/resolving-migration-failures.asciidoc index d81a577a19a88..596674237eb7a 100644 --- a/docs/setup/upgrade/resolving-migration-failures.asciidoc +++ b/docs/setup/upgrade/resolving-migration-failures.asciidoc @@ -18,24 +18,6 @@ When you address the root cause for the migration failure, {kib} automatically retries the migration. If you're unable to resolve a failed migration, contact Support. - -[float] -==== Known issues with {fleet} beta -If you see a`timeout_exception` or `receive_timeout_transport_exception` error, -it might be from a known known issue in 7.12.0 if you tried the {fleet} beta. -Upgrade migrations fail because of a large number of documents in the `.kibana` index, -which causes {kib} to log errors such as: - -[source,sh] --------------------------------------------- -Error: Unable to complete saved object migrations for the [.kibana] index. Please check the health of your Elasticsearch cluster and try again. Error: [receive_timeout_transport_exception]: [instance-0000000002][10.32.1.112:19541][cluster:monitor/task/get] request_id [2648] timed out after [59940ms] - -Error: Unable to complete saved object migrations for the [.kibana] index. Please check the health of your Elasticsearch cluster and try again. Error: [timeout_exception]: Timed out waiting for completion of [org.elasticsearch.index.reindex.BulkByScrollTask@6a74c54] --------------------------------------------- - -For instructions on how to mitigate the known issue, refer to https://github.com/elastic/kibana/issues/95321[the GitHub issue]. - - [float] ==== Corrupt saved objects To find and remedy problems caused by corrupt documents, we highly recommend testing your {kib} upgrade in a development cluster, @@ -56,7 +38,7 @@ To delete the documents that cause migrations to fail, take the following steps: . Create a role as follows: + -[source,sh] +[source,console] -------------------------------------------- PUT _security/role/grant_kibana_system_indices { @@ -76,7 +58,7 @@ PUT _security/role/grant_kibana_system_indices . Create a user with the role above and `superuser` built-in role: + -[source,sh] +[source,console] -------------------------------------------- POST /_security/user/temporarykibanasuperuser { @@ -87,7 +69,7 @@ POST /_security/user/temporarykibanasuperuser . Remove the write block which the migration system has placed on the previous index: + -[source,sh] +[source,console] -------------------------------------------- PUT .kibana_7.12.1_001/_settings { @@ -99,7 +81,7 @@ PUT .kibana_7.12.1_001/_settings . Delete the corrupt document: + -[source,sh] +[source,console] -------------------------------------------- DELETE .kibana_7.12.0_001/_doc/marketing_space:dashboard:e3c5fc71-ac71-4805-bcab-2bcc9cc93275 -------------------------------------------- @@ -185,7 +167,7 @@ The process is waiting for a yellow index status. There are two known causes: Before retrying the migration, inspect the output of the `_cluster/allocation/explain?index=${targetIndex}` API to identify why the index isn't yellow: -[source,sh] +[source,console] -------------------------------------------- GET _cluster/allocation/explain { @@ -220,7 +202,7 @@ Unable to complete saved object migrations for the [.kibana] index: [incompatibl -------------------------------------------- To get around the issue, remove the transient and persisted routing allocation settings: -[source,sh] +[source,console] -------------------------------------------- PUT /_cluster/settings { diff --git a/docs/user/alerting/alerting-setup.asciidoc b/docs/user/alerting/alerting-setup.asciidoc index cf1f84c9cc032..b3af9bfbe0303 100644 --- a/docs/user/alerting/alerting-setup.asciidoc +++ b/docs/user/alerting/alerting-setup.asciidoc @@ -54,12 +54,11 @@ To use {alert-features} in a {kib} app, you must have the appropriate feature pr |=== | Action | {kib} privileges -| Give full access to manage alerts, connectors, and rules in *{stack-manage-app}* or *Discover* +| Give full access to manage alerts, connectors, and rules in *{stack-manage-app}* a| * `All` for the *Management > {stack-rules-feature}* feature. * `All` for the *Management > Rules Settings* feature. * `All` for the *Management > {connectors-feature}* feature. -* `Read` index privileges for the `.alerts-*` system indices [NOTE] ==== @@ -77,12 +76,11 @@ For {observability} rules, you must have `all` privileges for the appropriate {o For Security rules, refer to {security-guide}/detections-permissions-section.html[Detections prerequisites and requirements]. ==== -| Give view-only access to alerts, connectors, and rules in *{stack-manage-app}* or *Discover* +| Give view-only access to alerts, connectors, and rules in *{stack-manage-app}* a| * `Read` for the *Management > {stack-rules-feature}* feature. * `Read` for the *Management > Rules Settings* feature. * `Read` for the *Management > {connectors-feature}* feature. -* `Read` index privileges for the `.alerts-*` system indices [NOTE] ==== @@ -93,12 +91,16 @@ For {observability} rules, you must have `read` privileges for the appropriate { For Security rules, refer to {security-guide}/detections-permissions-section.html[Detections prerequisites and requirements]. ==== -| Revoke all access to alerts, connectors, and rules in *{stack-manage-app}* or *Discover* +| Give view-only access to alerts in *Discover* or *Dashboards* +a| +* `Read` index privileges for the `.alerts-*` system indices. + +| Revoke all access to alerts, connectors, and rules in *{stack-manage-app}*, *Discover*, or *Dashboards* a| * `None` for the *Management > {stack-rules-feature}* feature. * `None` for the *Management > Rules Settings* feature. * `None` for the *Management > {connectors-feature}* feature. - +* No index privileges for the `.alerts-*` system indices. |=== For more information on configuring roles that provide access to features, go to <>. diff --git a/docs/user/alerting/alerting-troubleshooting.asciidoc b/docs/user/alerting/alerting-troubleshooting.asciidoc index 88b553c9064c1..a0bcd6dcea290 100644 --- a/docs/user/alerting/alerting-troubleshooting.asciidoc +++ b/docs/user/alerting/alerting-troubleshooting.asciidoc @@ -55,7 +55,7 @@ Diagnosing these may be difficult - but there may be log messages for error cond === Use the REST APIs There is a rich set of HTTP endpoints to introspect and manage rules and connectors. -One of the HTTP endpoints available for actions is the <>. You can use this to “test” an action. For instance, if you have a server log action created, you can run it via curling the endpoint: +One of the HTTP endpoints available for actions is the run connector API. You can use this to “test” an action. For instance, if you have a server log action created, you can run it via curling the endpoint: [source, txt] -------------------------------------------------- curl -X POST -k \ @@ -219,8 +219,7 @@ the {kib} {alert-features}: If you create a rule in the {observability} or {security-app}, its alerts are not visible in *{stack-manage-app} > {rules-ui}*. You can view them only in the -{kib} app where you created the rule. If you use the -<>, the visibility of the alerts is related to +{kib} app where you created the rule. If you use the create rule API, the visibility of the alerts is related to the `consumer` property. include::troubleshooting/alerting-common-issues.asciidoc[] diff --git a/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc b/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc index b7d9ba5168d11..1f5ee61167041 100644 --- a/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc +++ b/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc @@ -239,7 +239,7 @@ This query returns the following: <1> Most run durations fall within the first bucket (0 - 1 seconds). <2> A single rule with id `41893910-6bca-11eb-9e0d-85d233e3ee35` took between 30 and 31 seconds to run. -Use the <> to retrieve additional information about rules that take a long time to run. +Use the get rule API to retrieve additional information about rules that take a long time to run. [float] [[rule-cannot-decrypt-api-key]] diff --git a/docs/user/api.asciidoc b/docs/user/api.asciidoc index 0309fe720c333..03ad9763fb438 100644 --- a/docs/user/api.asciidoc +++ b/docs/user/api.asciidoc @@ -5,6 +5,8 @@ Some {kib} features are provided via a REST API, which is ideal for creating an integration with {kib}, or automating certain aspects of configuring and deploying {kib}. +NOTE: For the latest details, refer to {api-kibana}[{kib} API]. + [float] [[using-apis]] == Using the APIs diff --git a/docs/user/dashboard/dashboard.asciidoc b/docs/user/dashboard/dashboard.asciidoc index 36dce0e2586e5..d597cf135f396 100644 --- a/docs/user/dashboard/dashboard.asciidoc +++ b/docs/user/dashboard/dashboard.asciidoc @@ -442,7 +442,7 @@ To share the dashboard with a larger audience, click *Share* in the toolbar. For [[import-dashboards]] == Export dashboards -To automate {kib}, you can export dashboards as NDJSON using the <>. It is important to export dashboards with all necessary references. +To automate {kib}, you can export dashboards as NDJSON using the {api-kibana}/group/endpoint-saved-objects[Export saved objects API]. It is important to export dashboards with all necessary references. -- include::tutorial-create-a-dashboard-of-lens-panels.asciidoc[] diff --git a/docs/user/reporting/reporting-csv-limitations.asciidoc b/docs/user/reporting/reporting-csv-limitations.asciidoc index 253d6e4d75157..277b720e21be1 100644 --- a/docs/user/reporting/reporting-csv-limitations.asciidoc +++ b/docs/user/reporting/reporting-csv-limitations.asciidoc @@ -7,4 +7,8 @@ We recommend using CSV reports to export moderate amounts of data only. The feat - Cross-cluster search is used - ES|QL is used and result row count exceeds the limits of ES|QL queries -To work around the limitations, use filters to create multiple smaller reports, or extract the data you need directly with the Elasticsearch APIs. See {ref}/scroll-api.html[Scroll API], {ref}/point-in-time-api.html[Point in time API], {ref}/esql-rest.html[ES|QL] or {ref}/sql-rest-format.html#_csv[SQL] with CSV response data format. <> can be adjusted to overcome some of these limiting scenarios. Results are dependent on data size, availability, and latency factors and are not guaranteed. \ No newline at end of file +To work around the limitations, use filters to create multiple smaller reports, or extract the data you need directly with the Elasticsearch APIs. + +For more information on using Elasticsearch APIs directly, see {ref}/scroll-api.html[Scroll API], {ref}/point-in-time-api.html[Point in time API], {ref}/esql-rest.html[ES|QL] or {ref}/sql-rest-format.html#_csv[SQL] with CSV response data format. We recommend that you use an official Elastic language client: 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]. + +<> can be adjusted to overcome some of these limiting scenarios. Results are dependent on data size, availability, and latency factors and are not guaranteed. \ No newline at end of file diff --git a/docs/user/reporting/response-codes.asciidoc b/docs/user/reporting/response-codes.asciidoc index 24a12a3de93a5..0b60fac63dc4b 100644 --- a/docs/user/reporting/response-codes.asciidoc +++ b/docs/user/reporting/response-codes.asciidoc @@ -1,5 +1,7 @@ -The reporting APIs use HTTP response codes to give feedback. In automation, -this helps external systems track the various possible job states: +The response payload of a request to generate a report includes the path to +download a report. The API to download a report uses HTTP response codes to give +feedback. In automation, this helps external systems track the various possible +job states: - **`200` (OK)**: As expected, Kibana returns `200` status in the response for successful requests to queue or download reports. diff --git a/docs/user/security/secure-saved-objects.asciidoc b/docs/user/security/secure-saved-objects.asciidoc index d83a8ec0a23ea..b6c26a9e4ee12 100644 --- a/docs/user/security/secure-saved-objects.asciidoc +++ b/docs/user/security/secure-saved-objects.asciidoc @@ -29,7 +29,7 @@ For help generating the encryption key, refer to the <>. +When you change an encryption key, be sure to keep the old one for some time. Although {kib} only uses a new encryption key to encrypt all new and updated data, it still may need the old one to decrypt data that was encrypted using the old key. It's possible to have multiple old keys used only for decryption. {kib} doesn't automatically re-encrypt existing saved objects with the new encryption key. Re-encryption only happens when you update existing object or use the {api-kibana}/group/endpoint-saved-objects[rotate encryption key API]. Here is how your `kibana.yml` might look if you use key rotation functionality: @@ -49,7 +49,7 @@ xpack.encryptedSavedObjects: You might also leverage this functionality if multiple {kib} instances connected to the same {es} cluster use different encryption keys. In this case, you might have a mix of saved objects encrypted with different keys, and every {kib} instance can only deal with a specific subset of objects. To fix this, you must choose a single primary encryption key for `xpack.encryptedSavedObjects.encryptionKey`, move all other encryption keys to `xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys`, and sync this configuration across all {kib} instances. ============================================================================ -At some point, you might want to dispose of old encryption keys completely. Make sure there are no saved objects that {kib} encrypted with these encryption keys. You can use the <> to determine which existing saved objects require decryption-only keys and re-encrypt them with the primary key. +At some point, you might want to dispose of old encryption keys completely. Make sure there are no saved objects that {kib} encrypted with these encryption keys. You can use the {api-kibana}/group/endpoint-saved-objects[rotate encryption key API] to determine which existing saved objects require decryption-only keys and re-encrypt them with the primary key. [[encryption-key-docker-configuration]] ==== Docker configuration diff --git a/docs/user/whats-new.asciidoc b/docs/user/whats-new.asciidoc index 3410a889c8f26..2a726ba3dc4f3 100644 --- a/docs/user/whats-new.asciidoc +++ b/docs/user/whats-new.asciidoc @@ -7,28 +7,44 @@ check the <>. Previous versions: {kibana-ref-all}/8.14/whats-new.html[8.14] | {kibana-ref-all}/8.13/whats-new.html[8.13] | {kibana-ref-all}/8.12/whats-new.html[8.12] | {kibana-ref-all}/8.11/whats-new.html[8.11] | {kibana-ref-all}/8.10/whats-new.html[8.10] | {kibana-ref-all}/8.9/whats-new.html[8.9] | {kibana-ref-all}/8.8/whats-new.html[8.8] | {kibana-ref-all}/8.7/whats-new.html[8.7] | {kibana-ref-all}/8.6/whats-new.html[8.6] | {kibana-ref-all}/8.5/whats-new.html[8.5] | {kibana-ref-all}/8.4/whats-new.html[8.4] | {kibana-ref-all}/8.3/whats-new.html[8.3] | {kibana-ref-all}/8.2/whats-new.html[8.2] | {kibana-ref-all}/8.1/whats-new.html[8.1] | {kibana-ref-all}/8.0/whats-new.html[8.0] - [discrete] -=== Analyst Experience +=== ES|QL [discrete] -==== View dashboard creator and last editor +==== Filter UX improvements in ES|QL -You can now see who created and who last updated a dashboard. +We're thrilled to unveil a complete overhaul of filtering in the ES|QL UX. Now, you can seamlessly filter data by browsing a time series chart, allowing for quick and intuitive time-based filtering. Interactive chart filtering lets you refine your data directly by clicking on any chart, while creating WHERE clause filters from the Discover table or sidebar has never been easier. These enhancements streamline data exploration and analysis, making your ES|QL experience more efficient and user-friendly than ever. -You can find the creator information right from the dashboard list. +*Filter by clicking a chart:* -image::images/dashboard-creator.png[Dashboard creator column in dashboard list] +image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt965a5190f246f7c8/669a7d41e5f7c84793b031cb/filter-by-clicking-chart.gif[Filter by clicking a chart] -Quickly find all dashboards created by the same user with a simple filter. +*Filter by browsing a time series chart:* -image::images/dashboard-creator-filter.png[Filtering dashboards by creator] +image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blta20c9a93dded707c/669a7d40843f93a02fe51013/filter-by-brushing-time-series.gif[Filter by browsing a time series chart] -Note that the creator information will be visible only for dashboards created on or after version 8.14. +*Create WHERE clause filters from Discover table or sidebar:* -You can also see who last updated a dashboard by clicking the dashboard information icon from the dashboard list. The creator is also visible next to it. This information is immutable and cannot be changed. +image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt50ac35ab3af29ff8/669a7d4006a6fafe4c7cb39d/create-where-clause-filters-from-sidebar.gif[Create WHERE clause filters from Discover table or sidebar] + + +[discrete] +==== Field statistics in ES|QL + +Field statistics are now available in ES|QL. This feature is designed to provide comprehensive insights for each data field. With this enhancement, you can access detailed statistics such as distributions, averages, and other key metrics, helping you quickly understand your data. This makes data exploration and quality assessment more efficient, providing deeper insights and streamlining the analysis of field-level data in ES|QL. + +image::images/field-statistics-esql.png[Field statistics in ES|QL] + +[discrete] +==== Integrations support in the ES|QL editor when using FROM command. + +We're excited to announce enhanced support for integrations in the ES|QL editor with the *FROM* command. Previously, you could only access indices, but now you can also view a list of installed integrations directly within the editor. This improvement streamlines your workflow, making it easier to manage and utilize various integrations while working with your data. + +image::images/integrations-in-esql.png[Accessing an integration from ES|QL] -image::images/dashboard-last-editor.png[Dashboard details panel with the name of the last editor] + +[discrete] +=== Dashboards [discrete] ==== Field statistics in Dashboards @@ -48,50 +64,36 @@ You can find the option to select statistics for your legends along with an expl image::images/statistics-in-legends2.png[Select statistics in legends] -[discrete] -==== Array of values for Metrics - -The new **Metrics** now supports fields that show an array of values. - -image::images/array-in-metrics.png[A metric showing an array of values, width=35%] [discrete] -==== Push flyout for Discover document viewer +==== View dashboard creator and last editor -You can now seamlessly view document details and the main table simultaneously in **Discover** with the new _push_ flyout. You can adjust the width of the flyout to suit your needs and explore your data much more easily. +You can now see who created and who last updated a dashboard. -image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltb40a408acf4ab688/669a58ea9fecd85219d58ed2/discover-push-flyout.gif[Resizable push flyout in Discover] +You can find the creator information right from the dashboard list. -[discrete] -==== Integrations support in the ES|QL editor when using FROM command. +image::images/dashboard-creator.png[Dashboard creator column in dashboard list] -We're excited to announce enhanced support for integrations in the ES|QL editor with the *FROM* command. Previously, you could only access indices, but now you can also view a list of installed integrations directly within the editor. This improvement streamlines your workflow, making it easier to manage and utilize various integrations while working with your data. +Quickly find all dashboards created by the same user with a simple filter. -image::images/integrations-in-esql.png[Accessing an integration from ES|QL] +image::images/dashboard-creator-filter.png[Filtering dashboards by creator] -[discrete] -==== Field statistics in ES|QL +Note that the creator information will be visible only for dashboards created on or after version 8.14. -Field statistics are now available in ES|QL. This feature is designed to provide comprehensive insights for each data field. With this enhancement, you can access detailed statistics such as distributions, averages, and other key metrics, helping you quickly understand your data. This makes data exploration and quality assessment more efficient, providing deeper insights and streamlining the analysis of field-level data in ES|QL. +You can also see who last updated a dashboard by clicking the dashboard information icon from the dashboard list. The creator is also visible next to it. This information is immutable and cannot be changed. -image::images/field-statistics-esql.png[Field statistics in ES|QL] +image::images/dashboard-last-editor.png[Dashboard details panel with the name of the last editor] [discrete] -==== Filter UX improvements in ES|QL - -We're thrilled to unveil a complete overhaul of filtering in the ES|QL UX. Now, you can seamlessly filter data by browsing a time series chart, allowing for quick and intuitive time-based filtering. Interactive chart filtering lets you refine your data directly by clicking on any chart, while creating WHERE clause filters from the Discover table or sidebar has never been easier. These enhancements streamline data exploration and analysis, making your ES|QL experience more efficient and user-friendly than ever. +=== Discover -*Filter by clicking a chart:* - -image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt965a5190f246f7c8/669a7d41e5f7c84793b031cb/filter-by-clicking-chart.gif[Filter by clicking a chart] - -*Filter by browsing a time series chart:* +[discrete] +==== Push flyout for Discover document viewer -image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blta20c9a93dded707c/669a7d40843f93a02fe51013/filter-by-brushing-time-series.gif[Filter by browsing a time series chart] +You can now seamlessly view document details and the main table simultaneously in **Discover** with the new _push_ flyout. You can adjust the width of the flyout to suit your needs and explore your data much more easily. -*Create WHERE clause filters from Discover table or sidebar:* +image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltb40a408acf4ab688/669a58ea9fecd85219d58ed2/discover-push-flyout.gif[Resizable push flyout in Discover] -image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt50ac35ab3af29ff8/669a7d4006a6fafe4c7cb39d/create-where-clause-filters-from-sidebar.gif[Create WHERE clause filters from Discover table or sidebar] [discrete] === Alerting, cases, and connectors @@ -134,20 +136,6 @@ Analyze large volumes of logs efficiently, in very short times with Log Pattern image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt7e63d7e764ab183e/669a807bd316c7015db35458/ml-log-pattern-analysis.gif[New log pattern analysis interface] -[discrete] -==== ES|QL support for field statistics in Discover - -The Field statistics functionality now supports ES|QL, Elastic's primary query language. - -image::images/esql-field-statistics.png[Field statistics in ES|QL] - -[discrete] -==== Field statistics embeddable panel in Dashboards - -You can now add field statistics panels with ES|QL support straight within your dashboards, eliminating the need to transition between **Discover** and **Dashboards**. - -image::images/field-statistics-panel-in-dashboards.png[Field statistics embeddable panel in Dashboards] - [discrete] ==== Log Rate Analysis contextual insights in serverless Observability @@ -156,42 +144,31 @@ You can now see insights in natural language, for example for the root cause of image::images/obs-log-rate-analysis-insigths.png[Log Rate Analysis contextual insights in serverless Observability] [discrete] -==== Anthropic integration with the Inference API +==== Inference API improvements -The inference API provides a seamless, intuitive interface to perform inference and other tasks against proprietary, hosted, and integrated external services. In 8.15, we're extending it to support Anthropic's chat completion API. +The inference API provides a seamless, intuitive interface to perform inference and other tasks against proprietary, hosted, and integrated external services. In 8.15, we're extending it with the following capabilities: -[discrete] -==== Support for reranking with the Inference API +* Support for Anthropic's chat completion API. +* Ability to host cross encoder models and perform the reranking task. -In 8.15, we're also extending the inference API with the ability to host cross encoder models in Elastic and perform the reranking task. [discrete] -=== Global Experience +=== Managing {kib} users and objects [discrete] -==== Simplified Sharing +==== Sharing improvements -You can now share a dashboard, search, or lens object in one click. When sharing an object, the most common actions are directly presented to you, and a short link is automatically generated, making it simpler than ever to share your work. +You can now share a dashboard, search, or Lens object in one click. When sharing an object, the most common actions are directly presented to you, and a short link is automatically generated, making it simpler than ever to share your work. image::images/share-modal.png[New object share modal, width=50%] [discrete] -==== “My dashboards” filter - -The days of manually scrolling through an endless list of dashboards are behind you. You can now filter by creator to go directly to the dashboards created by a specific teammate. - -NOTE: Only dashboards created on or after 8.14 will have a creator. - -[discrete] -==== Quick API keys +==== Quick API key creation Many API keys don’t require custom settings, so we made it simple to generate a standard key. From the **Endpoints & API keys** top menu in Search, you can create a key in seconds. image::images/create-simple-api-key.png[Shortcut to create an API key, width=60%] -[discrete] -=== Platform Security - [discrete] ==== Filtering by User in Kibana Audit Logs diff --git a/examples/controls_example/public/app/react_control_example/react_control_example.tsx b/examples/controls_example/public/app/react_control_example/react_control_example.tsx index 690c33d0aad97..4ed6703c46c84 100644 --- a/examples/controls_example/public/app/react_control_example/react_control_example.tsx +++ b/examples/controls_example/public/app/react_control_example/react_control_example.tsx @@ -139,7 +139,6 @@ export const ReactControlExample = ({ addNewPanel: () => { return Promise.resolve(undefined); }, - lastUsedDataViewId: new BehaviorSubject(WEB_LOGS_DATA_VIEW_ID), saveNotification$, reload$, }; @@ -219,6 +218,19 @@ export const ReactControlExample = ({ }; }, [controlGroupApi, timeslice$]); + const [hasControls, setHasControls] = useState(false); + useEffect(() => { + if (!controlGroupApi) { + return; + } + const subscription = controlGroupApi.children$.subscribe((children) => { + setHasControls(Object.keys(children).length > 0); + }); + return () => { + subscription.unsubscribe(); + }; + }, [controlGroupApi]); + useEffect(() => { const subscription = combineLatest([controlGroupFilters$, unifiedSearchFilters$]).subscribe( ([controlGroupFilters, unifiedSearchFilters]) => { @@ -389,7 +401,7 @@ export const ReactControlExample = ({ reload$.next(); }} /> - + {hasControls && } { dashboardApi?.setChild(api); @@ -402,6 +414,7 @@ export const ReactControlExample = ({ getSerializedStateForChild: getControlGroupSerializedState, getRuntimeStateForChild: getControlGroupRuntimeState, })} + panelProps={{ hideLoader: true }} key={`control_group`} /> diff --git a/examples/grid_example/README.md b/examples/grid_example/README.md new file mode 100644 index 0000000000000..91b0ea05b79de --- /dev/null +++ b/examples/grid_example/README.md @@ -0,0 +1,3 @@ +# Grid Example + +This plugin is a playground and learning tool that demonstrates the Dashboard layout engine. diff --git a/examples/grid_example/kibana.jsonc b/examples/grid_example/kibana.jsonc new file mode 100644 index 0000000000000..ecaae63268e7a --- /dev/null +++ b/examples/grid_example/kibana.jsonc @@ -0,0 +1,13 @@ +{ + "type": "plugin", + "id": "@kbn/grid-example-plugin", + "owner": "@elastic/kibana-presentation", + "description": "Temporary example app used to build out the new Dashboard layout system", + "plugin": { + "id": "gridExample", + "server": false, + "browser": true, + "requiredPlugins": ["developerExamples"], + "requiredBundles": [] + } +} diff --git a/examples/grid_example/public/app.tsx b/examples/grid_example/public/app.tsx new file mode 100644 index 0000000000000..c10d740b8dc3f --- /dev/null +++ b/examples/grid_example/public/app.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 from 'react'; +import ReactDOM from 'react-dom'; +import { GridLayout, type GridLayoutData } from '@kbn/grid-layout'; +import { AppMountParameters } from '@kbn/core-application-browser'; +import { EuiPageTemplate, EuiProvider } from '@elastic/eui'; + +export const GridExample = () => { + return ( + + + + + { + return
{id}
; + }} + getCreationOptions={() => { + const initialLayout: GridLayoutData = [ + { + title: 'Large section', + isCollapsed: false, + panels: { + panel1: { column: 0, row: 0, width: 12, height: 6, id: 'panel1' }, + panel2: { column: 0, row: 6, width: 8, height: 4, id: 'panel2' }, + panel3: { column: 8, row: 6, width: 12, height: 4, id: 'panel3' }, + panel4: { column: 0, row: 10, width: 48, height: 4, id: 'panel4' }, + panel5: { column: 12, row: 0, width: 36, height: 6, id: 'panel5' }, + panel6: { column: 24, row: 6, width: 24, height: 4, id: 'panel6' }, + panel7: { column: 20, row: 6, width: 4, height: 2, id: 'panel7' }, + panel8: { column: 20, row: 8, width: 4, height: 2, id: 'panel8' }, + }, + }, + { + title: 'Small section', + isCollapsed: false, + panels: { panel9: { column: 0, row: 0, width: 12, height: 16, id: 'panel9' } }, + }, + { + title: 'Another small section', + isCollapsed: false, + panels: { panel10: { column: 24, row: 0, width: 12, height: 6, id: 'panel10' } }, + }, + ]; + + return { + gridSettings: { gutterSize: 8, rowHeight: 26, columnCount: 48 }, + initialLayout, + }; + }} + /> +
+
+
+ ); +}; + +export const renderGridExampleApp = (element: AppMountParameters['element']) => { + ReactDOM.render(, element); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/examples/grid_example/public/index.ts b/examples/grid_example/public/index.ts new file mode 100644 index 0000000000000..b1c5644c055d4 --- /dev/null +++ b/examples/grid_example/public/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. + */ + +import { GridExamplePlugin } from './plugin'; + +export const plugin = () => new GridExamplePlugin(); diff --git a/examples/grid_example/public/plugin.ts b/examples/grid_example/public/plugin.ts new file mode 100644 index 0000000000000..a4245bab8fd76 --- /dev/null +++ b/examples/grid_example/public/plugin.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; + +export const GRID_EXAMPLE_APP_ID = 'gridExample'; +const gridExampleTitle = 'Grid Example'; + +interface GridExamplePluginSetupDependencies { + developerExamples: DeveloperExamplesSetup; +} + +export class GridExamplePlugin + implements Plugin +{ + public setup(core: CoreSetup<{}>, { developerExamples }: GridExamplePluginSetupDependencies) { + core.application.register({ + id: GRID_EXAMPLE_APP_ID, + title: gridExampleTitle, + visibleIn: [], + async mount(params: AppMountParameters) { + const { renderGridExampleApp } = await import('./app'); + return renderGridExampleApp(params.element); + }, + }); + developerExamples.register({ + appId: GRID_EXAMPLE_APP_ID, + title: gridExampleTitle, + description: `A playground and learning tool that demonstrates the Dashboard layout engine.`, + }); + } + + public start(core: CoreStart, deps: {}) {} + + public stop() {} +} diff --git a/examples/grid_example/tsconfig.json b/examples/grid_example/tsconfig.json new file mode 100644 index 0000000000000..23be45a74c2f7 --- /dev/null +++ b/examples/grid_example/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["index.ts", "public/**/*.ts", "public/**/*.tsx", "../../typings/**/*"], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/grid-layout", + "@kbn/core-application-browser", + "@kbn/core", + "@kbn/developer-examples-plugin", + ] +} diff --git a/fleet_packages.json b/fleet_packages.json index 1217c4f2ec861..4ff38b376c6f9 100644 --- a/fleet_packages.json +++ b/fleet_packages.json @@ -30,11 +30,11 @@ }, { "name": "elastic_agent", - "version": "2.0.2" + "version": "2.0.3" }, { "name": "endpoint", - "version": "8.15.0" + "version": "8.15.1" }, { "name": "fleet_server", @@ -56,6 +56,6 @@ }, { "name": "security_detection_engine", - "version": "8.15.2" + "version": "8.15.3" } ] \ No newline at end of file diff --git a/oas_docs/.spectral.yaml b/oas_docs/.spectral.yaml index ec05decbc1fe4..a3e5a469bc63b 100644 --- a/oas_docs/.spectral.yaml +++ b/oas_docs/.spectral.yaml @@ -16,14 +16,17 @@ rules: # Operations operation-operationId: error operation-operationId-unique: error - operation-operationId-valid-in-url: error + operation-operationId-valid-in-url: false operation-tag-defined: warn operation-tags: warn + # Parameters + # Lower severity to allow optional path parameters + path-params: warn # Responses operation-success-response: warn # Schema - oas3-schema: error - oas2-schema: error + oas3-schema: warn + oas2-schema: warn array-items: false # Bump.sh handles $ref siblings. Documentation wise it's convenient to have properties like descriptions next to $ref. no-$ref-siblings: off @@ -44,6 +47,14 @@ rules: function: pattern functionOptions: notMatch: /(blacklist|whitelist|execute|kill)/i + property-description: + description: Properties should have descriptions. + message: "Each property should have a description" + severity: warn + given: $.components.schemas.*.properties.* + then: + field: description + function: defined # Examples operation-success-examples: formats: ['oas3_1'] @@ -69,13 +80,13 @@ rules: message: 'Each operation should have a summary' severity: error recommended: true - given: $.paths[*][*] + given: $.paths[*][get,put,post,delete,options,head,patch,trace] then: field: summary function: defined operation-summary-length: description: Operation summary should be between 5 and 45 characters - given: '$.paths[*][*]' + given: '$.paths[*][get,put,post,delete,options,head,patch,trace]' then: field: summary function: length diff --git a/oas_docs/README.md b/oas_docs/README.md index 2e11c838241a9..f5317ed084893 100644 --- a/oas_docs/README.md +++ b/oas_docs/README.md @@ -1,8 +1,9 @@ The `bundle.json` and `bundle.serverless.json` files are generated automatically. See `node scripts/capture_oas_snapshot --help` for more info. -The `output/kibana.serverless.yaml` file is a temporary OpenAPI document created by joining some manually-maintained files. -To create it and lint it, run `make api-docs` or `make api-docs-serverless` and `make api-docs-lint` or `make api-docs-lint-serverless`. +The `output/kibana.serverless.yaml` and `output/kibana.yaml` files join some manually-maintained files with the automatically generated files. +To add integrate more files into this bundle, edit the appropriate `oas_docs/scripts/merge*.js` files. +To generate the bundled files, run `make api-docs` (or `make api-docs-serverless` and `make api-docs-stateful`). +To lint them, run `make api-docs-lint` (or `make api-docs-lint-serverless` and `make api-lint-stateful`). -The `output/kibana.yaml` file is a temporary OpenAPI document created by joining some manually-maintained files. -To create it and lint it, run `make api-docs` or `make api-docs-stateful` and `make api-docs-lint` or `make api-docs-lint-stateful`. \ No newline at end of file +To apply some overlays that perform some post-processing and append some content, run `make api-docs-overlay`. \ No newline at end of file diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 3c6756b1da369..1f5b3e095ea7a 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -344,9 +344,4725 @@ }, "openapi": "3.0.0", "paths": { + "/api/alerting/rule/{id}": { + "delete": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a rule", + "tags": [ + "alerting" + ] + }, + "get": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Get rule details", + "tags": [ + "alerting" + ] + }, + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%3F%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule. If it is omitted, an ID is randomly generated.", + "in": "path", + "name": "id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "default": [], + "items": { + "additionalProperties": false, + "description": "An action that runs under defined conditions.", + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "description": "Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day.", + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "enabled": { + "default": true, + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "name": { + "description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.", + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "schedule": { + "additionalProperties": false, + "description": "The check interval, which specifies how frequently the rule conditions are checked.", + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "tags": { + "default": [], + "description": "The tags for the rule.", + "items": { + "type": "string" + }, + "type": "array" + }, + "throttle": { + "description": "Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "name", + "rule_type_id", + "consumer", + "schedule" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Create a rule", + "tags": [ + "alerting" + ] + }, + "put": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "default": [], + "items": { + "additionalProperties": false, + "description": "An action that runs under defined conditions.", + "properties": { + "alerts_filter": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "description": "Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day.", + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "name": { + "description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.", + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "tags": { + "default": [], + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "description": "Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "name", + "schedule" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Update a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_disable": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_disable#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "untrack": { + "description": "Defines whether this rule's alerts should be untracked.", + "type": "boolean" + } + }, + "type": "object", + "x-oas-optional": true + } + } + } + }, + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Disable a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_enable": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_enable#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Enable a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_mute_all": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_mute_all#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Mute all alerts", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_unmute_all": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_unmute_all#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Unmute all alerts", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_update_api_key": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_update_api_key#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Update the API key for a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_mute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The identifier for the alert.", + "in": "path", + "name": "alert_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Mute an alert", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_unmute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The identifier for the alert.", + "in": "path", + "name": "alert_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Unmute an alert", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rules/_find": { + "get": { + "operationId": "%2Fapi%2Falerting%2Frules%2F_find#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "The number of rules to return per page.", + "in": "query", + "name": "per_page", + "required": false, + "schema": { + "default": 10, + "minimum": 0, + "type": "number" + } + }, + { + "description": "The page number to return.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "number" + } + }, + { + "description": "An Elasticsearch simple_query_string query that filters the objects in the response.", + "in": "query", + "name": "search", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The default operator to use for the simple_query_string.", + "in": "query", + "name": "default_search_operator", + "required": false, + "schema": { + "default": "OR", + "enum": [ + "OR", + "AND" + ], + "type": "string" + } + }, + { + "description": "The fields to perform the simple_query_string parsed query against.", + "in": "query", + "name": "search_fields", + "required": false, + "schema": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + } + ] + } + }, + { + "description": "Determines which field is used to sort the results. The field must exist in the `attributes` key of the response.", + "in": "query", + "name": "sort_field", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Determines the sort order.", + "in": "query", + "name": "sort_order", + "required": false, + "schema": { + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Filters the rules that have a relation with the reference objects with a specific type and identifier.", + "in": "query", + "name": "has_reference", + "required": false, + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type", + "id" + ], + "type": "object" + } + }, + { + "in": "query", + "name": "fields", + "required": false, + "schema": { + "items": { + "description": "The fields to return in the `attributes` key of the response.", + "type": "string" + }, + "type": "array" + } + }, + { + "description": "A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`.", + "in": "query", + "name": "filter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "filter_consumers", + "required": false, + "schema": { + "items": { + "description": "List of consumers to filter.", + "type": "string" + }, + "type": "array" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Get information about rules", + "tags": [ + "alerting" + ] + } + }, "/api/status": { "get": { - "operationId": "/api/status#0", + "operationId": "%2Fapi%2Fstatus#0", "parameters": [ { "description": "The version of the API to use", @@ -435,6 +5151,9 @@ } ], "tags": [ + { + "name": "alerting" + }, { "name": "system" } diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 3c6756b1da369..1f5b3e095ea7a 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -344,9 +344,4725 @@ }, "openapi": "3.0.0", "paths": { + "/api/alerting/rule/{id}": { + "delete": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a rule", + "tags": [ + "alerting" + ] + }, + "get": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Get rule details", + "tags": [ + "alerting" + ] + }, + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%3F%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule. If it is omitted, an ID is randomly generated.", + "in": "path", + "name": "id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "default": [], + "items": { + "additionalProperties": false, + "description": "An action that runs under defined conditions.", + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "description": "Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day.", + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "enabled": { + "default": true, + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "name": { + "description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.", + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "schedule": { + "additionalProperties": false, + "description": "The check interval, which specifies how frequently the rule conditions are checked.", + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "tags": { + "default": [], + "description": "The tags for the rule.", + "items": { + "type": "string" + }, + "type": "array" + }, + "throttle": { + "description": "Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "name", + "rule_type_id", + "consumer", + "schedule" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Create a rule", + "tags": [ + "alerting" + ] + }, + "put": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "default": [], + "items": { + "additionalProperties": false, + "description": "An action that runs under defined conditions.", + "properties": { + "alerts_filter": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "description": "Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day.", + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "name": { + "description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.", + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "default": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "tags": { + "default": [], + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "description": "Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "name", + "schedule" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Update a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_disable": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_disable#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "untrack": { + "description": "Defines whether this rule's alerts should be untracked.", + "type": "boolean" + } + }, + "type": "object", + "x-oas-optional": true + } + } + } + }, + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Disable a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_enable": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_enable#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Enable a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_mute_all": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_mute_all#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Mute all alerts", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_unmute_all": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_unmute_all#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Unmute all alerts", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{id}/_update_api_key": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_update_api_key#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Update the API key for a rule", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_mute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The identifier for the alert.", + "in": "path", + "name": "alert_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Mute an alert", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute": { + "post": { + "operationId": "%2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_unmute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "The identifier for the rule.", + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The identifier for the alert.", + "in": "path", + "name": "alert_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Unmute an alert", + "tags": [ + "alerting" + ] + } + }, + "/api/alerting/rules/_find": { + "get": { + "operationId": "%2Fapi%2Falerting%2Frules%2F_find#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "The number of rules to return per page.", + "in": "query", + "name": "per_page", + "required": false, + "schema": { + "default": 10, + "minimum": 0, + "type": "number" + } + }, + { + "description": "The page number to return.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "number" + } + }, + { + "description": "An Elasticsearch simple_query_string query that filters the objects in the response.", + "in": "query", + "name": "search", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The default operator to use for the simple_query_string.", + "in": "query", + "name": "default_search_operator", + "required": false, + "schema": { + "default": "OR", + "enum": [ + "OR", + "AND" + ], + "type": "string" + } + }, + { + "description": "The fields to perform the simple_query_string parsed query against.", + "in": "query", + "name": "search_fields", + "required": false, + "schema": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + } + ] + } + }, + { + "description": "Determines which field is used to sort the results. The field must exist in the `attributes` key of the response.", + "in": "query", + "name": "sort_field", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Determines the sort order.", + "in": "query", + "name": "sort_order", + "required": false, + "schema": { + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Filters the rules that have a relation with the reference objects with a specific type and identifier.", + "in": "query", + "name": "has_reference", + "required": false, + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type", + "id" + ], + "type": "object" + } + }, + { + "in": "query", + "name": "fields", + "required": false, + "schema": { + "items": { + "description": "The fields to return in the `attributes` key of the response.", + "type": "string" + }, + "type": "array" + } + }, + { + "description": "A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`.", + "in": "query", + "name": "filter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "filter_consumers", + "required": false, + "schema": { + "items": { + "description": "List of consumers to filter.", + "type": "string" + }, + "type": "array" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "alerts_filter": { + "additionalProperties": false, + "description": "Defines a period that limits whether the action runs.", + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "dsl": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL).", + "type": "string" + }, + "filters": { + "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", + "items": { + "additionalProperties": false, + "properties": { + "$state": { + "additionalProperties": false, + "properties": { + "store": { + "description": "A filter can be either specific to an application context or applied globally.", + "enum": [ + "appState", + "globalState" + ], + "type": "string" + } + }, + "required": [ + "store" + ], + "type": "object" + }, + "meta": { + "additionalProperties": {}, + "type": "object" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "meta" + ], + "type": "object" + }, + "type": "array" + }, + "kql": { + "description": "A filter written in Kibana Query Language (KQL).", + "type": "string" + } + }, + "required": [ + "kql", + "filters" + ], + "type": "object" + }, + "timeframe": { + "additionalProperties": false, + "properties": { + "days": { + "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", + "items": { + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer" + }, + "type": "array" + }, + "hours": { + "additionalProperties": false, + "properties": { + "end": { + "description": "The end of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + }, + "start": { + "description": "The start of the time frame in 24-hour notation (`hh:mm`).", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "timezone": { + "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.", + "type": "string" + } + }, + "required": [ + "days", + "hours", + "timezone" + ], + "type": "object" + } + }, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector. This property appears in responses but cannot be set in requests.", + "type": "string" + }, + "frequency": { + "additionalProperties": false, + "properties": { + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "type": "string" + }, + "summary": { + "description": "Indicates whether the action is a summary.", + "type": "boolean" + }, + "throttle": { + "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if 'notify_when' is set to 'onThrottleInterval'. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "summary", + "notify_when", + "throttle" + ], + "type": "object" + }, + "group": { + "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.", + "type": "string" + }, + "id": { + "description": "The identifier for the connector saved object.", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", + "type": "object" + }, + "use_alert_data_for_template": { + "description": "Indicates whether to use alert data as a template.", + "type": "boolean" + }, + "uuid": { + "description": "A universally unique identifier (UUID) for the action.", + "type": "string" + } + }, + "required": [ + "id", + "connector_type_id", + "params" + ], + "type": "object" + }, + "type": "array" + }, + "active_snoozes": { + "items": { + "description": "List of active snoozes for the rule.", + "type": "string" + }, + "type": "array" + }, + "alert_delay": { + "additionalProperties": false, + "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", + "properties": { + "active": { + "description": "The number of consecutive runs that must meet the rule conditions.", + "type": "number" + } + }, + "required": [ + "active" + ], + "type": "object" + }, + "api_key_created_by_user": { + "description": "Indicates whether the API key that is associated with the rule was created by the user.", + "nullable": true, + "type": "boolean" + }, + "api_key_owner": { + "description": "The owner of the API key that is associated with the rule and used to run background tasks.", + "nullable": true, + "type": "string" + }, + "consumer": { + "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", + "type": "string" + }, + "created_at": { + "description": "The date and time that the rule was created.", + "type": "string" + }, + "created_by": { + "description": "The identifier for the user that created the rule.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates whether you want to run the rule on an interval basis after it is created.", + "type": "boolean" + }, + "execution_status": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Error message.", + "type": "string" + }, + "reason": { + "description": "Reason for error.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + }, + "last_duration": { + "description": "Duration of last execution of the rule.", + "type": "number" + }, + "last_execution_date": { + "description": "The date and time when rule was executed last.", + "type": "string" + }, + "status": { + "description": "Status of rule execution.", + "enum": [ + "ok", + "active", + "error", + "warning", + "pending", + "unknown" + ], + "type": "string" + }, + "warning": { + "additionalProperties": false, + "properties": { + "message": { + "description": "Warning message.", + "type": "string" + }, + "reason": { + "description": "Reason for warning.", + "enum": [ + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "type": "string" + } + }, + "required": [ + "reason", + "message" + ], + "type": "object" + } + }, + "required": [ + "status", + "last_execution_date" + ], + "type": "object" + }, + "id": { + "description": "The identifier for the rule.", + "type": "string" + }, + "is_snoozed_until": { + "description": "The date when the rule will no longer be snoozed.", + "nullable": true, + "type": "string" + }, + "last_run": { + "additionalProperties": false, + "nullable": true, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "mapped_params": { + "additionalProperties": {}, + "type": "object" + }, + "monitoring": { + "additionalProperties": false, + "description": "Monitoring details of the rule.", + "properties": { + "run": { + "additionalProperties": false, + "description": "Rule run details.", + "properties": { + "calculated_metrics": { + "additionalProperties": false, + "description": "Calculation of different percentiles and success ratio.", + "properties": { + "p50": { + "type": "number" + }, + "p95": { + "type": "number" + }, + "p99": { + "type": "number" + }, + "success_ratio": { + "type": "number" + } + }, + "required": [ + "success_ratio" + ], + "type": "object" + }, + "history": { + "description": "History of the rule run.", + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule run.", + "type": "number" + }, + "outcome": { + "additionalProperties": false, + "properties": { + "alerts_count": { + "additionalProperties": false, + "properties": { + "active": { + "description": "Number of active alerts during last run.", + "nullable": true, + "type": "number" + }, + "ignored": { + "description": "Number of ignored alerts during last run.", + "nullable": true, + "type": "number" + }, + "new": { + "description": "Number of new alerts during last run.", + "nullable": true, + "type": "number" + }, + "recovered": { + "description": "Number of recovered alerts during last run.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "outcome": { + "description": "Outcome of last run of the rule. Value could be succeeded, warning or failed.", + "enum": [ + "succeeded", + "warning", + "failed" + ], + "type": "string" + }, + "outcome_msg": { + "items": { + "description": "Outcome message generated during last rule run.", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "outcome_order": { + "description": "Order of the outcome.", + "type": "number" + }, + "warning": { + "description": "Warning of last rule execution.", + "enum": [ + "read", + "decrypt", + "execute", + "unknown", + "license", + "timeout", + "disabled", + "validate", + "maxExecutableActions", + "maxAlerts", + "maxQueuedActions", + "ruleExecution" + ], + "nullable": true, + "type": "string" + } + }, + "required": [ + "outcome", + "alerts_count" + ], + "type": "object" + }, + "success": { + "description": "Indicates whether the rule run was successful.", + "type": "boolean" + }, + "timestamp": { + "description": "Time of rule run.", + "type": "number" + } + }, + "required": [ + "success", + "timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "last_run": { + "additionalProperties": false, + "properties": { + "metrics": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of most recent rule run.", + "type": "number" + }, + "gap_duration_s": { + "description": "Duration in seconds of rule run gap.", + "nullable": true, + "type": "number" + }, + "total_alerts_created": { + "description": "Total number of alerts created during last rule run.", + "nullable": true, + "type": "number" + }, + "total_alerts_detected": { + "description": "Total number of alerts detected during last rule run.", + "nullable": true, + "type": "number" + }, + "total_indexing_duration_ms": { + "description": "Total time spent indexing documents during last rule run in milliseconds.", + "nullable": true, + "type": "number" + }, + "total_search_duration_ms": { + "description": "Total time spent performing Elasticsearch searches as measured by Kibana; includes network latency and time spent serializing or deserializing the request and response.", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "timestamp": { + "description": "Time of the most recent rule run.", + "type": "string" + } + }, + "required": [ + "timestamp", + "metrics" + ], + "type": "object" + } + }, + "required": [ + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { + "byhour": { + "items": { + "description": "Indicates hours of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "byminute": { + "items": { + "description": "Indicates minutes of the hour to recur.", + "type": "number" + }, + "type": "array" + }, + "bymonth": { + "items": { + "description": "Indicates months of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "bymonthday": { + "items": { + "description": "Indicates the days of the month to recur.", + "type": "number" + }, + "type": "array" + }, + "bysecond": { + "items": { + "description": "Indicates seconds of the day to recur.", + "type": "number" + }, + "type": "array" + }, + "bysetpos": { + "items": { + "description": "A positive or negative integer affecting the nth day of the month. For example, -2 combined with `byweekday` of FR is 2nd to last Friday of the month. It is recommended to not set this manually and just use `byweekday`.", + "type": "number" + }, + "type": "array" + }, + "byweekday": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Indicates the days of the week to recur or else nth-day-of-month strings. For example, \"+2TU\" second Tuesday of month, \"-1FR\" last Friday of the month, which are internally converted to a `byweekday/bysetpos` combination." + }, + "type": "array" + }, + "byweekno": { + "items": { + "description": "Indicates number of the week hours to recur.", + "type": "number" + }, + "type": "array" + }, + "byyearday": { + "items": { + "description": "Indicates the days of the year that this rule should recur.", + "type": "number" + }, + "type": "array" + }, + "count": { + "description": "Number of times the rule should recur until it stops.", + "type": "number" + }, + "dtstart": { + "description": "Rule start date in Coordinated Universal Time (UTC).", + "type": "string" + }, + "freq": { + "description": "Indicates frequency of the rule. Options are YEARLY, MONTHLY, WEEKLY, DAILY.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "type": "integer" + }, + "interval": { + "description": "Indicates the interval of frequency. For example, 1 and YEARLY is every 1 year, 2 and WEEKLY is every 2 weeks.", + "type": "number" + }, + "tzid": { + "description": "Indicates timezone abbreviation.", + "type": "string" + }, + "until": { + "description": "Recur the rule until this date.", + "type": "string" + }, + "wkst": { + "description": "Indicates the start of week, defaults to Monday.", + "enum": [ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU" + ], + "type": "string" + } + }, + "required": [ + "dtstart", + "tzid" + ], + "type": "object" + }, + "skipRecurrences": { + "items": { + "description": "Skips recurrence of rule on this date.", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "duration", + "rRule" + ], + "type": "object" + }, + "type": "array" + }, + "tags": { + "items": { + "description": "The tags for the rule.", + "type": "string" + }, + "type": "array" + }, + "throttle": { + "deprecated": true, + "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time that the rule was updated most recently.", + "type": "string" + }, + "updated_by": { + "description": "The identifier for the user that updated this rule most recently.", + "nullable": true, + "type": "string" + }, + "view_in_app_relative_url": { + "description": "Relative URL to view rule in the app.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "tags", + "rule_type_id", + "consumer", + "schedule", + "actions", + "params", + "created_by", + "updated_by", + "created_at", + "updated_at", + "api_key_owner", + "mute_all", + "muted_alert_ids", + "execution_status", + "revision" + ], + "type": "object" + } + } + }, + "description": "Indicates a successful call." + } + }, + "summary": "Get information about rules", + "tags": [ + "alerting" + ] + } + }, "/api/status": { "get": { - "operationId": "/api/status#0", + "operationId": "%2Fapi%2Fstatus#0", "parameters": [ { "description": "The version of the API to use", @@ -435,6 +5151,9 @@ } ], "tags": [ + { + "name": "alerting" + }, { "name": "system" } diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_esql_rule_request.yaml b/oas_docs/examples/create_es_query_esql_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_esql_rule_request.yaml rename to oas_docs/examples/create_es_query_esql_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_esql_rule_response.yaml b/oas_docs/examples/create_es_query_esql_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_esql_rule_response.yaml rename to oas_docs/examples/create_es_query_esql_rule_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_kql_rule_request.yaml b/oas_docs/examples/create_es_query_kql_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_kql_rule_request.yaml rename to oas_docs/examples/create_es_query_kql_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_kql_rule_response.yaml b/oas_docs/examples/create_es_query_kql_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_kql_rule_response.yaml rename to oas_docs/examples/create_es_query_kql_rule_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_rule_request.yaml b/oas_docs/examples/create_es_query_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_rule_request.yaml rename to oas_docs/examples/create_es_query_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_rule_response.yaml b/oas_docs/examples/create_es_query_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_es_query_rule_response.yaml rename to oas_docs/examples/create_es_query_rule_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_index_threshold_rule_request.yaml b/oas_docs/examples/create_index_threshold_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_index_threshold_rule_request.yaml rename to oas_docs/examples/create_index_threshold_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_index_threshold_rule_response.yaml b/oas_docs/examples/create_index_threshold_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_index_threshold_rule_response.yaml rename to oas_docs/examples/create_index_threshold_rule_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_tracking_containment_rule_request.yaml b/oas_docs/examples/create_tracking_containment_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_tracking_containment_rule_request.yaml rename to oas_docs/examples/create_tracking_containment_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/create_tracking_containment_rule_response.yaml b/oas_docs/examples/create_tracking_containment_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/create_tracking_containment_rule_response.yaml rename to oas_docs/examples/create_tracking_containment_rule_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/find_rules_response.yaml b/oas_docs/examples/find_rules_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/find_rules_response.yaml rename to oas_docs/examples/find_rules_response.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/find_rules_response_conditional_action.yaml b/oas_docs/examples/find_rules_response_conditional_action.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/find_rules_response_conditional_action.yaml rename to oas_docs/examples/find_rules_response_conditional_action.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/update_rule_request.yaml b/oas_docs/examples/update_rule_request.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/update_rule_request.yaml rename to oas_docs/examples/update_rule_request.yaml diff --git a/x-pack/plugins/alerting/docs/openapi/components/examples/update_rule_response.yaml b/oas_docs/examples/update_rule_response.yaml similarity index 100% rename from x-pack/plugins/alerting/docs/openapi/components/examples/update_rule_response.yaml rename to oas_docs/examples/update_rule_response.yaml diff --git a/oas_docs/kibana.info.serverless.yaml b/oas_docs/kibana.info.serverless.yaml index 09322f0851847..fca516d797f24 100644 --- a/oas_docs/kibana.info.serverless.yaml +++ b/oas_docs/kibana.info.serverless.yaml @@ -28,24 +28,19 @@ info: ``` version: "1.0.2" license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: https://creativecommons.org/licenses/by-nc-nd/4.0/ contact: name: Kibana Team -# servers: -# - url: https://{kibana_url} -# variables: -# kibana_url: -# default: localhost:5601 -# security: -# - apiKeyAuth: [] -# components: -# securitySchemes: -# apiKeyAuth: -# type: apiKey -# in: header -# name: Authorization -# description: > -# These APIs use key-based authentication. -# You must create an API key and use the encoded value in the request header. -# For example: `Authorization: ApiKey base64AccessApiKey` \ No newline at end of file + x-feedbackLink: + label: Feedback + url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ +security: + - apiKeyAuth: [] +components: + securitySchemes: + apiKeyAuth: + type: apiKey + in: header + name: Authorization + description: You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys). diff --git a/oas_docs/kibana.info.yaml b/oas_docs/kibana.info.yaml index 97766ed5f9b58..40795333fcf44 100644 --- a/oas_docs/kibana.info.yaml +++ b/oas_docs/kibana.info.yaml @@ -26,10 +26,13 @@ info: For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html). version: '1.0.2' license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: https://creativecommons.org/licenses/by-nc-nd/4.0/ contact: name: Kibana Team + x-feedbackLink: + label: Feedback + url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ servers: - url: https://{kibana_url} variables: @@ -37,6 +40,7 @@ servers: default: localhost:5601 security: - apiKeyAuth: [] + - basicAuth: [] components: securitySchemes: apiKeyAuth: @@ -47,3 +51,6 @@ components: These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey` + basicAuth: + type: http + scheme: basic \ No newline at end of file diff --git a/oas_docs/makefile b/oas_docs/makefile index 6e300734cdd17..d64e296b795a6 100644 --- a/oas_docs/makefile +++ b/oas_docs/makefile @@ -18,24 +18,27 @@ api-docs: ## Generate Serverless and ESS Kibana OpenAPI bundles with kbn-openapi @node scripts/merge_serverless_oas.js @node scripts/merge_ess_oas.js -.PHONY: api-docs-redocly -api-docs-redocly: ## Generate kibana.serverless.yaml and kibana.yaml with Redocly CLI - @npx @redocly/cli join "kibana.info.serverless.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml" "../packages/core/saved-objects/docs/openapi/bundled_serverless.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.serverless.json" -o "output/kibana.serverless.yaml" --prefix-components-with-info-prop title - @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/cases/docs/openapi/bundled.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title +.PHONY: api-docs-staging +api-docs-staging: ## Generate Serverless and ESS Kibana OpenAPI bundles with kbn-openapi-bundler + @node scripts/merge_serverless_oas_staging.js + @node scripts/merge_ess_oas_staging.js .PHONY: api-docs-stateful api-docs-stateful: ## Generate only kibana.yaml - @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/cases/docs/openapi/bundled.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title -# Temporarily omit "../x-pack/plugins/fleet/common/openapi/bundled.yaml" due to internals tag and tag sorting + @node scripts/merge_ess_oas.js .PHONY: api-docs-serverless api-docs-serverless: ## Generate only kibana.serverless.yaml - @npx @redocly/cli join "kibana.info.serverless.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml" "../packages/core/saved-objects/docs/openapi/bundled_serverless.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.serverless.json" -o "output/kibana.serverless.yaml" --prefix-components-with-info-prop title + @node scripts/merge_serverless_oas.js .PHONY: api-docs-lint api-docs-lint: ## Run spectral API docs linter @npx @stoplight/spectral-cli lint "output/*.yaml" --ruleset ".spectral.yaml" +.PHONY: api-docs-lint-errs +api-docs-lint-errs: ## Run spectral API docs linter and return only errors + @npx @stoplight/spectral-cli lint "output/*.yaml" --ruleset ".spectral.yaml" -D + .PHONY: api-docs-lint-stateful api-docs-lint-stateful: ## Run spectral API docs linter on kibana.yaml @npx @stoplight/spectral-cli lint "output/kibana.yaml" --ruleset ".spectral.yaml" @@ -46,8 +49,14 @@ api-docs-lint-serverless: ## Run spectral API docs linter on kibana.serverless.y .PHONY: api-docs-overlay api-docs-overlay: ## Run spectral API docs linter on kibana.serverless.yaml - @npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.new.yaml" - @npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.new.yaml" + @npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.tmp1.yaml" + @npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.serverless.tmp2.yaml" + @npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.tmp1.yaml" + @npx bump overlay "output/kibana.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.tmp2.yaml" + @npx @redocly/cli bundle output/kibana.serverless.tmp2.yaml --ext yaml -o output/kibana.serverless.new.yaml + @npx @redocly/cli bundle output/kibana.tmp2.yaml --ext yaml -o output/kibana.new.yaml + rm output/kibana.tmp*.yaml + rm output/kibana.serverless.tmp*.yaml help: ## Display help @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 0626823f8739a..8d81681f3789e 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -3,18 +3,26 @@ info: contact: name: Kibana Team description: > - The Kibana REST APIs enable you to manage resources such as connectors, data - views, and saved objects. + **Technical preview** - The API calls are stateless. + This functionality is in technical preview and may be changed or removed in + a future release. - Each request that you make happens in isolation from other calls and must - include all of the necessary information for Kibana to fulfill the + Elastic will work to fix any issues, but features in technical preview are + not subject to the support SLA of official GA features. - request. - API requests return JSON output, which is a format that is machine-readable - and works well for automation. + The Kibana REST APIs for Elastic serverless enable you to manage resources + + such as connectors, data views, and saved objects. The API calls are + + stateless. Each request that you make happens in isolation from other calls + + and must include all of the necessary information for Kibana to fulfill the + + request. API requests return JSON output, which is a format that is + + machine-readable and works well for automation. To interact with Kibana APIs, use the following operations: @@ -22,8 +30,6 @@ info: - GET: Fetches the information. - - PATCH: Applies partial modifications to the existing information. - - POST: Adds new information. - PUT: Updates the existing information. @@ -32,9 +38,8 @@ info: You can prepend any Kibana API endpoint with `kbn:` and run the request in - **Dev Tools → Console**. - For example: + **Dev Tools → Console**. For example: ``` @@ -42,291 +47,243 @@ info: GET kbn:/api/data_views ``` - - - For more information about the console, refer to [Run API - requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html). license: - name: Elastic License 2.0 - url: 'https://www.elastic.co/licensing/elastic-license' - title: Kibana APIs + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/' + title: Kibana Serverless APIs version: 1.0.2 + x-feedbackLink: + label: Feedback + url: >- + https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ servers: + - url: 'http://{kibana_host}:{port}' + variables: + kibana_host: + default: localhost + port: + default: '5601' + - url: 'http://localhost:5622' + - url: 'https://{kibanaUrl}' + variables: + kibanaUrl: + default: 'localhost:5601' - url: 'https://{kibana_url}' variables: kibana_url: default: 'localhost:5601' + - url: / + - description: Public and supported Fleet API + url: 'http://KIBANA_HOST:5601/api/fleet' + - description: local + url: 'http://localhost:5601' paths: - /api/actions/connector: - post: - description: The connector identifier is randomly generated. - operationId: createConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_email_connector_request - createIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_index_connector_request - createWebhookConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_webhook_connector_request - createXmattersConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_xmatters_connector_request - schema: - $ref: '#/components/schemas/Connectors_create_connector_request' - required: true + /agent_download_sources: + get: + operationId: get-download-sources responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_email_connector_response - createIndexConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_index_connector_response - createWebhookConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_webhook_connector_response - createXmattersConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_xmatters_connector_response schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Create a connector with a random ID + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_download_sources' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent binary download sources tags: - - connectors - /api/actions/connector_types: - get: - operationId: getConnectorTypes - parameters: - - description: >- - A filter to limit the retrieved connector types to those that - support a specific feature (such as alerting or cases). - in: query - name: feature_id - schema: - $ref: '#/components/schemas/Connectors_features' + - Elastic Agent binary download sources + post: + operationId: post-download-sources + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + host: + type: string + id: + type: string + is_default: + type: boolean + name: + type: string + required: + - name + - host + - is_default responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorTypesServerlessResponse: - $ref: >- - #/components/examples/Connectors_get_connector_types_generativeai_response schema: - description: The properties vary for each connector type. - items: - type: object - properties: - enabled: - description: >- - Indicates whether the connector type is enabled in - Kibana. - example: true - type: boolean - enabled_in_config: - description: >- - Indicates whether the connector type is enabled in the - Kibana configuration file. - example: true - type: boolean - enabled_in_license: - description: >- - Indicates whether the connector is enabled in the - license. - example: true - type: boolean - id: - $ref: '#/components/schemas/Connectors_connector_types' - is_system_action_type: - example: false - type: boolean - minimum_license_required: - description: The license that is required to use the connector type. - example: basic - type: string - name: - description: The name of the connector type. - example: Index - type: string - supported_feature_ids: - description: The features that are supported by the connector type. - example: - - alerting - - cases - - siem - items: - $ref: '#/components/schemas/Connectors_features' - type: array - title: Get connector types response body properties - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get all connector types + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create agent binary download source tags: - - connectors - '/api/actions/connector/{connectorId}': + - Elastic Agent binary download sources + '/agent_download_sources/{sourceId}': delete: - operationId: deleteConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_connector_id' - responses: - '204': - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Delete a connector - tags: - - connectors - get: - operationId: getConnector + operationId: delete-download-source parameters: - - $ref: '#/components/parameters/Connectors_connector_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorResponse: - $ref: '#/components/examples/Connectors_get_connector_response' schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Get a connector information + type: object + properties: + id: + type: string + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent binary download source by ID tags: - - connectors - post: - operationId: createConnectorId - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - description: > - A UUID v1 or v4 identifier for the connector. If you omit this - parameter, an identifier is randomly generated. - in: path - name: connectorId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_index_connector_request - schema: - $ref: '#/components/schemas/Connectors_create_connector_request' - required: true + - Elastic Agent binary download sources + get: + operationId: get-one-download-source responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createIndexConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_index_connector_response schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Create a connector + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent binary download source by ID tags: - - connectors + - Elastic Agent binary download sources + parameters: + - in: path + name: sourceId + required: true + schema: + type: string put: - operationId: updateConnector + operationId: update-download-source parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_connector_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_update_index_connector_request schema: - $ref: '#/components/schemas/Connectors_update_connector_request' - required: true + type: object + properties: + host: + type: string + is_default: + type: boolean + name: + type: string + required: + - name + - is_default + - host responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + required: + - item + description: OK '400': - $ref: '#/components/responses/Connectors_401' - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Update a connector + $ref: '#/components/responses/Fleet_error' + summary: Update agent binary download source by ID tags: - - connectors - /api/actions/connectors: + - Elastic Agent binary download sources + /agent_policies: get: - operationId: getConnectors + description: '' + operationId: agent-policy-list + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - description: >- + When set to true, retrieve the related package policies for each + agent policy. + in: query + name: full + schema: + type: boolean + - description: >- + When set to true, do not count how many agents are in the agent + policy, this can improve performance if you are searching over a + large number of agent policies. The "agents" property will always be + 0 if set to true. + in: query + name: noAgentCount + schema: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorsResponse: - $ref: '#/components/examples/Connectors_get_connectors_response' schema: - items: - $ref: >- - #/components/schemas/Connectors_connector_response_properties - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get all connectors + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_agent_policy' + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + - total + - page + - perPage + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent policies tags: - - connectors - /api/apm/agent_keys: + - Elastic Agent policies post: - description: Create a new agent key for APM. - operationId: createAgentKey + operationId: create-agent-policy + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - name: - type: string - privileges: - items: - enum: - - 'event:write' - - 'config_agent:read' - type: string - type: array - required: true + $ref: '#/components/schemas/Fleet_agent_policy_create_request' responses: '200': content: @@ -334,125 +291,36 @@ paths: schema: type: object properties: - api_key: - type: string - encoded: - type: string - expiration: - format: int64 - type: integer - id: - type: string - name: - type: string - description: Agent key created successfully - summary: Create an APM agent key + item: + $ref: '#/components/schemas/Fleet_agent_policy' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create agent policy tags: - - APM agent keys - '/api/apm/services/{serviceName}/annotation': + - Elastic Agent policies + /agent_policies/_bulk_get: post: - description: Create a new annotation for a specific service. - operationId: createAnnotation - parameters: - - description: The name of the service - in: path - name: serviceName - required: true - schema: - type: string + operationId: bulk-get-agent-policies + parameters: [] requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - '@timestamp': - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - version: - type: string - tags: + full: + description: get full policies with package policies populated + type: boolean + ids: + description: list of agent policy ids items: type: string type: array - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - _id: - type: string - _index: - type: string - _source: - type: object - properties: - '@timestamp': - type: string - annotation: - type: string - event: - type: object - properties: - created: - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - name: - type: string - version: - type: string - tags: - items: - type: string - type: array - description: Annotation created successfully - summary: Create a service annotation - tags: - - APM annotations - '/api/apm/services/{serviceName}/annotation/search': - get: - description: Search for annotations related to a specific service. - operationId: getAnnotation - parameters: - - description: The name of the service - in: path - name: serviceName - required: true - schema: - type: string - - description: The environment to filter annotations by - in: query - name: environment - required: false - schema: - type: string - - description: The start date for the search - in: query - name: start - required: false - schema: - type: string - - description: The end date for the search - in: query - name: end - required: false - schema: - type: string + ignoreMissing: + type: boolean + required: + - ids responses: '200': content: @@ -460,51 +328,23 @@ paths: schema: type: object properties: - annotations: + items: items: - type: object - properties: - '@timestamp': - type: number - id: - type: string - text: - type: string - type: - enum: - - version - type: string + $ref: '#/components/schemas/Fleet_agent_policy' type: array - description: Successful response - summary: Search for annotations + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk get agent policies tags: - - APM annotations - /api/asset_criticality: - delete: - operationId: DeleteAssetCriticalityRecord - parameters: - - description: The ID value of the asset. - in: query - name: id_value - required: true - schema: - type: string - - description: The field representing the ID. - example: host.name - in: query - name: id_field - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_IdField - - description: If 'wait_for' the request will wait for the index refresh. - in: query - name: refresh - required: false - schema: - enum: - - wait_for - type: string + - Elastic Agent policies + '/agent_policies/{agentPolicyId}': + get: + description: Get one agent policy + operationId: agent-policy-info + parameters: [] responses: '200': content: @@ -512,186 +352,220 @@ paths: schema: type: object properties: - deleted: - description: >- - If the record was deleted. If false the record did not - exist. - type: boolean - record: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord + item: + $ref: '#/components/schemas/Fleet_agent_policy' required: - - deleted - description: Successful response + - item + description: OK '400': - description: Invalid request - summary: Delete Criticality Record + $ref: '#/components/responses/Fleet_error' + summary: Get agent policy by ID tags: - - Security Solution Entity Analytics API - get: - operationId: GetAssetCriticalityRecord + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string + put: + operationId: update-agent-policy parameters: - - description: The ID value of the asset. - in: query - name: id_value - required: true - schema: - type: string - - description: The field representing the ID. - example: host.name - in: query - name: id_field - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_IdField - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - description: Successful response - '400': - description: Invalid request - '404': - description: Criticality record not found - summary: Get Criticality Record - tags: - - Security Solution Entity Analytics API - post: - operationId: CreateAssetCriticalityRecord + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - - type: object - properties: - refresh: - description: >- - If 'wait_for' the request will wait for the index - refresh. - enum: - - wait_for - type: string - required: true + $ref: '#/components/schemas/Fleet_agent_policy_update_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - description: Successful response + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_policy' + required: + - item + description: OK '400': - description: Invalid request - summary: Create Criticality Record + $ref: '#/components/responses/Fleet_error' + summary: Update agent policy by ID tags: - - Security Solution Entity Analytics API - /api/asset_criticality/bulk: + - Elastic Agent policies + '/agent_policies/{agentPolicyId}/copy': + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string post: - operationId: BulkUpsertAssetCriticalityRecords + operationId: agent-policy-copy + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - example: - records: - - criticality_level: low_impact - id_field: host.name - id_value: host-1 - - criticality_level: medium_impact - id_field: host.name - id_value: host-2 type: object properties: - records: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - maxItems: 1000 - minItems: 1 - type: array + description: + type: string + name: + type: string required: - - records + - name + description: '' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - example: - errors: - - index: 0 - message: Invalid ID field - stats: - failed: 1 - successful: 1 - total: 2 type: object properties: - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadErrorItem - type: array - stats: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadStats + item: + $ref: '#/components/schemas/Fleet_agent_policy' required: - - errors - - stats - description: Bulk upload successful - '413': - description: File too large - summary: >- - Bulk upsert asset criticality data, creating or updating records as - needed + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Copy agent policy by ID + tags: + - Elastic Agent policies + '/agent_policies/{agentPolicyId}/download': + get: + operationId: agent-policy-download + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Download agent policy by ID + tags: + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string + - in: query + name: download + required: false + schema: + type: string + - in: query + name: standalone + required: false + schema: + type: string + - in: query + name: kubernetes + required: false + schema: + type: string + '/agent_policies/{agentPolicyId}/full': + get: + operationId: agent-policy-full + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + oneOf: + - type: string + - $ref: '#/components/schemas/Fleet_agent_policy_full' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get full agent policy by ID tags: - - Security Solution Entity Analytics API - /api/asset_criticality/list: + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string + - in: query + name: download + required: false + schema: + type: string + - in: query + name: standalone + required: false + schema: + type: string + - in: query + name: kubernetes + required: false + schema: + type: string + /agent_policies/delete: + parameters: [] post: - operationId: FindAssetCriticalityRecords + operationId: delete-agent-policy parameters: - - description: The field to sort by. - in: query - name: sort_field - required: false - schema: - enum: - - id_value - - id_field - - criticality_level - - \@timestamp - type: string - - description: The order to sort by. - in: query - name: sort_direction + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + agentPolicyId: + type: string + force: + description: >- + bypass validation checks that can prevent agent policy + deletion + type: boolean + required: + - agentPolicyId + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + id: + type: string + success: + type: boolean + required: + - id + - success + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent policy by ID + tags: + - Elastic Agent policies + /agent_status: + get: + operationId: get-agent-status + parameters: + - in: query + name: policyId required: false schema: - enum: - - asc - - desc type: string - - description: The page number to return. - in: query - name: page - required: false - schema: - minimum: 1 - type: integer - - description: The number of records to return per page. - in: query - name: per_page - required: false - schema: - maximum: 1000 - minimum: 1 - type: integer - - description: The kuery to filter by. + - deprecated: true in: query name: kuery required: false @@ -704,196 +578,289 @@ paths: schema: type: object properties: - page: - minimum: 1 + active: type: integer - per_page: - maximum: 1000 - minimum: 1 + all: + type: integer + error: + type: integer + events: + type: integer + inactive: + type: integer + offline: + type: integer + online: + type: integer + other: type: integer - records: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - type: array total: - minimum: 0 + deprecated: true + type: integer + unenrolled: + type: integer + updating: type: integer required: - - records - - page - - per_page + - active + - all + - error + - events + - inactive + - offline + - online + - other - total - description: Bulk upload successful - summary: 'List asset criticality data, filtering and sorting as needed' + - updating + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent status summary tags: - - Security Solution Entity Analytics API - /api/data_views: + - Elastic Agent status + /agent_status/data: get: - operationId: getAllDataViewsDefault + operationId: get-agent-data + parameters: + - in: query + name: agentsIds + required: true + schema: + items: + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getAllDataViewsResponse: - $ref: '#/components/examples/Data_views_get_data_views_response' schema: type: object properties: - data_view: + items: items: + additionalProperties: + type: object + properties: + data: + type: boolean type: object - properties: - id: - type: string - name: - type: string - namespaces: - items: - type: string - type: array - title: - type: string - typeMeta: - type: object type: array - description: Indicates a successful call. + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Get incoming agent data + tags: + - Elastic Agent status + /agent-status: + get: + deprecated: true + operationId: get-agent-status-deprecated + parameters: + - in: query + name: policyId + required: false + schema: + type: string + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Get all data views + type: object + properties: + error: + type: integer + events: + type: integer + inactive: + type: integer + offline: + type: integer + online: + type: integer + other: + type: integer + total: + type: integer + updating: + type: integer + required: + - error + - events + - inactive + - offline + - online + - other + - total + - updating + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent status summary tags: - - data views - /api/data_views/data_view: + - Elastic Agent status + /agents: + get: + operationId: get-agents + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - $ref: '#/components/parameters/Fleet_show_inactive' + - $ref: '#/components/parameters/Fleet_show_upgradeable' + - $ref: '#/components/parameters/Fleet_sort_field' + - $ref: '#/components/parameters/Fleet_sort_order' + - $ref: '#/components/parameters/Fleet_with_metrics' + - in: query + name: getStatusSummary + required: false + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_get_agents_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agents + tags: + - Elastic Agents post: - operationId: createDataViewDefaultw + operationId: get-agents-by-actions parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createDataViewRequest: - $ref: '#/components/examples/Data_views_create_data_view_request' schema: - $ref: '#/components/schemas/Data_views_create_data_view_request_object' + type: object + properties: + actionIds: + items: + type: string + type: array + required: + - policy_id required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. + $ref: '#/components/schemas/Fleet_agent_get_by_actions' + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Create a data view + $ref: '#/components/responses/Fleet_error' + summary: List agents by action ids tags: - - data views - '/api/data_views/data_view/{viewId}': + - Elastic Agents + '/agents/{agentId}': delete: - description: | - WARNING: When you delete a data view, it cannot be recovered. - operationId: deleteDataViewDefault + operationId: delete-agent parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: - '204': - description: Indicates a successful call. - '404': + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Delete a data view + type: object + properties: + action: + enum: + - deleted + type: string + required: + - action + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent by ID tags: - - data views + - Elastic Agents get: - operationId: getDataViewDefault + operationId: get-agent parameters: - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_with_metrics' responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - getDataViewResponse: - $ref: '#/components/examples/Data_views_get_data_view_response' - schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. - '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Get a data view - tags: - - data views - post: - operationId: updateDataViewDefault + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent by ID + tags: + - Elastic Agents + parameters: + - in: path + name: agentId + required: true + schema: + type: string + put: + operationId: update-agent parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateDataViewRequest: - $ref: '#/components/examples/Data_views_update_data_view_request' schema: - $ref: '#/components/schemas/Data_views_update_data_view_request_object' + type: object + properties: + tags: + items: + type: string + type: array + user_provided_metadata: + type: object required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent' + required: + - item + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update a data view + $ref: '#/components/responses/Fleet_error' + summary: Update agent by ID tags: - - data views - '/api/data_views/data_view/{viewId}/fields': + - Elastic Agents + '/agents/{agentId}/actions': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - description: > - Update fields presentation metadata such as count, customLabel, - customDescription, and format. - operationId: updateFieldsMetadataDefault + operationId: new-agent-action parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateFieldsMetadataRequest: - $ref: '#/components/examples/Data_views_update_field_metadata_request' schema: type: object properties: - fields: - description: The field object. - type: object - required: - - fields + action: + $ref: '#/components/schemas/Fleet_agent_action' required: true responses: '200': @@ -902,44 +869,41 @@ paths: schema: type: object properties: - acknowledged: - type: boolean - description: Indicates a successful call. + body: + items: + type: number + type: array + headers: + type: string + statusCode: + type: number + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update data view fields metadata + $ref: '#/components/responses/Fleet_error' + summary: Create agent action tags: - - data views - '/api/data_views/data_view/{viewId}/runtime_field': + - Elastic Agent actions + '/agents/{agentId}/reassign': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - operationId: createRuntimeFieldDefault + operationId: reassign-agent parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_create_runtime_field_request' schema: type: object properties: - name: - description: | - The name for a runtime field. + policy_id: type: string - runtimeField: - description: | - The runtime field definition object. - type: object required: - - name - - runtimeField + - policy_id required: true responses: '200': @@ -947,41 +911,27 @@ paths: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. - summary: Create a runtime field + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Reassign agent tags: - - data views + - Elastic Agents put: - operationId: createUpdateRuntimeFieldDefault + deprecated: true + operationId: reassign-agent-deprecated parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - description: | - The ID of the data view fields you want to update. - in: path - name: viewId - required: true - schema: - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_create_runtime_field_request' schema: type: object properties: - name: - description: | - The name for a runtime field. + policy_id: type: string - runtimeField: - description: | - The runtime field definition object. - type: object required: - - name - - runtimeField + - policy_id required: true responses: '200': @@ -989,163 +939,324 @@ paths: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - data_view: - type: object - fields: - items: - type: object - type: array - description: Indicates a successful call. + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Create or update a runtime field + $ref: '#/components/responses/Fleet_error' + summary: Reassign agent tags: - - data views - '/api/data_views/data_view/{viewId}/runtime_field/{fieldName}': - delete: - operationId: deleteRuntimeFieldDefault + - Elastic Agents + '/agents/{agentId}/request_diagnostics': + parameters: + - in: path + name: agentId + required: true + schema: + type: string + post: + operationId: request-diagnostics-agent parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + additional_metrics: + items: + oneOf: + - enum: + - CPU + type: string + type: array responses: '200': - description: Indicates a successful call. - '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Delete a runtime field from a data view + type: object + properties: + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Request agent diagnostics tags: - - data views - get: - operationId: getRuntimeFieldDefault + - Elastic Agents + '/agents/{agentId}/unenroll': + parameters: + - in: path + name: agentId + required: true + schema: + type: string + post: + operationId: unenroll-agent parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + type: boolean + revoke: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getRuntimeFieldResponse: - $ref: '#/components/examples/Data_views_get_runtime_field_response' schema: type: object - properties: - data_view: - type: object - fields: - items: - type: object - type: array - description: Indicates a successful call. - '404': + description: OK + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Get a runtime field + type: object + properties: + error: + type: string + message: + type: string + statusCode: + enum: + - 400 + type: number + description: BAD REQUEST + summary: Unenroll agent tags: - - data views + - Elastic Agents + '/agents/{agentId}/upgrade': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - operationId: updateRuntimeFieldDefault + operationId: upgrade-agent parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_update_runtime_field_request' schema: - type: object - properties: - runtimeField: - description: | - The runtime field definition object. - - You can update following fields: - - - `type` - - `script` - type: object - required: - - runtimeField + $ref: '#/components/schemas/Fleet_upgrade_agent' required: true responses: '200': - description: Indicates a successful call. - '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update a runtime field + $ref: '#/components/schemas/Fleet_upgrade_agent' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Upgrade agent tags: - - data views - /api/data_views/default: + - Elastic Agents + '/agents/{agentId}/uploads': get: - operationId: getDefaultDataViewDefault + operationId: list-agent-uploads responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getDefaultDataViewResponse: - $ref: >- - #/components/examples/Data_views_get_default_data_view_response schema: type: object properties: - data_view_id: - type: string - description: Indicates a successful call. + body: + type: object + properties: + item: + items: + $ref: '#/components/schemas/Fleet_agent_diagnostics' + type: array + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent uploads + tags: + - Elastic Agents + parameters: + - in: path + name: agentId + required: true + schema: + type: string + /agents/action_status: + get: + operationId: agents-action-status + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - in: query + name: errorSize + schema: + default: 5 + type: integer + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Get the default data view + type: object + properties: + items: + items: + type: object + properties: + actionId: + type: string + cancellationTime: + type: string + completionTime: + type: string + creationTime: + description: creation time of action + type: string + expiration: + type: string + latestErrors: + description: >- + latest errors that happened when the agents executed + the action + items: + type: object + properties: + agentId: + type: string + error: + type: string + timestamp: + type: string + type: array + nbAgentsAck: + description: number of agents that acknowledged the action + type: number + nbAgentsActionCreated: + description: number of agents included in action from kibana + type: number + nbAgentsActioned: + description: number of agents actioned + type: number + nbAgentsFailed: + description: number of agents that failed to execute the action + type: number + newPolicyId: + description: new policy id (POLICY_REASSIGN action) + type: string + policyId: + description: policy id (POLICY_CHANGE action) + type: string + revision: + description: new policy revision (POLICY_CHANGE action) + type: string + startTime: + description: start time of action (scheduled actions) + type: string + status: + enum: + - COMPLETE + - EXPIRED + - CANCELLED + - FAILED + - IN_PROGRESS + - ROLLOUT_PASSED + type: string + type: + enum: + - POLICY_REASSIGN + - UPGRADE + - UNENROLL + - FORCE_UNENROLL + - UPDATE_TAGS + - CANCEL + - REQUEST_DIAGNOSTICS + - SETTINGS + - POLICY_CHANGE + - INPUT_ACTION + type: string + version: + description: agent version number (UPGRADE action) + type: string + required: + - actionId + - complete + - nbAgentsActioned + - nbAgentsActionCreated + - nbAgentsAck + - nbAgentsFailed + - status + - creationTime + - type + type: array + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent action status tags: - - data views + - Elastic Agent actions + '/agents/actions/{actionId}/cancel': + parameters: + - in: path + name: actionId + required: true + schema: + type: string post: - operationId: setDefaultDatailViewDefault + operationId: agent-action-cancel parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_action' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Cancel agent action + tags: + - Elastic Agent actions + /agents/bulk_reassign: + post: + operationId: bulk-reassign-agents + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - setDefaultDataViewRequest: - $ref: '#/components/examples/Data_views_set_default_data_view_request' + example: + agents: 'fleet-agents.policy_id : ("policy1" or "policy2")' + policy_id: policy_id schema: type: object properties: - data_view_id: - description: > - The data view identifier. NOTE: The API does not validate - whether it is a valid identifier. Use `null` to unset the - default data view. - nullable: true + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + policy_id: + description: new agent policy id type: string - force: - default: false - description: Update an existing default data view identifier. - type: boolean required: - - data_view_id - required: true + - policy_id + - agents responses: '200': content: @@ -1153,36 +1264,46 @@ paths: schema: type: object properties: - acknowledged: - type: boolean - description: Indicates a successful call. + actionId: + type: string + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Set the default data view + $ref: '#/components/responses/Fleet_error' + summary: Bulk reassign agents tags: - - data views - /api/data_views/swap_references: + - Elastic Agents + /agents/bulk_request_diagnostics: post: - description: > - Changes saved object references from one data view identifier to - another. WARNING: Misuse can break large numbers of saved objects! - Practicing with a backup is recommended. - operationId: swapDataViewsDefault + operationId: bulk-request-diagnostics parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - swapDataViewRequest: - $ref: '#/components/examples/Data_views_swap_data_view_request' + example: + agents: 'fleet-agents.policy_id : ("policy1" or "policy2")' schema: - $ref: '#/components/schemas/Data_views_swap_data_view_request_object' - required: true + type: object + properties: + additional_metrics: + items: + oneOf: + - enum: + - CPU + type: string + type: array + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + batchSize: + type: number + required: + - agents responses: '200': content: @@ -1190,46 +1311,52 @@ paths: schema: type: object properties: - deleteStatus: - type: object - properties: - deletePerformed: - type: boolean - remainingRefs: - type: integer - result: - items: - type: object - properties: - id: - description: A saved object identifier. - type: string - type: - description: The saved object type. - type: string - type: array - description: Indicates a successful call. - summary: Swap saved object references + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk request diagnostics from agents tags: - - data views - /api/data_views/swap_references/_preview: + - Elastic Agents + /agents/bulk_unenroll: post: - description: > - Preview the impact of swapping saved object references from one data - view identifier to another. - operationId: previewSwapDataViewsDefault + operationId: bulk-unenroll-agents parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - previewSwapDataViewRequest: - $ref: >- - #/components/examples/Data_views_preview_swap_data_view_request + example: + agents: + - agent1 + - agent2 + force: false + revoke: true schema: - $ref: '#/components/schemas/Data_views_swap_data_view_request_object' - required: true + type: object + properties: + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + force: + description: Unenrolls hosted agents too + type: boolean + includeInactive: + description: >- + When passing agents by KQL query, unenrolls inactive agents + too + type: boolean + revoke: + description: Revokes API keys of agents + type: boolean + required: + - agents responses: '200': content: @@ -1237,33 +1364,53 @@ paths: schema: type: object properties: - result: - items: - type: object - properties: - id: - description: A saved object identifier. - type: string - type: - description: The saved object type. - type: string - type: array - description: Indicates a successful call. - summary: Preview a saved object reference swap + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk unenroll agents tags: - - data views - /api/detection_engine/privileges: - get: - description: > - Retrieves whether or not the user is authenticated, and the user's - Kibana - - space and index privileges, which determine if the user can create an - - index for the Elastic Security alerts generated by - - detection engine rules. - operationId: ReadPrivileges + - Elastic Agents + /agents/bulk_update_agent_tags: + post: + operationId: bulk-update-agent-tags + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + example: + agents: + - agent1 + - agent2 + tagsToAdd: + - newTag + tagsToRemove: + - existingTag + schema: + type: object + properties: + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + batchSize: + type: number + tagsToAdd: + items: + type: string + type: array + tagsToRemove: + items: + type: string + type: array + required: + - agents responses: '200': content: @@ -1271,3112 +1418,5116 @@ paths: schema: type: object properties: - has_encryption_key: - type: boolean - is_authenticated: - type: boolean - required: - - is_authenticated - - has_encryption_key - description: Successful response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Returns user privileges for the Kibana space + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk update agent tags tags: - - Security Solution Detections API - - Privileges API - /api/detection_engine/rules: - delete: - description: Delete a detection rule using the `rule_id` or `id` field. - operationId: DeleteRule + - Elastic Agents + /agents/bulk_upgrade: + post: + operationId: bulk-upgrade-agents parameters: - - description: The rule's `id` value. - in: query - name: id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - - description: The rule's `rule_id` value. - in: query - name: rule_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + example: + agents: + - agent1 + - agent2 + rollout_duration_seconds: 3600 + source_uri: 'https://artifacts.elastic.co/downloads/beats/elastic-agent' + start_time: '2022-08-03T14:00:00.000Z' + version: 8.4.0 + schema: + $ref: '#/components/schemas/Fleet_bulk_upgrade_agents' + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Delete a detection rule + type: object + properties: + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk upgrade agents tags: - - Security Solution Detections API - - Rules API - get: - description: Retrieve a detection rule using the `rule_id` or `id` field. - operationId: ReadRule - parameters: - - description: The rule's `id` value. - in: query - name: id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - - description: The rule's `rule_id` value. - in: query - name: rule_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId + - Elastic Agents + '/agents/files/{fileId}': + delete: + operationId: delete-agent-upload-file responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Retrieve a detection rule + type: object + properties: + body: + type: object + properties: + deleted: + type: boolean + id: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete file uploaded by agent tags: - - Security Solution Detections API - - Rules API - patch: - description: >- - Update specific fields of an existing detection rule using the `rule_id` - or `id` field. - operationId: PatchRule - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePatchProps + - Elastic Agents + parameters: + - in: path + name: fileId required: true + schema: + type: string + '/agents/files/{fileId}/{fileName}': + get: + operationId: get-agent-upload-file responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Patch a detection rule + type: object + properties: + body: + type: object + properties: + items: + type: object + properties: + body: {} + headers: {} + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get file uploaded by agent tags: - - Security Solution Detections API - - Rules API - post: - description: Create a new detection rule. - operationId: CreateRule - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleCreateProps + - Elastic Agents + parameters: + - in: path + name: fileId + required: true + schema: + type: string + - in: path + name: fileName required: true + schema: + type: string + /agents/setup: + get: + operationId: get-agents-setup-status responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Create a detection rule + $ref: '#/components/schemas/Fleet_fleet_status_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent setup info tags: - - Security Solution Detections API - - Rules API - put: - description: > - Update a detection rule using the `rule_id` or `id` field. The original - rule is replaced, and all unspecified fields are deleted. - - > info - - > You cannot modify the `id` or `rule_id` values. - operationId: UpdateRule + - Elastic Agents + post: + operationId: setup-agents + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleUpdateProps - required: true + type: object + properties: + admin_password: + type: string + admin_username: + type: string + required: + - admin_username + - admin_password responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Update a detection rule + $ref: '#/components/schemas/Fleet_fleet_setup_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Initiate agent setup tags: - - Security Solution Detections API - - Rules API - /api/detection_engine/rules/_bulk_action: - post: - description: >- - Apply a bulk action, such as bulk edit, duplicate, or delete, to - multiple detection rules. The bulk action is applied to all rules that - match the query or to the rules listed by their IDs. - operationId: PerformRulesBulkAction - parameters: - - description: Enables dry run mode for the request call. - in: query - name: dry_run - required: false - schema: - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDeleteRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDisableRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEnableRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkExportRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDuplicateRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkManualRuleRun - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditRules + - Elastic Agents + /agents/tags: + get: + operationId: get-agent-tags responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkExportActionResponse + $ref: '#/components/schemas/Fleet_get_agent_tags_response' description: OK - summary: Apply a bulk action to detection rules + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent tags tags: - - Security Solution Detections API - - Bulk API - /api/detection_engine/rules/_export: + - Elastic Agents + /api/actions/connector: post: - description: > - Export detection rules to an `.ndjson` file. The following configuration - items are also included in the `.ndjson` file: - - - Actions - - - Exception lists - - > info - - > You cannot export prebuilt rules. - operationId: ExportRules + description: The connector identifier is randomly generated. + operationId: createConnector parameters: - - description: Determines whether a summary of the exported rules is returned. - in: query - name: exclude_export_details - required: false - schema: - default: false - type: boolean - - description: File name for saving the exported rules. - in: query - name: file_name - required: false - schema: - default: export.ndjson - type: string + - $ref: '#/components/parameters/Connectors_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_email_connector_request + createIndexConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_index_connector_request + createWebhookConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_webhook_connector_request + createXmattersConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_xmatters_connector_request schema: - nullable: true - type: object - properties: - objects: - description: >- - Array of `rule_id` fields. Exports all rules when - unspecified. - items: - type: object - properties: - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - required: - - rule_id - type: array - required: - - objects - required: false + $ref: '#/components/schemas/Connectors_create_connector_request' + required: true responses: '200': content: - application/ndjson; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_email_connector_response + createIndexConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_index_connector_response + createWebhookConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_webhook_connector_response + createXmattersConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_xmatters_connector_response schema: - description: An `.ndjson` file containing the returned rules. - format: binary - type: string + $ref: '#/components/schemas/Connectors_connector_response_properties' description: Indicates a successful call. - summary: Export detection rules + '401': + $ref: '#/components/responses/Connectors_401' + summary: Create a connector with a random ID tags: - - Security Solution Detections API - - Import/Export API - /api/detection_engine/rules/_find: + - connectors + /api/actions/connector_types: get: - description: >- - Retrieve a paginated list of detection rules. By default, the first page - is returned, with 20 results per page. - operationId: FindRules - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_FindRulesSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Rules per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - summary: List all detection rules - tags: - - Security Solution Detections API - - Rules API - /api/detection_engine/rules/_import: - post: - description: > - Import detection rules from an `.ndjson` file, including actions and - exception lists. The request must include: - - - The `Content-Type: multipart/form-data` HTTP header. - - - A link to the `.ndjson` file containing the rules. - operationId: ImportRules + operationId: getConnectorTypes parameters: - description: >- - Determines whether existing rules with the same `rule_id` are - overwritten. - in: query - name: overwrite - required: false - schema: - default: false - type: boolean - - description: >- - Determines whether existing exception lists with the same `list_id` - are overwritten. - in: query - name: overwrite_exceptions - required: false - schema: - default: false - type: boolean - - description: >- - Determines whether existing actions with the same - `kibana.alert.rule.actions.id` are overwritten. - in: query - name: overwrite_action_connectors - required: false - schema: - default: false - type: boolean - - description: Generates a new list ID for each imported exception list. + A filter to limit the retrieved connector types to those that + support a specific feature (such as alerting or cases). in: query - name: as_new_list - required: false + name: feature_id schema: - default: false - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - description: The `.ndjson` file containing the rules. - format: binary - type: string - required: true + $ref: '#/components/schemas/Connectors_features' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorTypesServerlessResponse: + $ref: >- + #/components/examples/Connectors_get_connector_types_generativeai_response schema: - additionalProperties: false - type: object - properties: - action_connectors_errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema - type: array - action_connectors_success: - type: boolean - action_connectors_success_count: - minimum: 0 - type: integer - action_connectors_warnings: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_WarningSchema - type: array - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema - type: array - exceptions_errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema - type: array - exceptions_success: - type: boolean - exceptions_success_count: - minimum: 0 - type: integer - rules_count: - minimum: 0 - type: integer - success: - type: boolean - success_count: - minimum: 0 - type: integer - required: - - exceptions_success - - exceptions_success_count - - exceptions_errors - - rules_count - - success - - success_count - - errors - - action_connectors_errors - - action_connectors_warnings - - action_connectors_success - - action_connectors_success_count + description: The properties vary for each connector type. + items: + type: object + properties: + enabled: + description: >- + Indicates whether the connector type is enabled in + Kibana. + example: true + type: boolean + enabled_in_config: + description: >- + Indicates whether the connector type is enabled in the + Kibana configuration file. + example: true + type: boolean + enabled_in_license: + description: >- + Indicates whether the connector is enabled in the + license. + example: true + type: boolean + id: + $ref: '#/components/schemas/Connectors_connector_types' + is_system_action_type: + example: false + type: boolean + minimum_license_required: + description: The license that is required to use the connector type. + example: basic + type: string + name: + description: The name of the connector type. + example: Index + type: string + supported_feature_ids: + description: The features that are supported by the connector type. + example: + - alerting + - cases + - siem + items: + $ref: '#/components/schemas/Connectors_features' + type: array + title: Get connector types response body properties + type: array description: Indicates a successful call. - summary: Import detection rules + '401': + $ref: '#/components/responses/Connectors_401' + summary: Get all connector types tags: - - Security Solution Detections API - - Import/Export API - '/api/detection_engine/rules/{id}/exceptions': - post: - operationId: CreateRuleExceptionListItems + - connectors + '/api/actions/connector/{connectorId}': + delete: + operationId: deleteConnector parameters: - - description: Detection rule's identifier - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_RuleId' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - items: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemProps - type: array - required: - - items - description: Rule exception list items - required: true + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_connector_id' + responses: + '204': + description: Indicates a successful call. + '401': + $ref: '#/components/responses/Connectors_401' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Delete a connector + tags: + - connectors + get: + operationId: getConnector + parameters: + - $ref: '#/components/parameters/Connectors_connector_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorResponse: + $ref: '#/components/examples/Connectors_get_connector_response' schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + $ref: '#/components/schemas/Connectors_connector_response_properties' + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates rule exception list items + $ref: '#/components/responses/Connectors_401' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Get a connector information tags: - - Security Solution Exceptions API - /api/detection_engine/rules/preview: + - connectors post: - operationId: RulePreview + operationId: createConnectorId + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - description: > + A UUID v1 or v4 identifier for the connector. If you omit this + parameter, an identifier is randomly generated. + in: path + name: connectorId + required: true + schema: + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createIndexConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_index_connector_request schema: - anyOf: - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - discriminator: - propertyName: type - description: >- - An object containing tags to add or remove and alert ids the changes - will be applied + $ref: '#/components/schemas/Connectors_create_connector_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createIndexConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_index_connector_response schema: - type: object - properties: - isAborted: - type: boolean - logs: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewLogs - type: array - previewId: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - required: - - logs - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response + $ref: '#/components/schemas/Connectors_connector_response_properties' + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Preview rule alerts generated on specified time range + $ref: '#/components/responses/Connectors_401' + summary: Create a connector tags: - - Security Solution Detections API - - Rule preview API - /api/detection_engine/signals/assignees: - post: - description: | - Assign users to detection alerts, and unassign them from alerts. - > info - > You cannot add and remove the same assignee in the same request. - operationId: SetAlertAssignees + - connectors + put: + operationId: updateConnector + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_connector_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateIndexConnectorRequest: + $ref: >- + #/components/examples/Connectors_update_index_connector_request schema: - type: object - properties: - assignees: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertAssignees - description: Details about the assignees to assign and unassign. - ids: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertIds - description: List of alerts ids to assign and unassign passed assignees. - required: - - assignees - - ids + $ref: '#/components/schemas/Connectors_update_connector_request' required: true responses: '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Connectors_connector_response_properties' description: Indicates a successful call. '400': - description: Invalid request. - summary: Assign and unassign users from detection alerts + $ref: '#/components/responses/Connectors_401' + '401': + $ref: '#/components/responses/Connectors_401' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Update a connector tags: - - Security Solution Detections API - /api/detection_engine/signals/search: - post: - description: Find and/or aggregate detection alerts that match the given query. - operationId: SearchAlerts - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - description: Elasticsearch query and aggregation request - type: object - properties: - _source: - oneOf: - - type: boolean - - type: string - - items: - type: string - type: array - aggs: - additionalProperties: true - type: object - fields: - items: - type: string - type: array - query: - additionalProperties: true - type: object - runtime_mappings: - additionalProperties: true - type: object - size: - minimum: 0 - type: integer - sort: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSort - track_total_hits: - type: boolean - description: Search and/or aggregation query - required: true + - connectors + /api/actions/connectors: + get: + operationId: getConnectors responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorsResponse: + $ref: '#/components/examples/Connectors_get_connectors_response' schema: - additionalProperties: true - description: Elasticsearch search response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response + items: + $ref: >- + #/components/schemas/Connectors_connector_response_properties + type: array + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Find and/or aggregate detection alerts - tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/signals/status: - post: - description: Set the status of one or more detection alerts. - operationId: SetAlertsStatus - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertsStatusByIds - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertsStatusByQuery - description: >- - An object containing desired status and explicit alert ids or a query - to select alerts - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: true - description: Elasticsearch update by query response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Set a detection alert status - tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/signals/tags: - post: - description: | - And tags to detection alerts, and remove them from alerts. - > info - > You cannot add and remove the same alert tag in the same request. - operationId: SetAlertTags - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - ids: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertIds - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertTags - required: - - ids - - tags - description: >- - An object containing tags to add or remove and alert ids the changes - will be applied - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: true - description: Elasticsearch update by query response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Add and remove detection alert tags - tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/tags: - get: - description: List all unique tags from all detection rules. - operationId: ReadTags - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - description: Indicates a successful call - summary: List all detection rule tags + $ref: '#/components/responses/Connectors_401' + summary: Get all connectors tags: - - Security Solution Detections API - - Tags API - /api/endpoint_list: - post: - description: Creates an endpoint list or does nothing if the list already exists - operationId: CreateEndpointList - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Creates an endpoint list - /api/endpoint_list/items: + - connectors + '/api/alerting/rule/{id}': delete: - operationId: DeleteEndpointListItem + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2' parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false + - description: The version of the API to use + in: header + name: elastic-api-version schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified - in: query - name: item_id - required: false + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Deletes an endpoint list item + '204': + description: Indicates a successful call. + summary: Delete a rule + tags: + - alerting get: - operationId: ReadEndpointListItem + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#0' parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false + - description: The version of the API to use + in: header + name: elastic-api-version schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified - in: query - name: item_id - required: false + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Reads an endpoint list item - post: - operationId: CreateEndpointListItem - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - required: - - type - - name - - description - - entries - description: Exception list item's properties - required: true + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item already exists - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Creates an endpoint list item - put: - operationId: UpdateEndpointListItem + additionalProperties: false + type: object + properties: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: + items: + description: List of active snoozes for the rule. + type: string + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Get rule details + tags: + - alerting + post: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%3F%7D#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: >- + The identifier for the rule. If it is omitted, an ID is randomly + generated. + in: path + name: id + required: false + schema: + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - _version: - type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - description: Either `id` or `item_id` must be specified - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - description: Either `id` or `item_id` must be specified - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray + actions: default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - required: - - type - - name - - description - - entries - description: Exception list item's properties - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Updates an endpoint list item - /api/endpoint_list/items/_find: - get: - operationId: FindEndpointListItems - parameters: - - description: > - Filters the returned results according to the value of the specified - field, - - using the `:` syntax. - in: query - name: filter - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_FindEndpointListItemsFilter - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 0 - type: integer - - description: The number of exception list items to return per page - in: query - name: per_page - required: false - schema: - minimum: 0 - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc - type: string + items: + additionalProperties: false + description: An action that runs under defined conditions. + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Conditions that affect whether the action runs. If you + specify multiple conditions, all conditions must be + met for the action to run. For example, if an alert + occurs within the specified time frame and matches the + query, the action runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL) as defined in the + `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the days + of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + description: >- + Defines the range of time in a day that the + action can run. If the `start` value is + `00:00` and the `end` value is `24:00`, + actions be generated all day. + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work but + lack built-in daylight savings time support + and are not recommended. + type: string + required: + - days + - hours + - timezone + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. Valid + values include: `onActionGroupChange`: Actions run + when the alert status changes; `onActiveAlert`: + Actions run when the alert becomes active and at + each check interval while the rule conditions are + met; `onThrottleInterval`: Actions run when the + alert becomes active and at the interval specified + in the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` at + both the rule and action level. The recommended + method is to set it for each action. If you set it + at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific + values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often an + alert generates repeated actions. It is specified + in seconds, minutes, hours, or days and is + applicable only if `notify_when` is set to + `onThrottleInterval`. NOTE: You cannot specify the + throttle interval at both the rule and action + level. The recommended method is to set it for + each action. If you set it at the rule level then + update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + default: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: A universally unique identifier (UUID) for the action. + type: string + required: + - id + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, `infrastructure`, + `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, + `siem`, `stackAlerts`, or `uptime`. + type: string + enabled: + default: true + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + name: + description: >- + The name of the rule. While this name does not have to be + unique, a distinctive name can help you identify a rule. + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while the rule + conditions are met; `onThrottleInterval`: Actions run when + the alert becomes active and at the interval specified in + the throttle property while the rule conditions are met. + NOTE: You cannot specify `notify_when` at both the rule and + action level. The recommended method is to set it for each + action. If you set it at the rule level then update the rule + in Kibana, it is automatically changed to use + action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + type: object + rule_type_id: + description: The rule type identifier. + type: string + schedule: + additionalProperties: false + description: >- + The check interval, which specifies how frequently the rule + conditions are checked. + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, or + days. + type: string + required: + - interval + tags: + default: [] + description: The tags for the rule. + items: + type: string + type: array + throttle: + description: >- + Use the `throttle` property in the action `frequency` object + instead. The throttle interval, which defines how often an + alert generates repeated actions. NOTE: You cannot specify + the throttle interval at both the rule and action level. If + you set it at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific values. + nullable: true + type: string + required: + - name + - rule_type_id + - consumer + - schedule responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - data: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem + description: List of active snoozes for the rule. + type: string type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - pit: + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true type: string - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Finds endpoint list items - /api/endpoint/action: - get: - description: Get a list of action requests and their responses - operationId: EndpointGetActionsList - parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetEndpointActionListRouteQuery - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Actions List schema - tags: - - Security Solution Endpoint Management API - '/api/endpoint/action_log/{agent_id}': - get: - deprecated: true - description: Get action requests log - operationId: EndpointGetActionLog - parameters: - - in: path - name: agent_id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionLogRequestQuery - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get action requests log schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/action_status: - get: - description: Get action status - operationId: EndpointGetActionsStatus - parameters: - - in: query - name: query - required: true - schema: - type: object - properties: - agent_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentIds - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionStatusSuccessResponse - description: OK - summary: Get Actions status schema - tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}': - get: - description: Get action details - operationId: EndpointGetActionsDetails - parameters: - - in: path - name: action_id - required: true - schema: - type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Action details schema - tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}/file/{file_id}/download`': - get: - description: Download a file from an endpoint - operationId: EndpointFileDownload - parameters: - - in: path - name: action_id - required: true - schema: - type: string - - in: path - name: file_id - required: true - schema: - type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: File Download schema + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Create a rule tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}/file/{file_id}`': - get: - description: Get file info - operationId: EndpointFileInfo + - alerting + put: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#1' parameters: - - in: path - name: action_id + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf required: true schema: + example: 'true' type: string - - in: path - name: file_id + - description: The identifier for the rule. + in: path + name: id required: true schema: type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: File Info schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/execute: - post: - description: Execute a given command on an endpoint - operationId: EndpointExecuteAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ExecuteRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Execute Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/get_file: - post: - description: Get a file from an endpoint - operationId: EndpointGetFileAction requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetFileRouteRequestBody - required: true + additionalProperties: false + type: object + properties: + actions: + default: [] + items: + additionalProperties: false + description: An action that runs under defined conditions. + type: object + properties: + alerts_filter: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL) as defined in the + `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the days + of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + description: >- + Defines the range of time in a day that the + action can run. If the `start` value is + `00:00` and the `end` value is `24:00`, + actions be generated all day. + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work but + lack built-in daylight savings time support + and are not recommended. + type: string + required: + - days + - hours + - timezone + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. Valid + values include: `onActionGroupChange`: Actions run + when the alert status changes; `onActiveAlert`: + Actions run when the alert becomes active and at + each check interval while the rule conditions are + met; `onThrottleInterval`: Actions run when the + alert becomes active and at the interval specified + in the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` at + both the rule and action level. The recommended + method is to set it for each action. If you set it + at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific + values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often an + alert generates repeated actions. It is specified + in seconds, minutes, hours, or days and is + applicable only if `notify_when` is set to + `onThrottleInterval`. NOTE: You cannot specify the + throttle interval at both the rule and action + level. The recommended method is to set it for + each action. If you set it at the rule level then + update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + default: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: A universally unique identifier (UUID) for the action. + type: string + required: + - id + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + name: + description: >- + The name of the rule. While this name does not have to be + unique, a distinctive name can help you identify a rule. + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while the rule + conditions are met; `onThrottleInterval`: Actions run when + the alert becomes active and at the interval specified in + the throttle property while the rule conditions are met. + NOTE: You cannot specify `notify_when` at both the rule and + action level. The recommended method is to set it for each + action. If you set it at the rule level then update the rule + in Kibana, it is automatically changed to use + action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + type: object + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, or + days. + type: string + required: + - interval + tags: + default: [] + items: + description: The tags for the rule. + type: string + type: array + throttle: + description: >- + Use the `throttle` property in the action `frequency` object + instead. The throttle interval, which defines how often an + alert generates repeated actions. NOTE: You cannot specify + the throttle interval at both the rule and action level. If + you set it at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific values. + nullable: true + type: string + required: + - name + - schedule responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get File Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/isolate: - post: - description: Isolate an endpoint - operationId: EndpointIsolateAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_IsolateRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Isolate Action + additionalProperties: false + type: object + properties: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: + items: + description: List of active snoozes for the rule. + type: string + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Update a rule tags: - - Security Solution Endpoint Management API - /api/endpoint/action/kill_process: + - alerting + '/api/alerting/rule/{id}/_disable': post: - description: Kill a running process on an endpoint - operationId: EndpointKillProcessAction + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_disable#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema - required: true + additionalProperties: false + nullable: true + type: object + properties: + untrack: + description: Defines whether this rule's alerts should be untracked. + type: boolean + x-oas-optional: true responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Kill process Action + '204': + description: Indicates a successful call. + summary: Disable a rule tags: - - Security Solution Endpoint Management API - /api/endpoint/action/running_procs: + - alerting + '/api/alerting/rule/{id}/_enable': post: - description: Get list of running processes on an endpoint - operationId: EndpointGetProcessesAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetProcessesRouteRequestBody - required: true + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_enable#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Running Processes Action + '204': + description: Indicates a successful call. + summary: Enable a rule tags: - - Security Solution Endpoint Management API - /api/endpoint/action/scan: + - alerting + '/api/alerting/rule/{id}/_mute_all': post: - description: Scan a file or directory - operationId: EndpointScanAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ScanRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Scan Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/state: - get: - operationId: EndpointGetActionsState - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionStateSuccessResponse - description: OK - summary: Get Action State schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/suspend_process: - post: - description: Suspend a running process on an endpoint - operationId: EndpointSuspendProcessAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Suspend process Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/unisolate: - post: - description: Release an endpoint - operationId: EndpointUnisolateAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UnisolateRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Unisolate Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/upload: - post: - description: Upload a file to an endpoint - operationId: EndpointUploadAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UploadRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Upload Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/metadata: - get: - operationId: GetEndpointMetadataList + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_mute_all#0' parameters: - - in: query - name: query + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ListRequestQuery - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata List schema - tags: - - Security Solution Endpoint Management API - '/api/endpoint/metadata/{id}': - get: - operationId: GetEndpointMetadata - parameters: - - in: path + example: 'true' + type: string + - description: The identifier for the rule. + in: path name: id required: true schema: type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/metadata/transforms: - get: - operationId: GetEndpointMetadataTransform - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata Transform schema + '204': + description: Indicates a successful call. + summary: Mute all alerts tags: - - Security Solution Endpoint Management API - /api/endpoint/policy_response: - get: - operationId: GetPolicyResponse + - alerting + '/api/alerting/rule/{id}/_unmute_all': + post: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_unmute_all#0' parameters: - - in: query - name: query + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf required: true schema: - type: object - properties: - agentId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Policy Response schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/policy/summaries: - get: - deprecated: true - operationId: GetAgentPolicySummary - parameters: - - in: query - name: query + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id required: true schema: - type: object - properties: - package_name: - type: string - policy_id: - nullable: true - type: string + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Agent Policy Summary schema + '204': + description: Indicates a successful call. + summary: Unmute all alerts tags: - - Security Solution Endpoint Management API - '/api/endpoint/protection_updates_note/{package_policy_id}': - get: - operationId: GetProtectionUpdatesNote + - alerting + '/api/alerting/rule/{id}/_update_api_key': + post: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_update_api_key#0' parameters: - - in: path - name: package_policy_id + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id required: true schema: type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse - description: OK - summary: Get Protection Updates Note schema + '204': + description: Indicates a successful call. + summary: Update the API key for a rule tags: - - Security Solution Endpoint Management API + - alerting + '/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute': post: - operationId: CreateUpdateProtectionUpdatesNote + operationId: >- + %2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_mute#0 parameters: - - in: path - name: package_policy_id + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: rule_id + required: true + schema: + type: string + - description: The identifier for the alert. + in: path + name: alert_id required: true schema: type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - note: - type: string - required: true responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse - description: OK - summary: Create Update Protection Updates Note schema + '204': + description: Indicates a successful call. + summary: Mute an alert tags: - - Security Solution Endpoint Management API - '/api/endpoint/suggestions/{suggestion_type}': + - alerting + '/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute': post: - operationId: GetEndpointSuggestions + operationId: >- + %2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_unmute#0 parameters: - - in: path - name: suggestion_type - required: true + - description: The version of the API to use + in: header + name: elastic-api-version schema: + default: '2023-10-31' enum: - - eventFilters + - '2023-10-31' type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - field: - type: string - fieldMeta: {} - filters: {} - query: - type: string - required: - - parameters - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get suggestions - tags: - - Security Solution Endpoint Management API - /api/exception_lists: - delete: - operationId: DeleteExceptionList - parameters: - - description: Either `id` or `list_id` must be specified - in: query - name: id - required: false + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Either `id` or `list_id` must be specified - in: query - name: list_id - required: false + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: rule_id + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: false + type: string + - description: The identifier for the alert. + in: path + name: alert_id + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Deletes an exception list + '204': + description: Indicates a successful call. + summary: Unmute an alert tags: - - Security Solution Exceptions API + - alerting + /api/alerting/rules/_find: get: - operationId: ReadExceptionList + operationId: '%2Fapi%2Falerting%2Frules%2F_find#0' parameters: - - description: Either `id` or `list_id` must be specified + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: The number of rules to return per page. in: query - name: id + name: per_page required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Either `id` or `list_id` must be specified + default: 10 + minimum: 0 + type: number + - description: The page number to return. in: query - name: list_id + name: page required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type + default: 1 + minimum: 1 + type: number + - description: >- + An Elasticsearch simple_query_string query that filters the objects + in the response. + in: query + name: search required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves an exception list using its `id` or `list_id` field - tags: - - Security Solution Exceptions API - post: - operationId: CreateExceptionList - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType - version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion - default: 1 - required: - - name - - description - - type - description: Exception list's properties - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list already exists response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates an exception list - tags: - - Security Solution Exceptions API - put: - operationId: UpdateExceptionList - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - _version: - type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType - version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion - required: - - name - - description - - type - description: Exception list's properties - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Updates an exception list - tags: - - Security Solution Exceptions API - /api/exception_lists/_duplicate: - post: - operationId: DuplicateExceptionList - parameters: - - description: Exception list's human identifier + type: string + - description: The default operator to use for the simple_query_string. in: query - name: list_id - required: true + name: default_search_operator + required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: true + default: OR + enum: + - OR + - AND + type: string + - description: The fields to perform the simple_query_string parsed query against. + in: query + name: search_fields + required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType + anyOf: + - items: + type: string + type: array + - type: string - description: >- - Determines whether to include expired exceptions in the exported - list + Determines which field is used to sort the results. The field must + exist in the `attributes` key of the response. in: query - name: include_expired_exceptions - required: true + name: sort_field + required: false + schema: + type: string + - description: Determines the sort order. + in: query + name: sort_order + required: false schema: - default: 'true' enum: - - 'true' - - 'false' + - asc + - desc type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '405': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list to duplicate not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Duplicates an exception list - tags: - - Security Solution Exceptions API - /api/exception_lists/_export: - post: - description: Exports an exception list and its associated items to an .ndjson file - operationId: ExportExceptionList - parameters: - - description: Exception list's identifier - in: query - name: id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Exception list's human identifier - in: query - name: list_id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - description: >- - Determines whether to include expired exceptions in the exported - list - in: query - name: include_expired_exceptions - required: true - schema: - default: 'true' - enum: - - 'true' - - 'false' - type: string - responses: - '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: >- - A `.ndjson` file containing specified exception list and its - items - format: binary - type: string - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Exports an exception list - tags: - - Security Solution Exceptions API - /api/exception_lists/_find: - get: - operationId: FindExceptionLists - parameters: - - description: > - Filters the returned results according to the value of the specified - field. - - - Uses the `so type.field name:field` value syntax, where `so type` - can be: - - - - `exception-list`: Specify a space-aware exception list. - - - `exception-list-agnostic`: Specify an exception list that is - shared across spaces. + Filters the rules that have a relation with the reference objects + with a specific type and identifier. in: query - name: filter + name: has_reference required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_FindExceptionListsFilter - - description: > - Determines whether the returned containers are Kibana associated - with a Kibana space - - or available in all spaces (`agnostic` or `single`) - in: query - name: namespace_type + additionalProperties: false + nullable: true + type: object + properties: + id: + type: string + type: + type: string + required: + - type + - id + - in: query + name: fields required: false schema: - default: - - single items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType + description: The fields to return in the `attributes` key of the response. + type: string type: array - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 1 - type: integer - - description: The number of exception lists to return per page - in: query - name: per_page - required: false - schema: - minimum: 1 - type: integer - - description: Determines which field is used to sort the results + - description: >- + A KQL string that you filter with an attribute from your saved + object. It should look like `savedObjectType.attributes.title: + "myTitle"`. However, if you used a direct attribute of a saved + object, such as `updatedAt`, you must define your filter, for + example, `savedObjectType.updatedAt > 2018-12-22`. in: query - name: sort_field + name: filter required: false schema: type: string - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order + - in: query + name: filter_consumers required: false schema: - enum: - - desc - - asc - type: string + items: + description: List of consumers to filter. + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - data: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList + description: List of active snoozes for the rule. + type: string type: array - page: - minimum: 1 - type: integer - per_page: - minimum: 1 - type: integer - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Finds exception lists - tags: - - Security Solution Exceptions API - /api/exception_lists/_import: - post: - description: Imports an exception list and associated items - operationId: ImportExceptionList - parameters: - - description: > - Determines whether existing exception lists with the same `list_id` - are overwritten. - - If any exception items have the same `item_id`, those are also - overwritten. - in: query - name: overwrite - required: false - schema: - default: false - type: boolean - - in: query - name: overwrite_exceptions - required: false - schema: - default: false - type: boolean - - in: query - name: overwrite_action_connectors - required: false - schema: - default: false - type: boolean - - description: > - Determines whether the list being imported will have a new `list_id` - generated. - - Additional `item_id`'s are generated for each exception item. Both - the exception - - list and its items are overwritten. - in: query - name: as_new_list - required: false - schema: - default: false - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - description: A `.ndjson` file containing the exception list - format: binary - type: string - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - errors: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListsImportBulkErrorArray - success: - type: boolean - success_count: - minimum: 0 - type: integer - success_count_exception_list_items: - minimum: 0 - type: integer - success_count_exception_lists: - minimum: 0 - type: integer - success_exception_list_items: + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true type: boolean - success_exception_lists: + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. type: boolean - required: - - errors - - success - - success_count - - success_exception_lists - - success_count_exception_lists - - success_exception_list_items - - success_count_exception_list_items - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Get information about rules + tags: + - alerting + /api/apm/agent_keys: + post: + description: Create a new agent key for APM. + operationId: createAgentKey + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + name: + type: string + privileges: + items: + enum: + - 'event:write' + - 'config_agent:read' + type: string + type: array + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Imports an exception list + type: object + properties: + api_key: + type: string + encoded: + type: string + expiration: + format: int64 + type: integer + id: + type: string + name: + type: string + description: Agent key created successfully + summary: Create an APM agent key tags: - - Security Solution Exceptions API - /api/exception_lists/items: - delete: - operationId: DeleteExceptionListItem + - APM agent keys + '/api/apm/services/{serviceName}/annotation': + post: + description: Create a new annotation for a specific service. + operationId: createAnnotation parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified - in: query - name: item_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - - in: query - name: namespace_type - required: false + - description: The name of the service + in: path + name: serviceName + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + '@timestamp': + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + version: + type: string + tags: + items: + type: string + type: array + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Deletes an exception list item - tags: - - Security Solution Exceptions API - get: - operationId: ReadExceptionListItem - parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified + type: object + properties: + _id: + type: string + _index: + type: string + _source: + type: object + properties: + '@timestamp': + type: string + annotation: + type: string + event: + type: object + properties: + created: + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + name: + type: string + version: + type: string + tags: + items: + type: string + type: array + description: Annotation created successfully + summary: Create a service annotation + tags: + - APM annotations + '/api/apm/services/{serviceName}/annotation/search': + get: + description: Search for annotations related to a specific service. + operationId: getAnnotation + parameters: + - description: The name of the service + in: path + name: serviceName + required: true + schema: + type: string + - description: The environment to filter annotations by in: query - name: item_id + name: environment required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - - in: query - name: namespace_type + type: string + - description: The start date for the search + in: query + name: start required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + type: string + - description: The end date for the search + in: query + name: end + required: false + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem + type: object + properties: + annotations: + items: + type: object + properties: + '@timestamp': + type: number + id: + type: string + text: + type: string + type: + enum: + - version + type: string + type: array description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': + summary: Search for annotations + tags: + - APM annotations + /api/data_views: + get: + operationId: getAllDataViewsDefault + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getAllDataViewsResponse: + $ref: '#/components/examples/Data_views_get_data_views_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': + type: object + properties: + data_view: + items: + type: object + properties: + id: + type: string + name: + type: string + namespaces: + items: + type: string + type: array + title: + type: string + typeMeta: + type: object + type: array + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Gets an exception list item + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Get all data views tags: - - Security Solution Exceptions API + - data views + /api/data_views/data_view: post: - operationId: CreateExceptionListItem + operationId: createDataViewDefaultw + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createDataViewRequest: + $ref: '#/components/examples/Data_views_create_data_view_request' schema: - type: object - properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time - type: string - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType - required: - - list_id - - type - - name - - description - - entries - description: Exception list item's properties + $ref: '#/components/schemas/Data_views_create_data_view_request_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Create a data view + tags: + - data views + '/api/data_views/data_view/{viewId}': + delete: + description: | + WARNING: When you delete a data view, it cannot be recovered. + operationId: deleteDataViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' + responses: + '204': + description: Indicates a successful call. + '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Delete a data view + tags: + - data views + get: + operationId: getDataViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_view_id' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getDataViewResponse: + $ref: '#/components/examples/Data_views_get_data_view_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item already exists response - '500': + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. + '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates an exception list item + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Get a data view tags: - - Security Solution Exceptions API - put: - operationId: UpdateExceptionListItem + - data views + post: + operationId: updateDataViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateDataViewRequest: + $ref: '#/components/examples/Data_views_update_data_view_request' schema: - type: object - properties: - _version: - type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_UpdateExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time - type: string - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - description: Either `id` or `item_id` must be specified - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - description: Either `id` or `item_id` must be specified - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType - required: - - type - - name - - description - - entries - description: Exception list item's properties + $ref: '#/components/schemas/Data_views_update_data_view_request_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update a data view + tags: + - data views + '/api/data_views/data_view/{viewId}/fields': + post: + description: > + Update fields presentation metadata such as count, customLabel, + customDescription, and format. + operationId: updateFieldsMetadataDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateFieldsMetadataRequest: + $ref: '#/components/examples/Data_views_update_field_metadata_request' + schema: + type: object + properties: + fields: + description: The field object. + type: object + required: + - fields + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': + type: object + properties: + acknowledged: + type: boolean + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update data view fields metadata + tags: + - data views + '/api/data_views/data_view/{viewId}/runtime_field': + post: + operationId: createRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_create_runtime_field_request' + schema: + type: object + properties: + name: + description: | + The name for a runtime field. + type: string + runtimeField: + description: | + The runtime field definition object. + type: object + required: + - name + - runtimeField + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Updates an exception list item + type: object + description: Indicates a successful call. + summary: Create a runtime field tags: - - Security Solution Exceptions API - /api/exception_lists/items/_find: - get: - operationId: FindExceptionListItems + - data views + put: + operationId: createUpdateRuntimeFieldDefault parameters: - - description: List's id - in: query - name: list_id + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - description: | + The ID of the data view fields you want to update. + in: path + name: viewId required: true schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - type: array - - description: > - Filters the returned results according to the value of the specified - field, - - using the `:` syntax. - in: query - name: filter - required: false - schema: - default: [] - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_FindExceptionListItemsFilter - type: array - - description: > - Determines whether the returned containers are Kibana associated - with a Kibana space - - or available in all spaces (`agnostic` or `single`) - in: query - name: namespace_type - required: false - schema: - default: - - single - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - type: array - - in: query - name: search - required: false - schema: - type: string - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 0 - type: integer - - description: The number of exception list items to return per page - in: query - name: per_page - required: false - schema: - minimum: 0 - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_NonEmptyString - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_create_runtime_field_request' + schema: + type: object + properties: + name: + description: | + The name for a runtime field. + type: string + runtimeField: + description: | + The runtime field definition object. + type: object + required: + - name + - runtimeField + required: true responses: '200': content: @@ -4384,712 +6535,557 @@ paths: schema: type: object properties: - data: + data_view: + type: object + fields: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem + type: object type: array - page: - minimum: 1 - type: integer - per_page: - minimum: 1 - type: integer - pit: - type: string - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - description: Successful response + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Create or update a runtime field + tags: + - data views + '/api/data_views/data_view/{viewId}/runtime_field/{fieldName}': + delete: + operationId: deleteRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' + responses: + '200': + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Finds exception list items + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Delete a runtime field from a data view tags: - - Security Solution Exceptions API - /api/exception_lists/summary: + - data views get: - operationId: ReadExceptionListSummary + operationId: getRuntimeFieldDefault parameters: - - description: Exception list's identifier generated upon creation - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Exception list's human readable identifier - in: query - name: list_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - - description: Search filter clause - in: query - name: filter - required: false - schema: - type: string + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getRuntimeFieldResponse: + $ref: '#/components/examples/Data_views_get_runtime_field_response' schema: type: object properties: - linux: - minimum: 0 - type: integer - macos: - minimum: 0 - type: integer - total: - minimum: 0 - type: integer - windows: - minimum: 0 - type: integer - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + data_view: + type: object + fields: + items: + type: object + type: array + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves an exception list summary + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Get a runtime field tags: - - Security Solution Exceptions API - /api/exceptions/shared: + - data views post: - operationId: CreateSharedExceptionList + operationId: updateRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_update_runtime_field_request' schema: type: object properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName + runtimeField: + description: | + The runtime field definition object. + + You can update following fields: + + - `type` + - `script` + type: object required: - - name - - description + - runtimeField required: true responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list already exists response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates a shared exception list - tags: - - Security Solution Exceptions API - /api/lists: - delete: - operationId: DeleteList - parameters: - - description: List's `id` value - in: query - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - in: query - name: deleteReferences - required: false - schema: - default: false - type: boolean - - in: query - name: ignoreReferences - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes a list + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update a runtime field tags: - - Security Solution Lists API + - data views + /api/data_views/default: get: - operationId: ReadList - parameters: - - description: List's `id` value - in: query - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' + operationId: getDefaultDataViewDefault responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getDefaultDataViewResponse: + $ref: >- + #/components/examples/Data_views_get_default_data_view_response schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + data_view_id: + type: string + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves a list using its id field + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Get the default data view tags: - - Security Solution Lists API - patch: - operationId: PatchList + - data views + post: + operationId: setDefaultDatailViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + setDefaultDataViewRequest: + $ref: '#/components/examples/Data_views_set_default_data_view_request' schema: type: object properties: - _version: + data_view_id: + description: > + The data view identifier. NOTE: The API does not validate + whether it is a valid identifier. Use `null` to unset the + default data view. + nullable: true type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - version: - minimum: 1 - type: integer + force: + default: false + description: Update an existing default data view identifier. + type: boolean required: - - id - description: List's properties + - data_view_id required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + acknowledged: + type: boolean + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Patches a list + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Set the default data view tags: - - Security Solution Lists API + - data views + /api/data_views/swap_references: post: - operationId: CreateList + description: > + Changes saved object references from one data view identifier to + another. WARNING: Misuse can break large numbers of saved objects! + Practicing with a backup is recommended. + operationId: swapDataViewsDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + swapDataViewRequest: + $ref: '#/components/examples/Data_views_swap_data_view_request' schema: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - deserializer: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - serializer: - type: string - type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - version: - default: 1 - minimum: 1 - type: integer - required: - - name - - description - - type - description: List's properties + $ref: '#/components/schemas/Data_views_swap_data_view_request_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: + type: object + properties: + deleteStatus: + type: object + properties: + deletePerformed: + type: boolean + remainingRefs: + type: integer + result: + items: + type: object + properties: + id: + description: A saved object identifier. + type: string + type: + description: The saved object type. + type: string + type: array + description: Indicates a successful call. + summary: Swap saved object references + tags: + - data views + /api/data_views/swap_references/_preview: + post: + description: > + Preview the impact of swapping saved object references from one data + view identifier to another. + operationId: previewSwapDataViewsDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + previewSwapDataViewRequest: $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + #/components/examples/Data_views_preview_swap_data_view_request + schema: + $ref: '#/components/schemas/Data_views_swap_data_view_request_object' + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': + type: object + properties: + result: + items: + type: object + properties: + id: + description: A saved object identifier. + type: string + type: + description: The saved object type. + type: string + type: array + description: Indicates a successful call. + summary: Preview a saved object reference swap + tags: + - data views + /api/ml/saved_objects/sync: + get: + description: > + Synchronizes Kibana saved objects for machine learning jobs and trained + models. This API runs automatically when you start Kibana and + periodically thereafter. + operationId: mlSync + parameters: + - $ref: '#/components/parameters/Machine_learning_APIs_simulateParam' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + syncExample: + $ref: '#/components/examples/Machine_learning_APIs_mlSyncExample' schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List already exists response - '500': + $ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response' + description: Indicates a successful call + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates a list + $ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse' + description: Authorization information is missing or invalid. + summary: Sync machine learning saved objects tags: - - Security Solution Lists API - put: - operationId: UpdateList + - ml + /api/saved_objects/_export: + post: + description: > + Retrieve sets of saved objects that you want to import into Kibana. + + You must include `type` or `objects` in the request body. + + + Exported saved objects are not backwards compatible and cannot be + imported into an older version of Kibana. + + + NOTE: The `savedObjects.maxImportExportSize` configuration setting + limits the number of saved objects which may be exported. + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: exportSavedObjectsDefault + parameters: + - $ref: '#/components/parameters/Serverless_saved_objects_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + exportSavedObjectsRequest: + $ref: >- + #/components/examples/Serverless_saved_objects_export_objects_request schema: type: object properties: - _version: - type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - version: - minimum: 1 - type: integer - required: - - id - - name - - description - description: List's properties + excludeExportDetails: + default: false + description: Do not add export details entry at the end of the stream. + type: boolean + includeReferencesDeep: + description: >- + Includes all of the referenced objects in the exported + objects. + type: boolean + objects: + description: A list of objects to export. + items: + type: object + type: array + type: + description: >- + The saved object types to include in the export. Use `*` to + export all the types. + oneOf: + - type: string + - items: + type: string + type: array required: true responses: '200': content: - application/json; Elastic-Api-Version=2023-10-31: + application/x-ndjson; Elastic-Api-Version=2023-10-31: + examples: + exportSavedObjectsResponse: + $ref: >- + #/components/examples/Serverless_saved_objects_export_objects_response schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + additionalProperties: true + type: object + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Updates a list + $ref: '#/components/schemas/Serverless_saved_objects_400_response' + description: Bad request. + summary: Export saved objects tags: - - Security Solution Lists API - /api/lists/_find: - get: - operationId: FindLists + - saved objects + /api/saved_objects/_import: + post: + description: > + Create sets of Kibana saved objects from a file created by the export + API. + + Saved objects can be imported only into the same version, a newer minor + on the same major, or the next major. Exported saved objects are not + backwards compatible and cannot be imported into an older version of + Kibana. + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: importSavedObjectsDefault parameters: - - description: The page number to return - in: query - name: page - required: false - schema: - type: integer - - description: The number of lists to return per page + - $ref: '#/components/parameters/Serverless_saved_objects_kbn_xsrf' + - description: > + Creates copies of saved objects, regenerates each object ID, and + resets the origin. When used, potential conflict errors are avoided. + NOTE: This option cannot be used with the `overwrite` and + `compatibilityMode` options. in: query - name: per_page + name: createNewCopies required: false schema: - type: integer - - description: Determines which field is used to sort the results + type: boolean + - description: > + Overwrites saved objects when they already exist. When used, + potential conflict errors are automatically resolved by overwriting + the destination object. NOTE: This option cannot be used with the + `createNewCopies` option. in: query - name: sort_field + name: overwrite required: false schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - - description: 'Determines the sort order, which can be `desc` or `asc`' + type: boolean + - description: > + Applies various adjustments to the saved objects that are being + imported to maintain compatibility between different Kibana + versions. Use this option only if you encounter issues with imported + saved objects. NOTE: This option cannot be used with the + `createNewCopies` option. in: query - name: sort_order + name: compatibilityMode required: false schema: - enum: - - desc - - asc - type: string - - description: > - Returns the list that come after the last list returned in the - previous call - - (use the cursor value returned in the previous call). This parameter - uses - - the `tie_breaker_id` field to ensure all lists are sorted and - returned correctly. - in: query - name: cursor - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_FindListsCursor' - - description: > - Filters the returned results according to the value of the specified - field, - - using the : syntax. - in: query - name: filter - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_FindListsFilter' + type: boolean + requestBody: + content: + multipart/form-data; Elastic-Api-Version=2023-10-31: + examples: + importObjectsRequest: + $ref: >- + #/components/examples/Serverless_saved_objects_import_objects_request + schema: + type: object + properties: + file: + description: > + A file exported using the export API. NOTE: The + `savedObjects.maxImportExportSize` configuration setting + limits the number of saved objects which may be included in + this file. Similarly, the + `savedObjects.maxImportPayloadBytes` setting limits the + overall size of the file that can be imported. + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + importObjectsResponse: + $ref: >- + #/components/examples/Serverless_saved_objects_import_objects_response schema: type: object properties: - cursor: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListsCursor - data: + errors: + description: > + Indicates the import was unsuccessful and specifies the + objects that failed to import. + + + NOTE: One object may result in multiple errors, which + requires separate steps to resolve. For instance, a + `missing_references` error and conflict error. items: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' + type: object type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - total: - minimum: 0 + success: + description: > + Indicates when the import was successfully completed. When + set to false, some objects may not have been created. For + additional information, refer to the `errors` and + `successResults` properties. + type: boolean + successCount: + description: Indicates the number of successfully imported records. type: integer - required: - - data - - page - - per_page - - total - - cursor - description: Successful response + successResults: + description: > + Indicates the objects that are successfully imported, with + any metadata if applicable. + + + NOTE: Objects are created only when all resolvable errors + are addressed, including conflicts and missing references. + If objects are created as new copies, each entry in the + `successResults` array includes a `destinationId` + attribute. + items: + type: object + type: array + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Serverless_saved_objects_400_response' + description: Bad request. + summary: Import saved objects + tags: + - saved objects + /api/status: + get: + operationId: '%2Fapi%2Fstatus#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: Set to "true" to get the response in v7 format. + in: query + name: v7format + required: false + schema: + type: boolean + - description: Set to "true" to get the response in v8 format. + in: query + name: v8format + required: false + schema: + type: boolean + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': + anyOf: + - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' + - $ref: >- + #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse + description: >- + Kibana's operational status. A minimal response is sent for + unauthorized users. + description: Overall status is OK and Kibana should be functioning normally. + '503': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Finds lists + anyOf: + - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' + - $ref: >- + #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse + description: >- + Kibana's operational status. A minimal response is sent for + unauthorized users. + description: >- + Kibana or some of it's essential services are unavailable. Kibana + may be degraded or unavailable. + summary: Get Kibana's current status tags: - - Security Solution Lists API - /api/lists/index: - delete: - operationId: DeleteListIndex + - system + /data_streams: + get: + operationId: data-streams-list responses: '200': content: @@ -5097,54 +7093,21 @@ paths: schema: type: object properties: - acknowledged: - type: boolean - required: - - acknowledged - description: Successful response + data_streams: + items: + $ref: '#/components/schemas/Fleet_data_stream' + type: array + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes list data streams + $ref: '#/components/responses/Fleet_error' + summary: List data streams tags: - - Security Solution Lists API + - Data streams + parameters: [] + /enrollment_api_keys: get: - operationId: ReadListIndex + operationId: get-enrollment-api-keys + parameters: [] responses: '200': content: @@ -5152,57 +7115,60 @@ paths: schema: type: object properties: - list_index: - type: boolean - list_item_index: - type: boolean + items: + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + page: + type: number + perPage: + type: number + total: + type: number required: - - list_index - - list_item_index - description: Successful response + - items + - page + - perPage + - total + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List enrollment API keys + tags: + - Fleet enrollment API keys + post: + operationId: create-enrollment-api-keys + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream(s) not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Get list data stream existence status + type: object + properties: + action: + enum: + - created + type: string + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create enrollment API key tags: - - Security Solution Lists API - post: - operationId: CreateListIndex + - Fleet enrollment API keys + '/enrollment_api_keys/{keyId}': + delete: + operationId: delete-enrollment-api-key + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: @@ -5210,159 +7176,255 @@ paths: schema: type: object properties: - acknowledged: - type: boolean + action: + enum: + - deleted + type: string required: - - acknowledged - description: Successful response + - action + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete enrollment API key by ID + tags: + - Fleet enrollment API keys + get: + operationId: get-enrollment-api-key + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment API key by ID + tags: + - Fleet enrollment API keys + parameters: + - in: path + name: keyId + required: true + schema: + type: string + /enrollment-api-keys: + get: + deprecated: true + operationId: get-enrollment-api-keys-deprecated + parameters: [] + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream exists response - '500': + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + - page + - perPage + - total + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List enrollment API keys + tags: + - Fleet enrollment API keys + post: + deprecated: true + operationId: create-enrollment-api-keys-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates necessary list data streams + type: object + properties: + action: + enum: + - created + type: string + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create enrollment API key tags: - - Security Solution Lists API - /api/lists/items: + - Fleet enrollment API keys + '/enrollment-api-keys/{keyId}': delete: - operationId: DeleteListItem + deprecated: true + operationId: delete-enrollment-api-key-deprecated parameters: - - description: Required if `list_id` and `value` are not specified - in: query - name: id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified - in: query - name: list_id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified - in: query - name: value - required: false - schema: - type: string - - description: >- - Determines when changes made by the request are made visible to - search - in: query - name: refresh - required: false - schema: - default: 'false' - enum: - - 'true' - - 'false' - - wait_for - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - description: Successful response + type: object + properties: + action: + enum: + - deleted + type: string + required: + - action + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete enrollment API key by ID + tags: + - Fleet enrollment API keys + get: + deprecated: true + operationId: get-enrollment-api-key-deprecated + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment API key by ID + tags: + - Fleet enrollment API keys + parameters: + - in: path + name: keyId + required: true + schema: + type: string + /epm/bulk_assets: + post: + operationId: bulk-get-assets + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + assetIds: + description: list of items necessary to fetch assets + items: + type: object + properties: + id: + type: string + type: + type: string + type: array + required: + - assetIds + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': + $ref: '#/components/schemas/Fleet_get_bulk_assets_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk get assets + tags: + - Elastic Package Manager (EPM) + /epm/categories: + get: + operationId: get-package-categories + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes a list item + $ref: '#/components/schemas/Fleet_get_categories_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List package categories tags: - - Security Solution Lists API + - Elastic Package Manager (EPM) + parameters: + - description: >- + Whether to include prerelease packages in categories count (e.g. beta, + rc, preview) + in: query + name: prerelease + schema: + default: false + type: boolean + - deprecated: true + in: query + name: experimental + schema: + default: false + type: boolean + - in: query + name: include_policy_templates + schema: + default: false + type: boolean + /epm/packages: get: - operationId: ReadListItem + operationId: list-all-packages parameters: - - description: Required if `list_id` and `value` are not specified + - description: >- + Whether to exclude the install status of each package. Enabling this + option will opt in to caching for the response via `cache-control` + headers. If you don't need up-to-date installation info for a + package, and are querying for a list of available packages, + providing this flag can improve performance substantially. in: query - name: id - required: false + name: excludeInstallStatus schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + default: false + type: boolean + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) in: query - name: list_id - required: false + name: prerelease schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + default: false + type: boolean + - deprecated: true in: query - name: value - required: false + name: experimental + schema: + default: false + type: boolean + - in: query + name: category schema: type: string responses: @@ -5370,408 +7432,529 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - description: Successful response + $ref: '#/components/schemas/Fleet_get_packages_response' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List packages + tags: + - Elastic Package Manager (EPM) + post: + description: '' + operationId: install-package-by-upload + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: avoid erroring out on unexpected mapping update errors + in: query + name: ignoreMappingUpdateErrors + schema: + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover + schema: + default: false + type: boolean + requestBody: + content: + application/gzip; Elastic-Api-Version=2023-10-31: + schema: + format: binary + type: string + application/zip; Elastic-Api-Version=2023-10-31: + schema: + format: binary + type: string + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Gets a list item + type: object + properties: + _meta: + type: object + properties: + install_source: + enum: + - upload + - registry + - bundled + type: string + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + '429': + $ref: '#/components/responses/Fleet_error' + summary: Install by package by direct upload tags: - - Security Solution Lists API - patch: - operationId: PatchListItem + - Elastic Package Manager (EPM) + /epm/packages/_bulk: + post: + operationId: bulk-install-packages + parameters: + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease + schema: + default: false + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - _version: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - refresh: - description: >- - Determines when changes made by the request are made visible - to search - enum: - - 'true' - - 'false' - - wait_for - type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue + force: + description: force install to ignore package verification errors + type: boolean + packages: + description: list of packages to install + items: + oneOf: + - description: package name + type: string + - type: object + properties: + name: + description: package name + type: string + version: + description: package version + type: string + type: array required: - - id - description: List item's properties - required: true + - packages responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response + $ref: '#/components/schemas/Fleet_bulk_install_packages_response' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk install packages + tags: + - Elastic Package Manager (EPM) + '/epm/packages/{pkgkey}': + delete: + deprecated: true + operationId: delete-package-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - in: path + name: pkgkey + required: true + schema: + type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + type: boolean + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': + type: object + properties: + response: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - response + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete ackage + tags: + - Elastic Package Manager (EPM) + get: + deprecated: true + operationId: get-package-deprecated + parameters: + - in: path + name: pkgkey + required: true + schema: + type: string + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease + schema: + default: false + type: boolean + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Patches a list item + allOf: + - properties: + response: + $ref: '#/components/schemas/Fleet_package_info' + - properties: + savedObject: + type: string + status: + enum: + - installed + - installing + - install_failed + - not_installed + type: string + required: + - status + - savedObject + type: object + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package tags: - - Security Solution Lists API + - Elastic Package Manager (EPM) post: - operationId: CreateListItem + deprecated: true + description: '' + operationId: install-package-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - in: path + name: pkgkey + required: true + schema: + type: string + - description: avoid erroring out on unexpected mapping update errors + in: query + name: ignoreMappingUpdateErrors + schema: + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover + schema: + default: false + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - list_id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - refresh: - description: >- - Determines when changes made by the request are made visible - to search - enum: - - 'true' - - 'false' - - wait_for - type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue - required: - - list_id - - value - description: List item's properties - required: true + force: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response + type: object + properties: + response: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - response + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item already exists response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates a list item + $ref: '#/components/responses/Fleet_error' + summary: Install package tags: - - Security Solution Lists API - put: - operationId: UpdateListItem + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/{pkgVersion}': + delete: + operationId: delete-package + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: delete package even if policies used by agents + in: query + name: force + schema: + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + deprecated: true type: object properties: - _version: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue - required: - - id - - value - description: List item's properties - required: true + force: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response + type: object + properties: + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package + tags: + - Elastic Package Manager (EPM) + get: + operationId: get-package + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Updates a list item + allOf: + - properties: + item: + $ref: '#/components/schemas/Fleet_package_info' + - properties: + keepPoliciesUpToDate: + type: boolean + latestVersion: + type: string + licensePath: + type: string + notice: + type: string + savedObject: + deprecated: true + type: object + status: + enum: + - installed + - installing + - install_failed + - not_installed + type: string + required: + - status + - savedObject + type: object + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package tags: - - Security Solution Lists API - /api/lists/items/_export: + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - description: Ignore if the package is fails signature verification + in: query + name: ignoreUnverified + schema: + type: boolean + - description: >- + Return all fields from the package manifest, not just those supported + by the Elastic Package Registry + in: query + name: full + schema: + type: boolean + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease + schema: + default: false + type: boolean post: - description: Exports list item values from the specified list - operationId: ExportListItems + description: '' + operationId: install-package parameters: - - description: List's id to export + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: avoid erroring out on unexpected mapping update errors in: query - name: list_id - required: true + name: ignoreMappingUpdateErrors + schema: + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + type: boolean + ignore_constraints: + type: boolean responses: '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: A `.txt` file containing list items from the specified list - format: binary - type: string - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': + type: object + properties: + _meta: + type: object + properties: + install_source: + enum: + - registry + - upload + - bundled + type: string + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Install package + tags: + - Elastic Package Manager (EPM) + put: + description: '' + operationId: update-package + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + keepPoliciesUpToDate: + type: boolean + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Exports list items + type: object + properties: + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update package settings tags: - - Security Solution Lists API - /api/lists/items/_find: + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/{pkgVersion}/{filePath}': get: - operationId: FindListItems - parameters: - - description: List's id - in: query - name: list_id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: The page number to return - in: query - name: page - required: false - schema: - type: integer - - description: The number of list items to return per page - in: query - name: per_page - required: false - schema: - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc - type: string - - description: > - Returns the list that come after the last list returned in the - previous call - - (use the cursor value returned in the previous call). This parameter - uses - - the `tie_breaker_id` field to ensure all lists are sorted and - returned correctly. - in: query - name: cursor - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsCursor - - description: > - Filters the returned results according to the value of the specified - field, - - using the : syntax. - in: query - name: filter - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsFilter + operationId: packages-get-file responses: '200': content: @@ -5779,180 +7962,103 @@ paths: schema: type: object properties: - cursor: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsCursor - data: - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - - cursor - description: Successful response + body: + type: object + headers: + type: object + statusCode: + type: number + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Finds list items + $ref: '#/components/responses/Fleet_error' + summary: Get package file tags: - - Security Solution Lists API - /api/lists/items/_import: + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - in: path + name: filePath + required: true + schema: + type: string + '/epm/packages/{pkgName}/{pkgVersion}/transforms/authorize': post: - description: > - Imports a list of items from a `.txt` or `.csv` file. The maximum file - size is 9 million bytes. - - - You can import items to a new or existing list. - operationId: ImportListItems + description: '' + operationId: reauthorize-transforms parameters: - - description: | - List's id. - - Required when importing to an existing list. - in: query - name: list_id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: > - Type of the importing list. - - - Required when importing a new list that is `list_id` is not - specified. - in: query - name: type - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - - in: query - name: serializer - required: false + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - in: path + name: pkgName + required: true schema: type: string - - in: query - name: deserializer - required: false + - in: path + name: pkgVersion + required: true schema: type: string - description: >- - Determines when changes made by the request are made visible to - search + Whether to include prerelease packages in categories count (e.g. + beta, rc, preview) in: query - name: refresh - required: false + name: prerelease schema: - enum: - - 'true' - - 'false' - - wait_for - type: string + default: false + type: boolean requestBody: content: - multipart/form-data; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - file: - description: >- - A `.txt` or `.csv` file containing newline separated list - items - format: binary - type: string - required: true + transforms: + items: + type: object + properties: + transformId: + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + items: + items: + type: object + properties: + error: + type: string + success: + type: boolean + transformId: + type: string + required: + - transformId + - error + type: array + required: + - items + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List with specified list_id does not exist response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Imports list items + $ref: '#/components/responses/Fleet_error' + summary: Authorize transforms tags: - - Security Solution Lists API - /api/lists/privileges: + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/stats': get: - operationId: ReadListPrivileges + operationId: get-package-stats responses: '200': content: @@ -5960,107 +8066,168 @@ paths: schema: type: object properties: - is_authenticated: - type: boolean - listItems: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemPrivileges - lists: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListPrivileges + response: + $ref: '#/components/schemas/Fleet_package_usage_stats' required: - - lists - - listItems - - is_authenticated - description: Successful response + - response + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package stats + tags: + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + /epm/packages/limited: + get: + operationId: list-limited-packages + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Gets list privileges + type: object + properties: + items: + items: + type: string + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get limited package list tags: - - Security Solution Lists API - /api/ml/saved_objects/sync: + - Elastic Package Manager (EPM) + parameters: [] + '/epm/templates/{pkgName}/{pkgVersion}/inputs': get: - description: > - Synchronizes Kibana saved objects for machine learning jobs and trained - models. This API runs automatically when you start Kibana and - periodically thereafter. - operationId: mlSync - parameters: - - $ref: '#/components/parameters/Machine_learning_APIs_simulateParam' + operationId: get-inputs-template + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get inputs template + tags: + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - description: Format of response - json or yaml + in: query + name: format + schema: + enum: + - json + - yaml + - yml + type: string + - description: Specify if version is prerelease + in: query + name: prerelease + schema: + type: boolean + - description: Ignore if the package is fails signature verification + in: query + name: ignoreUnverified + schema: + type: boolean + /epm/verification_key_id: + get: + operationId: packages-get-verification-key-id responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - syncExample: - $ref: '#/components/examples/Machine_learning_APIs_mlSyncExample' schema: - $ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response' - description: Indicates a successful call - '401': + type: object + properties: + body: + type: object + properties: + id: + description: >- + the key ID of the GPG key used to verify package + signatures + nullable: true + type: string + headers: + type: object + statusCode: + type: number + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package signature verification key ID + tags: + - Elastic Package Manager (EPM) + parameters: [] + /fleet_server_hosts: + get: + operationId: get-fleet-server-hosts + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse' - description: Authorization information is missing or invalid. - summary: Sync machine learning saved objects + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_fleet_server_host' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List Fleet Server hosts tags: - - ml - /api/note: - delete: - operationId: DeleteNote + - Fleet Server hosts + post: + operationId: post-fleet-server-hosts requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - nullable: true - type: object - properties: - noteId: - type: string - required: - - noteId - - type: object - properties: - noteIds: - items: - type: string - nullable: true - type: array - required: - - noteIds - description: The id of the note to delete. - required: true + type: object + properties: + host_urls: + items: + type: string + type: array + id: + type: string + is_default: + type: boolean + is_internal: + type: boolean + name: + type: string + proxy_id: + description: >- + The ID of the proxy to use for this fleet server host. See + the proxies API for more information. + type: string + required: + - name + - host_urls responses: '200': content: @@ -6068,91 +8235,87 @@ paths: schema: type: object properties: - data: - type: object - description: Indicates the note was successfully deleted. - summary: Deletes a note from a timeline. + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create Fleet Server host tags: - - Security Solution Timeline API - - 'access:securitySolution' - get: - description: Gets notes - operationId: GetNotes + - Fleet Server hosts + '/fleet_server_hosts/{itemId}': + delete: + operationId: delete-fleet-server-hosts parameters: - - in: query - name: documentIds - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_DocumentIds' - - in: query - name: page - schema: - nullable: true - type: number - - in: query - name: perPage - schema: - nullable: true - type: number - - in: query - name: search - schema: - nullable: true - type: string - - in: query - name: sortField - schema: - nullable: true - type: string - - in: query - name: sortOrder - schema: - nullable: true - type: string - - in: query - name: filter - schema: - nullable: true - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + id: + type: string + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete Fleet Server host by ID + tags: + - Fleet Server hosts + get: + operationId: get-one-fleet-server-hosts responses: '200': - description: Indicates the requested notes were returned. - summary: Get all notes for a given document. + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get Fleet Server host by ID tags: - - Security Solution Timeline API - - 'access:securitySolution' - patch: - operationId: PersistNoteRoute + - Fleet Server hosts + parameters: + - in: path + name: itemId + required: true + schema: + type: string + put: + operationId: update-fleet-server-hosts + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - eventDataView: - nullable: true - type: string - eventIngested: - nullable: true - type: string - eventTimestamp: - nullable: true - type: string - note: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - noteId: - nullable: true - type: string - overrideOwner: - nullable: true + host_urls: + items: + type: string + type: array + is_default: + type: boolean + is_internal: type: boolean - version: + name: + type: string + proxy_id: + description: >- + The ID of the proxy to use for this fleet server host. See + the proxies API for more information. nullable: true type: string - required: - - note - description: The note to persist or update along with additional metadata. - required: true responses: '200': content: @@ -6160,701 +8323,641 @@ paths: schema: type: object properties: - data: - type: object - properties: - persistNote: - type: object - properties: - code: - type: number - message: - type: string - note: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_Note - required: - - code - - message - - note - required: - - persistNote + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' required: - - data - description: Indicates the note was successfully created. - summary: Persists a note to a timeline. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/osquery/live_queries: - get: - operationId: OsqueryFindLiveQueries - parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindLiveQueryRequestQuery - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + - item description: OK - summary: Find live queries + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update Fleet Server host by ID tags: - - Security Solution Osquery API + - Fleet Server hosts + /health_check: post: - operationId: OsqueryCreateLiveQuery + operationId: fleet-server-health-check + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreateLiveQueryRequestBody + type: object + properties: + host: + deprecated: true + type: string + id: + type: string + required: + - id required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + host: + deprecated: true + type: string + id: + description: Fleet Server host id + type: string + status: + type: string description: OK - summary: Create a live query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Fleet Server health check tags: - - Security Solution Osquery API - '/api/osquery/live_queries/{id}': + - Fleet internals + /kubernetes: get: - operationId: OsqueryGetLiveQueryDetails + operationId: get-full-k8s-manifest parameters: - - in: path - name: id - required: true + - in: query + name: download + required: false schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' + type: boolean - in: query - name: query + name: fleetServer + required: false schema: - additionalProperties: true - type: object + type: string + - in: query + name: enrolToken + required: false + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + type: string description: OK - summary: Get live query details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get full K8s agent manifest tags: - - Security Solution Osquery API - '/api/osquery/live_queries/{id}/results/{actionId}': - get: - operationId: OsqueryGetLiveQueryResults + - Fleet Kubernetes + /logstash_api_keys: + post: + operationId: generate-logstash-api-key parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - - in: path - name: actionId - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_GetLiveQueryResultsRequestQuery + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + api_key: + type: string description: OK - summary: Get live query results + '400': + $ref: '#/components/responses/Fleet_error' + summary: Generate Logstash API key tags: - - Security Solution Osquery API - /api/osquery/packs: + - Fleet outputs + /outputs: get: - operationId: OsqueryFindPacks - parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindPacksRequestQuery + operationId: get-outputs responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_output_create_request' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer description: OK - summary: Find packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: List outputs tags: - - Security Solution Osquery API + - Fleet outputs post: - operationId: OsqueryCreatePacks + operationId: post-outputs requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreatePacksRequestBody + $ref: '#/components/schemas/Fleet_output_create_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_output_create_request' description: OK - summary: Create a packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create output tags: - - Security Solution Osquery API - '/api/osquery/packs/{id}': + - Fleet outputs + '/outputs/{outputId}': delete: - operationId: OsqueryDeletePacks + operationId: delete-output parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + id: + type: string + required: + - id description: OK - summary: Delete packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete output by ID tags: - - Security Solution Osquery API + - Fleet outputs get: - operationId: OsqueryGetPacksDetails - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + operationId: get-output responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_output_create_request' description: OK - summary: Get packs details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get output by ID tags: - - Security Solution Osquery API + - Fleet outputs + parameters: + - in: path + name: outputId + required: true + schema: + type: string put: - operationId: OsqueryUpdatePacks + operationId: update-output parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_UpdatePacksRequestBody - required: true + $ref: '#/components/schemas/Fleet_output_update_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_output_update_request' description: OK - summary: Update packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update output by ID tags: - - Security Solution Osquery API - /api/osquery/saved_queries: + - Fleet outputs + '/outputs/{outputId}/health': get: - operationId: OsqueryFindSavedQueries - parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindSavedQueryRequestQuery + operationId: get-output-health responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + message: + description: long message if unhealthy + type: string + state: + description: 'state of output, HEALTHY or DEGRADED' + type: string + timestamp: + description: timestamp of reported state + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get latest output health + tags: + - Fleet outputs + parameters: + - in: path + name: outputId + required: true + schema: + type: string + /package_policies: + get: + operationId: get-package-policies + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - $ref: '#/components/parameters/Fleet_format' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_package_policy' + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items description: OK - summary: Find saved queries + '400': + $ref: '#/components/responses/Fleet_error' + summary: List package policies tags: - - Security Solution Osquery API + - Fleet package policies + parameters: [] post: - operationId: OsqueryCreateSavedQuery + operationId: create-package-policy + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_format' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreateSavedQueryRequestBody - required: true + $ref: '#/components/schemas/Fleet_package_policy_request' + description: >- + You should use inputs as an object and not use the deprecated inputs + array. responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + '409': + $ref: '#/components/responses/Fleet_error' + summary: Create package policy + tags: + - Fleet package policies + /package_policies/_bulk_get: + post: + operationId: bulk-get-package-policies + parameters: + - $ref: '#/components/parameters/Fleet_format' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + ids: + description: list of package policy ids + items: + type: string + type: array + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_package_policy' + type: array + required: + - items description: OK - summary: Create a saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk get package policies tags: - - Security Solution Osquery API - '/api/osquery/saved_queries/{id}': + - Fleet package policies + '/package_policies/{packagePolicyId}': delete: - operationId: OsqueryDeleteSavedQuery + operationId: delete-package-policy parameters: - - in: path - name: id - required: true + - in: query + name: force schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + id: + type: string + required: + - id description: OK - summary: Delete saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package policy by ID tags: - - Security Solution Osquery API + - Fleet package policies get: - operationId: OsqueryGetSavedQueryDetails + operationId: get-package-policy parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' + - $ref: '#/components/parameters/Fleet_format' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + required: + - item description: OK - summary: Get saved query details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package policy by ID tags: - - Security Solution Osquery API + - Fleet package policies + parameters: + - in: path + name: packagePolicyId + required: true + schema: + type: string put: - operationId: OsqueryUpdateSavedQuery + operationId: update-package-policy parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_format' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_UpdateSavedQueryRequestBody - required: true + $ref: '#/components/schemas/Fleet_package_policy_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + sucess: + type: boolean + required: + - item + - sucess description: OK - summary: Update saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update package policy by ID tags: - - Security Solution Osquery API - /api/pinned_event: - patch: - operationId: PersistPinnedEventRoute + - Fleet package policies + /package_policies/delete: + post: + operationId: post-delete-package-policy + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - eventId: - type: string - pinnedEventId: - nullable: true - type: string - timelineId: - type: string + force: + type: boolean + packagePolicyIds: + items: + type: string + type: array required: - - eventId - - timelineId - description: The pinned event to persist or update along with additional metadata. - required: true + - packagePolicyIds responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistPinnedEventOnTimeline: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_PinnedEvent - - type: object - properties: - code: - type: number - message: - type: string - required: - - persistPinnedEventOnTimeline - required: - - data - description: Indicate the event was successfully pinned in the timeline. - summary: Persists a pinned event to a timeline. + items: + type: object + properties: + id: + type: string + name: + type: string + success: + type: boolean + required: + - id + - success + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package policy tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/saved_objects/_export: + - Fleet package policies + /package_policies/upgrade: post: - description: > - Retrieve sets of saved objects that you want to import into Kibana. - - You must include `type` or `objects` in the request body. - - - Exported saved objects are not backwards compatible and cannot be - imported into an older version of Kibana. - - - NOTE: The `savedObjects.maxImportExportSize` configuration setting - limits the number of saved objects which may be exported. - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: exportSavedObjectsDefault - parameters: - - $ref: '#/components/parameters/Serverless_saved_objects_kbn_xsrf' + operationId: upgrade-package-policy requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - exportSavedObjectsRequest: - $ref: >- - #/components/examples/Serverless_saved_objects_export_objects_request schema: type: object properties: - excludeExportDetails: - default: false - description: Do not add export details entry at the end of the stream. - type: boolean - includeReferencesDeep: - description: >- - Includes all of the referenced objects in the exported - objects. - type: boolean - objects: - description: A list of objects to export. + packagePolicyIds: items: - type: object + type: string type: array - type: - description: >- - The saved object types to include in the export. Use `*` to - export all the types. - oneOf: - - type: string - - items: - type: string - type: array - required: true + required: + - packagePolicyIds responses: '200': content: - application/x-ndjson; Elastic-Api-Version=2023-10-31: - examples: - exportSavedObjectsResponse: - $ref: >- - #/components/examples/Serverless_saved_objects_export_objects_response + application/json; Elastic-Api-Version=2023-10-31: schema: - additionalProperties: true - type: object - description: Indicates a successful call. + items: + type: object + properties: + id: + type: string + name: + type: string + success: + type: boolean + required: + - id + - success + type: array + description: OK '400': + $ref: '#/components/responses/Fleet_error' + '409': + $ref: '#/components/responses/Fleet_error' + summary: Upgrade package policy to a newer package version + tags: + - Fleet package policies + /package_policies/upgrade/dryrun: + post: + operationId: upgrade-package-policy-dry-run + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + packagePolicyIds: + items: + type: string + type: array + packageVersion: + type: string + required: + - packagePolicyIds + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Serverless_saved_objects_400_response' - description: Bad request. - summary: Export saved objects + items: + type: object + properties: + agent_diff: + $ref: '#/components/schemas/Fleet_upgrade_agent_diff' + diff: + $ref: '#/components/schemas/Fleet_upgrade_diff' + hasErrors: + type: boolean + required: + - hasErrors + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Dry run package policy upgrade tags: - - saved objects - /api/saved_objects/_import: - post: - description: > - Create sets of Kibana saved objects from a file created by the export - API. - - Saved objects can be imported only into the same version, a newer minor - on the same major, or the next major. Exported saved objects are not - backwards compatible and cannot be imported into an older version of - Kibana. - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: importSavedObjectsDefault - parameters: - - $ref: '#/components/parameters/Serverless_saved_objects_kbn_xsrf' - - description: > - Creates copies of saved objects, regenerates each object ID, and - resets the origin. When used, potential conflict errors are avoided. - NOTE: This option cannot be used with the `overwrite` and - `compatibilityMode` options. - in: query - name: createNewCopies - required: false - schema: - type: boolean - - description: > - Overwrites saved objects when they already exist. When used, - potential conflict errors are automatically resolved by overwriting - the destination object. NOTE: This option cannot be used with the - `createNewCopies` option. - in: query - name: overwrite - required: false - schema: - type: boolean - - description: > - Applies various adjustments to the saved objects that are being - imported to maintain compatibility between different Kibana - versions. Use this option only if you encounter issues with imported - saved objects. NOTE: This option cannot be used with the - `createNewCopies` option. - in: query - name: compatibilityMode - required: false - schema: - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - examples: - importObjectsRequest: - $ref: >- - #/components/examples/Serverless_saved_objects_import_objects_request - schema: - type: object - properties: - file: - description: > - A file exported using the export API. NOTE: The - `savedObjects.maxImportExportSize` configuration setting - limits the number of saved objects which may be included in - this file. Similarly, the - `savedObjects.maxImportPayloadBytes` setting limits the - overall size of the file that can be imported. - required: true + - Fleet package policies + /proxies: + get: + operationId: get-fleet-proxies responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - importObjectsResponse: - $ref: >- - #/components/examples/Serverless_saved_objects_import_objects_response schema: type: object properties: - errors: - description: > - Indicates the import was unsuccessful and specifies the - objects that failed to import. - - - NOTE: One object may result in multiple errors, which - requires separate steps to resolve. For instance, a - `missing_references` error and conflict error. + items: items: - type: object + $ref: '#/components/schemas/Fleet_proxies' type: array - success: - description: > - Indicates when the import was successfully completed. When - set to false, some objects may not have been created. For - additional information, refer to the `errors` and - `successResults` properties. - type: boolean - successCount: - description: Indicates the number of successfully imported records. + page: type: integer - successResults: - description: > - Indicates the objects that are successfully imported, with - any metadata if applicable. - - - NOTE: Objects are created only when all resolvable errors - are addressed, including conflicts and missing references. - If objects are created as new copies, each entry in the - `successResults` array includes a `destinationId` - attribute. - items: - type: object - type: array - description: Indicates a successful call. + perPage: + type: integer + total: + type: integer + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Serverless_saved_objects_400_response' - description: Bad request. - summary: Import saved objects + $ref: '#/components/responses/Fleet_error' + summary: List proxies tags: - - saved objects - /api/security_ai_assistant/anonymization_fields/_bulk_action: + - Fleet proxies post: - description: >- - The bulk action is applied to all anonymization fields that match the - filter or to the list of anonymization fields by their IDs. - operationId: PerformAnonymizationFieldsBulkAction + operationId: post-fleet-proxies requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - create: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldCreateProps - type: array - delete: + certificate: + type: string + certificate_authorities: + type: string + certificate_key: + type: string + id: + type: string + name: + type: string + proxy_headers: type: object - properties: - ids: - description: Array of anonymization fields IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter anonymization fields - type: string - update: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldUpdateProps - type: array + url: + type: string + required: + - name + - url responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResponse - description: Indicates a successful call. - '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple anonymization fields + item: + $ref: '#/components/schemas/Fleet_proxies' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create proxy tags: - - Security AI Assistant API - - Bulk API - /api/security_ai_assistant/anonymization_fields/_find: - get: - description: Finds anonymization fields that match the given query. - operationId: FindAnonymizationFields + - Fleet proxies + '/proxies/{itemId}': + delete: + operationId: delete-fleet-proxies parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindAnonymizationFieldsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: AnonymizationFields per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: @@ -6862,1157 +8965,687 @@ paths: schema: type: object properties: - data: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer + id: + type: string required: - - page - - perPage - - total - - data - description: Successful response + - id + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds anonymization fields that match the given query. + $ref: '#/components/responses/Fleet_error' + summary: Delete proxy by ID tags: - - Security AI Assistant API - - AnonymizationFields API - /api/security_ai_assistant/chat/complete: - post: - description: Creates a model response for the given chat conversation. - operationId: ChatComplete - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatCompleteProps' - required: true + - Fleet proxies + get: + operationId: get-one-fleet-proxies responses: '200': - content: - application/octet-stream; Elastic-Api-Version=2023-10-31: - schema: - format: binary - type: string - description: Indicates a successful call. - '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Creates a model response for the given chat conversation. + item: + $ref: '#/components/schemas/Fleet_proxies' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get proxy by ID tags: - - Security AI Assistant API - - Chat Complete API - /api/security_ai_assistant/current_user/conversations: - post: - description: Create a conversation - operationId: CreateConversation + - Fleet proxies + parameters: + - in: path + name: itemId + required: true + schema: + type: string + put: + operationId: update-fleet-proxies + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationCreateProps - required: true + type: object + properties: + certificate: + type: string + certificate_authorities: + type: string + certificate_key: + type: string + name: + type: string + proxy_headers: + type: object + url: + type: string responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. - '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Create a conversation + item: + $ref: '#/components/schemas/Fleet_proxies' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update proxy by ID tags: - - Security AI Assistant API - - Conversation API - /api/security_ai_assistant/current_user/conversations/_find: + - Fleet proxies + '/s/{spaceId}/api/observability/slos': get: - description: Finds conversations that match the given query. - operationId: FindConversations - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query + description: > + You must have the `read` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: findSlosOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - description: A valid kql query to filter the SLO with + example: 'slo.name:latency* and slo.tags : "prod"' in: query - name: filter - required: false + name: kqlQuery schema: type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindConversationsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number + - description: 'The page to use for pagination, must be greater or equal than 1' + example: 1 in: query name: page - required: false schema: default: 1 - minimum: 1 type: integer - - description: Conversations per page + - description: Number of SLOs returned by page + example: 25 in: query - name: per_page - required: false + name: perPage schema: - default: 20 - minimum: 0 + default: 25 + maximum: 5000 type: integer + - description: Sort by field + example: status + in: query + name: sortBy + schema: + default: status + enum: + - sli_value + - status + - error_budget_consumed + - error_budget_remaining + type: string + - description: Sort order + example: asc + in: query + name: sortDirection + schema: + default: asc + enum: + - asc + - desc + type: string + - description: >- + Hide stale SLOs from the list as defined by stale SLO threshold in + SLO settings + in: query + name: hideStale + schema: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response + $ref: '#/components/schemas/SLOs_find_slo_response' + description: Successful request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds conversations that match the given query. - tags: - - Security AI Assistant API - - Conversations API - '/api/security_ai_assistant/current_user/conversations/{id}': - delete: - description: Deletes a single conversation using the `id` field. - operationId: DeleteConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Deletes a single conversation using the `id` field. - tags: - - Security AI Assistant API - - Conversation API - get: - description: Read a single conversation - operationId: ReadConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - responses: - '200': + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Read a single conversation + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Get a paginated list of SLOs tags: - - Security AI Assistant API - - Conversations API - put: - description: Update a single conversation - operationId: UpdateConversation + - slo + post: + description: > + You must have `all` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: createSloOp parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationUpdateProps + $ref: '#/components/schemas/SLOs_create_slo_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. + $ref: '#/components/schemas/SLOs_create_slo_response' + description: Successful request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Update a conversation + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '409': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_409_response' + description: Conflict - The SLO id already exists + servers: + - url: 'https://localhost:5601' + summary: Create an SLO tags: - - Security AI Assistant API - - Conversation API - /api/security_ai_assistant/prompts/_bulk_action: + - slo + '/s/{spaceId}/api/observability/slos/_delete_instances': post: - description: >- - The bulk action is applied to all prompts that match the filter or to - the list of prompts by their IDs. - operationId: PerformPromptsBulkAction + description: > + The deletion occurs for the specified list of `sloId` and `instanceId`. + You must have `all` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: deleteSloInstancesOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - create: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptCreateProps - type: array - delete: - type: object - properties: - ids: - description: Array of prompts IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter promps - type: string - update: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptUpdateProps - type: array + $ref: '#/components/schemas/SLOs_delete_slo_instances_request' + required: true responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple prompts + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + servers: + - url: 'https://localhost:5601' + summary: Batch delete rollup and summary data tags: - - Security AI Assistant API - - Bulk API - /api/security_ai_assistant/prompts/_find: - get: - description: Finds prompts that match the given query. - operationId: FindPrompts + - slo + '/s/{spaceId}/api/observability/slos/{sloId}': + delete: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: deleteSloOp parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindPromptsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Prompts per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds prompts that match the given query. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Delete an SLO tags: - - Security AI Assistant API - - Prompts API - /api/status: + - slo get: - operationId: /api/status#0 + description: > + You must have the `read` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: getSloOp parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: Set to "true" to get the response in v7 format. - in: query - name: v7format - required: false - schema: - type: boolean - - description: Set to "true" to get the response in v8 format. + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' + - description: the specific instanceId used by the summary calculation + example: host-abcde in: query - name: v8format - required: false + name: instanceId schema: - type: boolean + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - anyOf: - - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' - - $ref: >- - #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse - description: >- - Kibana's operational status. A minimal response is sent for - unauthorized users. - description: Overall status is OK and Kibana should be functioning normally. - '503': + $ref: '#/components/schemas/SLOs_slo_with_summary_response' + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - anyOf: - - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' - - $ref: >- - #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse - description: >- - Kibana's operational status. A minimal response is sent for - unauthorized users. - description: >- - Kibana or some of it's essential services are unavailable. Kibana - may be degraded or unavailable. - summary: Get Kibana's current status - tags: - - system - /api/timeline: - delete: - operationId: DeleteTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - savedObjectIds: - items: - type: string - type: array - searchIds: - description: >- - Saved search ids that should be deleted alongside the - timelines - items: - type: string - type: array - required: - - savedObjectIds - description: The ids of the timelines or timeline templates to delete. - required: true - responses: - '200': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - deleteTimeline: - type: boolean - required: - - deleteTimeline - required: - - data - description: Indicates the timeline was successfully deleted. - summary: Deletes one or more timelines or timeline templates. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - get: - operationId: GetTimeline - parameters: - - description: The ID of the template timeline to retrieve - in: query - name: template_timeline_id - schema: - type: string - - description: The ID of the timeline to retrieve - in: query - name: id - schema: - type: string - responses: - '200': + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - getOneTimeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - nullable: true - required: - - getOneTimeline - required: - - data - description: Indicates that the (template) timeline was found and returned. - summary: >- - Get an existing saved timeline or timeline template. This API is used to - retrieve an existing saved timeline or timeline template. + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Get an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' - patch: - description: >- - Updates an existing timeline. This API is used to update the title, - description, date range, pinned events, pinned queries, and/or pinned - saved queries of an existing timeline. - operationId: PatchTimeline + - slo + put: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: updateSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - timelineId: - nullable: true - type: string - version: - nullable: true - type: string - required: - - timelineId - - version - - timeline - description: The timeline updates along with the timeline ID and version. + $ref: '#/components/schemas/SLOs_update_slo_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: >- - Indicates that the draft timeline was successfully created. In the - event the user already has a draft timeline, the existing draft - timeline is cleared and returned. - '405': + $ref: '#/components/schemas/SLOs_slo_definition_response' + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: >- - Indicates that the user does not have the required access to create - a draft timeline. - summary: Updates an existing timeline. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - post: - operationId: CreateTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - status: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineStatus - nullable: true - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - timelineId: - nullable: true - type: string - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - nullable: true - version: - nullable: true - type: string - required: - - timeline - description: >- - The required timeline fields used to create a new timeline along with - optional fields that will be created if not provided. - required: true + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Update an SLO + tags: + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/_reset': + post: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: resetSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - persistTimeline - required: - - data - description: Indicates the timeline was successfully created. - '405': + $ref: '#/components/schemas/SLOs_slo_definition_response' + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: Indicates that there was an error in the timeline creation. - summary: Creates a new timeline. + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Reset an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_draft: - get: - operationId: GetDraftTimelines + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/disable': + post: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: disableSloOp parameters: - - in: query - name: timelineType - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: '200': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: Indicates that the draft timeline was successfully retrieved. + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response '403': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - If a draft timeline was not found and we attempted to create one, it - indicates that the user does not have the required permissions to - create a draft timeline. - '409': + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - This should never happen, but if a draft timeline was not found and - we attempted to create one, it indicates that there is already a - draft timeline with the given timelineId. - summary: >- - Retrieves the draft timeline for the current user. If the user does not - have a draft timeline, an empty timeline is returned. + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Disable an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/enable': post: description: > - Retrieves a clean draft timeline. If a draft timeline does not exist, it - is created and returned. - operationId: CleanDraftTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - required: - - timelineType - description: >- - The type of timeline to create. Valid values are `default` and - `template`. - required: true + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: enableSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: >- - Indicates that the draft timeline was successfully created. In the - event the user already has a draft timeline, the existing draft - timeline is cleared and returned. + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response '403': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Enable an SLO + tags: + - slo + /service_tokens: + post: + operationId: generate-service-token + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - message: + name: type: string - status_code: - type: number - description: >- - Indicates that the user does not have the required permissions to - create a draft timeline. - '409': + value: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create service token + tags: + - Fleet service tokens + /service-tokens: + post: + deprecated: true + operationId: generate-service-token-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - message: + name: type: string - status_code: - type: number - description: >- - Indicates that there is already a draft timeline with the given - timelineId. - summary: Retrieves a draft timeline or timeline template. + value: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create service token tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_export: - post: - operationId: ExportTimelines - parameters: - - description: The name of the file to export - in: query - name: file_name - required: true - schema: - type: string + - Fleet service tokens + /settings: + get: + operationId: get-settings + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_fleet_settings_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get settings + tags: + - Fleet internals + put: + operationId: update-settings requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - ids: + additional_yaml_config: + type: string + fleet_server_hosts: + description: Protocol and path must be the same for each URL items: type: string - nullable: true type: array - description: The ids of the timelines to export - required: true + has_seen_add_data_notice: + type: boolean responses: '200': content: - application/ndjson; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: schema: - description: NDJSON of the exported timelines - type: string - description: Indicates the timelines were successfully exported + $ref: '#/components/schemas/Fleet_fleet_settings_response' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Update settings + tags: + - Fleet internals + /settings/enrollment: + get: + operationId: get-enrollment-settings + parameters: + - description: >- + An agent policy ID to scope the enrollment settings to. For example, + that policy's Fleet Server host, its proxy, download location, etc. + If not provided, the default Fleet Server policy is used (if any). + in: query + name: agentPolicyId + required: false + schema: + type: string + responses: + '200': content: - application/ndjson; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: Indicates that the export size limit was exceeded - summary: Exports timelines as an NDJSON file - tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_favorite: - patch: - operationId: PersistFavoriteRoute - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timelineId: - nullable: true - type: string - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - nullable: true - required: - - timelineId - - templateTimelineId - - templateTimelineVersion - - timelineType - description: The required fields used to favorite a (template) timeline. - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - data: - type: object - properties: - persistFavorite: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResponse - required: - - persistFavorite - required: - - data - description: Indicates the favorite status was successfully updated. - '403': - content: - 'application:json; Elastic-Api-Version=2023-10-31': - schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: >- - Indicates the user does not have the required permissions to persist - the favorite status. - summary: Persists a given users favorite status of a timeline. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_import: - post: - operationId: ImportTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_Readable - - type: object - properties: - hapi: - type: object - properties: - filename: - type: string - headers: - type: object - isImmutable: - enum: - - 'true' - - 'false' - type: string - required: - - filename - - headers - required: - - hapi - description: The timelines to import as a readable stream. - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - data: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelineResult - required: - - data - description: Indicates the import of timelines was successful. + $ref: '#/components/schemas/Fleet_fleet_settings_enrollment_response' + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - body: - type: string - id: - type: string - statusCode: - type: number - description: >- - Indicates the import of timelines was unsuccessful because of an - invalid file extension. - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - id: - type: string - statusCode: - type: number - description: >- - Indicates that we were unable to locate the saved object client - necessary to handle the import. - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - body: - type: string - id: - type: string - statusCode: - type: number - description: Indicates the import of timelines was unsuccessful. - summary: Imports timelines. + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment settings tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_prepackaged: + - Fleet internals + servers: + - description: Used for Fleet internals and not supported + url: 'http://KIBANA_HOST:5601/internal/fleet' + /setup: post: - operationId: InstallPrepackedTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - prepackagedTimelines: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - type: array - timelinesToInstall: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelines - nullable: true - type: array - timelinesToUpdate: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelines - nullable: true - type: array - required: - - timelinesToInstall - - timelinesToUpdate - - prepackagedTimelines - description: The timelines to install or update. - required: true + operationId: setup + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelineResult - required: - - data - description: Indicates the installation of prepackaged timelines was successful. + $ref: '#/components/schemas/Fleet_fleet_setup_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' '500': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - body: + message: type: string - statusCode: - type: number - description: >- - Indicates the installation of prepackaged timelines was - unsuccessful. - summary: Installs prepackaged timelines. + description: Internal Server Error + summary: Initiate Fleet setup tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/resolve: + - Fleet internals + /uninstall_tokens: get: - operationId: ResolveTimeline + operationId: get-uninstall-tokens parameters: - - description: The ID of the template timeline to resolve + - description: The number of items to return in: query - name: template_timeline_id + name: perPage + required: false schema: - type: string - - description: The ID of the timeline to resolve + default: 20 + minimum: 5 + type: integer + - $ref: '#/components/parameters/Fleet_page_index' + - description: Partial match filtering for policy IDs in: query - name: id + name: policyId + required: false schema: type: string responses: @@ -8022,78 +9655,47 @@ paths: schema: type: object properties: - data: - type: object - properties: - getOneTimeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - nullable: true - required: - - getOneTimeline + items: + items: + type: object + properties: + created_at: + type: string + id: + type: string + policy_id: + type: string + required: + - id + - policy_id + - created_at + type: array + page: + type: number + perPage: + type: number + total: + type: number required: - - data - description: The (template) timeline has been found + - items + - total + - page + - perPage + description: OK '400': - description: The request is missing parameters - '404': - description: The (template) timeline was not found - summary: Get an existing saved timeline or timeline template. + $ref: '#/components/responses/Fleet_error' + summary: List metadata for latest uninstall tokens per agent policy tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timelines: + - Fleet uninstall tokens + '/uninstall_tokens/{uninstallTokenId}': get: - operationId: GetTimelines + operationId: get-uninstall-token parameters: - - description: >- - If true, only timelines that are marked as favorites by the user are - returned. - in: query - name: only_user_favorite - schema: - enum: - - 'true' - - 'false' - nullable: true - type: string - - in: query - name: timeline_type - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' - nullable: true - - in: query - name: sort_field - schema: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SortFieldTimeline - - in: query - name: sort_order - schema: - enum: - - asc - - desc - type: string - - in: query - name: page_size - schema: - nullable: true - type: string - - in: query - name: page_index - schema: - nullable: true - type: string - - in: query - name: search + - in: path + name: uninstallTokenId + required: true schema: - nullable: true type: string - - in: query - name: status - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineStatus' - nullable: true responses: '200': content: @@ -8101,16285 +9703,8082 @@ paths: schema: type: object properties: - data: + item: type: object properties: - customTemplateTimelineCount: - type: number - defaultTimelineCount: - type: number - elasticTemplateTimelineCount: - type: number - favoriteCount: - type: number - templateTimelineCount: - type: number - timelines: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - type: array - totalCount: - type: number + created_at: + type: string + id: + type: string + policy_id: + type: string + token: + type: string required: - - timelines - - totalCount - - defaultTimelineCount - - templateTimelineCount - - favoriteCount - - elasticTemplateTimelineCount - - customTemplateTimelineCount + - id + - token + - policy_id + - created_at required: - - data - description: Indicates that the (template) timelines were found and returned. + - item + description: OK '400': - content: - 'application:json; Elastic-Api-Version=2023-10-31': - schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: Bad request. The user supplied invalid data. - summary: >- - This API is used to retrieve a list of existing saved timelines or - timeline templates. + $ref: '#/components/responses/Fleet_error' + summary: Get one decrypted uninstall token by its ID tags: - - Security Solution Timeline API - - 'access:securitySolution' - '/s/{spaceId}/api/observability/slos': - get: - description: > - You must have the `read` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: findSlosOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - description: A valid kql query to filter the SLO with - example: 'slo.name:latency* and slo.tags : "prod"' - in: query - name: kqlQuery - schema: - type: string - - description: 'The page to use for pagination, must be greater or equal than 1' - example: 1 - in: query - name: page - schema: - default: 1 - type: integer - - description: Number of SLOs returned by page - example: 25 - in: query - name: perPage - schema: - default: 25 - maximum: 5000 - type: integer - - description: Sort by field - example: status - in: query - name: sortBy - schema: - default: status - enum: - - sli_value - - status - - error_budget_consumed - - error_budget_remaining - type: string - - description: Sort order - example: asc - in: query - name: sortDirection - schema: - default: asc - enum: - - asc - - desc - type: string - - description: >- - Hide stale SLOs from the list as defined by stale SLO threshold in - SLO settings - in: query - name: hideStale - schema: - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_find_slo_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Get a paginated list of SLOs - tags: - - slo - post: - description: > - You must have `all` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: createSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_create_slo_request' - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_create_slo_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_409_response' - description: Conflict - The SLO id already exists - summary: Create an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/_delete_instances': - post: - description: > - The deletion occurs for the specified list of `sloId` and `instanceId`. - You must have `all` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: deleteSloInstancesOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_delete_slo_instances_request' - required: true - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - summary: Batch delete rollup and summary data - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}': - delete: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: deleteSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Delete an SLO - tags: - - slo - get: - description: > - You must have the `read` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: getSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - - description: the specific instanceId used by the summary calculation - example: host-abcde - in: query - name: instanceId - schema: - type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_with_summary_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Get an SLO - tags: - - slo - put: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: updateSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_update_slo_request' - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_definition_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Update an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/_reset': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: resetSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_definition_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Reset an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/disable': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: disableSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '200': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Disable an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/enable': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: enableSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Enable an SLO - tags: - - slo -components: - examples: - Connectors_create_email_connector_request: - summary: Create an email connector. - value: - config: - from: tester@example.com - hasAuth: true - host: 'https://example.com' - port: 1025 - secure: false - service: other - connector_type_id: .email - name: email-connector-1 - secrets: - password: password - user: username - Connectors_create_email_connector_response: - summary: A new email connector. - value: - config: - clientId: null - from: tester@example.com - hasAuth: true - host: 'https://example.com' - oauthTokenUrl: null - port: 1025 - secure: false - service: other - tenantId: null - connector_type_id: .email - id: 90a82c60-478f-11ee-a343-f98a117c727f - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: email-connector-1 - Connectors_create_index_connector_request: - summary: Create an index connector. - value: - config: - index: test-index - connector_type_id: .index - name: my-connector - Connectors_create_index_connector_response: - summary: A new index connector. - value: - config: - executionTimeField: null - index: test-index - refresh: false - connector_type_id: .index - id: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-connector - Connectors_create_webhook_connector_request: - summary: Create a webhook connector with SSL authentication. - value: - config: - authType: webhook-authentication-ssl - certType: ssl-crt-key - method: post - url: 'https://example.com' - connector_type_id: .webhook - name: my-webhook-connector - secrets: - crt: QmFnIEF0dH... - key: LS0tLS1CRUdJ... - password: my-passphrase - Connectors_create_webhook_connector_response: - summary: A new webhook connector. - value: - config: - authType: webhook-authentication-ssl - certType: ssl-crt-key - hasAuth: true - headers: null - method: post - url: 'https://example.com' - verificationMode: full - connector_type_id: .webhook - id: 900eb010-3b9d-11ee-a642-8ffbb94e38bd - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-webhook-connector - Connectors_create_xmatters_connector_request: - summary: Create an xMatters connector with URL authentication. - value: - config: - usesBasic: false - connector_type_id: .xmatters - name: my-xmatters-connector - secrets: - secretsUrl: 'https://example.com?apiKey=xxxxx' - Connectors_create_xmatters_connector_response: - summary: A new xMatters connector. - value: - config: - configUrl: null - usesBasic: false - connector_type_id: .xmatters - id: 4d2d8da0-4d1f-11ee-9367-577408be4681 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-xmatters-connector - Connectors_get_connector_response: - summary: Get connector details. - value: - config: {} - connector_type_id: .server-log - id: df770e30-8b8b-11ed-a780-3b746c987a81 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my_server_log_connector - Connectors_get_connector_types_generativeai_response: - summary: A list of connector types for the `generativeAI` feature. - value: - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .gen-ai - is_system_action_type: false - minimum_license_required: enterprise - name: OpenAI - supported_feature_ids: - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .bedrock - is_system_action_type: false - minimum_license_required: enterprise - name: AWS Bedrock - supported_feature_ids: - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .gemini - is_system_action_type: false - minimum_license_required: enterprise - name: Google Gemini - supported_feature_ids: - - generativeAIForSecurity - Connectors_get_connectors_response: - summary: A list of connectors - value: - - connector_type_id: .email - id: preconfigured-email-connector - is_deprecated: false - is_preconfigured: true - is_system_action: false - name: my-preconfigured-email-notification - referenced_by_count: 0 - - config: - executionTimeField: null - index: test-index - refresh: false - connector_type_id: .index - id: e07d0c80-8b8b-11ed-a780-3b746c987a81 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-index-connector - referenced_by_count: 2 - Connectors_update_index_connector_request: - summary: Update an index connector. - value: - config: - index: updated-index - name: updated-connector - Data_views_create_data_view_request: - summary: Create a data view with runtime fields. - value: - data_view: - name: My Logstash data view - runtimeFieldMap: - runtime_shape_name: - script: - source: 'emit(doc[''shape_name''].value)' - type: keyword - title: logstash-* - Data_views_create_runtime_field_request: - summary: Create a runtime field. - value: - name: runtimeFoo - runtimeField: - script: - source: 'emit(doc["foo"].value)' - type: long - Data_views_get_data_view_response: - summary: >- - The get data view API returns a JSON object that contains information - about the data view. - value: - data_view: - allowNoIndex: false - fieldAttrs: - products.manufacturer: - count: 1 - products.price: - count: 1 - products.product_name: - count: 1 - total_quantity: - count: 1 - fieldFormats: - products.base_price: - id: number - params: - pattern: '$0,0.00' - products.base_unit_price: - id: number - params: - pattern: '$0,0.00' - products.min_price: - id: number - params: - pattern: '$0,0.00' - products.price: - id: number - params: - pattern: '$0,0.00' - products.taxful_price: - id: number - params: - pattern: '$0,0.00' - products.taxless_price: - id: number - params: - pattern: '$0,0.00' - taxful_total_price: - id: number - params: - pattern: '$0,0.[00]' - taxless_total_price: - id: number - params: - pattern: '$0,0.00' - fields: - _id: - aggregatable: false - count: 0 - esTypes: - - _id - format: - id: string - isMapped: true - name: _id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _index: - aggregatable: true - count: 0 - esTypes: - - _index - format: - id: string - isMapped: true - name: _index - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _score: - aggregatable: false - count: 0 - format: - id: number - isMapped: true - name: _score - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: number - _source: - aggregatable: false - count: 0 - esTypes: - - _source - format: - id: _source - isMapped: true - name: _source - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: _source - category: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: category - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - category.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: category.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: category - type: string - currency: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: currency - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_birth_date: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: customer_birth_date - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - customer_first_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_first_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_first_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_first_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_first_name - type: string - customer_full_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_full_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_full_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_full_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_full_name - type: string - customer_gender: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_gender - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_id: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_last_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_last_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_last_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_last_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_last_name - type: string - customer_phone: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_phone - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - day_of_week: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: day_of_week - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - day_of_week_i: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: day_of_week_i - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - email: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: email - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - event.dataset: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: event.dataset - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.city_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.city_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.continent_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.continent_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.country_iso_code: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.country_iso_code - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.location: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: geoip.location - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - geoip.region_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.region_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - manufacturer: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: manufacturer - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - manufacturer.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: manufacturer.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: manufacturer - type: string - order_date: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: order_date - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - order_id: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: order_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - products._id: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: products._id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products._id.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products._id.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products._id - type: string - products.base_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.base_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.base_unit_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.base_unit_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.category: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: products.category - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.category.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.category.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.category - type: string - products.created_on: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: products.created_on - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - products.discount_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.discount_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.discount_percentage: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.discount_percentage - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.manufacturer: - aggregatable: false - count: 1 - esTypes: - - text - format: - id: string - isMapped: true - name: products.manufacturer - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.manufacturer.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.manufacturer.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.manufacturer - type: string - products.min_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.min_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.price: - aggregatable: true - count: 1 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.product_id: - aggregatable: true - count: 0 - esTypes: - - long - format: - id: number - isMapped: true - name: products.product_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.product_name: - aggregatable: false - count: 1 - esTypes: - - text - format: - id: string - isMapped: true - name: products.product_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.product_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.product_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.product_name - type: string - products.quantity: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: products.quantity - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.sku: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.sku - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.tax_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.tax_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.taxful_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.taxful_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.taxless_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.taxless_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.unit_discount_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.unit_discount_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - sku: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: sku - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - taxful_total_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.[00]' - isMapped: true - name: taxful_total_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - taxless_total_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: taxless_total_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - total_quantity: - aggregatable: true - count: 1 - esTypes: - - integer - format: - id: number - isMapped: true - name: total_quantity - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - total_unique_products: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: total_unique_products - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - type: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: type - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - user: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: user - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - name: Kibana Sample Data eCommerce - namespaces: - - default - runtimeFieldMap: {} - sourceFilters: [] - timeFieldName: order_date - title: kibana_sample_data_ecommerce - typeMeta: {} - version: WzUsMV0= - Data_views_get_data_views_response: - summary: The get all data views API returns a list of data views. - value: - data_view: - - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - name: Kibana Sample Data eCommerce - namespaces: - - default - title: kibana_sample_data_ecommerce - typeMeta: {} - - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - name: Kibana Sample Data Flights - namespaces: - - default - title: kibana_sample_data_flights - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: Kibana Sample Data Logs - namespaces: - - default - title: kibana_sample_data_logs - Data_views_get_default_data_view_response: - summary: The get default data view API returns the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - Data_views_get_runtime_field_response: - summary: >- - The get runtime field API returns a JSON object that contains - information about the runtime field (`hour_of_day`) and the data view - (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). - value: - data_view: - allowNoIndex: false - fieldAttrs: {} - fieldFormats: - AvgTicketPrice: - id: number - params: - pattern: '$0,0.[00]' - hour_of_day: - id: number - params: - pattern: '00' - fields: - _id: - aggregatable: false - count: 0 - esTypes: - - _id - format: - id: string - isMapped: true - name: _id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _index: - aggregatable: true - count: 0 - esTypes: - - _index - format: - id: string - isMapped: true - name: _index - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _score: - aggregatable: false - count: 0 - format: - id: number - isMapped: true - name: _score - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: number - _source: - aggregatable: false - count: 0 - esTypes: - - _source - format: - id: _source - isMapped: true - name: _source - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: _source - AvgTicketPrice: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - params: - pattern: '$0,0.[00]' - isMapped: true - name: AvgTicketPrice - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - Cancelled: - aggregatable: true - count: 0 - esTypes: - - boolean - format: - id: boolean - isMapped: true - name: Cancelled - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: boolean - Carrier: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Carrier - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - dayOfWeek: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: dayOfWeek - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - Dest: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Dest - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestAirportID: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestAirportID - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestCityName: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestCityName - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestCountry: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestCountry - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestLocation: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: DestLocation - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - DestRegion: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestRegion - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestWeather: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestWeather - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DistanceKilometers: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: DistanceKilometers - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - DistanceMiles: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: DistanceMiles - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - FlightDelay: - aggregatable: true - count: 0 - esTypes: - - boolean - format: - id: boolean - isMapped: true - name: FlightDelay - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: boolean - FlightDelayMin: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: FlightDelayMin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - FlightDelayType: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightDelayType - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightNum: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightNum - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightTimeHour: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightTimeHour - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightTimeMin: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: FlightTimeMin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - hour_of_day: - aggregatable: true - count: 0 - esTypes: - - long - format: - id: number - params: - pattern: '00' - name: hour_of_day - readFromDocValues: false - runtimeField: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - scripted: false - searchable: true - shortDotsEnable: false - type: number - Origin: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Origin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginAirportID: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginAirportID - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginCityName: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginCityName - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginCountry: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginCountry - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginLocation: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: OriginLocation - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - OriginRegion: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginRegion - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginWeather: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginWeather - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - timestamp: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: timestamp - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - name: Kibana Sample Data Flights - runtimeFieldMap: - hour_of_day: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - sourceFilters: [] - timeFieldName: timestamp - title: kibana_sample_data_flights - version: WzM2LDJd - fields: - - aggregatable: true - count: 0 - esTypes: - - long - name: hour_of_day - readFromDocValues: false - runtimeField: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - scripted: false - searchable: true - shortDotsEnable: false - type: number - Data_views_preview_swap_data_view_request: - summary: Preview swapping references from data view ID "abcd-efg" to "xyz-123". - value: - fromId: abcd-efg - toId: xyz-123 - Data_views_set_default_data_view_request: - summary: Set the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - force: true - Data_views_swap_data_view_request: - summary: >- - Swap references from data view ID "abcd-efg" to "xyz-123" and remove the - data view that is no longer referenced. - value: - delete: true - fromId: abcd-efg - toId: xyz-123 - Data_views_update_data_view_request: - summary: Update some properties for a data view. - value: - data_view: - allowNoIndex: false - name: Kibana Sample Data eCommerce - timeFieldName: order_date - title: kibana_sample_data_ecommerce - refresh_fields: true - Data_views_update_field_metadata_request: - summary: Update metadata for multiple fields. - value: - fields: - field1: - count: 123 - customLabel: Field 1 label - field2: - customDescription: Field 2 description - customLabel: Field 2 label - Data_views_update_runtime_field_request: - summary: Update an existing runtime field on a data view. - value: - runtimeField: - script: - source: 'emit(doc["bar"].value)' - Machine_learning_APIs_mlSyncExample: - summary: Two anomaly detection jobs required synchronization in this example. - value: - datafeedsAdded: {} - datafeedsRemoved: {} - savedObjectsCreated: - anomaly-detector: - myjob1: - success: true - myjob2: - success: true - savedObjectsDeleted: {} - Serverless_saved_objects_export_objects_request: - summary: Export a specific saved object. - value: - excludeExportDetails: true - includeReferencesDeep: false - objects: - - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 - type: map - Serverless_saved_objects_export_objects_response: - summary: >- - The export objects API response contains a JSON record for each exported - object. - value: - attributes: - description: '' - layerListJSON: >- - [{"id":"0hmz5","alpha":1,"sourceDescriptor":{"type":"EMS_TMS","isAutoSelect":true,"lightModeDefault":"road_map_desaturated"},"visible":true,"style":{},"type":"EMS_VECTOR_TILE","minZoom":0,"maxZoom":24},{"id":"edh66","label":"Total - Requests by - Destination","minZoom":0,"maxZoom":24,"alpha":0.5,"sourceDescriptor":{"type":"EMS_FILE","id":"world_countries","tooltipProperties":["name","iso2"]},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"__kbnjoin__count__673ff994-fc75-4c67-909b-69fcb0e1060e","origin":"join"},"color":"Greys","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"STATIC","options":{"size":10}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR","joins":[{"leftField":"iso2","right":{"type":"ES_TERM_SOURCE","id":"673ff994-fc75-4c67-909b-69fcb0e1060e","indexPatternTitle":"kibana_sample_data_logs","term":"geo.dest","indexPatternRefName":"layer_1_join_0_index_pattern","metrics":[{"type":"count","label":"web - logs - count"}],"applyGlobalQuery":true}}]},{"id":"gaxya","label":"Actual - Requests","minZoom":9,"maxZoom":24,"alpha":1,"sourceDescriptor":{"id":"b7486535-171b-4d3b-bb2e-33c1a0a2854c","type":"ES_SEARCH","geoField":"geo.coordinates","limit":2048,"filterByMapBounds":true,"tooltipProperties":["clientip","timestamp","host","request","response","machine.os","agent","bytes"],"indexPatternRefName":"layer_2_source_index_pattern","applyGlobalQuery":true,"scalingType":"LIMIT"},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"STATIC","options":{"color":"#2200ff"}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":2}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"bytes","origin":"source"},"minSize":1,"maxSize":23,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"},{"id":"tfi3f","label":"Total - Requests and - Bytes","minZoom":0,"maxZoom":9,"alpha":1,"sourceDescriptor":{"type":"ES_GEO_GRID","resolution":"COARSE","id":"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b","geoField":"geo.coordinates","requestType":"point","metrics":[{"type":"count","label":"web - logs - count"},{"type":"sum","field":"bytes"}],"indexPatternRefName":"layer_3_source_index_pattern","applyGlobalQuery":true},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"color":"Blues","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#cccccc"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"sum_of_bytes","origin":"source"},"minSize":7,"maxSize":25,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelText":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelSize":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"minSize":12,"maxSize":24,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"}] - mapStateJSON: >- - {"zoom":3.64,"center":{"lon":-88.92107,"lat":42.16337},"timeFilters":{"from":"now-7d","to":"now"},"refreshConfig":{"isPaused":true,"interval":0},"query":{"language":"kuery","query":""},"settings":{"autoFitToDataBounds":false}} - title: '[Logs] Total Requests and Bytes' - uiStateJSON: '{"isDarkMode":false}' - coreMigrationVersion: 8.8.0 - created_at: '2023-08-23T20:03:32.204Z' - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 - managed: false - references: - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_1_join_0_index_pattern - type: index-pattern - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_2_source_index_pattern - type: index-pattern - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_3_source_index_pattern - type: index-pattern - type: map - typeMigrationVersion: 8.4.0 - updated_at: '2023-08-23T20:03:32.204Z' - version: WzEzLDFd - Serverless_saved_objects_import_objects_request: - value: - file: file.ndjson - Serverless_saved_objects_import_objects_response: - summary: >- - The import objects API response indicates a successful import and the - objects are created. Since these objects are created as new copies, each - entry in the successResults array includes a destinationId attribute. - value: - success: true - successCount: 1 - successResults: - - destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - managed: false - meta: - icon: indexPatternApp - title: Kibana Sample Data Logs - type: index-pattern - parameters: - Connectors_connector_id: - description: An identifier for the connector. - in: path - name: connectorId - required: true - schema: - example: df770e30-8b8b-11ed-a780-3b746c987a81 - type: string - Connectors_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - Data_views_field_name: - description: The name of the runtime field. - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - Data_views_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - Data_views_view_id: - description: An identifier for the data view. - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - Machine_learning_APIs_simulateParam: - description: >- - When true, simulates the synchronization by returning only the list of - actions that would be performed. - example: 'true' - in: query - name: simulate - required: false - schema: - type: boolean - Serverless_saved_objects_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - SLOs_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - SLOs_slo_id: - description: An identifier for the slo. - in: path - name: sloId - required: true - schema: - example: 9c235211-6834-11ea-a78c-6feb38a34414 - type: string - SLOs_space_id: - description: >- - An identifier for the space. If `/s/` and the identifier are omitted - from the path, the default space is used. - in: path - name: spaceId - required: true - schema: - example: default - type: string - responses: - Connectors_401: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - error: - enum: - - Unauthorized - example: Unauthorized - type: string - message: - type: string - statusCode: - enum: - - 401 - example: 401 - type: integer - title: Unauthorized response - type: object - description: Authorization information is missing or invalid. - Connectors_404: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - error: - enum: - - Not Found - example: Not Found - type: string - message: - example: >- - Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not - found - type: string - statusCode: - enum: - - 404 - example: 404 - type: integer - title: Not found response - type: object - description: Object is not found. - schemas: - Connectors_config_properties_bedrock: - description: Defines properties for connectors when type is `.bedrock`. - properties: - apiUrl: - description: The Amazon Bedrock request URL. - type: string - defaultModel: - default: 'anthropic.claude-3-5-sonnet-20240620-v1:0' - description: > - The generative artificial intelligence model for Amazon Bedrock to - use. Current support is for the Anthropic Claude models. - type: string - required: - - apiUrl - title: Connector request properties for an Amazon Bedrock connector - type: object - Connectors_config_properties_cases_webhook: - description: Defines properties for connectors when type is `.cases-webhook`. - type: object - properties: - createCommentJson: - description: > - A JSON payload sent to the create comment URL to create a case - comment. You can use variables to add Kibana Cases data to the - payload. The required variable is `case.comment`. Due to Mustache - template variables (the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated once the Mustache variables have - been placed when the REST method runs. Manually ensure that the JSON - is valid, disregarding the Mustache variables, so the later - validation will pass. - example: '{"body": {{{case.comment}}}}' - type: string - createCommentMethod: - default: put - description: > - The REST API HTTP request method to create a case comment in the - third-party system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - createCommentUrl: - description: > - The REST API URL to create a case comment by ID in the third-party - system. You can use a variable to add the external system ID to the - URL. If you are using the `xpack.actions.allowedHosts setting`, add - the hostname to the allowed hosts. - example: 'https://example.com/issue/{{{external.system.id}}}/comment' - type: string - createIncidentJson: - description: > - A JSON payload sent to the create case URL to create a case. You can - use variables to add case data to the payload. Required variables - are `case.title` and `case.description`. Due to Mustache template - variables (which is the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated after the Mustache variables have - been placed when REST method runs. Manually ensure that the JSON is - valid to avoid future validation errors; disregard Mustache - variables during your review. - example: >- - {"fields": {"summary": {{{case.title}}},"description": - {{{case.description}}},"labels": {{{case.tags}}}}} - type: string - createIncidentMethod: - default: post - description: > - The REST API HTTP request method to create a case in the third-party - system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - createIncidentResponseKey: - description: >- - The JSON key in the create external case response that contains the - case ID. - type: string - createIncidentUrl: - description: > - The REST API URL to create a case in the third-party system. If you - are using the `xpack.actions.allowedHosts` setting, add the hostname - to the allowed hosts. - type: string - getIncidentResponseExternalTitleKey: - description: >- - The JSON key in get external case response that contains the case - title. - type: string - getIncidentUrl: - description: > - The REST API URL to get the case by ID from the third-party system. - If you are using the `xpack.actions.allowedHosts` setting, add the - hostname to the allowed hosts. You can use a variable to add the - external system ID to the URL. Due to Mustache template variables - (the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated after the Mustache variables have - been placed when REST method runs. Manually ensure that the JSON is - valid, disregarding the Mustache variables, so the later validation - will pass. - example: 'https://example.com/issue/{{{external.system.id}}}' - type: string - hasAuth: - default: true - description: >- - If true, a username and password for login type authentication must - be provided. - type: boolean - headers: - description: > - A set of key-value pairs sent as headers with the request URLs for - the create case, update case, get case, and create comment methods. - type: string - updateIncidentJson: - description: > - The JSON payload sent to the update case URL to update the case. You - can use variables to add Kibana Cases data to the payload. Required - variables are `case.title` and `case.description`. Due to Mustache - template variables (which is the text enclosed in triple braces, for - example, `{{{case.title}}}`), the JSON is not validated when you - create the connector. The JSON is validated after the Mustache - variables have been placed when REST method runs. Manually ensure - that the JSON is valid to avoid future validation errors; disregard - Mustache variables during your review. - example: >- - {"fields": {"summary": {{{case.title}}},"description": - {{{case.description}}},"labels": {{{case.tags}}}}} - type: string - updateIncidentMethod: - default: put - description: > - The REST API HTTP request method to update the case in the - third-party system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - updateIncidentUrl: - description: > - The REST API URL to update the case by ID in the third-party system. - You can use a variable to add the external system ID to the URL. If - you are using the `xpack.actions.allowedHosts` setting, add the - hostname to the allowed hosts. - example: 'https://example.com/issue/{{{external.system.ID}}}' - type: string - viewIncidentUrl: - description: > - The URL to view the case in the external system. You can use - variables to add the external system ID or external system title to - the URL. - example: >- - https://testing-jira.atlassian.net/browse/{{{external.system.title}}} - type: string - required: - - createIncidentJson - - createIncidentResponseKey - - createIncidentUrl - - getIncidentResponseExternalTitleKey - - getIncidentUrl - - updateIncidentJson - - updateIncidentUrl - - viewIncidentUrl - title: Connector request properties for Webhook - Case Management connector - Connectors_config_properties_d3security: - description: Defines properties for connectors when type is `.d3security`. - properties: - url: - description: > - The D3 Security API request URL. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - url - title: Connector request properties for a D3 Security connector - type: object - Connectors_config_properties_email: - description: Defines properties for connectors when type is `.email`. - type: object - properties: - clientId: - description: > - The client identifier, which is a part of OAuth 2.0 client - credentials authentication, in GUID format. If `service` is - `exchange_server`, this property is required. - nullable: true - type: string - from: - description: > - The from address for all emails sent by the connector. It must be - specified in `user@host-name` format. - type: string - hasAuth: - default: true - description: > - Specifies whether a user and password are required inside the - secrets configuration. - type: boolean - host: - description: > - The host name of the service provider. If the `service` is - `elastic_cloud` (for Elastic Cloud notifications) or one of - Nodemailer's well-known email service providers, this property is - ignored. If `service` is `other`, this property must be defined. - type: string - oauthTokenUrl: - nullable: true - type: string - port: - description: > - The port to connect to on the service provider. If the `service` is - `elastic_cloud` (for Elastic Cloud notifications) or one of - Nodemailer's well-known email service providers, this property is - ignored. If `service` is `other`, this property must be defined. - type: integer - secure: - description: > - Specifies whether the connection to the service provider will use - TLS. If the `service` is `elastic_cloud` (for Elastic Cloud - notifications) or one of Nodemailer's well-known email service - providers, this property is ignored. - type: boolean - service: - description: | - The name of the email service. - enum: - - elastic_cloud - - exchange_server - - gmail - - other - - outlook365 - - ses - type: string - tenantId: - description: > - The tenant identifier, which is part of OAuth 2.0 client credentials - authentication, in GUID format. If `service` is `exchange_server`, - this property is required. - nullable: true - type: string - required: - - from - title: Connector request properties for an email connector - Connectors_config_properties_gemini: - description: Defines properties for connectors when type is `.gemini`. - properties: - apiUrl: - description: The Google Gemini request URL. - type: string - defaultModel: - default: gemini-1.5-pro-001 - description: >- - The generative artificial intelligence model for Google Gemini to - use. - type: string - gcpProjectID: - description: The Google ProjectID that has Vertex AI endpoint enabled. - type: string - gcpRegion: - description: The GCP region where the Vertex AI endpoint enabled. - type: string - required: - - apiUrl - - gcpRegion - - gcpProjectID - title: Connector request properties for an Google Gemini connector - type: object - Connectors_config_properties_genai: - description: Defines properties for connectors when type is `.gen-ai`. - discriminator: - mapping: - Azure OpenAI: '#/components/schemas/Connectors_config_properties_genai_azure' - OpenAI: '#/components/schemas/Connectors_config_properties_genai_openai' - propertyName: apiProvider - oneOf: - - $ref: '#/components/schemas/Connectors_config_properties_genai_azure' - - $ref: '#/components/schemas/Connectors_config_properties_genai_openai' - title: Connector request properties for an OpenAI connector - Connectors_config_properties_genai_azure: - description: > - Defines properties for connectors when type is `.gen-ai` and the API - provider is `Azure OpenAI'. - properties: - apiProvider: - description: The OpenAI API provider. - enum: - - Azure OpenAI - type: string - apiUrl: - description: The OpenAI API endpoint. - type: string - required: - - apiProvider - - apiUrl - title: >- - Connector request properties for an OpenAI connector that uses Azure - OpenAI - type: object - Connectors_config_properties_genai_openai: - description: > - Defines properties for connectors when type is `.gen-ai` and the API - provider is `OpenAI'. - properties: - apiProvider: - description: The OpenAI API provider. - enum: - - OpenAI - type: string - apiUrl: - description: The OpenAI API endpoint. - type: string - defaultModel: - description: The default model to use for requests. - type: string - required: - - apiProvider - - apiUrl - title: Connector request properties for an OpenAI connector - type: object - Connectors_config_properties_index: - description: Defines properties for connectors when type is `.index`. - type: object - properties: - executionTimeField: - default: null - description: A field that indicates when the document was indexed. - nullable: true - type: string - index: - description: The Elasticsearch index to be written to. - type: string - refresh: - default: false - description: > - The refresh policy for the write request, which affects when changes - are made visible to search. Refer to the refresh setting for - Elasticsearch document APIs. - type: boolean - required: - - index - title: Connector request properties for an index connector - Connectors_config_properties_jira: - description: Defines properties for connectors when type is `.jira`. - type: object - properties: - apiUrl: - description: The Jira instance URL. - type: string - projectKey: - description: The Jira project key. - type: string - required: - - apiUrl - - projectKey - title: Connector request properties for a Jira connector - Connectors_config_properties_opsgenie: - description: Defines properties for connectors when type is `.opsgenie`. - type: object - properties: - apiUrl: - description: > - The Opsgenie URL. For example, `https://api.opsgenie.com` or - `https://api.eu.opsgenie.com`. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - apiUrl - title: Connector request properties for an Opsgenie connector - Connectors_config_properties_pagerduty: - description: Defines properties for connectors when type is `.pagerduty`. - properties: - apiUrl: - description: The PagerDuty event URL. - example: 'https://events.pagerduty.com/v2/enqueue' - nullable: true - type: string - title: Connector request properties for a PagerDuty connector - type: object - Connectors_config_properties_resilient: - description: Defines properties for connectors when type is `.resilient`. - type: object - properties: - apiUrl: - description: The IBM Resilient instance URL. - type: string - orgId: - description: The IBM Resilient organization ID. - type: string - required: - - apiUrl - - orgId - title: Connector request properties for a IBM Resilient connector - Connectors_config_properties_sentinelone: - description: Defines properties for connectors when type is `.sentinelone`. - type: object - properties: - url: - description: > - The SentinelOne tenant URL. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - url - title: Connector request properties for a SentinelOne connector - Connectors_config_properties_servicenow: - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - description: The ServiceNow instance URL. - type: string - clientId: - description: > - The client ID assigned to your OAuth application. This property is - required when `isOAuth` is `true`. - type: string - isOAuth: - default: false - description: > - The type of authentication to use. The default value is false, which - means basic authentication is used instead of open authorization - (OAuth). - type: boolean - jwtKeyId: - description: > - The key identifier assigned to the JWT verifier map of your OAuth - application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: > - The identifier to use for OAuth authentication. This identifier - should be the user field you selected when you created an OAuth JWT - API endpoint for external clients in your ServiceNow instance. For - example, if the selected user field is `Email`, the user identifier - should be the user's email address. This property is required when - `isOAuth` is `true`. - type: string - usesTableApi: - default: true - description: > - Determines whether the connector uses the Table API or the Import - Set API. This property is supported only for ServiceNow ITSM and - ServiceNow SecOps connectors. NOTE: If this property is set to - `false`, the Elastic application should be installed in ServiceNow. - type: boolean - required: - - apiUrl - title: Connector request properties for a ServiceNow ITSM connector - Connectors_config_properties_servicenow_itom: - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - description: The ServiceNow instance URL. - type: string - clientId: - description: > - The client ID assigned to your OAuth application. This property is - required when `isOAuth` is `true`. - type: string - isOAuth: - default: false - description: > - The type of authentication to use. The default value is false, which - means basic authentication is used instead of open authorization - (OAuth). - type: boolean - jwtKeyId: - description: > - The key identifier assigned to the JWT verifier map of your OAuth - application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: > - The identifier to use for OAuth authentication. This identifier - should be the user field you selected when you created an OAuth JWT - API endpoint for external clients in your ServiceNow instance. For - example, if the selected user field is `Email`, the user identifier - should be the user's email address. This property is required when - `isOAuth` is `true`. - type: string - required: - - apiUrl - title: Connector request properties for a ServiceNow ITSM connector - Connectors_config_properties_slack_api: - description: Defines properties for connectors when type is `.slack_api`. - properties: - allowedChannels: - description: A list of valid Slack channels. - items: - maxItems: 25 - type: object - properties: - id: - description: The Slack channel ID. - example: C123ABC456 - minLength: 1 - type: string - name: - description: The Slack channel name. - minLength: 1 - type: string - required: - - id - - name - type: array - title: Connector request properties for a Slack connector - type: object - Connectors_config_properties_swimlane: - description: Defines properties for connectors when type is `.swimlane`. - type: object - properties: - apiUrl: - description: The Swimlane instance URL. - type: string - appId: - description: The Swimlane application ID. - type: string - connectorType: - description: >- - The type of connector. Valid values are `all`, `alerts`, and - `cases`. - enum: - - all - - alerts - - cases - type: string - mappings: - description: The field mapping. - properties: - alertIdConfig: - description: Mapping for the alert ID. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Alert identifier mapping - type: object - caseIdConfig: - description: Mapping for the case ID. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case identifier mapping - type: object - caseNameConfig: - description: Mapping for the case name. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case name mapping - type: object - commentsConfig: - description: Mapping for the case comments. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case comment mapping - type: object - descriptionConfig: - description: Mapping for the case description. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case description mapping - type: object - ruleNameConfig: - description: Mapping for the name of the alert's rule. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Rule name mapping - type: object - severityConfig: - description: Mapping for the severity. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Severity mapping - type: object - title: Connector mappings properties for a Swimlane connector - type: object - required: - - apiUrl - - appId - - connectorType - title: Connector request properties for a Swimlane connector - Connectors_config_properties_tines: - description: Defines properties for connectors when type is `.tines`. - properties: - url: - description: > - The Tines tenant URL. If you are using the - `xpack.actions.allowedHosts` setting, make sure this hostname is - added to the allowed hosts. - type: string - required: - - url - title: Connector request properties for a Tines connector - type: object - Connectors_config_properties_torq: - description: Defines properties for connectors when type is `.torq`. - properties: - webhookIntegrationUrl: - description: The endpoint URL of the Elastic Security integration in Torq. - type: string - required: - - webhookIntegrationUrl - title: Connector request properties for a Torq connector - type: object - Connectors_config_properties_webhook: - description: Defines properties for connectors when type is `.webhook`. - properties: - authType: - description: | - The type of authentication to use: basic, SSL, or none. - enum: - - webhook-authentication-basic - - webhook-authentication-ssl - nullable: true - type: string - ca: - description: > - A base64 encoded version of the certificate authority file that the - connector can trust to sign and validate certificates. This option - is available for all authentication types. - type: string - certType: - description: > - If the `authType` is `webhook-authentication-ssl`, specifies whether - the certificate authentication data is in a CRT and key file format - or a PFX file format. - enum: - - ssl-crt-key - - ssl-pfx - type: string - hasAuth: - description: > - If `true`, a user name and password must be provided for login type - authentication. - type: boolean - headers: - description: A set of key-value pairs sent as headers with the request. - nullable: true - type: object - method: - default: post - description: | - The HTTP request method, either `post` or `put`. - enum: - - post - - put - type: string - url: - description: > - The request URL. If you are using the `xpack.actions.allowedHosts` - setting, add the hostname to the allowed hosts. - type: string - verificationMode: - default: full - description: > - Controls the verification of certificates. Use `full` to validate - that the certificate has an issue date within the `not_before` and - `not_after` dates, chains to a trusted certificate authority (CA), - and has a hostname or IP address that matches the names within the - certificate. Use `certificate` to validate the certificate and - verify that it is signed by a trusted authority; this option does - not check the certificate hostname. Use `none` to skip certificate - validation. - enum: - - certificate - - full - - none - type: string - title: Connector request properties for a Webhook connector - type: object - Connectors_config_properties_xmatters: - description: Defines properties for connectors when type is `.xmatters`. - properties: - configUrl: - description: > - The request URL for the Elastic Alerts trigger in xMatters. It is - applicable only when `usesBasic` is `true`. - nullable: true - type: string - usesBasic: - default: true - description: >- - Specifies whether the connector uses HTTP basic authentication - (`true`) or URL authentication (`false`). - type: boolean - title: Connector request properties for an xMatters connector - type: object - Connectors_connector_response_properties: - description: The properties vary depending on the connector type. - discriminator: - mapping: - .bedrock: >- - #/components/schemas/Connectors_connector_response_properties_bedrock - .cases-webhook: >- - #/components/schemas/Connectors_connector_response_properties_cases_webhook - .d3security: >- - #/components/schemas/Connectors_connector_response_properties_d3security - .email: '#/components/schemas/Connectors_connector_response_properties_email' - .gemini: '#/components/schemas/Connectors_connector_response_properties_gemini' - .gen-ai: '#/components/schemas/Connectors_connector_response_properties_genai' - .index: '#/components/schemas/Connectors_connector_response_properties_index' - .jira: '#/components/schemas/Connectors_connector_response_properties_jira' - .opsgenie: >- - #/components/schemas/Connectors_connector_response_properties_opsgenie - .pagerduty: >- - #/components/schemas/Connectors_connector_response_properties_pagerduty - .resilient: >- - #/components/schemas/Connectors_connector_response_properties_resilient - .sentinelone: >- - #/components/schemas/Connectors_connector_response_properties_sentinelone - .server-log: >- - #/components/schemas/Connectors_connector_response_properties_serverlog - .servicenow: >- - #/components/schemas/Connectors_connector_response_properties_servicenow - .servicenow-itom: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_itom - .servicenow-sir: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_sir - .slack: >- - #/components/schemas/Connectors_connector_response_properties_slack_webhook - .slack_api: >- - #/components/schemas/Connectors_connector_response_properties_slack_api - .swimlane: >- - #/components/schemas/Connectors_connector_response_properties_swimlane - .teams: '#/components/schemas/Connectors_connector_response_properties_teams' - .tines: '#/components/schemas/Connectors_connector_response_properties_tines' - .torq: '#/components/schemas/Connectors_connector_response_properties_torq' - .webhook: >- - #/components/schemas/Connectors_connector_response_properties_webhook - .xmatters: >- - #/components/schemas/Connectors_connector_response_properties_xmatters - propertyName: connector_type_id - oneOf: - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_bedrock - - $ref: '#/components/schemas/Connectors_connector_response_properties_gemini' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_cases_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_d3security - - $ref: '#/components/schemas/Connectors_connector_response_properties_email' - - $ref: '#/components/schemas/Connectors_connector_response_properties_genai' - - $ref: '#/components/schemas/Connectors_connector_response_properties_index' - - $ref: '#/components/schemas/Connectors_connector_response_properties_jira' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_opsgenie - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_pagerduty - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_resilient - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_sentinelone - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_serverlog - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_itom - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_sir - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_slack_api - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_slack_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_swimlane - - $ref: '#/components/schemas/Connectors_connector_response_properties_teams' - - $ref: '#/components/schemas/Connectors_connector_response_properties_tines' - - $ref: '#/components/schemas/Connectors_connector_response_properties_torq' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_xmatters - title: Connector response properties - Connectors_connector_response_properties_bedrock: - title: Connector response properties for an Amazon Bedrock connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - connector_type_id: - description: The type of connector. - enum: - - .bedrock - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - required: - - config - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_cases_webhook: - title: Connector request properties for a Webhook - Case Management connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - connector_type_id: - description: The type of connector. - enum: - - .cases-webhook - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_d3security: - title: Connector response properties for a D3 Security connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - connector_type_id: - description: The type of connector. - enum: - - .d3security - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_email: - title: Connector response properties for an email connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - connector_type_id: - description: The type of connector. - enum: - - .email - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_gemini: - title: Connector response properties for a Google Gemini connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - connector_type_id: - description: The type of connector. - enum: - - .gemini - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_genai: - title: Connector response properties for an OpenAI connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_genai' - connector_type_id: - description: The type of connector. - enum: - - .gen-ai - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_index: - title: Connector response properties for an index connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_index' - connector_type_id: - description: The type of connector. - enum: - - .index - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_jira: - title: Connector response properties for a Jira connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - connector_type_id: - description: The type of connector. - enum: - - .jira - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_opsgenie: - title: Connector response properties for an Opsgenie connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - connector_type_id: - description: The type of connector. - enum: - - .opsgenie - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_pagerduty: - title: Connector response properties for a PagerDuty connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - connector_type_id: - description: The type of connector. - enum: - - .pagerduty - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_resilient: - title: Connector response properties for a IBM Resilient connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - connector_type_id: - description: The type of connector. - enum: - - .resilient - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_sentinelone: - title: Connector response properties for a SentinelOne connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - connector_type_id: - description: The type of connector. - enum: - - .sentinelone - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_serverlog: - title: Connector response properties for a server log connector - type: object - properties: - config: - nullable: true - type: object - connector_type_id: - description: The type of connector. - enum: - - .server-log - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow: - title: Connector response properties for a ServiceNow ITSM connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow_itom: - title: Connector response properties for a ServiceNow ITOM connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-itom - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow_sir: - title: Connector response properties for a ServiceNow SecOps connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-sir - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_slack_api: - title: Connector response properties for a Slack connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - connector_type_id: - description: The type of connector. - enum: - - .slack_api - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_slack_webhook: - title: Connector response properties for a Slack connector - type: object - properties: - connector_type_id: - description: The type of connector. - enum: - - .slack - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_swimlane: - title: Connector response properties for a Swimlane connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - connector_type_id: - description: The type of connector. - enum: - - .swimlane - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_teams: - title: Connector response properties for a Microsoft Teams connector - type: object - properties: - config: - type: object - connector_type_id: - description: The type of connector. - enum: - - .teams - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_tines: - title: Connector response properties for a Tines connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - connector_type_id: - description: The type of connector. - enum: - - .tines - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_torq: - title: Connector response properties for a Torq connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - connector_type_id: - description: The type of connector. - enum: - - .torq - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_webhook: - title: Connector response properties for a Webhook connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - connector_type_id: - description: The type of connector. - enum: - - .webhook - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_xmatters: - title: Connector response properties for an xMatters connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - connector_type_id: - description: The type of connector. - enum: - - .xmatters - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_types: - description: >- - The type of connector. For example, `.email`, `.index`, `.jira`, - `.opsgenie`, or `.server-log`. - enum: - - .bedrock - - .gemini - - .cases-webhook - - .d3security - - .email - - .gen-ai - - .index - - .jira - - .opsgenie - - .pagerduty - - .resilient - - .sentinelone - - .servicenow - - .servicenow-itom - - .servicenow-sir - - .server-log - - .slack - - .slack_api - - .swimlane - - .teams - - .tines - - .torq - - .webhook - - .xmatters - example: .server-log - title: Connector types - type: string - Connectors_create_connector_request: - description: The properties vary depending on the connector type. - discriminator: - mapping: - .bedrock: '#/components/schemas/Connectors_create_connector_request_bedrock' - .cases-webhook: >- - #/components/schemas/Connectors_create_connector_request_cases_webhook - .d3security: '#/components/schemas/Connectors_create_connector_request_d3security' - .email: '#/components/schemas/Connectors_create_connector_request_email' - .gemini: '#/components/schemas/Connectors_create_connector_request_gemini' - .gen-ai: '#/components/schemas/Connectors_create_connector_request_genai' - .index: '#/components/schemas/Connectors_create_connector_request_index' - .jira: '#/components/schemas/Connectors_create_connector_request_jira' - .opsgenie: '#/components/schemas/Connectors_create_connector_request_opsgenie' - .pagerduty: '#/components/schemas/Connectors_create_connector_request_pagerduty' - .resilient: '#/components/schemas/Connectors_create_connector_request_resilient' - .sentinelone: '#/components/schemas/Connectors_create_connector_request_sentinelone' - .server-log: '#/components/schemas/Connectors_create_connector_request_serverlog' - .servicenow: '#/components/schemas/Connectors_create_connector_request_servicenow' - .servicenow-itom: >- - #/components/schemas/Connectors_create_connector_request_servicenow_itom - .servicenow-sir: >- - #/components/schemas/Connectors_create_connector_request_servicenow_sir - .slack: >- - #/components/schemas/Connectors_create_connector_request_slack_webhook - .slack_api: '#/components/schemas/Connectors_create_connector_request_slack_api' - .swimlane: '#/components/schemas/Connectors_create_connector_request_swimlane' - .teams: '#/components/schemas/Connectors_create_connector_request_teams' - .tines: '#/components/schemas/Connectors_create_connector_request_tines' - .torq: '#/components/schemas/Connectors_create_connector_request_torq' - .webhook: '#/components/schemas/Connectors_create_connector_request_webhook' - .xmatters: '#/components/schemas/Connectors_create_connector_request_xmatters' - propertyName: connector_type_id - oneOf: - - $ref: '#/components/schemas/Connectors_create_connector_request_bedrock' - - $ref: '#/components/schemas/Connectors_create_connector_request_gemini' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_cases_webhook - - $ref: '#/components/schemas/Connectors_create_connector_request_d3security' - - $ref: '#/components/schemas/Connectors_create_connector_request_email' - - $ref: '#/components/schemas/Connectors_create_connector_request_genai' - - $ref: '#/components/schemas/Connectors_create_connector_request_index' - - $ref: '#/components/schemas/Connectors_create_connector_request_jira' - - $ref: '#/components/schemas/Connectors_create_connector_request_opsgenie' - - $ref: '#/components/schemas/Connectors_create_connector_request_pagerduty' - - $ref: '#/components/schemas/Connectors_create_connector_request_resilient' - - $ref: '#/components/schemas/Connectors_create_connector_request_sentinelone' - - $ref: '#/components/schemas/Connectors_create_connector_request_serverlog' - - $ref: '#/components/schemas/Connectors_create_connector_request_servicenow' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_servicenow_itom - - $ref: >- - #/components/schemas/Connectors_create_connector_request_servicenow_sir - - $ref: '#/components/schemas/Connectors_create_connector_request_slack_api' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_slack_webhook - - $ref: '#/components/schemas/Connectors_create_connector_request_swimlane' - - $ref: '#/components/schemas/Connectors_create_connector_request_teams' - - $ref: '#/components/schemas/Connectors_create_connector_request_tines' - - $ref: '#/components/schemas/Connectors_create_connector_request_torq' - - $ref: '#/components/schemas/Connectors_create_connector_request_webhook' - - $ref: '#/components/schemas/Connectors_create_connector_request_xmatters' - title: Create connector request body properties - Connectors_create_connector_request_bedrock: - description: >- - The Amazon Bedrock connector uses axios to send a POST request to Amazon - Bedrock. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - connector_type_id: - description: The type of connector. - enum: - - .bedrock - example: .bedrock - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' - required: - - config - - connector_type_id - - name - - secrets - title: Create Amazon Bedrock connector request - type: object - Connectors_create_connector_request_cases_webhook: - description: > - The Webhook - Case Management connector uses axios to send POST, PUT, - and GET requests to a case management RESTful API web service. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - connector_type_id: - description: The type of connector. - enum: - - .cases-webhook - example: .cases-webhook - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' - required: - - config - - connector_type_id - - name - title: Create Webhook - Case Managment connector request - type: object - Connectors_create_connector_request_d3security: - description: > - The connector uses axios to send a POST request to a D3 Security - endpoint. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - connector_type_id: - description: The type of connector. - enum: - - .d3security - example: .d3security - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_d3security' - required: - - config - - connector_type_id - - name - - secrets - title: Create D3 Security connector request - type: object - Connectors_create_connector_request_email: - description: > - The email connector uses the SMTP protocol to send mail messages, using - an integration of Nodemailer. An exception is Microsoft Exchange, which - uses HTTP protocol for sending emails, Send mail. Email message text is - sent as both plain text and html text. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - connector_type_id: - description: The type of connector. - enum: - - .email - example: .email - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_email' - required: - - config - - connector_type_id - - name - - secrets - title: Create email connector request - type: object - Connectors_create_connector_request_gemini: - description: >- - The Google Gemini connector uses axios to send a POST request to Google - Gemini. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - connector_type_id: - description: The type of connector. - enum: - - .gemini - example: .gemini - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_gemini' - required: - - config - - connector_type_id - - name - - secrets - title: Create Google Gemini connector request - type: object - Connectors_create_connector_request_genai: - description: > - The OpenAI connector uses axios to send a POST request to either OpenAI - or Azure OpenAPI. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_genai' - connector_type_id: - description: The type of connector. - enum: - - .gen-ai - example: .gen-ai - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_genai' - required: - - config - - connector_type_id - - name - - secrets - title: Create OpenAI connector request - type: object - Connectors_create_connector_request_index: - description: The index connector indexes a document into Elasticsearch. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_index' - connector_type_id: - description: The type of connector. - enum: - - .index - example: .index - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - required: - - config - - connector_type_id - - name - title: Create index connector request - type: object - Connectors_create_connector_request_jira: - description: The Jira connector uses the REST API v2 to create Jira issues. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - connector_type_id: - description: The type of connector. - enum: - - .jira - example: .jira - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_jira' - required: - - config - - connector_type_id - - name - - secrets - title: Create Jira connector request - type: object - Connectors_create_connector_request_opsgenie: - description: The Opsgenie connector uses the Opsgenie alert API. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - connector_type_id: - description: The type of connector. - enum: - - .opsgenie - example: .opsgenie - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' - required: - - config - - connector_type_id - - name - - secrets - title: Create Opsgenie connector request - type: object - Connectors_create_connector_request_pagerduty: - description: > - The PagerDuty connector uses the v2 Events API to trigger, acknowledge, - and resolve PagerDuty alerts. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - connector_type_id: - description: The type of connector. - enum: - - .pagerduty - example: .pagerduty - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' - required: - - config - - connector_type_id - - name - - secrets - title: Create PagerDuty connector request - type: object - Connectors_create_connector_request_resilient: - description: >- - The IBM Resilient connector uses the RESILIENT REST v2 to create IBM - Resilient incidents. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - connector_type_id: - description: The type of connector. - enum: - - .resilient - example: .resilient - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_resilient' - required: - - config - - connector_type_id - - name - - secrets - title: Create IBM Resilient connector request - type: object - Connectors_create_connector_request_sentinelone: - description: > - The SentinelOne connector communicates with SentinelOne Management - Console via REST API. This functionality is in technical preview and may - be changed or removed in a future release. Elastic will work to fix any - issues, but features in technical preview are not subject to the support - SLA of official GA features. - title: Create SentinelOne connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - connector_type_id: - description: The type of connector. - enum: - - .sentinelone - example: .sentinelone - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' - required: - - config - - connector_type_id - - name - - secrets - x-technical-preview: true - Connectors_create_connector_request_serverlog: - description: This connector writes an entry to the Kibana server log. - properties: - connector_type_id: - description: The type of connector. - enum: - - .server-log - example: .server-log - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - required: - - connector_type_id - - name - title: Create server log connector request - type: object - Connectors_create_connector_request_servicenow: - description: > - The ServiceNow ITSM connector uses the import set API to create - ServiceNow incidents. You can use the connector for rule actions and - cases. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow - example: .servicenow - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow ITSM connector request - type: object - Connectors_create_connector_request_servicenow_itom: - description: > - The ServiceNow ITOM connector uses the event API to create ServiceNow - events. You can use the connector for rule actions. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-itom - example: .servicenow-itom - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow ITOM connector request - type: object - Connectors_create_connector_request_servicenow_sir: - description: > - The ServiceNow SecOps connector uses the import set API to create - ServiceNow security incidents. You can use the connector for rule - actions and cases. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-sir - example: .servicenow-sir - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow SecOps connector request - type: object - Connectors_create_connector_request_slack_api: - description: The Slack connector uses an API method to send Slack messages. - properties: + - Fleet uninstall tokens +components: + examples: + Connectors_create_email_connector_request: + summary: Create an email connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - connector_type_id: - description: The type of connector. - enum: - - .slack_api - example: .slack_api - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' - required: - - connector_type_id - - name - - secrets - title: Create Slack connector request - type: object - Connectors_create_connector_request_slack_webhook: - description: The Slack connector uses Slack Incoming Webhooks. - properties: - connector_type_id: - description: The type of connector. - enum: - - .slack - example: .slack - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + from: tester@example.com + hasAuth: true + host: 'https://example.com' + port: 1025 + secure: false + service: other + connector_type_id: .email + name: email-connector-1 secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' - required: - - connector_type_id - - name - - secrets - title: Create Slack connector request - type: object - Connectors_create_connector_request_swimlane: - description: >- - The Swimlane connector uses the Swimlane REST API to create Swimlane - records. - properties: + password: password + user: username + Connectors_create_email_connector_response: + summary: A new email connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - connector_type_id: - description: The type of connector. - enum: - - .swimlane - example: .swimlane - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' - required: - - config - - connector_type_id - - name - - secrets - title: Create Swimlane connector request - type: object - Connectors_create_connector_request_teams: - description: The Microsoft Teams connector uses Incoming Webhooks. - properties: - connector_type_id: - description: The type of connector. - enum: - - .teams - example: .teams - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_teams' - required: - - connector_type_id - - name - - secrets - title: Create Microsoft Teams connector request - type: object - Connectors_create_connector_request_tines: - description: > - The Tines connector uses Tines Webhook actions to send events via POST - request. - properties: + clientId: null + from: tester@example.com + hasAuth: true + host: 'https://example.com' + oauthTokenUrl: null + port: 1025 + secure: false + service: other + tenantId: null + connector_type_id: .email + id: 90a82c60-478f-11ee-a343-f98a117c727f + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: email-connector-1 + Connectors_create_index_connector_request: + summary: Create an index connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - connector_type_id: - description: The type of connector. - enum: - - .tines - example: .tines - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_tines' - required: - - config - - connector_type_id - - name - - secrets - title: Create Tines connector request - type: object - Connectors_create_connector_request_torq: - description: > - The Torq connector uses a Torq webhook to trigger workflows with Kibana - actions. - properties: + index: test-index + connector_type_id: .index + name: my-connector + Connectors_create_index_connector_response: + summary: A new index connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - connector_type_id: - description: The type of connector. - enum: - - .torq - example: .torq - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_torq' - required: - - config - - connector_type_id - - name - - secrets - title: Create Torq connector request - type: object - Connectors_create_connector_request_webhook: - description: > - The Webhook connector uses axios to send a POST or PUT request to a web - service. - properties: + executionTimeField: null + index: test-index + refresh: false + connector_type_id: .index + id: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-connector + Connectors_create_webhook_connector_request: + summary: Create a webhook connector with SSL authentication. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - connector_type_id: - description: The type of connector. - enum: - - .webhook - example: .webhook - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + authType: webhook-authentication-ssl + certType: ssl-crt-key + method: post + url: 'https://example.com' + connector_type_id: .webhook + name: my-webhook-connector secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_webhook' - required: - - config - - connector_type_id - - name - - secrets - title: Create Webhook connector request - type: object - Connectors_create_connector_request_xmatters: - description: > - The xMatters connector uses the xMatters Workflow for Elastic to send - actionable alerts to on-call xMatters resources. - properties: + crt: QmFnIEF0dH... + key: LS0tLS1CRUdJ... + password: my-passphrase + Connectors_create_webhook_connector_response: + summary: A new webhook connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - connector_type_id: - description: The type of connector. - enum: - - .xmatters - example: .xmatters - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + authType: webhook-authentication-ssl + certType: ssl-crt-key + hasAuth: true + headers: null + method: post + url: 'https://example.com' + verificationMode: full + connector_type_id: .webhook + id: 900eb010-3b9d-11ee-a642-8ffbb94e38bd + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-webhook-connector + Connectors_create_xmatters_connector_request: + summary: Create an xMatters connector with URL authentication. + value: + config: + usesBasic: false + connector_type_id: .xmatters + name: my-xmatters-connector secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' - required: - - config - - connector_type_id - - name - - secrets - title: Create xMatters connector request - type: object - Connectors_features: - description: | - The feature that uses the connector. - enum: - - alerting - - cases - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - siem - - uptime - type: string - Connectors_is_deprecated: - description: Indicates whether the connector type is deprecated. - example: false - type: boolean - Connectors_is_missing_secrets: + secretsUrl: 'https://example.com?apiKey=xxxxx' + Connectors_create_xmatters_connector_response: + summary: A new xMatters connector. + value: + config: + configUrl: null + usesBasic: false + connector_type_id: .xmatters + id: 4d2d8da0-4d1f-11ee-9367-577408be4681 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-xmatters-connector + Connectors_get_connector_response: + summary: Get connector details. + value: + config: {} + connector_type_id: .server-log + id: df770e30-8b8b-11ed-a780-3b746c987a81 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my_server_log_connector + Connectors_get_connector_types_generativeai_response: + summary: A list of connector types for the `generativeAI` feature. + value: + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .gen-ai + is_system_action_type: false + minimum_license_required: enterprise + name: OpenAI + supported_feature_ids: + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .bedrock + is_system_action_type: false + minimum_license_required: enterprise + name: AWS Bedrock + supported_feature_ids: + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .gemini + is_system_action_type: false + minimum_license_required: enterprise + name: Google Gemini + supported_feature_ids: + - generativeAIForSecurity + Connectors_get_connectors_response: + summary: A list of connectors + value: + - connector_type_id: .email + id: preconfigured-email-connector + is_deprecated: false + is_preconfigured: true + is_system_action: false + name: my-preconfigured-email-notification + referenced_by_count: 0 + - config: + executionTimeField: null + index: test-index + refresh: false + connector_type_id: .index + id: e07d0c80-8b8b-11ed-a780-3b746c987a81 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-index-connector + referenced_by_count: 2 + Connectors_update_index_connector_request: + summary: Update an index connector. + value: + config: + index: updated-index + name: updated-connector + Data_views_create_data_view_request: + summary: Create a data view with runtime fields. + value: + data_view: + name: My Logstash data view + runtimeFieldMap: + runtime_shape_name: + script: + source: 'emit(doc[''shape_name''].value)' + type: keyword + title: logstash-* + Data_views_create_runtime_field_request: + summary: Create a runtime field. + value: + name: runtimeFoo + runtimeField: + script: + source: 'emit(doc["foo"].value)' + type: long + Data_views_get_data_view_response: + summary: >- + The get data view API returns a JSON object that contains information + about the data view. + value: + data_view: + allowNoIndex: false + fieldAttrs: + products.manufacturer: + count: 1 + products.price: + count: 1 + products.product_name: + count: 1 + total_quantity: + count: 1 + fieldFormats: + products.base_price: + id: number + params: + pattern: '$0,0.00' + products.base_unit_price: + id: number + params: + pattern: '$0,0.00' + products.min_price: + id: number + params: + pattern: '$0,0.00' + products.price: + id: number + params: + pattern: '$0,0.00' + products.taxful_price: + id: number + params: + pattern: '$0,0.00' + products.taxless_price: + id: number + params: + pattern: '$0,0.00' + taxful_total_price: + id: number + params: + pattern: '$0,0.[00]' + taxless_total_price: + id: number + params: + pattern: '$0,0.00' + fields: + _id: + aggregatable: false + count: 0 + esTypes: + - _id + format: + id: string + isMapped: true + name: _id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _index: + aggregatable: true + count: 0 + esTypes: + - _index + format: + id: string + isMapped: true + name: _index + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _score: + aggregatable: false + count: 0 + format: + id: number + isMapped: true + name: _score + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: number + _source: + aggregatable: false + count: 0 + esTypes: + - _source + format: + id: _source + isMapped: true + name: _source + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: _source + category: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: category + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + category.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: category.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: category + type: string + currency: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: currency + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_birth_date: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: customer_birth_date + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + customer_first_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_first_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_first_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_first_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_first_name + type: string + customer_full_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_full_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_full_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_full_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_full_name + type: string + customer_gender: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_gender + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_id: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_last_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_last_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_last_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_last_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_last_name + type: string + customer_phone: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_phone + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + day_of_week: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: day_of_week + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + day_of_week_i: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: day_of_week_i + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + email: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: email + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + event.dataset: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: event.dataset + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.city_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.city_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.continent_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.continent_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.country_iso_code: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.country_iso_code + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.location: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: geoip.location + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + geoip.region_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.region_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + manufacturer: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: manufacturer + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + manufacturer.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: manufacturer.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: manufacturer + type: string + order_date: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: order_date + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + order_id: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: order_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + products._id: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: products._id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products._id.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products._id.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products._id + type: string + products.base_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.base_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.base_unit_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.base_unit_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.category: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: products.category + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.category.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.category.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.category + type: string + products.created_on: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: products.created_on + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + products.discount_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.discount_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.discount_percentage: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.discount_percentage + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.manufacturer: + aggregatable: false + count: 1 + esTypes: + - text + format: + id: string + isMapped: true + name: products.manufacturer + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.manufacturer.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.manufacturer.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.manufacturer + type: string + products.min_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.min_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.price: + aggregatable: true + count: 1 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.product_id: + aggregatable: true + count: 0 + esTypes: + - long + format: + id: number + isMapped: true + name: products.product_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.product_name: + aggregatable: false + count: 1 + esTypes: + - text + format: + id: string + isMapped: true + name: products.product_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.product_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.product_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.product_name + type: string + products.quantity: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: products.quantity + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.sku: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.sku + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.tax_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.tax_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.taxful_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.taxful_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.taxless_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.taxless_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.unit_discount_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.unit_discount_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + sku: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: sku + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + taxful_total_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.[00]' + isMapped: true + name: taxful_total_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + taxless_total_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: taxless_total_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + total_quantity: + aggregatable: true + count: 1 + esTypes: + - integer + format: + id: number + isMapped: true + name: total_quantity + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + total_unique_products: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: total_unique_products + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + type: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: type + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + user: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: user + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + name: Kibana Sample Data eCommerce + namespaces: + - default + runtimeFieldMap: {} + sourceFilters: [] + timeFieldName: order_date + title: kibana_sample_data_ecommerce + typeMeta: {} + version: WzUsMV0= + Data_views_get_data_views_response: + summary: The get all data views API returns a list of data views. + value: + data_view: + - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + name: Kibana Sample Data eCommerce + namespaces: + - default + title: kibana_sample_data_ecommerce + typeMeta: {} + - id: d3d7af60-4c81-11e8-b3d7-01146121b73d + name: Kibana Sample Data Flights + namespaces: + - default + title: kibana_sample_data_flights + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: Kibana Sample Data Logs + namespaces: + - default + title: kibana_sample_data_logs + Data_views_get_default_data_view_response: + summary: The get default data view API returns the default data view identifier. + value: + data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + Data_views_get_runtime_field_response: + summary: >- + The get runtime field API returns a JSON object that contains + information about the runtime field (`hour_of_day`) and the data view + (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). + value: + data_view: + allowNoIndex: false + fieldAttrs: {} + fieldFormats: + AvgTicketPrice: + id: number + params: + pattern: '$0,0.[00]' + hour_of_day: + id: number + params: + pattern: '00' + fields: + _id: + aggregatable: false + count: 0 + esTypes: + - _id + format: + id: string + isMapped: true + name: _id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _index: + aggregatable: true + count: 0 + esTypes: + - _index + format: + id: string + isMapped: true + name: _index + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _score: + aggregatable: false + count: 0 + format: + id: number + isMapped: true + name: _score + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: number + _source: + aggregatable: false + count: 0 + esTypes: + - _source + format: + id: _source + isMapped: true + name: _source + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: _source + AvgTicketPrice: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + params: + pattern: '$0,0.[00]' + isMapped: true + name: AvgTicketPrice + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + Cancelled: + aggregatable: true + count: 0 + esTypes: + - boolean + format: + id: boolean + isMapped: true + name: Cancelled + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: boolean + Carrier: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Carrier + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + dayOfWeek: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: dayOfWeek + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + Dest: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Dest + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestAirportID: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestAirportID + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestCityName: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestCityName + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestCountry: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestCountry + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestLocation: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: DestLocation + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + DestRegion: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestRegion + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestWeather: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestWeather + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DistanceKilometers: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: DistanceKilometers + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + DistanceMiles: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: DistanceMiles + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + FlightDelay: + aggregatable: true + count: 0 + esTypes: + - boolean + format: + id: boolean + isMapped: true + name: FlightDelay + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: boolean + FlightDelayMin: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: FlightDelayMin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + FlightDelayType: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightDelayType + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightNum: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightNum + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightTimeHour: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightTimeHour + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightTimeMin: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: FlightTimeMin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + hour_of_day: + aggregatable: true + count: 0 + esTypes: + - long + format: + id: number + params: + pattern: '00' + name: hour_of_day + readFromDocValues: false + runtimeField: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + scripted: false + searchable: true + shortDotsEnable: false + type: number + Origin: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Origin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginAirportID: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginAirportID + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginCityName: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginCityName + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginCountry: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginCountry + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginLocation: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: OriginLocation + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + OriginRegion: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginRegion + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginWeather: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginWeather + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + timestamp: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: timestamp + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + id: d3d7af60-4c81-11e8-b3d7-01146121b73d + name: Kibana Sample Data Flights + runtimeFieldMap: + hour_of_day: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + sourceFilters: [] + timeFieldName: timestamp + title: kibana_sample_data_flights + version: WzM2LDJd + fields: + - aggregatable: true + count: 0 + esTypes: + - long + name: hour_of_day + readFromDocValues: false + runtimeField: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + scripted: false + searchable: true + shortDotsEnable: false + type: number + Data_views_preview_swap_data_view_request: + summary: Preview swapping references from data view ID "abcd-efg" to "xyz-123". + value: + fromId: abcd-efg + toId: xyz-123 + Data_views_set_default_data_view_request: + summary: Set the default data view identifier. + value: + data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + force: true + Data_views_swap_data_view_request: + summary: >- + Swap references from data view ID "abcd-efg" to "xyz-123" and remove the + data view that is no longer referenced. + value: + delete: true + fromId: abcd-efg + toId: xyz-123 + Data_views_update_data_view_request: + summary: Update some properties for a data view. + value: + data_view: + allowNoIndex: false + name: Kibana Sample Data eCommerce + timeFieldName: order_date + title: kibana_sample_data_ecommerce + refresh_fields: true + Data_views_update_field_metadata_request: + summary: Update metadata for multiple fields. + value: + fields: + field1: + count: 123 + customLabel: Field 1 label + field2: + customDescription: Field 2 description + customLabel: Field 2 label + Data_views_update_runtime_field_request: + summary: Update an existing runtime field on a data view. + value: + runtimeField: + script: + source: 'emit(doc["bar"].value)' + Machine_learning_APIs_mlSyncExample: + summary: Two anomaly detection jobs required synchronization in this example. + value: + datafeedsAdded: {} + datafeedsRemoved: {} + savedObjectsCreated: + anomaly-detector: + myjob1: + success: true + myjob2: + success: true + savedObjectsDeleted: {} + Serverless_saved_objects_export_objects_request: + summary: Export a specific saved object. + value: + excludeExportDetails: true + includeReferencesDeep: false + objects: + - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 + type: map + Serverless_saved_objects_export_objects_response: + summary: >- + The export objects API response contains a JSON record for each exported + object. + value: + attributes: + description: '' + layerListJSON: >- + [{"id":"0hmz5","alpha":1,"sourceDescriptor":{"type":"EMS_TMS","isAutoSelect":true,"lightModeDefault":"road_map_desaturated"},"visible":true,"style":{},"type":"EMS_VECTOR_TILE","minZoom":0,"maxZoom":24},{"id":"edh66","label":"Total + Requests by + Destination","minZoom":0,"maxZoom":24,"alpha":0.5,"sourceDescriptor":{"type":"EMS_FILE","id":"world_countries","tooltipProperties":["name","iso2"]},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"__kbnjoin__count__673ff994-fc75-4c67-909b-69fcb0e1060e","origin":"join"},"color":"Greys","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"STATIC","options":{"size":10}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR","joins":[{"leftField":"iso2","right":{"type":"ES_TERM_SOURCE","id":"673ff994-fc75-4c67-909b-69fcb0e1060e","indexPatternTitle":"kibana_sample_data_logs","term":"geo.dest","indexPatternRefName":"layer_1_join_0_index_pattern","metrics":[{"type":"count","label":"web + logs + count"}],"applyGlobalQuery":true}}]},{"id":"gaxya","label":"Actual + Requests","minZoom":9,"maxZoom":24,"alpha":1,"sourceDescriptor":{"id":"b7486535-171b-4d3b-bb2e-33c1a0a2854c","type":"ES_SEARCH","geoField":"geo.coordinates","limit":2048,"filterByMapBounds":true,"tooltipProperties":["clientip","timestamp","host","request","response","machine.os","agent","bytes"],"indexPatternRefName":"layer_2_source_index_pattern","applyGlobalQuery":true,"scalingType":"LIMIT"},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"STATIC","options":{"color":"#2200ff"}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":2}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"bytes","origin":"source"},"minSize":1,"maxSize":23,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"},{"id":"tfi3f","label":"Total + Requests and + Bytes","minZoom":0,"maxZoom":9,"alpha":1,"sourceDescriptor":{"type":"ES_GEO_GRID","resolution":"COARSE","id":"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b","geoField":"geo.coordinates","requestType":"point","metrics":[{"type":"count","label":"web + logs + count"},{"type":"sum","field":"bytes"}],"indexPatternRefName":"layer_3_source_index_pattern","applyGlobalQuery":true},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"color":"Blues","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#cccccc"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"sum_of_bytes","origin":"source"},"minSize":7,"maxSize":25,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelText":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelSize":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"minSize":12,"maxSize":24,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"}] + mapStateJSON: >- + {"zoom":3.64,"center":{"lon":-88.92107,"lat":42.16337},"timeFilters":{"from":"now-7d","to":"now"},"refreshConfig":{"isPaused":true,"interval":0},"query":{"language":"kuery","query":""},"settings":{"autoFitToDataBounds":false}} + title: '[Logs] Total Requests and Bytes' + uiStateJSON: '{"isDarkMode":false}' + coreMigrationVersion: 8.8.0 + created_at: '2023-08-23T20:03:32.204Z' + id: de71f4f0-1902-11e9-919b-ffe5949a18d2 + managed: false + references: + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_1_join_0_index_pattern + type: index-pattern + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_2_source_index_pattern + type: index-pattern + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_3_source_index_pattern + type: index-pattern + type: map + typeMigrationVersion: 8.4.0 + updated_at: '2023-08-23T20:03:32.204Z' + version: WzEzLDFd + Serverless_saved_objects_import_objects_request: + value: + file: file.ndjson + Serverless_saved_objects_import_objects_response: + summary: >- + The import objects API response indicates a successful import and the + objects are created. Since these objects are created as new copies, each + entry in the successResults array includes a destinationId attribute. + value: + success: true + successCount: 1 + successResults: + - destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + managed: false + meta: + icon: indexPatternApp + title: Kibana Sample Data Logs + type: index-pattern + parameters: + Connectors_connector_id: + description: An identifier for the connector. + in: path + name: connectorId + required: true + schema: + example: df770e30-8b8b-11ed-a780-3b746c987a81 + type: string + Connectors_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Data_views_field_name: + description: The name of the runtime field. + in: path + name: fieldName + required: true + schema: + example: hour_of_day + type: string + Data_views_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Data_views_view_id: + description: An identifier for the data view. + in: path + name: viewId + required: true + schema: + example: ff959d40-b880-11e8-a6d9-e546fe2bba5f + type: string + Fleet_format: + description: Simplified or legacy format for package inputs + in: query + name: format + required: false + schema: + enum: + - simplified + - legacy + type: string + Fleet_kbn_xsrf: + description: Kibana's anti Cross-Site Request Forgery token. Can be any string value. + in: header + name: kbn-xsrf + required: true + schema: + type: string + Fleet_kuery: + in: query + name: kuery + required: false + schema: + type: string + Fleet_page_index: + in: query + name: page + required: false + schema: + default: 1 + type: integer + Fleet_page_size: + description: The number of items to return + in: query + name: perPage + required: false + schema: + default: 20 + type: integer + Fleet_show_inactive: + in: query + name: showInactive + required: false + schema: + type: boolean + Fleet_show_upgradeable: + in: query + name: showUpgradeable + required: false + schema: + type: boolean + Fleet_sort_field: + in: query + name: sortField + required: false + schema: + deprecated: true + type: string + Fleet_sort_order: + in: query + name: sortOrder + required: false + schema: + enum: + - asc + - desc + type: string + Fleet_with_metrics: + description: 'Return agent metrics, false by default' + in: query + name: withMetrics + required: false + schema: + type: boolean + Machine_learning_APIs_simulateParam: description: >- - Indicates whether secrets are missing for the connector. Secrets - configuration properties vary depending on the connector type. - example: false - type: boolean - Connectors_is_preconfigured: - description: > - Indicates whether it is a preconfigured connector. If true, the `config` - and `is_missing_secrets` properties are omitted from the response. - example: false - type: boolean - Connectors_is_system_action: - description: Indicates whether the connector is used for system actions. - example: false - type: boolean - Connectors_referenced_by_count: - description: > - Indicates the number of saved objects that reference the connector. If - `is_preconfigured` is true, this value is not calculated. This property - is returned only by the get all connectors API. - example: 2 - type: integer - Connectors_secrets_properties_bedrock: - description: Defines secrets for connectors when type is `.bedrock`. - properties: - accessKey: - description: The AWS access key for authentication. - type: string - secret: - description: The AWS secret for authentication. - type: string - required: - - accessKey - - secret - title: Connector secrets properties for an Amazon Bedrock connector - type: object - Connectors_secrets_properties_cases_webhook: - title: Connector secrets properties for Webhook - Case Management connector - type: object - properties: - password: - description: >- - The password for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - user: - description: >- - The username for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - Connectors_secrets_properties_d3security: - description: Defines secrets for connectors when type is `.d3security`. - type: object - properties: - token: - description: The D3 Security token. - type: string - required: - - token - title: Connector secrets properties for a D3 Security connector - Connectors_secrets_properties_email: - description: Defines secrets for connectors when type is `.email`. - properties: - clientSecret: - description: > - The Microsoft Exchange Client secret for OAuth 2.0 client - credentials authentication. It must be URL-encoded. If `service` is - `exchange_server`, this property is required. - type: string - password: - description: > - The password for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - user: - description: > - The username for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - title: Connector secrets properties for an email connector - type: object - Connectors_secrets_properties_gemini: - description: Defines secrets for connectors when type is `.gemini`. - properties: - credentialsJSON: - description: >- - The service account credentials JSON file. The service account - should have Vertex AI user IAM role assigned to it. - type: string - required: - - credentialsJSON - title: Connector secrets properties for a Google Gemini connector - type: object - Connectors_secrets_properties_genai: - description: Defines secrets for connectors when type is `.gen-ai`. - properties: - apiKey: - description: The OpenAI API key. - type: string - title: Connector secrets properties for an OpenAI connector - type: object - Connectors_secrets_properties_jira: - description: Defines secrets for connectors when type is `.jira`. - type: object - properties: - apiToken: - description: The Jira API authentication token for HTTP basic authentication. - type: string - email: - description: The account email for HTTP Basic authentication. - type: string - required: - - apiToken - - email - title: Connector secrets properties for a Jira connector - Connectors_secrets_properties_opsgenie: - description: Defines secrets for connectors when type is `.opsgenie`. - type: object + When true, simulates the synchronization by returning only the list of + actions that would be performed. + example: 'true' + in: query + name: simulate + required: false + schema: + type: boolean + Serverless_saved_objects_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + SLOs_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + SLOs_slo_id: + description: An identifier for the slo. + in: path + name: sloId + required: true + schema: + example: 9c235211-6834-11ea-a78c-6feb38a34414 + type: string + SLOs_space_id: + description: >- + An identifier for the space. If `/s/` and the identifier are omitted + from the path, the default space is used. + in: path + name: spaceId + required: true + schema: + example: default + type: string + responses: + Connectors_401: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + error: + enum: + - Unauthorized + example: Unauthorized + type: string + message: + type: string + statusCode: + enum: + - 401 + example: 401 + type: integer + title: Unauthorized response + type: object + description: Authorization information is missing or invalid. + Connectors_404: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + error: + enum: + - Not Found + example: Not Found + type: string + message: + example: >- + Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not + found + type: string + statusCode: + enum: + - 404 + example: 404 + type: integer + title: Not found response + type: object + description: Object is not found. + Fleet_error: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + schemas: + Connectors_config_properties_bedrock: + description: Defines properties for connectors when type is `.bedrock`. properties: - apiKey: - description: The Opsgenie API authentication key for HTTP Basic authentication. + apiUrl: + description: The Amazon Bedrock request URL. type: string - required: - - apiKey - title: Connector secrets properties for an Opsgenie connector - Connectors_secrets_properties_pagerduty: - description: Defines secrets for connectors when type is `.pagerduty`. - properties: - routingKey: + defaultModel: + default: 'anthropic.claude-3-5-sonnet-20240620-v1:0' description: > - A 32 character PagerDuty Integration Key for an integration on a - service. + The generative artificial intelligence model for Amazon Bedrock to + use. Current support is for the Anthropic Claude models. type: string required: - - routingKey - title: Connector secrets properties for a PagerDuty connector + - apiUrl + title: Connector request properties for an Amazon Bedrock connector type: object - Connectors_secrets_properties_resilient: - description: Defines secrets for connectors when type is `.resilient`. + Connectors_config_properties_cases_webhook: + description: Defines properties for connectors when type is `.cases-webhook`. type: object properties: - apiKeyId: - description: The authentication key ID for HTTP Basic authentication. - type: string - apiKeySecret: - description: The authentication key secret for HTTP Basic authentication. - type: string - required: - - apiKeyId - - apiKeySecret - title: Connector secrets properties for IBM Resilient connector - Connectors_secrets_properties_sentinelone: - description: Defines secrets for connectors when type is `.sentinelone`. - properties: - token: - description: The A SentinelOne API token. + createCommentJson: + description: > + A JSON payload sent to the create comment URL to create a case + comment. You can use variables to add Kibana Cases data to the + payload. The required variable is `case.comment`. Due to Mustache + template variables (the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated once the Mustache variables have + been placed when the REST method runs. Manually ensure that the JSON + is valid, disregarding the Mustache variables, so the later + validation will pass. + example: '{"body": {{{case.comment}}}}' type: string - required: - - token - title: Connector secrets properties for a SentinelOne connector - type: object - Connectors_secrets_properties_servicenow: - description: >- - Defines secrets for connectors when type is `.servicenow`, - `.servicenow-sir`, or `.servicenow-itom`. - properties: - clientSecret: - description: >- - The client secret assigned to your OAuth application. This property - is required when `isOAuth` is `true`. + createCommentMethod: + default: put + description: > + The REST API HTTP request method to create a case comment in the + third-party system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put type: string - password: - description: >- - The password for HTTP basic authentication. This property is - required when `isOAuth` is `false`. + createCommentUrl: + description: > + The REST API URL to create a case comment by ID in the third-party + system. You can use a variable to add the external system ID to the + URL. If you are using the `xpack.actions.allowedHosts setting`, add + the hostname to the allowed hosts. + example: 'https://example.com/issue/{{{external.system.id}}}/comment' type: string - privateKey: - description: >- - The RSA private key that you created for use in ServiceNow. This - property is required when `isOAuth` is `true`. + createIncidentJson: + description: > + A JSON payload sent to the create case URL to create a case. You can + use variables to add case data to the payload. Required variables + are `case.title` and `case.description`. Due to Mustache template + variables (which is the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated after the Mustache variables have + been placed when REST method runs. Manually ensure that the JSON is + valid to avoid future validation errors; disregard Mustache + variables during your review. + example: >- + {"fields": {"summary": {{{case.title}}},"description": + {{{case.description}}},"labels": {{{case.tags}}}}} type: string - privateKeyPassword: - description: >- - The password for the RSA private key. This property is required when - `isOAuth` is `true` and you set a password on your private key. + createIncidentMethod: + default: post + description: > + The REST API HTTP request method to create a case in the third-party + system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put type: string - username: + createIncidentResponseKey: description: >- - The username for HTTP basic authentication. This property is - required when `isOAuth` is `false`. - type: string - title: >- - Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and - ServiceNow SecOps connectors - type: object - Connectors_secrets_properties_slack_api: - description: Defines secrets for connectors when type is `.slack`. - type: object - properties: - token: - description: Slack bot user OAuth token. - type: string - required: - - token - title: Connector secrets properties for a Web API Slack connector - Connectors_secrets_properties_slack_webhook: - description: Defines secrets for connectors when type is `.slack`. - type: object - properties: - webhookUrl: - description: Slack webhook url. - type: string - required: - - webhookUrl - title: Connector secrets properties for a Webhook Slack connector - Connectors_secrets_properties_swimlane: - description: Defines secrets for connectors when type is `.swimlane`. - properties: - apiToken: - description: Swimlane API authentication token. + The JSON key in the create external case response that contains the + case ID. type: string - title: Connector secrets properties for a Swimlane connector - type: object - Connectors_secrets_properties_teams: - description: Defines secrets for connectors when type is `.teams`. - properties: - webhookUrl: + createIncidentUrl: description: > - The URL of the incoming webhook. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - webhookUrl - title: Connector secrets properties for a Microsoft Teams connector - type: object - Connectors_secrets_properties_tines: - description: Defines secrets for connectors when type is `.tines`. - properties: - email: - description: The email used to sign in to Tines. - type: string - token: - description: The Tines API token. - type: string - required: - - email - - token - title: Connector secrets properties for a Tines connector - type: object - Connectors_secrets_properties_torq: - description: Defines secrets for connectors when type is `.torq`. - properties: - token: - description: The secret of the webhook authentication header. - type: string - required: - - token - title: Connector secrets properties for a Torq connector - type: object - Connectors_secrets_properties_webhook: - description: Defines secrets for connectors when type is `.webhook`. - properties: - crt: - description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT - file. + The REST API URL to create a case in the third-party system. If you + are using the `xpack.actions.allowedHosts` setting, add the hostname + to the allowed hosts. type: string - key: + getIncidentResponseExternalTitleKey: description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-crt-key`, it is a base64 encoded version of the KEY file. + The JSON key in get external case response that contains the case + title. type: string - password: + getIncidentUrl: description: > - The password for HTTP basic authentication or the passphrase for the - SSL certificate files. If `hasAuth` is set to `true` and `authType` - is `webhook-authentication-basic`, this property is required. - type: string - pfx: - description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + The REST API URL to get the case by ID from the third-party system. + If you are using the `xpack.actions.allowedHosts` setting, add the + hostname to the allowed hosts. You can use a variable to add the + external system ID to the URL. Due to Mustache template variables + (the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated after the Mustache variables have + been placed when REST method runs. Manually ensure that the JSON is + valid, disregarding the Mustache variables, so the later validation + will pass. + example: 'https://example.com/issue/{{{external.system.id}}}' type: string - user: + hasAuth: + default: true + description: >- + If true, a username and password for login type authentication must + be provided. + type: boolean + headers: description: > - The username for HTTP basic authentication. If `hasAuth` is set to - `true` and `authType` is `webhook-authentication-basic`, this - property is required. + A set of key-value pairs sent as headers with the request URLs for + the create case, update case, get case, and create comment methods. type: string - title: Connector secrets properties for a Webhook connector - type: object - Connectors_secrets_properties_xmatters: - description: Defines secrets for connectors when type is `.xmatters`. - properties: - password: + updateIncidentJson: description: > - A user name for HTTP basic authentication. It is applicable only - when `usesBasic` is `true`. + The JSON payload sent to the update case URL to update the case. You + can use variables to add Kibana Cases data to the payload. Required + variables are `case.title` and `case.description`. Due to Mustache + template variables (which is the text enclosed in triple braces, for + example, `{{{case.title}}}`), the JSON is not validated when you + create the connector. The JSON is validated after the Mustache + variables have been placed when REST method runs. Manually ensure + that the JSON is valid to avoid future validation errors; disregard + Mustache variables during your review. + example: >- + {"fields": {"summary": {{{case.title}}},"description": + {{{case.description}}},"labels": {{{case.tags}}}}} type: string - secretsUrl: + updateIncidentMethod: + default: put description: > - The request URL for the Elastic Alerts trigger in xMatters with the - API key included in the URL. It is applicable only when `usesBasic` - is `false`. + The REST API HTTP request method to update the case in the + third-party system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put type: string - user: + updateIncidentUrl: description: > - A password for HTTP basic authentication. It is applicable only when - `usesBasic` is `true`. + The REST API URL to update the case by ID in the third-party system. + You can use a variable to add the external system ID to the URL. If + you are using the `xpack.actions.allowedHosts` setting, add the + hostname to the allowed hosts. + example: 'https://example.com/issue/{{{external.system.ID}}}' type: string - title: Connector secrets properties for an xMatters connector - type: object - Connectors_update_connector_request: - description: The properties vary depending on the connector type. - oneOf: - - $ref: '#/components/schemas/Connectors_update_connector_request_bedrock' - - $ref: '#/components/schemas/Connectors_update_connector_request_gemini' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_cases_webhook - - $ref: '#/components/schemas/Connectors_update_connector_request_d3security' - - $ref: '#/components/schemas/Connectors_update_connector_request_email' - - $ref: '#/components/schemas/Connectors_create_connector_request_genai' - - $ref: '#/components/schemas/Connectors_update_connector_request_index' - - $ref: '#/components/schemas/Connectors_update_connector_request_jira' - - $ref: '#/components/schemas/Connectors_update_connector_request_opsgenie' - - $ref: '#/components/schemas/Connectors_update_connector_request_pagerduty' - - $ref: '#/components/schemas/Connectors_update_connector_request_resilient' - - $ref: '#/components/schemas/Connectors_update_connector_request_sentinelone' - - $ref: '#/components/schemas/Connectors_update_connector_request_serverlog' - - $ref: '#/components/schemas/Connectors_update_connector_request_servicenow' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_servicenow_itom - - $ref: '#/components/schemas/Connectors_update_connector_request_slack_api' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_slack_webhook - - $ref: '#/components/schemas/Connectors_update_connector_request_swimlane' - - $ref: '#/components/schemas/Connectors_update_connector_request_teams' - - $ref: '#/components/schemas/Connectors_update_connector_request_tines' - - $ref: '#/components/schemas/Connectors_update_connector_request_torq' - - $ref: '#/components/schemas/Connectors_update_connector_request_webhook' - - $ref: '#/components/schemas/Connectors_update_connector_request_xmatters' - title: Update connector request body properties - Connectors_update_connector_request_bedrock: - title: Update Amazon Bedrock connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - name: - description: The display name for the connector. + viewIncidentUrl: + description: > + The URL to view the case in the external system. You can use + variables to add the external system ID or external system title to + the URL. + example: >- + https://testing-jira.atlassian.net/browse/{{{external.system.title}}} type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' required: - - config - - name - Connectors_update_connector_request_cases_webhook: - title: Update Webhook - Case Managment connector request - type: object + - createIncidentJson + - createIncidentResponseKey + - createIncidentUrl + - getIncidentResponseExternalTitleKey + - getIncidentUrl + - updateIncidentJson + - updateIncidentUrl + - viewIncidentUrl + title: Connector request properties for Webhook - Case Management connector + Connectors_config_properties_d3security: + description: Defines properties for connectors when type is `.d3security`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - name: - description: The display name for the connector. - example: my-connector + url: + description: > + The D3 Security API request URL. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' required: - - config - - name - Connectors_update_connector_request_d3security: - title: Update D3 Security connector request + - url + title: Connector request properties for a D3 Security connector type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - name: - description: The display name for the connector. - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_d3security' - required: - - config - - name - - secrets - Connectors_update_connector_request_email: - title: Update email connector request + Connectors_config_properties_email: + description: Defines properties for connectors when type is `.email`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - name: - description: The display name for the connector. + clientId: + description: > + The client identifier, which is a part of OAuth 2.0 client + credentials authentication, in GUID format. If `service` is + `exchange_server`, this property is required. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_email' - required: - - config - - name - Connectors_update_connector_request_gemini: - title: Update Google Gemini connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - name: - description: The display name for the connector. + from: + description: > + The from address for all emails sent by the connector. It must be + specified in `user@host-name` format. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_gemini' - required: - - config - - name - Connectors_update_connector_request_index: - title: Update index connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_index' - name: - description: The display name for the connector. + hasAuth: + default: true + description: > + Specifies whether a user and password are required inside the + secrets configuration. + type: boolean + host: + description: > + The host name of the service provider. If the `service` is + `elastic_cloud` (for Elastic Cloud notifications) or one of + Nodemailer's well-known email service providers, this property is + ignored. If `service` is `other`, this property must be defined. type: string - required: - - config - - name - Connectors_update_connector_request_jira: - title: Update Jira connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - name: - description: The display name for the connector. + oauthTokenUrl: + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_jira' - required: - - config - - name - - secrets - Connectors_update_connector_request_opsgenie: - title: Update Opsgenie connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - name: - description: The display name for the connector. + port: + description: > + The port to connect to on the service provider. If the `service` is + `elastic_cloud` (for Elastic Cloud notifications) or one of + Nodemailer's well-known email service providers, this property is + ignored. If `service` is `other`, this property must be defined. + type: integer + secure: + description: > + Specifies whether the connection to the service provider will use + TLS. If the `service` is `elastic_cloud` (for Elastic Cloud + notifications) or one of Nodemailer's well-known email service + providers, this property is ignored. + type: boolean + service: + description: | + The name of the email service. + enum: + - elastic_cloud + - exchange_server + - gmail + - other + - outlook365 + - ses type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' - required: - - config - - name - - secrets - Connectors_update_connector_request_pagerduty: - title: Update PagerDuty connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - name: - description: The display name for the connector. + tenantId: + description: > + The tenant identifier, which is part of OAuth 2.0 client credentials + authentication, in GUID format. If `service` is `exchange_server`, + this property is required. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' required: - - config - - name - - secrets - Connectors_update_connector_request_resilient: - title: Update IBM Resilient connector request - type: object + - from + title: Connector request properties for an email connector + Connectors_config_properties_gemini: + description: Defines properties for connectors when type is `.gemini`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - name: - description: The display name for the connector. + apiUrl: + description: The Google Gemini request URL. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_resilient' - required: - - config - - name - - secrets - Connectors_update_connector_request_sentinelone: - title: Update SentinelOne connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - name: - description: The display name for the connector. + defaultModel: + default: gemini-1.5-pro-001 + description: >- + The generative artificial intelligence model for Google Gemini to + use. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' - required: - - config - - name - - secrets - Connectors_update_connector_request_serverlog: - title: Update server log connector request - type: object - properties: - name: - description: The display name for the connector. + gcpProjectID: + description: The Google ProjectID that has Vertex AI endpoint enabled. type: string - required: - - name - Connectors_update_connector_request_servicenow: - title: Update ServiceNow ITSM connector or ServiceNow SecOps request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - name: - description: The display name for the connector. + gcpRegion: + description: The GCP region where the Vertex AI endpoint enabled. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - config - - name - - secrets - Connectors_update_connector_request_servicenow_itom: - title: Create ServiceNow ITOM connector request + - apiUrl + - gcpRegion + - gcpProjectID + title: Connector request properties for an Google Gemini connector type: object + Connectors_config_properties_genai: + description: Defines properties for connectors when type is `.gen-ai`. + discriminator: + mapping: + Azure OpenAI: '#/components/schemas/Connectors_config_properties_genai_azure' + OpenAI: '#/components/schemas/Connectors_config_properties_genai_openai' + propertyName: apiProvider + oneOf: + - $ref: '#/components/schemas/Connectors_config_properties_genai_azure' + - $ref: '#/components/schemas/Connectors_config_properties_genai_openai' + title: Connector request properties for an OpenAI connector + Connectors_config_properties_genai_azure: + description: > + Defines properties for connectors when type is `.gen-ai` and the API + provider is `Azure OpenAI'. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - name: - description: The display name for the connector. + apiProvider: + description: The OpenAI API provider. + enum: + - Azure OpenAI + type: string + apiUrl: + description: The OpenAI API endpoint. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - config - - name - - secrets - Connectors_update_connector_request_slack_api: - title: Update Slack connector request + - apiProvider + - apiUrl + title: >- + Connector request properties for an OpenAI connector that uses Azure + OpenAI type: object + Connectors_config_properties_genai_openai: + description: > + Defines properties for connectors when type is `.gen-ai` and the API + provider is `OpenAI'. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - name: - description: The display name for the connector. + apiProvider: + description: The OpenAI API provider. + enum: + - OpenAI + type: string + apiUrl: + description: The OpenAI API endpoint. + type: string + defaultModel: + description: The default model to use for requests. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' required: - - name - - secrets - Connectors_update_connector_request_slack_webhook: - title: Update Slack connector request + - apiProvider + - apiUrl + title: Connector request properties for an OpenAI connector + type: object + Connectors_config_properties_index: + description: Defines properties for connectors when type is `.index`. type: object properties: - name: - description: The display name for the connector. + executionTimeField: + default: null + description: A field that indicates when the document was indexed. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' + index: + description: The Elasticsearch index to be written to. + type: string + refresh: + default: false + description: > + The refresh policy for the write request, which affects when changes + are made visible to search. Refer to the refresh setting for + Elasticsearch document APIs. + type: boolean required: - - name - - secrets - Connectors_update_connector_request_swimlane: - title: Update Swimlane connector request + - index + title: Connector request properties for an index connector + Connectors_config_properties_jira: + description: Defines properties for connectors when type is `.jira`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - name: - description: The display name for the connector. - example: my-connector + apiUrl: + description: The Jira instance URL. + type: string + projectKey: + description: The Jira project key. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' required: - - config - - name - - secrets - Connectors_update_connector_request_teams: - title: Update Microsoft Teams connector request + - apiUrl + - projectKey + title: Connector request properties for a Jira connector + Connectors_config_properties_opsgenie: + description: Defines properties for connectors when type is `.opsgenie`. type: object properties: - name: - description: The display name for the connector. + apiUrl: + description: > + The Opsgenie URL. For example, `https://api.opsgenie.com` or + `https://api.eu.opsgenie.com`. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_teams' required: - - name - - secrets - Connectors_update_connector_request_tines: - title: Update Tines connector request - type: object + - apiUrl + title: Connector request properties for an Opsgenie connector + Connectors_config_properties_pagerduty: + description: Defines properties for connectors when type is `.pagerduty`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - name: - description: The display name for the connector. + apiUrl: + description: The PagerDuty event URL. + example: 'https://events.pagerduty.com/v2/enqueue' + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_tines' - required: - - config - - name - - secrets - Connectors_update_connector_request_torq: - title: Update Torq connector request + title: Connector request properties for a PagerDuty connector + type: object + Connectors_config_properties_resilient: + description: Defines properties for connectors when type is `.resilient`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - name: - description: The display name for the connector. + apiUrl: + description: The IBM Resilient instance URL. + type: string + orgId: + description: The IBM Resilient organization ID. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - config - - name - - secrets - Connectors_update_connector_request_webhook: - title: Update Webhook connector request + - apiUrl + - orgId + title: Connector request properties for a IBM Resilient connector + Connectors_config_properties_sentinelone: + description: Defines properties for connectors when type is `.sentinelone`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - name: - description: The display name for the connector. + url: + description: > + The SentinelOne tenant URL. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - config - - name - - secrets - Connectors_update_connector_request_xmatters: - title: Update xMatters connector request + - url + title: Connector request properties for a SentinelOne connector + Connectors_config_properties_servicenow: + description: Defines properties for connectors when type is `.servicenow`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - name: - description: The display name for the connector. + apiUrl: + description: The ServiceNow instance URL. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' + clientId: + description: > + The client ID assigned to your OAuth application. This property is + required when `isOAuth` is `true`. + type: string + isOAuth: + default: false + description: > + The type of authentication to use. The default value is false, which + means basic authentication is used instead of open authorization + (OAuth). + type: boolean + jwtKeyId: + description: > + The key identifier assigned to the JWT verifier map of your OAuth + application. This property is required when `isOAuth` is `true`. + type: string + userIdentifierValue: + description: > + The identifier to use for OAuth authentication. This identifier + should be the user field you selected when you created an OAuth JWT + API endpoint for external clients in your ServiceNow instance. For + example, if the selected user field is `Email`, the user identifier + should be the user's email address. This property is required when + `isOAuth` is `true`. + type: string + usesTableApi: + default: true + description: > + Determines whether the connector uses the Table API or the Import + Set API. This property is supported only for ServiceNow ITSM and + ServiceNow SecOps connectors. NOTE: If this property is set to + `false`, the Elastic application should be installed in ServiceNow. + type: boolean required: - - config - - name - - secrets - Data_views_400_response: - title: Bad request + - apiUrl + title: Connector request properties for a ServiceNow ITSM connector + Connectors_config_properties_servicenow_itom: + description: Defines properties for connectors when type is `.servicenow`. type: object properties: - error: - example: Bad Request + apiUrl: + description: The ServiceNow instance URL. type: string - message: + clientId: + description: > + The client ID assigned to your OAuth application. This property is + required when `isOAuth` is `true`. + type: string + isOAuth: + default: false + description: > + The type of authentication to use. The default value is false, which + means basic authentication is used instead of open authorization + (OAuth). + type: boolean + jwtKeyId: + description: > + The key identifier assigned to the JWT verifier map of your OAuth + application. This property is required when `isOAuth` is `true`. + type: string + userIdentifierValue: + description: > + The identifier to use for OAuth authentication. This identifier + should be the user field you selected when you created an OAuth JWT + API endpoint for external clients in your ServiceNow instance. For + example, if the selected user field is `Email`, the user identifier + should be the user's email address. This property is required when + `isOAuth` is `true`. type: string - statusCode: - example: 400 - type: number required: - - statusCode - - error - - message - Data_views_404_response: + - apiUrl + title: Connector request properties for a ServiceNow ITSM connector + Connectors_config_properties_slack_api: + description: Defines properties for connectors when type is `.slack_api`. + properties: + allowedChannels: + description: A list of valid Slack channels. + items: + maxItems: 25 + type: object + properties: + id: + description: The Slack channel ID. + example: C123ABC456 + minLength: 1 + type: string + name: + description: The Slack channel name. + minLength: 1 + type: string + required: + - id + - name + type: array + title: Connector request properties for a Slack connector + type: object + Connectors_config_properties_swimlane: + description: Defines properties for connectors when type is `.swimlane`. type: object properties: - error: - enum: - - Not Found - example: Not Found + apiUrl: + description: The Swimlane instance URL. type: string - message: - example: >- - Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] - not found + appId: + description: The Swimlane application ID. type: string - statusCode: + connectorType: + description: >- + The type of connector. Valid values are `all`, `alerts`, and + `cases`. enum: - - 404 - example: 404 - type: integer - Data_views_allownoindex: - description: Allows the data view saved object to exist before the data is available. - type: boolean - Data_views_create_data_view_request_object: - title: Create data view request - type: object - properties: - data_view: - description: The data view object. - type: object + - all + - alerts + - cases + type: string + mappings: + description: The field mapping. properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldAttrs: - additionalProperties: - $ref: '#/components/schemas/Data_views_fieldattrs' + alertIdConfig: + description: Mapping for the alert ID. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Alert identifier mapping type: object - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: + caseIdConfig: + description: Mapping for the case ID. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case identifier mapping + type: object + caseNameConfig: + description: Mapping for the case name. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case name mapping type: object - id: - type: string - name: - description: The data view name. - type: string - namespaces: - $ref: '#/components/schemas/Data_views_namespaces' - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' + commentsConfig: + description: Mapping for the case comments. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case comment mapping type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - type: - $ref: '#/components/schemas/Data_views_type' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta' - version: - type: string - required: - - title - override: - default: false - description: >- - Override an existing data view if a data view with the provided - title already exists. - type: boolean - required: - - data_view - Data_views_data_view_response_object: - title: Data view response properties - type: object - properties: - data_view: - type: object - properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldAttrs: - additionalProperties: - $ref: '#/components/schemas/Data_views_fieldattrs' + descriptionConfig: + description: Mapping for the case description. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case description mapping type: object - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: + ruleNameConfig: + description: Mapping for the name of the alert's rule. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Rule name mapping type: object - id: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - name: - description: The data view name. - type: string - namespaces: - $ref: '#/components/schemas/Data_views_namespaces' - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' + severityConfig: + description: Mapping for the severity. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Severity mapping type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta_response' - version: - example: WzQ2LDJd - type: string - Data_views_fieldattrs: - description: A map of field attributes by field name. - type: object - properties: - count: - description: Popularity count for the field. - type: integer - customDescription: - description: Custom description for the field. - maxLength: 300 - type: string - customLabel: - description: Custom label for the field. - type: string - Data_views_fieldformats: - description: A map of field formats by field name. - type: object - Data_views_namespaces: - description: >- - An array of space identifiers for sharing the data view between multiple - spaces. - items: - default: default - type: string - type: array - Data_views_runtimefieldmap: - description: A map of runtime field definitions by field name. - type: object - properties: - script: + title: Connector mappings properties for a Swimlane connector type: object - properties: - source: - description: Script for the runtime field. - type: string - type: - description: Mapping type of the runtime field. - type: string required: - - script - - type - Data_views_sourcefilters: - description: The array of field names you want to filter out in Discover. - items: - type: object - properties: - value: - type: string - required: - - value - type: array - Data_views_swap_data_view_request_object: - title: Data view reference swap request - type: object + - apiUrl + - appId + - connectorType + title: Connector request properties for a Swimlane connector + Connectors_config_properties_tines: + description: Defines properties for connectors when type is `.tines`. properties: - delete: - description: Deletes referenced saved object if all references are removed. - type: boolean - forId: - description: Limit the affected saved objects to one or more by identifier. - oneOf: - - type: string - - items: - type: string - type: array - forType: - description: Limit the affected saved objects by type. - type: string - fromId: - description: The saved object reference to change. - type: string - fromType: - description: > - Specify the type of the saved object reference to alter. The default - value is `index-pattern` for data views. - type: string - toId: - description: New saved object reference value to replace the old value. - type: string - required: - - fromId - - toId - Data_views_timefieldname: - description: 'The timestamp field name, which you use for time-based data views.' - type: string - Data_views_title: - description: >- - Comma-separated list of data streams, indices, and aliases that you want - to search. Supports wildcards (`*`). - type: string - Data_views_type: - description: 'When set to `rollup`, identifies the rollup data views.' - type: string - Data_views_typemeta: - description: >- - When you use rollup indices, contains the field list for the rollup data - view API endpoints. + url: + description: > + The Tines tenant URL. If you are using the + `xpack.actions.allowedHosts` setting, make sure this hostname is + added to the allowed hosts. + type: string + required: + - url + title: Connector request properties for a Tines connector type: object + Connectors_config_properties_torq: + description: Defines properties for connectors when type is `.torq`. properties: - aggs: - description: A map of rollup restrictions by aggregation type and field name. - type: object - params: - description: Properties for retrieving rollup fields. - type: object + webhookIntegrationUrl: + description: The endpoint URL of the Elastic Security integration in Torq. + type: string required: - - aggs - - params - Data_views_typemeta_response: - description: >- - When you use rollup indices, contains the field list for the rollup data - view API endpoints. - nullable: true + - webhookIntegrationUrl + title: Connector request properties for a Torq connector type: object + Connectors_config_properties_webhook: + description: Defines properties for connectors when type is `.webhook`. properties: - aggs: - description: A map of rollup restrictions by aggregation type and field name. - type: object - params: - description: Properties for retrieving rollup fields. + authType: + description: | + The type of authentication to use: basic, SSL, or none. + enum: + - webhook-authentication-basic + - webhook-authentication-ssl + nullable: true + type: string + ca: + description: > + A base64 encoded version of the certificate authority file that the + connector can trust to sign and validate certificates. This option + is available for all authentication types. + type: string + certType: + description: > + If the `authType` is `webhook-authentication-ssl`, specifies whether + the certificate authentication data is in a CRT and key file format + or a PFX file format. + enum: + - ssl-crt-key + - ssl-pfx + type: string + hasAuth: + description: > + If `true`, a user name and password must be provided for login type + authentication. + type: boolean + headers: + description: A set of key-value pairs sent as headers with the request. + nullable: true type: object - Data_views_update_data_view_request_object: - title: Update data view request + method: + default: post + description: | + The HTTP request method, either `post` or `put`. + enum: + - post + - put + type: string + url: + description: > + The request URL. If you are using the `xpack.actions.allowedHosts` + setting, add the hostname to the allowed hosts. + type: string + verificationMode: + default: full + description: > + Controls the verification of certificates. Use `full` to validate + that the certificate has an issue date within the `not_before` and + `not_after` dates, chains to a trusted certificate authority (CA), + and has a hostname or IP address that matches the names within the + certificate. Use `certificate` to validate the certificate and + verify that it is signed by a trusted authority; this option does + not check the certificate hostname. Use `none` to skip certificate + validation. + enum: + - certificate + - full + - none + type: string + title: Connector request properties for a Webhook connector type: object + Connectors_config_properties_xmatters: + description: Defines properties for connectors when type is `.xmatters`. properties: - data_view: + configUrl: description: > - The data view properties you want to update. Only the specified - properties are updated in the data view. Unspecified fields stay as - they are persisted. - type: object - properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: - type: object - name: - type: string - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' - type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - type: - $ref: '#/components/schemas/Data_views_type' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta' - refresh_fields: - default: false - description: Reloads the data view fields after the data view is updated. + The request URL for the Elastic Alerts trigger in xMatters. It is + applicable only when `usesBasic` is `true`. + nullable: true + type: string + usesBasic: + default: true + description: >- + Specifies whether the connector uses HTTP basic authentication + (`true`) or URL authentication (`false`). type: boolean + title: Connector request properties for an xMatters connector + type: object + Connectors_connector_response_properties: + description: The properties vary depending on the connector type. + discriminator: + mapping: + .bedrock: >- + #/components/schemas/Connectors_connector_response_properties_bedrock + .cases-webhook: >- + #/components/schemas/Connectors_connector_response_properties_cases_webhook + .d3security: >- + #/components/schemas/Connectors_connector_response_properties_d3security + .email: '#/components/schemas/Connectors_connector_response_properties_email' + .gemini: '#/components/schemas/Connectors_connector_response_properties_gemini' + .gen-ai: '#/components/schemas/Connectors_connector_response_properties_genai' + .index: '#/components/schemas/Connectors_connector_response_properties_index' + .jira: '#/components/schemas/Connectors_connector_response_properties_jira' + .opsgenie: >- + #/components/schemas/Connectors_connector_response_properties_opsgenie + .pagerduty: >- + #/components/schemas/Connectors_connector_response_properties_pagerduty + .resilient: >- + #/components/schemas/Connectors_connector_response_properties_resilient + .sentinelone: >- + #/components/schemas/Connectors_connector_response_properties_sentinelone + .server-log: >- + #/components/schemas/Connectors_connector_response_properties_serverlog + .servicenow: >- + #/components/schemas/Connectors_connector_response_properties_servicenow + .servicenow-itom: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_itom + .servicenow-sir: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_sir + .slack: >- + #/components/schemas/Connectors_connector_response_properties_slack_webhook + .slack_api: >- + #/components/schemas/Connectors_connector_response_properties_slack_api + .swimlane: >- + #/components/schemas/Connectors_connector_response_properties_swimlane + .teams: '#/components/schemas/Connectors_connector_response_properties_teams' + .tines: '#/components/schemas/Connectors_connector_response_properties_tines' + .torq: '#/components/schemas/Connectors_connector_response_properties_torq' + .webhook: >- + #/components/schemas/Connectors_connector_response_properties_webhook + .xmatters: >- + #/components/schemas/Connectors_connector_response_properties_xmatters + propertyName: connector_type_id + oneOf: + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_bedrock + - $ref: '#/components/schemas/Connectors_connector_response_properties_gemini' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_cases_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_d3security + - $ref: '#/components/schemas/Connectors_connector_response_properties_email' + - $ref: '#/components/schemas/Connectors_connector_response_properties_genai' + - $ref: '#/components/schemas/Connectors_connector_response_properties_index' + - $ref: '#/components/schemas/Connectors_connector_response_properties_jira' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_opsgenie + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_pagerduty + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_resilient + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_sentinelone + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_serverlog + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_itom + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_sir + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_slack_api + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_slack_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_swimlane + - $ref: '#/components/schemas/Connectors_connector_response_properties_teams' + - $ref: '#/components/schemas/Connectors_connector_response_properties_tines' + - $ref: '#/components/schemas/Connectors_connector_response_properties_torq' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_xmatters + title: Connector response properties + Connectors_connector_response_properties_bedrock: + title: Connector response properties for an Amazon Bedrock connector + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + connector_type_id: + description: The type of connector. + enum: + - .bedrock + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string required: - - data_view - Kibana_HTTP_APIs_core_status_redactedResponse: - additionalProperties: false - description: A minimal representation of Kibana's operational status. + - config + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_cases_webhook: + title: Connector request properties for a Webhook - Case Management connector type: object properties: - status: - additionalProperties: false - type: object - properties: - overall: - additionalProperties: false - type: object - properties: - level: - description: Service status levels as human and machine readable values. - enum: - - available - - degraded - - unavailable - - critical - type: string - required: - - level - required: - - overall + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' + connector_type_id: + description: The type of connector. + enum: + - .cases-webhook + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - status - Kibana_HTTP_APIs_core_status_response: - additionalProperties: false - description: >- - Kibana's operational status as well as a detailed breakdown of plugin - statuses indication of various loads (like event loop utilization and - network traffic) at time of request. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_d3security: + title: Connector response properties for a D3 Security connector type: object properties: - metrics: - additionalProperties: false - description: Metric groups collected by Kibana. - type: object - properties: - collection_interval_in_millis: - description: The interval at which metrics should be collected. - type: number - elasticsearch_client: - additionalProperties: false - description: Current network metrics of Kibana's Elasticsearch client. - type: object - properties: - totalActiveSockets: - description: Count of network sockets currently in use. - type: number - totalIdleSockets: - description: Count of network sockets currently idle. - type: number - totalQueuedRequests: - description: Count of requests not yet assigned to sockets. - type: number - required: - - totalActiveSockets - - totalIdleSockets - - totalQueuedRequests - last_updated: - description: The time metrics were collected. - type: string - required: - - elasticsearch_client - - last_updated - - collection_interval_in_millis - name: - description: Kibana instance name. - type: string - status: - additionalProperties: false - type: object - properties: - core: - additionalProperties: false - description: Statuses of core Kibana services. - type: object - properties: - elasticsearch: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: >- - An unstructured set of extra metadata about this - service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - savedObjects: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: >- - An unstructured set of extra metadata about this - service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - required: - - elasticsearch - - savedObjects - overall: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: Service status levels as human and machine readable values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: An unstructured set of extra metadata about this service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - plugins: - additionalProperties: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: An unstructured set of extra metadata about this service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - description: A dynamic mapping of plugin ID to plugin status. - type: object - required: - - overall - - core - - plugins - uuid: - description: >- - Unique, generated Kibana instance UUID. This UUID should persist - even if the Kibana process restarts. + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + connector_type_id: + description: The type of connector. + enum: + - .d3security type: string - version: - additionalProperties: false - type: object - properties: - build_date: - description: The date and time of this build. - type: string - build_flavor: - description: >- - The build flavour determines configuration and behavior of - Kibana. On premise users will almost always run the - "traditional" flavour, while other flavours are reserved for - Elastic-specific use cases. - enum: - - serverless - - traditional - type: string - build_hash: - description: >- - A unique hash value representing the git commit of this Kibana - build. - type: string - build_number: - description: >- - A monotonically increasing number, each subsequent build will - have a higher number. - type: number - build_snapshot: - description: Whether this build is a snapshot build. - type: boolean - number: - description: A semantic version number. - type: string - required: - - number - - build_hash - - build_number - - build_snapshot - - build_flavor - - build_date + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured - name - - uuid - - version - - status - - metrics - Machine_learning_APIs_mlSync200Response: + Connectors_connector_response_properties_email: + title: Connector response properties for an email connector + type: object properties: - datafeedsAdded: - additionalProperties: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' - description: >- - If a saved object for an anomaly detection job is missing a datafeed - identifier, it is added when you run the sync machine learning saved - objects API. - type: object - datafeedsRemoved: - additionalProperties: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' - description: >- - If a saved object for an anomaly detection job references a datafeed - that no longer exists, it is deleted when you run the sync machine - learning saved objects API. - type: object - savedObjectsCreated: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsCreated - savedObjectsDeleted: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted - title: Successful sync API response + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + connector_type_id: + description: The type of connector. + enum: + - .email + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_gemini: + title: Connector response properties for a Google Gemini connector type: object - Machine_learning_APIs_mlSync4xxResponse: properties: - error: - example: Unauthorized + config: + $ref: '#/components/schemas/Connectors_config_properties_gemini' + connector_type_id: + description: The type of connector. + enum: + - .gemini type: string - message: + id: + description: The identifier for the connector. type: string - statusCode: - example: 401 - type: integer - title: Unsuccessful sync API response + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_genai: + title: Connector response properties for an OpenAI connector + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_genai' + connector_type_id: + description: The type of connector. + enum: + - .gen-ai + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_index: + title: Connector response properties for an index connector + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + connector_type_id: + description: The type of connector. + enum: + - .index + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_jira: + title: Connector response properties for a Jira connector + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + connector_type_id: + description: The type of connector. + enum: + - .jira + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_opsgenie: + title: Connector response properties for an Opsgenie connector type: object - Machine_learning_APIs_mlSyncResponseAnomalyDetectors: - description: >- - The sync machine learning saved objects API response contains this - object when there are anomaly detection jobs affected by the - synchronization. There is an object for each relevant job, which - contains the synchronization status. properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for anomaly detection jobs + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' + connector_type_id: + description: The type of connector. + enum: + - .opsgenie + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_pagerduty: + title: Connector response properties for a PagerDuty connector type: object - Machine_learning_APIs_mlSyncResponseDatafeeds: - description: >- - The sync machine learning saved objects API response contains this - object when there are datafeeds affected by the synchronization. There - is an object for each relevant datafeed, which contains the - synchronization status. properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for datafeeds + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' + connector_type_id: + description: The type of connector. + enum: + - .pagerduty + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_resilient: + title: Connector response properties for a IBM Resilient connector type: object - Machine_learning_APIs_mlSyncResponseDataFrameAnalytics: - description: >- - The sync machine learning saved objects API response contains this - object when there are data frame analytics jobs affected by the - synchronization. There is an object for each relevant job, which - contains the synchronization status. properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for data frame analytics jobs + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + connector_type_id: + description: The type of connector. + enum: + - .resilient + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_sentinelone: + title: Connector response properties for a SentinelOne connector type: object - Machine_learning_APIs_mlSyncResponseSavedObjectsCreated: - description: >- - If saved objects are missing for machine learning jobs or trained - models, they are created when you run the sync machine learning saved - objects API. properties: - anomaly-detector: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors - description: >- - If saved objects are missing for anomaly detection jobs, they are - created. - type: object - data-frame-analytics: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics - description: >- - If saved objects are missing for data frame analytics jobs, they are - created. - type: object - trained-model: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels - description: 'If saved objects are missing for trained models, they are created.' - type: object - title: Sync API response for created saved objects + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + connector_type_id: + description: The type of connector. + enum: + - .sentinelone + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_serverlog: + title: Connector response properties for a server log connector type: object - Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted: - description: >- - If saved objects exist for machine learning jobs or trained models that - no longer exist, they are deleted when you run the sync machine learning - saved objects API. properties: - anomaly-detector: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors - description: >- - If there are saved objects exist for nonexistent anomaly detection - jobs, they are deleted. - type: object - data-frame-analytics: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics - description: >- - If there are saved objects exist for nonexistent data frame - analytics jobs, they are deleted. - type: object - trained-model: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels - description: >- - If there are saved objects exist for nonexistent trained models, - they are deleted. + config: + nullable: true type: object - title: Sync API response for deleted saved objects - type: object - Machine_learning_APIs_mlSyncResponseSuccess: - description: The success or failure of the synchronization. - type: boolean - Machine_learning_APIs_mlSyncResponseTrainedModels: - description: >- - The sync machine learning saved objects API response contains this - object when there are trained models affected by the synchronization. - There is an object for each relevant trained model, which contains the - synchronization status. - properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for trained models - type: object - Security_AI_Assistant_API_AnonymizationFieldCreateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - field: + connector_type_id: + description: The type of connector. + enum: + - .server-log type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - field - Security_AI_Assistant_API_AnonymizationFieldDetailsInError: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow: + title: Connector response properties for a ServiceNow ITSM connector type: object properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. + enum: + - .servicenow + type: string id: + description: The identifier for the connector. type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_AnonymizationFieldResponse: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow_itom: + title: Connector response properties for a ServiceNow ITOM connector type: object properties: - allowed: - type: boolean - anonymized: - type: boolean - createdAt: - type: string - createdBy: - type: string - field: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + connector_type_id: + description: The type of connector. + enum: + - .servicenow-itom type: string id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - namespace: - description: Kibana space - type: string - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - updatedAt: + description: The identifier for the connector. type: string - updatedBy: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - field - Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason: - enum: - - ANONYMIZATION_FIELD_NOT_MODIFIED - type: string - Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipResult: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow_sir: + title: Connector response properties for a ServiceNow SecOps connector type: object properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. + enum: + - .servicenow-sir + type: string id: + description: The identifier for the connector. type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' name: + description: The display name for the connector. type: string - skip_reason: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - skip_reason - Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResponse: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_slack_api: + title: Connector response properties for a Slack connector type: object properties: - anonymization_fields_count: - type: integer - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_NormalizedAnonymizationFieldError - type: array - results: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResults - summary: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_BulkCrudActionSummary - required: - - results - - summary - message: + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + connector_type_id: + description: The type of connector. + enum: + - .slack_api type: string - status_code: - type: integer - success: - type: boolean - required: - - attributes - Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipResult - type: array - updated: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse - type: array - required: - - updated - - created - - deleted - - skipped - Security_AI_Assistant_API_AnonymizationFieldUpdateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_ApiConfig: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_slack_webhook: + title: Connector response properties for a Slack connector type: object properties: - actionTypeId: - description: action type id - type: string - connectorId: - description: connector id + connector_type_id: + description: The type of connector. + enum: + - .slack type: string - defaultSystemPromptId: - description: defaultSystemPromptId + id: + description: The identifier for the connector. type: string - model: - description: model + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string - provider: - $ref: '#/components/schemas/Security_AI_Assistant_API_Provider' - description: Provider + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - connectorId - - actionTypeId - Security_AI_Assistant_API_BulkCrudActionSummary: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_swimlane: + title: Connector response properties for a Swimlane connector type: object properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + connector_type_id: + description: The type of connector. + enum: + - .swimlane + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - failed - - skipped - - succeeded - - total - Security_AI_Assistant_API_ChatCompleteProps: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_teams: + title: Connector response properties for a Microsoft Teams connector type: object properties: - connectorId: - type: string - conversationId: + config: + type: object + connector_type_id: + description: The type of connector. + enum: + - .teams type: string - isStream: - type: boolean - langSmithApiKey: + id: + description: The identifier for the connector. type: string - langSmithProject: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string - messages: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' - type: array - model: + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_tines: + title: Connector response properties for a Tines connector + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + connector_type_id: + description: The type of connector. + enum: + - .tines type: string - persist: - type: boolean - promptId: + id: + description: The identifier for the connector. type: string - responseLanguage: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - messages - - persist - - connectorId - Security_AI_Assistant_API_ChatMessage: - description: AI assistant message. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_torq: + title: Connector response properties for a Torq connector type: object properties: - content: - description: Message content. + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' + connector_type_id: + description: The type of connector. + enum: + - .torq type: string - data: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' - description: Message role. - required: - - role - Security_AI_Assistant_API_ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - Security_AI_Assistant_API_ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - Security_AI_Assistant_API_ConversationCreateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - description: The conversation id. + description: The identifier for the connector. type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - title: - description: The conversation title. + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - title - Security_AI_Assistant_API_ConversationResponse: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_webhook: + title: Connector response properties for a Webhook connector type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + connector_type_id: + description: The type of connector. + enum: + - .webhook type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - title: - description: The conversation title. + description: The identifier for the connector. type: string - updatedAt: - description: The last time conversation was updated. + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - title - - createdAt - - users - - namespace - - category - Security_AI_Assistant_API_ConversationSummary: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_xmatters: + title: Connector response properties for an xMatters connector type: object properties: - confidence: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationConfidence - description: >- - How confident you are about this being a correct and useful - learning. - content: - description: Summary text of the conversation over time. + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + connector_type_id: + description: The type of connector. + enum: + - .xmatters type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp summary was updated. - Security_AI_Assistant_API_ConversationUpdateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - title: - description: The conversation title. + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - Security_AI_Assistant_API_FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - Security_AI_Assistant_API_FindPromptsSortField: - enum: - - created_at - - is_default + - is_deprecated + - is_preconfigured - name - - updated_at - type: string - Security_AI_Assistant_API_Message: - description: AI assistant conversation message. - type: object - properties: - content: - description: Message content. - type: string - isError: - description: Is error message. - type: boolean - reader: - $ref: '#/components/schemas/Security_AI_Assistant_API_Reader' - description: Message content. - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageRole' - description: Message role. - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp message was sent or received. - traceData: - $ref: '#/components/schemas/Security_AI_Assistant_API_TraceData' - description: trace Data - required: - - timestamp - - content - - role - Security_AI_Assistant_API_MessageData: - additionalProperties: true - type: object - Security_AI_Assistant_API_MessageRole: - description: Message role. + Connectors_connector_types: + description: >- + The type of connector. For example, `.email`, `.index`, `.jira`, + `.opsgenie`, or `.server-log`. enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ + - .bedrock + - .gemini + - .cases-webhook + - .d3security + - .email + - .gen-ai + - .index + - .jira + - .opsgenie + - .pagerduty + - .resilient + - .sentinelone + - .servicenow + - .servicenow-itom + - .servicenow-sir + - .server-log + - .slack + - .slack_api + - .swimlane + - .teams + - .tines + - .torq + - .webhook + - .xmatters + example: .server-log + title: Connector types type: string - Security_AI_Assistant_API_NormalizedAnonymizationFieldError: - type: object + Connectors_create_connector_request: + description: The properties vary depending on the connector type. + discriminator: + mapping: + .bedrock: '#/components/schemas/Connectors_create_connector_request_bedrock' + .cases-webhook: >- + #/components/schemas/Connectors_create_connector_request_cases_webhook + .d3security: '#/components/schemas/Connectors_create_connector_request_d3security' + .email: '#/components/schemas/Connectors_create_connector_request_email' + .gemini: '#/components/schemas/Connectors_create_connector_request_gemini' + .gen-ai: '#/components/schemas/Connectors_create_connector_request_genai' + .index: '#/components/schemas/Connectors_create_connector_request_index' + .jira: '#/components/schemas/Connectors_create_connector_request_jira' + .opsgenie: '#/components/schemas/Connectors_create_connector_request_opsgenie' + .pagerduty: '#/components/schemas/Connectors_create_connector_request_pagerduty' + .resilient: '#/components/schemas/Connectors_create_connector_request_resilient' + .sentinelone: '#/components/schemas/Connectors_create_connector_request_sentinelone' + .server-log: '#/components/schemas/Connectors_create_connector_request_serverlog' + .servicenow: '#/components/schemas/Connectors_create_connector_request_servicenow' + .servicenow-itom: >- + #/components/schemas/Connectors_create_connector_request_servicenow_itom + .servicenow-sir: >- + #/components/schemas/Connectors_create_connector_request_servicenow_sir + .slack: >- + #/components/schemas/Connectors_create_connector_request_slack_webhook + .slack_api: '#/components/schemas/Connectors_create_connector_request_slack_api' + .swimlane: '#/components/schemas/Connectors_create_connector_request_swimlane' + .teams: '#/components/schemas/Connectors_create_connector_request_teams' + .tines: '#/components/schemas/Connectors_create_connector_request_tines' + .torq: '#/components/schemas/Connectors_create_connector_request_torq' + .webhook: '#/components/schemas/Connectors_create_connector_request_webhook' + .xmatters: '#/components/schemas/Connectors_create_connector_request_xmatters' + propertyName: connector_type_id + oneOf: + - $ref: '#/components/schemas/Connectors_create_connector_request_bedrock' + - $ref: '#/components/schemas/Connectors_create_connector_request_gemini' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_cases_webhook + - $ref: '#/components/schemas/Connectors_create_connector_request_d3security' + - $ref: '#/components/schemas/Connectors_create_connector_request_email' + - $ref: '#/components/schemas/Connectors_create_connector_request_genai' + - $ref: '#/components/schemas/Connectors_create_connector_request_index' + - $ref: '#/components/schemas/Connectors_create_connector_request_jira' + - $ref: '#/components/schemas/Connectors_create_connector_request_opsgenie' + - $ref: '#/components/schemas/Connectors_create_connector_request_pagerduty' + - $ref: '#/components/schemas/Connectors_create_connector_request_resilient' + - $ref: '#/components/schemas/Connectors_create_connector_request_sentinelone' + - $ref: '#/components/schemas/Connectors_create_connector_request_serverlog' + - $ref: '#/components/schemas/Connectors_create_connector_request_servicenow' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_servicenow_itom + - $ref: >- + #/components/schemas/Connectors_create_connector_request_servicenow_sir + - $ref: '#/components/schemas/Connectors_create_connector_request_slack_api' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_slack_webhook + - $ref: '#/components/schemas/Connectors_create_connector_request_swimlane' + - $ref: '#/components/schemas/Connectors_create_connector_request_teams' + - $ref: '#/components/schemas/Connectors_create_connector_request_tines' + - $ref: '#/components/schemas/Connectors_create_connector_request_torq' + - $ref: '#/components/schemas/Connectors_create_connector_request_webhook' + - $ref: '#/components/schemas/Connectors_create_connector_request_xmatters' + title: Create connector request body properties + Connectors_create_connector_request_bedrock: + description: >- + The Amazon Bedrock connector uses axios to send a POST request to Amazon + Bedrock. properties: - anonymization_fields: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldDetailsInError - type: array - err_code: + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + connector_type_id: + description: The type of connector. + enum: + - .bedrock + example: .bedrock type: string - message: + name: + description: The display name for the connector. + example: my-connector type: string - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' required: - - message - - status_code - - anonymization_fields - Security_AI_Assistant_API_NormalizedPromptError: + - config + - connector_type_id + - name + - secrets + title: Create Amazon Bedrock connector request type: object + Connectors_create_connector_request_cases_webhook: + description: > + The Webhook - Case Management connector uses axios to send POST, PUT, + and GET requests to a case management RESTful API web service. properties: - err_code: + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' + connector_type_id: + description: The type of connector. + enum: + - .cases-webhook + example: .cases-webhook type: string - message: + name: + description: The display name for the connector. + example: my-connector type: string - prompts: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptDetailsInError - type: array - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' required: - - message - - status_code - - prompts - Security_AI_Assistant_API_PromptCreateProps: + - config + - connector_type_id + - name + title: Create Webhook - Case Managment connector request type: object + Connectors_create_connector_request_d3security: + description: > + The connector uses axios to send a POST request to a D3 Security + endpoint. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + connector_type_id: + description: The type of connector. + enum: + - .d3security + example: .d3security type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean name: + description: The display name for the connector. + example: my-connector type: string - promptType: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_d3security' required: + - config + - connector_type_id - name - - content - - promptType - Security_AI_Assistant_API_PromptDetailsInError: + - secrets + title: Create D3 Security connector request type: object + Connectors_create_connector_request_email: + description: > + The email connector uses the SMTP protocol to send mail messages, using + an integration of Nodemailer. An exception is Microsoft Exchange, which + uses HTTP protocol for sending emails, Send mail. Email message text is + sent as both plain text and html text. properties: - id: + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + connector_type_id: + description: The type of connector. + enum: + - .email + example: .email type: string name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_email' required: - - id - Security_AI_Assistant_API_PromptResponse: + - config + - connector_type_id + - name + - secrets + title: Create email connector request type: object + Connectors_create_connector_request_gemini: + description: >- + The Google Gemini connector uses axios to send a POST request to Google + Gemini. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - createdAt: - type: string - createdBy: + config: + $ref: '#/components/schemas/Connectors_config_properties_gemini' + connector_type_id: + description: The type of connector. + enum: + - .gemini + example: .gemini type: string - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - type: boolean - isNewConversationDefault: - type: boolean name: + description: The display name for the connector. + example: my-connector type: string - namespace: - description: Kibana space - type: string - promptType: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - updatedAt: - type: string - updatedBy: - type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_gemini' required: - - id + - config + - connector_type_id - name - - promptType - - content - Security_AI_Assistant_API_PromptsBulkActionSkipReason: - enum: - - PROMPT_FIELD_NOT_MODIFIED - type: string - Security_AI_Assistant_API_PromptsBulkActionSkipResult: + - secrets + title: Create Google Gemini connector request type: object + Connectors_create_connector_request_genai: + description: > + The OpenAI connector uses axios to send a POST request to either OpenAI + or Azure OpenAPI. properties: - id: + config: + $ref: '#/components/schemas/Connectors_config_properties_genai' + connector_type_id: + description: The type of connector. + enum: + - .gen-ai + example: .gen-ai type: string name: + description: The display name for the connector. + example: my-connector type: string - skip_reason: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipReason - required: - - id - - skip_reason - Security_AI_Assistant_API_PromptsBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_NormalizedPromptError - type: array - results: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResults - summary: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_BulkCrudActionSummary - required: - - results - - summary - message: - type: string - prompts_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - Security_AI_Assistant_API_PromptsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipResult - type: array - updated: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_genai' required: - - updated - - created - - deleted - - skipped - Security_AI_Assistant_API_PromptType: - description: Prompt type - enum: - - system - - quick - type: string - Security_AI_Assistant_API_PromptUpdateProps: + - config + - connector_type_id + - name + - secrets + title: Create OpenAI connector request type: object + Connectors_create_connector_request_index: + description: The index connector indexes a document into Elasticsearch. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + connector_type_id: + description: The type of connector. + enum: + - .index + example: .index type: string - id: + name: + description: The display name for the connector. + example: my-connector type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean required: - - id - Security_AI_Assistant_API_Provider: - description: Provider - enum: - - OpenAI - - Azure OpenAI - type: string - Security_AI_Assistant_API_Reader: - additionalProperties: true - type: object - Security_AI_Assistant_API_Replacements: - additionalProperties: - type: string - description: Replacements object used to anonymize/deanomymize messsages - type: object - Security_AI_Assistant_API_SortOrder: - enum: - - asc - - desc - type: string - Security_AI_Assistant_API_TraceData: - description: trace Data + - config + - connector_type_id + - name + title: Create index connector request type: object + Connectors_create_connector_request_jira: + description: The Jira connector uses the REST API v2 to create Jira issues. properties: - traceId: - description: 'Could be any string, not necessarily a UUID' + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + connector_type_id: + description: The type of connector. + enum: + - .jira + example: .jira type: string - transactionId: - description: 'Could be any string, not necessarily a UUID' + name: + description: The display name for the connector. + example: my-connector type: string - Security_AI_Assistant_API_User: - description: 'Could be any string, not necessarily a UUID' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_jira' + required: + - config + - connector_type_id + - name + - secrets + title: Create Jira connector request type: object + Connectors_create_connector_request_opsgenie: + description: The Opsgenie connector uses the Opsgenie alert API. properties: - id: - description: User id + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' + connector_type_id: + description: The type of connector. + enum: + - .opsgenie + example: .opsgenie type: string name: - description: User name + description: The display name for the connector. + example: my-connector type: string - Security_Solution_Detections_API_AlertAssignees: - type: object - properties: - add: - description: A list of users ids to assign. - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - remove: - description: A list of users ids to unassign. - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - required: - - add - - remove - Security_Solution_Detections_API_AlertIds: - description: A list of alerts ids. - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - minItems: 1 - type: array - Security_Solution_Detections_API_AlertsIndex: - deprecated: true - description: (deprecated) Has no effect. - type: string - Security_Solution_Detections_API_AlertsIndexNamespace: - description: Has no effect. - type: string - Security_Solution_Detections_API_AlertsSort: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSortCombinations - - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSortCombinations - type: array - Security_Solution_Detections_API_AlertsSortCombinations: - anyOf: - - type: string - - additionalProperties: true - type: object - Security_Solution_Detections_API_AlertStatus: - enum: - - open - - closed - - acknowledged - - in-progress - type: string - Security_Solution_Detections_API_AlertSuppression: - type: object - properties: - duration: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionDuration - group_by: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionGroupBy - missing_fields_strategy: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionMissingFieldsStrategy + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' required: - - group_by - Security_Solution_Detections_API_AlertSuppressionDuration: + - config + - connector_type_id + - name + - secrets + title: Create Opsgenie connector request type: object + Connectors_create_connector_request_pagerduty: + description: > + The PagerDuty connector uses the v2 Events API to trigger, acknowledge, + and resolve PagerDuty alerts. properties: - unit: + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' + connector_type_id: + description: The type of connector. enum: - - s - - m - - h + - .pagerduty + example: .pagerduty type: string - value: - minimum: 1 - type: integer + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' required: - - value - - unit - Security_Solution_Detections_API_AlertSuppressionGroupBy: - items: - type: string - maxItems: 3 - minItems: 1 - type: array - Security_Solution_Detections_API_AlertSuppressionMissingFieldsStrategy: - description: >- - Describes how alerts will be generated for documents with missing - suppress by fields: - - doNotSuppress - per each document a separate alert will be created - - suppress - only alert will be created per suppress by bucket - enum: - - doNotSuppress - - suppress - type: string - Security_Solution_Detections_API_AlertTag: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - Security_Solution_Detections_API_AlertTags: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTag' - type: array - Security_Solution_Detections_API_AnomalyThreshold: - description: Anomaly threshold - minimum: 0 - type: integer - Security_Solution_Detections_API_BuildingBlockType: - description: >- - Determines if the rule acts as a building block. By default, - building-block alerts are not displayed in the UI. These rules are used - as a foundation for other rules that do generate alerts. Its value must - be default. - type: string - Security_Solution_Detections_API_BulkActionEditPayload: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadTags - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadIndexPatterns - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadInvestigationFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadTimeline - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadRuleActions - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadSchedule - Security_Solution_Detections_API_BulkActionEditPayloadIndexPatterns: + - config + - connector_type_id + - name + - secrets + title: Create PagerDuty connector request type: object + Connectors_create_connector_request_resilient: + description: >- + The IBM Resilient connector uses the RESILIENT REST v2 to create IBM + Resilient incidents. properties: - overwrite_data_views: - type: boolean - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + connector_type_id: + description: The type of connector. enum: - - add_index_patterns - - delete_index_patterns - - set_index_patterns + - .resilient + example: .resilient type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_resilient' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadInvestigationFields: + - config + - connector_type_id + - name + - secrets + title: Create IBM Resilient connector request + type: object + Connectors_create_connector_request_sentinelone: + description: > + The SentinelOne connector communicates with SentinelOne Management + Console via REST API. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will work to fix any + issues, but features in technical preview are not subject to the support + SLA of official GA features. + title: Create SentinelOne connector request type: object properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + connector_type_id: + description: The type of connector. enum: - - add_investigation_fields - - delete_investigation_fields - - set_investigation_fields + - .sentinelone + example: .sentinelone type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadRuleActions: - type: object + - config + - connector_type_id + - name + - secrets + x-technical-preview: true + Connectors_create_connector_request_serverlog: + description: This connector writes an entry to the Kibana server log. properties: - type: + connector_type_id: + description: The type of connector. enum: - - add_rule_actions - - set_rule_actions + - .server-log + example: .server-log + type: string + name: + description: The display name for the connector. + example: my-connector type: string - value: - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NormalizedRuleAction - type: array - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThrottleForBulkActions - required: - - actions required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadSchedule: + - connector_type_id + - name + title: Create server log connector request type: object + Connectors_create_connector_request_servicenow: + description: > + The ServiceNow ITSM connector uses the import set API to create + ServiceNow incidents. You can use the connector for rule actions and + cases. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. enum: - - set_schedule + - .servicenow + example: .servicenow type: string - value: - type: object - properties: - interval: - description: >- - Interval in which the rule runs. For example, `"1h"` means the - rule runs every hour. - example: 1h - pattern: '^[1-9]\d*[smh]$' - type: string - lookback: - description: Lookback time for the rule - example: 1h - pattern: '^[1-9]\d*[smh]$' - type: string - required: - - interval - - lookback + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadTags: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow ITSM connector request type: object + Connectors_create_connector_request_servicenow_itom: + description: > + The ServiceNow ITOM connector uses the event API to create ServiceNow + events. You can use the connector for rule actions. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + connector_type_id: + description: The type of connector. enum: - - add_tags - - delete_tags - - set_tags + - .servicenow-itom + example: .servicenow-itom type: string - value: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleTagArray' + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadTimeline: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow ITOM connector request type: object + Connectors_create_connector_request_servicenow_sir: + description: > + The ServiceNow SecOps connector uses the import set API to create + ServiceNow security incidents. You can use the connector for rule + actions and cases. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. enum: - - set_timeline + - .servicenow-sir + example: .servicenow-sir type: string - value: - type: object - properties: - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - required: - - timeline_id - - timeline_title + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionsDryRunErrCode: - enum: - - IMMUTABLE - - MACHINE_LEARNING_AUTH - - MACHINE_LEARNING_INDEX_PATTERN - - ESQL_INDEX_PATTERN - - MANUAL_RULE_RUN_FEATURE - - MANUAL_RULE_RUN_DISABLED_RULE - type: string - Security_Solution_Detections_API_BulkActionSkipResult: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow SecOps connector request type: object + Connectors_create_connector_request_slack_api: + description: The Slack connector uses an API method to send Slack messages. properties: - id: + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + connector_type_id: + description: The type of connector. + enum: + - .slack_api + example: .slack_api type: string name: + description: The display name for the connector. + example: my-connector type: string - skip_reason: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditSkipReason + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' required: - - id - - skip_reason - Security_Solution_Detections_API_BulkDeleteRules: + - connector_type_id + - name + - secrets + title: Create Slack connector request type: object + Connectors_create_connector_request_slack_webhook: + description: The Slack connector uses Slack Incoming Webhooks. properties: - action: + connector_type_id: + description: The type of connector. enum: - - delete + - .slack + example: .slack type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' required: - - action - Security_Solution_Detections_API_BulkDisableRules: + - connector_type_id + - name + - secrets + title: Create Slack connector request type: object + Connectors_create_connector_request_swimlane: + description: >- + The Swimlane connector uses the Swimlane REST API to create Swimlane + records. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + connector_type_id: + description: The type of connector. enum: - - disable + - .swimlane + example: .swimlane type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' required: - - action - Security_Solution_Detections_API_BulkDuplicateRules: + - config + - connector_type_id + - name + - secrets + title: Create Swimlane connector request type: object + Connectors_create_connector_request_teams: + description: The Microsoft Teams connector uses Incoming Webhooks. properties: - action: + connector_type_id: + description: The type of connector. enum: - - duplicate - type: string - duplicate: - type: object - properties: - include_exceptions: - description: Whether to copy exceptions from the original rule - type: boolean - include_expired_exceptions: - description: Whether to copy expired exceptions from the original rule - type: boolean - required: - - include_exceptions - - include_expired_exceptions - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + - .teams + example: .teams type: string - required: - - action - Security_Solution_Detections_API_BulkEditActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NormalizedRuleError - type: array - results: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionResults - summary: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionSummary - required: - - results - - summary - message: + name: + description: The display name for the connector. + example: my-connector type: string - rules_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - Security_Solution_Detections_API_BulkEditActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - deleted: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionSkipResult - type: array - updated: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - required: - - updated - - created - - deleted - - skipped - Security_Solution_Detections_API_BulkEditActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_teams' required: - - failed - - skipped - - succeeded - - total - Security_Solution_Detections_API_BulkEditRules: + - connector_type_id + - name + - secrets + title: Create Microsoft Teams connector request type: object + Connectors_create_connector_request_tines: + description: > + The Tines connector uses Tines Webhook actions to send events via POST + request. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + connector_type_id: + description: The type of connector. enum: - - edit + - .tines + example: .tines type: string - edit: - description: Array of objects containing the edit operations - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayload - minItems: 1 - type: array - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_tines' required: - - action - - edit - Security_Solution_Detections_API_BulkEditSkipReason: - enum: - - RULE_NOT_MODIFIED - type: string - Security_Solution_Detections_API_BulkEnableRules: + - config + - connector_type_id + - name + - secrets + title: Create Tines connector request type: object + Connectors_create_connector_request_torq: + description: > + The Torq connector uses a Torq webhook to trigger workflows with Kibana + actions. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' + connector_type_id: + description: The type of connector. enum: - - enable + - .torq + example: .torq type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - action - Security_Solution_Detections_API_BulkExportActionResponse: - type: string - Security_Solution_Detections_API_BulkExportRules: + - config + - connector_type_id + - name + - secrets + title: Create Torq connector request type: object + Connectors_create_connector_request_webhook: + description: > + The Webhook connector uses axios to send a POST or PUT request to a web + service. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + connector_type_id: + description: The type of connector. enum: - - export + - .webhook + example: .webhook type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - action - Security_Solution_Detections_API_BulkManualRuleRun: + - config + - connector_type_id + - name + - secrets + title: Create Webhook connector request type: object + Connectors_create_connector_request_xmatters: + description: > + The xMatters connector uses the xMatters Workflow for Elastic to send + actionable alerts to on-call xMatters resources. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + connector_type_id: + description: The type of connector. enum: - - run + - .xmatters + example: .xmatters type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string - run: - type: object - properties: - end_date: - description: End date of the manual rule run - type: string - start_date: - description: Start date of the manual rule run - type: string - required: - - start_date + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' required: - - action - - run - Security_Solution_Detections_API_ConcurrentSearches: - minimum: 1 + - config + - connector_type_id + - name + - secrets + title: Create xMatters connector request + type: object + Connectors_features: + description: | + The feature that uses the connector. + enum: + - alerting + - cases + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - siem + - uptime + type: string + Connectors_is_deprecated: + description: Indicates whether the connector type is deprecated. + example: false + type: boolean + Connectors_is_missing_secrets: + description: >- + Indicates whether secrets are missing for the connector. Secrets + configuration properties vary depending on the connector type. + example: false + type: boolean + Connectors_is_preconfigured: + description: > + Indicates whether it is a preconfigured connector. If true, the `config` + and `is_missing_secrets` properties are omitted from the response. + example: false + type: boolean + Connectors_is_system_action: + description: Indicates whether the connector is used for system actions. + example: false + type: boolean + Connectors_referenced_by_count: + description: > + Indicates the number of saved objects that reference the connector. If + `is_preconfigured` is true, this value is not calculated. This property + is returned only by the get all connectors API. + example: 2 type: integer - Security_Solution_Detections_API_DataViewId: - type: string - Security_Solution_Detections_API_DefaultParams: - type: object + Connectors_secrets_properties_bedrock: + description: Defines secrets for connectors when type is `.bedrock`. properties: - command: - enum: - - isolate + accessKey: + description: The AWS access key for authentication. type: string - comment: + secret: + description: The AWS secret for authentication. type: string required: - - command - Security_Solution_Detections_API_EcsMapping: - additionalProperties: - type: object - properties: - field: - type: string - value: - oneOf: - - type: string - - items: - type: string - type: array + - accessKey + - secret + title: Connector secrets properties for an Amazon Bedrock connector type: object - Security_Solution_Detections_API_EndpointResponseAction: + Connectors_secrets_properties_cases_webhook: + title: Connector secrets properties for Webhook - Case Management connector type: object properties: - action_type_id: - enum: - - .endpoint + password: + description: >- + The password for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. type: string - params: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_DefaultParams - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ProcessesParams - required: - - action_type_id - - params - Security_Solution_Detections_API_EqlOptionalFields: - type: object - properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - event_category_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EventCategoryOverride - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - tiebreaker_field: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TiebreakerField - timestamp_field: - $ref: '#/components/schemas/Security_Solution_Detections_API_TimestampField' - Security_Solution_Detections_API_EqlQueryLanguage: - enum: - - eql - type: string - Security_Solution_Detections_API_EqlRequiredFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlQueryLanguage - description: Query language to use - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: EQL query to execute - type: - description: Rule type - enum: - - eql + user: + description: >- + The username for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. type: string - required: - - type - - query - - language - Security_Solution_Detections_API_EqlRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleResponseFields - Security_Solution_Detections_API_EqlRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateFields - Security_Solution_Detections_API_EqlRulePatchFields: - allOf: - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlQueryLanguage - description: Query language to use - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: EQL query to execute - type: - description: Rule type - enum: - - eql - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRulePatchFields - Security_Solution_Detections_API_EqlRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateFields - Security_Solution_Detections_API_ErrorSchema: - additionalProperties: false + Connectors_secrets_properties_d3security: + description: Defines secrets for connectors when type is `.d3security`. type: object properties: - error: - type: object - properties: - message: - type: string - status_code: - minimum: 400 - type: integer - required: - - status_code - - message - id: - type: string - item_id: - minLength: 1 - type: string - list_id: - minLength: 1 + token: + description: The D3 Security token. type: string - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId required: - - error - Security_Solution_Detections_API_EsqlQueryLanguage: - enum: - - esql - type: string - Security_Solution_Detections_API_EsqlRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleResponseFields - Security_Solution_Detections_API_EsqlRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleRequiredFields - Security_Solution_Detections_API_EsqlRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateFields - Security_Solution_Detections_API_EsqlRuleOptionalFields: - type: object + - token + title: Connector secrets properties for a D3 Security connector + Connectors_secrets_properties_email: + description: Defines secrets for connectors when type is `.email`. properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - Security_Solution_Detections_API_EsqlRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlQueryLanguage - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: ESQL query to execute - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - type: - description: Rule type - enum: - - esql - type: string - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - Security_Solution_Detections_API_EsqlRuleRequiredFields: + clientSecret: + description: > + The Microsoft Exchange Client secret for OAuth 2.0 client + credentials authentication. It must be URL-encoded. If `service` is + `exchange_server`, this property is required. + type: string + password: + description: > + The password for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + user: + description: > + The username for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + title: Connector secrets properties for an email connector type: object + Connectors_secrets_properties_gemini: + description: Defines secrets for connectors when type is `.gemini`. properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: ESQL query to execute - type: - description: Rule type - enum: - - esql + credentialsJSON: + description: >- + The service account credentials JSON file. The service account + should have Vertex AI user IAM role assigned to it. type: string required: - - type - - language - - query - Security_Solution_Detections_API_EsqlRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleRequiredFields - Security_Solution_Detections_API_EsqlRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateFields - Security_Solution_Detections_API_EventCategoryOverride: - type: string - Security_Solution_Detections_API_ExceptionListType: - description: The exception type - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Detections_API_ExternalRuleSource: - description: >- - Type of rule source for externally sourced rules, i.e. rules that have - an external source, such as the Elastic Prebuilt rules repo. + - credentialsJSON + title: Connector secrets properties for a Google Gemini connector + type: object + Connectors_secrets_properties_genai: + description: Defines secrets for connectors when type is `.gen-ai`. + properties: + apiKey: + description: The OpenAI API key. + type: string + title: Connector secrets properties for an OpenAI connector + type: object + Connectors_secrets_properties_jira: + description: Defines secrets for connectors when type is `.jira`. type: object properties: - is_customized: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsExternalRuleCustomized - type: - enum: - - external + apiToken: + description: The Jira API authentication token for HTTP basic authentication. + type: string + email: + description: The account email for HTTP Basic authentication. type: string required: - - type - - is_customized - Security_Solution_Detections_API_FindRulesSortField: - enum: - - created_at - - createdAt - - enabled - - execution_summary.last_execution.date - - execution_summary.last_execution.metrics.execution_gap_duration_s - - execution_summary.last_execution.metrics.total_indexing_duration_ms - - execution_summary.last_execution.metrics.total_search_duration_ms - - execution_summary.last_execution.status - - name - - risk_score - - riskScore - - severity - - updated_at - - updatedAt - type: string - Security_Solution_Detections_API_HistoryWindowStart: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - Security_Solution_Detections_API_IndexPatternArray: - items: - type: string - type: array - Security_Solution_Detections_API_InternalRuleSource: - description: >- - Type of rule source for internally sourced rules, i.e. created within - the Kibana apps. + - apiToken + - email + title: Connector secrets properties for a Jira connector + Connectors_secrets_properties_opsgenie: + description: Defines secrets for connectors when type is `.opsgenie`. type: object properties: - type: - enum: - - internal + apiKey: + description: The Opsgenie API authentication key for HTTP Basic authentication. type: string required: - - type - Security_Solution_Detections_API_InvestigationFields: - description: > - Schema for fields relating to investigation fields. These are user - defined fields we use to highlight - - in various features in the UI such as alert details flyout and - exceptions auto-population from alert. - - Added in PR #163235 - - Right now we only have a single field but anticipate adding more related - fields to store various - - configuration states such as `override` - where a user might say if they - want only these fields to - - display, or if they want these fields + the fields we select. When - expanding this field, it may look - - something like: - - ```typescript - - const investigationFields = z.object({ - field_names: NonEmptyArray(NonEmptyString), - override: z.boolean().optional(), - }); - - ``` + - apiKey + title: Connector secrets properties for an Opsgenie connector + Connectors_secrets_properties_pagerduty: + description: Defines secrets for connectors when type is `.pagerduty`. + properties: + routingKey: + description: > + A 32 character PagerDuty Integration Key for an integration on a + service. + type: string + required: + - routingKey + title: Connector secrets properties for a PagerDuty connector + type: object + Connectors_secrets_properties_resilient: + description: Defines secrets for connectors when type is `.resilient`. type: object properties: - field_names: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - minItems: 1 - type: array + apiKeyId: + description: The authentication key ID for HTTP Basic authentication. + type: string + apiKeySecret: + description: The authentication key secret for HTTP Basic authentication. + type: string required: - - field_names - Security_Solution_Detections_API_InvestigationGuide: - description: Notes to help investigate alerts produced by the rule. - type: string - Security_Solution_Detections_API_IsExternalRuleCustomized: - description: >- - Determines whether an external/prebuilt rule has been customized by the - user (i.e. any of its fields have been modified and diverged from the - base value). - type: boolean - Security_Solution_Detections_API_IsRuleEnabled: - description: Determines whether the rule is enabled. - type: boolean - Security_Solution_Detections_API_IsRuleImmutable: - deprecated: true + - apiKeyId + - apiKeySecret + title: Connector secrets properties for IBM Resilient connector + Connectors_secrets_properties_sentinelone: + description: Defines secrets for connectors when type is `.sentinelone`. + properties: + token: + description: The A SentinelOne API token. + type: string + required: + - token + title: Connector secrets properties for a SentinelOne connector + type: object + Connectors_secrets_properties_servicenow: description: >- - This field determines whether the rule is a prebuilt Elastic rule. It - will be replaced with the `rule_source` field. - type: boolean - Security_Solution_Detections_API_ItemsPerSearch: - minimum: 1 - type: integer - Security_Solution_Detections_API_KqlQueryLanguage: - enum: - - kuery - - lucene - type: string - Security_Solution_Detections_API_MachineLearningJobId: - description: Machine learning job ID - oneOf: - - type: string - - items: - type: string - minItems: 1 - type: array - Security_Solution_Detections_API_MachineLearningRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleResponseFields - Security_Solution_Detections_API_MachineLearningRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateFields - Security_Solution_Detections_API_MachineLearningRuleOptionalFields: + Defines secrets for connectors when type is `.servicenow`, + `.servicenow-sir`, or `.servicenow-itom`. + properties: + clientSecret: + description: >- + The client secret assigned to your OAuth application. This property + is required when `isOAuth` is `true`. + type: string + password: + description: >- + The password for HTTP basic authentication. This property is + required when `isOAuth` is `false`. + type: string + privateKey: + description: >- + The RSA private key that you created for use in ServiceNow. This + property is required when `isOAuth` is `true`. + type: string + privateKeyPassword: + description: >- + The password for the RSA private key. This property is required when + `isOAuth` is `true` and you set a password on your private key. + type: string + username: + description: >- + The username for HTTP basic authentication. This property is + required when `isOAuth` is `false`. + type: string + title: >- + Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and + ServiceNow SecOps connectors + type: object + Connectors_secrets_properties_slack_api: + description: Defines secrets for connectors when type is `.slack`. type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - Security_Solution_Detections_API_MachineLearningRulePatchFields: - allOf: - - type: object - properties: - anomaly_threshold: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AnomalyThreshold - machine_learning_job_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningJobId - type: - description: Rule type - enum: - - machine_learning - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRulePatchFields - Security_Solution_Detections_API_MachineLearningRuleRequiredFields: + token: + description: Slack bot user OAuth token. + type: string + required: + - token + title: Connector secrets properties for a Web API Slack connector + Connectors_secrets_properties_slack_webhook: + description: Defines secrets for connectors when type is `.slack`. type: object properties: - anomaly_threshold: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AnomalyThreshold - machine_learning_job_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningJobId - type: - description: Rule type - enum: - - machine_learning + webhookUrl: + description: Slack webhook url. type: string required: - - type - - machine_learning_job_id - - anomaly_threshold - Security_Solution_Detections_API_MachineLearningRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateFields - Security_Solution_Detections_API_MaxSignals: - minimum: 1 - type: integer - Security_Solution_Detections_API_NewTermsFields: - items: - type: string - maxItems: 3 - minItems: 1 - type: array - Security_Solution_Detections_API_NewTermsRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleResponseFields - Security_Solution_Detections_API_NewTermsRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleDefaultableFields - Security_Solution_Detections_API_NewTermsRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateFields - Security_Solution_Detections_API_NewTermsRuleDefaultableFields: - type: object + - webhookUrl + title: Connector secrets properties for a Webhook Slack connector + Connectors_secrets_properties_swimlane: + description: Defines secrets for connectors when type is `.swimlane`. properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_NewTermsRuleOptionalFields: + apiToken: + description: Swimlane API authentication token. + type: string + title: Connector secrets properties for a Swimlane connector type: object + Connectors_secrets_properties_teams: + description: Defines secrets for connectors when type is `.teams`. properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - Security_Solution_Detections_API_NewTermsRulePatchFields: - allOf: - - type: object - properties: - history_window_start: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_HistoryWindowStart - new_terms_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsFields - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - type: - description: Rule type - enum: - - new_terms - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleDefaultableFields - Security_Solution_Detections_API_NewTermsRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRulePatchFields - Security_Solution_Detections_API_NewTermsRuleRequiredFields: + webhookUrl: + description: > + The URL of the incoming webhook. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. + type: string + required: + - webhookUrl + title: Connector secrets properties for a Microsoft Teams connector type: object + Connectors_secrets_properties_tines: + description: Defines secrets for connectors when type is `.tines`. properties: - history_window_start: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_HistoryWindowStart - new_terms_fields: - $ref: '#/components/schemas/Security_Solution_Detections_API_NewTermsFields' - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - type: - description: Rule type - enum: - - new_terms + email: + description: The email used to sign in to Tines. + type: string + token: + description: The Tines API token. type: string required: - - type - - query - - new_terms_fields - - history_window_start - Security_Solution_Detections_API_NewTermsRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_NewTermsRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateFields - Security_Solution_Detections_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Detections_API_NormalizedRuleAction: - additionalProperties: false + - email + - token + title: Connector secrets properties for a Tines connector type: object + Connectors_secrets_properties_torq: + description: Defines secrets for connectors when type is `.torq`. properties: - alerts_filter: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionAlertsFilter - frequency: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionFrequency - group: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionGroup - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleActionId' - params: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionParams + token: + description: The secret of the webhook authentication header. + type: string required: - - id - - params - Security_Solution_Detections_API_NormalizedRuleError: + - token + title: Connector secrets properties for a Torq connector + type: object + Connectors_secrets_properties_webhook: + description: Defines secrets for connectors when type is `.webhook`. + properties: + crt: + description: >- + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT + file. + type: string + key: + description: >- + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-crt-key`, it is a base64 encoded version of the KEY file. + type: string + password: + description: > + The password for HTTP basic authentication or the passphrase for the + SSL certificate files. If `hasAuth` is set to `true` and `authType` + is `webhook-authentication-basic`, this property is required. + type: string + pfx: + description: >- + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + type: string + user: + description: > + The username for HTTP basic authentication. If `hasAuth` is set to + `true` and `authType` is `webhook-authentication-basic`, this + property is required. + type: string + title: Connector secrets properties for a Webhook connector + type: object + Connectors_secrets_properties_xmatters: + description: Defines secrets for connectors when type is `.xmatters`. + properties: + password: + description: > + A user name for HTTP basic authentication. It is applicable only + when `usesBasic` is `true`. + type: string + secretsUrl: + description: > + The request URL for the Elastic Alerts trigger in xMatters with the + API key included in the URL. It is applicable only when `usesBasic` + is `false`. + type: string + user: + description: > + A password for HTTP basic authentication. It is applicable only when + `usesBasic` is `true`. + type: string + title: Connector secrets properties for an xMatters connector + type: object + Connectors_update_connector_request: + description: The properties vary depending on the connector type. + oneOf: + - $ref: '#/components/schemas/Connectors_update_connector_request_bedrock' + - $ref: '#/components/schemas/Connectors_update_connector_request_gemini' + - $ref: >- + #/components/schemas/Connectors_update_connector_request_cases_webhook + - $ref: '#/components/schemas/Connectors_update_connector_request_d3security' + - $ref: '#/components/schemas/Connectors_update_connector_request_email' + - $ref: '#/components/schemas/Connectors_create_connector_request_genai' + - $ref: '#/components/schemas/Connectors_update_connector_request_index' + - $ref: '#/components/schemas/Connectors_update_connector_request_jira' + - $ref: '#/components/schemas/Connectors_update_connector_request_opsgenie' + - $ref: '#/components/schemas/Connectors_update_connector_request_pagerduty' + - $ref: '#/components/schemas/Connectors_update_connector_request_resilient' + - $ref: '#/components/schemas/Connectors_update_connector_request_sentinelone' + - $ref: '#/components/schemas/Connectors_update_connector_request_serverlog' + - $ref: '#/components/schemas/Connectors_update_connector_request_servicenow' + - $ref: >- + #/components/schemas/Connectors_update_connector_request_servicenow_itom + - $ref: '#/components/schemas/Connectors_update_connector_request_slack_api' + - $ref: >- + #/components/schemas/Connectors_update_connector_request_slack_webhook + - $ref: '#/components/schemas/Connectors_update_connector_request_swimlane' + - $ref: '#/components/schemas/Connectors_update_connector_request_teams' + - $ref: '#/components/schemas/Connectors_update_connector_request_tines' + - $ref: '#/components/schemas/Connectors_update_connector_request_torq' + - $ref: '#/components/schemas/Connectors_update_connector_request_webhook' + - $ref: '#/components/schemas/Connectors_update_connector_request_xmatters' + title: Update connector request body properties + Connectors_update_connector_request_bedrock: + title: Update Amazon Bedrock connector request type: object properties: - err_code: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionsDryRunErrCode - message: + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + name: + description: The display name for the connector. type: string - rules: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDetailsInError - type: array - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' required: - - message - - status_code - - rules - Security_Solution_Detections_API_OsqueryParams: - type: object - properties: - ecs_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_EcsMapping' - pack_id: - type: string - queries: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_OsqueryQuery' - type: array - query: - type: string - saved_query_id: - type: string - timeout: - type: number - Security_Solution_Detections_API_OsqueryQuery: + - config + - name + Connectors_update_connector_request_cases_webhook: + title: Update Webhook - Case Managment connector request type: object properties: - ecs_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_EcsMapping' - id: - description: Query ID - type: string - platform: - type: string - query: - description: Query to run - type: string - removed: - type: boolean - snapshot: - type: boolean - version: - description: Query version + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' required: - - id - - query - Security_Solution_Detections_API_OsqueryResponseAction: + - config + - name + Connectors_update_connector_request_d3security: + title: Update D3 Security connector request type: object properties: - action_type_id: - enum: - - .osquery + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + name: + description: The display name for the connector. type: string - params: - $ref: '#/components/schemas/Security_Solution_Detections_API_OsqueryParams' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_d3security' required: - - action_type_id - - params - Security_Solution_Detections_API_PlatformErrorResponse: + - config + - name + - secrets + Connectors_update_connector_request_email: + title: Update email connector request type: object properties: - error: - type: string - message: + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + name: + description: The display name for the connector. type: string - statusCode: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_email' required: - - statusCode - - error - - message - Security_Solution_Detections_API_ProcessesParams: + - config + - name + Connectors_update_connector_request_gemini: + title: Update Google Gemini connector request type: object properties: - command: - enum: - - kill-process - - suspend-process - type: string - comment: - type: string config: - type: object - properties: - field: - description: Field to use instead of process.pid - type: string - overwrite: - default: true - description: Whether to overwrite field with process.pid - type: boolean - required: - - field + $ref: '#/components/schemas/Connectors_config_properties_gemini' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_gemini' required: - - command - config - Security_Solution_Detections_API_QueryRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleResponseFields - Security_Solution_Detections_API_QueryRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleDefaultableFields - Security_Solution_Detections_API_QueryRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateFields - Security_Solution_Detections_API_QueryRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - Security_Solution_Detections_API_QueryRuleOptionalFields: - type: object - properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - response_actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ResponseAction - type: array - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - Security_Solution_Detections_API_QueryRulePatchFields: - allOf: - - type: object - properties: - type: - description: Rule type - enum: - - query - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleDefaultableFields - Security_Solution_Detections_API_QueryRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRulePatchFields - Security_Solution_Detections_API_QueryRuleRequiredFields: + - name + Connectors_update_connector_request_index: + title: Update index connector request type: object properties: - type: - description: Rule type - enum: - - query + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + name: + description: The display name for the connector. type: string required: - - type - Security_Solution_Detections_API_QueryRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - required: - - query - - language - Security_Solution_Detections_API_QueryRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateFields - Security_Solution_Detections_API_RelatedIntegration: - description: > - Related integration is a potential dependency of a rule. It's assumed - that if the user installs - - one of the related integrations of a rule, the rule might start to work - properly because it will - - have source events (generated by this integration) potentially matching - the rule's query. - - - NOTE: Proper work is not guaranteed, because a related integration, if - installed, can be - - configured differently or generate data that is not necessarily relevant - for this rule. - - - Related integration is a combination of a Fleet package and (optionally) - one of the - - package's "integrations" that this package contains. It is represented - by 3 properties: - - - - `package`: name of the package (required, unique id) - - - `version`: version of the package (required, semver-compatible) - - - `integration`: name of the integration of this package (optional, id - within the package) - - - There are Fleet packages like `windows` that contain only one - integration; in this case, - - `integration` should be unspecified. There are also packages like `aws` - and `azure` that contain - - several integrations; in this case, `integration` should be specified. - - - @example - - const x: RelatedIntegration = { - package: 'windows', - version: '1.5.x', - }; - - - @example - - const x: RelatedIntegration = { - package: 'azure', - version: '~1.1.6', - integration: 'activitylogs', - }; + - config + - name + Connectors_update_connector_request_jira: + title: Update Jira connector request type: object properties: - integration: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - package: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - version: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_jira' required: - - package - - version - Security_Solution_Detections_API_RelatedIntegrationArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegration - type: array - Security_Solution_Detections_API_RequiredField: - description: > - Describes an Elasticsearch field that is needed for the rule to - function. - - - Almost all types of Security rules check source event documents for a - match to some kind of - - query or filter. If a document has certain field with certain values, - then it's a match and - - the rule will generate an alert. - - - Required field is an event field that must be present in the source - indices of a given rule. - - - @example - - const standardEcsField: RequiredField = { - name: 'event.action', - type: 'keyword', - ecs: true, - }; - - - @example - - const nonEcsField: RequiredField = { - name: 'winlog.event_data.AttributeLDAPDisplayName', - type: 'keyword', - ecs: false, - }; + - config + - name + - secrets + Connectors_update_connector_request_opsgenie: + title: Update Opsgenie connector request type: object properties: - ecs: - description: Whether the field is an ECS field - type: boolean + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' name: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Name of an Elasticsearch field - type: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Type of the Elasticsearch field + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' required: + - config - name - - type - - ecs - Security_Solution_Detections_API_RequiredFieldArray: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RequiredField' - type: array - Security_Solution_Detections_API_RequiredFieldInput: - description: >- - Input parameters to create a RequiredField. Does not include the `ecs` - field, because `ecs` is calculated on the backend based on the field - name and type. + - secrets + Connectors_update_connector_request_pagerduty: + title: Update PagerDuty connector request type: object properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' name: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Name of an Elasticsearch field - type: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Type of an Elasticsearch field + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' required: + - config - name - - type - Security_Solution_Detections_API_ResponseAction: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_OsqueryResponseAction - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EndpointResponseAction - Security_Solution_Detections_API_ResponseFields: + - secrets + Connectors_update_connector_request_resilient: + title: Update IBM Resilient connector request type: object properties: - created_at: - format: date-time + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + name: + description: The display name for the connector. type: string - created_by: + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_resilient' + required: + - config + - name + - secrets + Connectors_update_connector_request_sentinelone: + title: Update SentinelOne connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + name: + description: The display name for the connector. type: string - execution_summary: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionSummary - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - immutable: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleImmutable - required_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldArray - revision: - minimum: 0 - type: integer - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_source: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleSource' - updated_at: - format: date-time + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' + required: + - config + - name + - secrets + Connectors_update_connector_request_serverlog: + title: Update server log connector request + type: object + properties: + name: + description: The display name for the connector. type: string - updated_by: + required: + - name + Connectors_update_connector_request_servicenow: + title: Update ServiceNow ITSM connector or ServiceNow SecOps request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + name: + description: The display name for the connector. type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - id - - rule_id - - immutable - - updated_at - - updated_by - - created_at - - created_by - - revision - - related_integrations - - required_fields - Security_Solution_Detections_API_RiskScore: - description: Risk score (0 to 100) - maximum: 100 - minimum: 0 - type: integer - Security_Solution_Detections_API_RiskScoreMapping: - description: >- - Overrides generated alerts' risk_score with a value from the source - event - items: - type: object - properties: - field: - type: string - operator: - enum: - - equals - type: string - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - value: - type: string - required: - - field - - operator - - value - type: array - Security_Solution_Detections_API_RuleAction: + - config + - name + - secrets + Connectors_update_connector_request_servicenow_itom: + title: Create ServiceNow ITOM connector request type: object properties: - action_type_id: - description: The action type used for sending notifications. + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + name: + description: The display name for the connector. type: string - alerts_filter: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionAlertsFilter - frequency: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionFrequency - group: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionGroup - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleActionId' - params: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionParams - uuid: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - action_type_id - - id - - params - Security_Solution_Detections_API_RuleActionAlertsFilter: - additionalProperties: true + - config + - name + - secrets + Connectors_update_connector_request_slack_api: + title: Update Slack connector request type: object - Security_Solution_Detections_API_RuleActionFrequency: - description: >- - The action frequency defines when the action runs (for example, only on - rule execution or at specific time intervals). + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' + required: + - name + - secrets + Connectors_update_connector_request_slack_webhook: + title: Update Slack connector request type: object properties: - notifyWhen: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionNotifyWhen - summary: - description: >- - Action summary indicates whether we will send a summary notification - about all the generate alerts or notification per individual alert - type: boolean - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - nullable: true + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' required: - - summary - - notifyWhen - - throttle - Security_Solution_Detections_API_RuleActionGroup: - description: >- - Optionally groups actions by use cases. Use `default` for alert - notifications. - type: string - Security_Solution_Detections_API_RuleActionId: - description: The connector ID. - type: string - Security_Solution_Detections_API_RuleActionNotifyWhen: - description: >- - The condition for throttling the notification: `onActionGroupChange`, - `onActiveAlert`, or `onThrottleInterval` - enum: - - onActiveAlert - - onThrottleInterval - - onActionGroupChange - type: string - Security_Solution_Detections_API_RuleActionParams: - additionalProperties: true - description: >- - Object containing the allowed connector fields, which varies according - to the connector type. + - name + - secrets + Connectors_update_connector_request_swimlane: + title: Update Swimlane connector request type: object - Security_Solution_Detections_API_RuleActionThrottle: - description: Defines how often rule actions are taken. - oneOf: - - enum: - - no_actions - - rule + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + name: + description: The display name for the connector. + example: my-connector type: string - - description: 'Time interval in seconds, minutes, hours, or days.' - example: 1h - pattern: '^[1-9]\d*[smhd]$' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' + required: + - config + - name + - secrets + Connectors_update_connector_request_teams: + title: Update Microsoft Teams connector request + type: object + properties: + name: + description: The display name for the connector. type: string - Security_Solution_Detections_API_RuleAuthorArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleCreateProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateProps - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleDescription: - minLength: 1 - type: string - Security_Solution_Detections_API_RuleDetailsInError: + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_teams' + required: + - name + - secrets + Connectors_update_connector_request_tines: + title: Update Tines connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_tines' + required: + - config + - name + - secrets + Connectors_update_connector_request_torq: + title: Update Torq connector request type: object properties: - id: - type: string + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' name: + description: The display name for the connector. type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - id - Security_Solution_Detections_API_RuleExceptionList: + - config + - name + - secrets + Connectors_update_connector_request_webhook: + title: Update Webhook connector request type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: ID of the exception container - list_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: List ID of the exception container - namespace_type: - description: Determines the exceptions validity in rule's Kibana space - enum: - - agnostic - - single + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + name: + description: The display name for the connector. type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ExceptionListType + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - id - - list_id - - type - - namespace_type - Security_Solution_Detections_API_RuleExecutionMetrics: + - config + - name + - secrets + Connectors_update_connector_request_xmatters: + title: Update xMatters connector request type: object properties: - execution_gap_duration_s: - description: Duration in seconds of execution gap - minimum: 0 - type: integer - total_enrichment_duration_ms: - description: >- - Total time spent enriching documents during current rule execution - cycle - minimum: 0 - type: integer - total_indexing_duration_ms: - description: >- - Total time spent indexing documents during current rule execution - cycle - minimum: 0 - type: integer - total_search_duration_ms: - description: >- - Total time spent performing ES searches as measured by Kibana; - includes network latency and time spent serializing/deserializing - request/response - minimum: 0 - type: integer - Security_Solution_Detections_API_RuleExecutionStatus: - description: >- - Custom execution status of Security rules that is different from the - status used in the Alerting Framework. We merge our custom status with - the Framework's status to determine the resulting status of a rule. - - - going to run - @deprecated Replaced by the 'running' status but left - for backwards compatibility with rule execution events already written - to Event Log in the prior versions of Kibana. Don't use when writing - rule status changes. - - - running - Rule execution started but not reached any intermediate or - final status. - - - partial failure - Rule can partially fail for various reasons either - in the middle of an execution (in this case we update its status right - away) or in the end of it. So currently this status can be both - intermediate and final at the same time. A typical reason for a partial - failure: not all the indices that the rule searches over actually exist. - - - failed - Rule failed to execute due to unhandled exception or a reason - defined in the business logic of its executor function. - - - succeeded - Rule executed successfully without any issues. Note: this - status is just an indication of a rule's "health". The rule might or - might not generate any alerts despite of it. - enum: - - going to run - - running - - partial failure - - failed - - succeeded - type: string - Security_Solution_Detections_API_RuleExecutionStatusOrder: - type: integer - Security_Solution_Detections_API_RuleExecutionSummary: + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' + required: + - config + - name + - secrets + Data_views_400_response: + title: Bad request type: object properties: - last_execution: - type: object - properties: - date: - description: Date of the last execution - format: date-time - type: string - message: - type: string - metrics: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionMetrics - status: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionStatus - description: Status of the last execution - status_order: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionStatusOrder - required: - - date - - status - - status_order - - message - - metrics + error: + example: Bad Request + type: string + message: + type: string + statusCode: + example: 400 + type: number required: - - last_execution - Security_Solution_Detections_API_RuleFalsePositiveArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleFilterArray: - items: {} - type: array - Security_Solution_Detections_API_RuleInterval: - description: >- - Frequency of rule execution, using a date math range. For example, "1h" - means the rule runs every hour. Defaults to 5m (5 minutes). - type: string - Security_Solution_Detections_API_RuleIntervalFrom: - description: >- - Time from which data is analyzed each time the rule runs, using a date - math range. For example, now-4200s means the rule analyzes data from 70 - minutes before its start time. Defaults to now-6m (analyzes data from 6 - minutes before the start time). - format: date-math - type: string - Security_Solution_Detections_API_RuleIntervalTo: - type: string - Security_Solution_Detections_API_RuleLicense: - description: The rule's license. - type: string - Security_Solution_Detections_API_RuleMetadata: - additionalProperties: true - type: object - Security_Solution_Detections_API_RuleName: - minLength: 1 - type: string - Security_Solution_Detections_API_RuleNameOverride: - description: Sets the source field for the alert's signal.rule.name value - type: string - Security_Solution_Detections_API_RuleObjectId: - $ref: '#/components/schemas/Security_Solution_Detections_API_UUID' - Security_Solution_Detections_API_RulePatchProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRulePatchProps - Security_Solution_Detections_API_RulePreviewLogs: + - statusCode + - error + - message + Data_views_404_response: type: object properties: - duration: - description: Execution duration in milliseconds + error: + enum: + - Not Found + example: Not Found + type: string + message: + example: >- + Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] + not found + type: string + statusCode: + enum: + - 404 + example: 404 type: integer - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - startedAt: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - warnings: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - required: - - errors - - warnings - - duration - Security_Solution_Detections_API_RulePreviewParams: + Data_views_allownoindex: + description: Allows the data view saved object to exist before the data is available. + type: boolean + Data_views_create_data_view_request_object: + title: Create data view request type: object properties: - invocationCount: - type: integer - timeframeEnd: - format: date-time - type: string - required: - - invocationCount - - timeframeEnd - Security_Solution_Detections_API_RuleQuery: - type: string - Security_Solution_Detections_API_RuleReferenceArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleResponse: - anyOf: - - $ref: '#/components/schemas/Security_Solution_Detections_API_EqlRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_QueryRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdRule' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRule - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRule - - $ref: '#/components/schemas/Security_Solution_Detections_API_NewTermsRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_EsqlRule' - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleSignatureId: - description: 'Could be any string, not necessarily a UUID' - type: string - Security_Solution_Detections_API_RuleSource: - description: >- - Discriminated union that determines whether the rule is internally - sourced (created within the Kibana app) or has an external source, such - as the Elastic Prebuilt rules repo. - discriminator: - propertyName: type - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ExternalRuleSource - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InternalRuleSource - Security_Solution_Detections_API_RuleTagArray: - description: >- - String array containing words and phrases to help categorize, filter, - and search rules. Defaults to an empty array. - items: - type: string - type: array - Security_Solution_Detections_API_RuleUpdateProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleUpdateProps - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleVersion: - description: The rule's version number. - minimum: 1 - type: integer - Security_Solution_Detections_API_SavedObjectResolveAliasPurpose: - enum: - - savedObjectConversion - - savedObjectImport - type: string - Security_Solution_Detections_API_SavedObjectResolveAliasTargetId: - type: string - Security_Solution_Detections_API_SavedObjectResolveOutcome: - enum: - - exactMatch - - aliasMatch - - conflict - type: string - Security_Solution_Detections_API_SavedQueryId: - type: string - Security_Solution_Detections_API_SavedQueryRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleResponseFields - Security_Solution_Detections_API_SavedQueryRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleDefaultableFields - Security_Solution_Detections_API_SavedQueryRuleCreateProps: - allOf: - - type: object + data_view: + description: The data view object. + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldAttrs: + additionalProperties: + $ref: '#/components/schemas/Data_views_fieldattrs' + type: object + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object + id: + type: string name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo + description: The data view name. + type: string + namespaces: + $ref: '#/components/schemas/Data_views_namespaces' + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + type: + $ref: '#/components/schemas/Data_views_type' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta' version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion + type: string required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateFields - Security_Solution_Detections_API_SavedQueryRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_SavedQueryRuleOptionalFields: + - title + override: + default: false + description: >- + Override an existing data view if a data view with the provided + title already exists. + type: boolean + required: + - data_view + Data_views_data_view_response_object: + title: Data view response properties type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - response_actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ResponseAction - type: array - Security_Solution_Detections_API_SavedQueryRulePatchFields: - allOf: - - type: object - properties: - saved_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryId - type: - description: Rule type - enum: - - saved_query - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleDefaultableFields - Security_Solution_Detections_API_SavedQueryRulePatchProps: - allOf: - - type: object + data_view: + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldAttrs: + additionalProperties: + $ref: '#/components/schemas/Data_views_fieldattrs' + type: object + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata + example: ff959d40-b880-11e8-a6d9-e546fe2bba5f + type: string name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo + description: The data view name. + type: string + namespaces: + $ref: '#/components/schemas/Data_views_namespaces' + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta_response' version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRulePatchFields - Security_Solution_Detections_API_SavedQueryRuleRequiredFields: + example: WzQ2LDJd + type: string + Data_views_fieldattrs: + description: A map of field attributes by field name. type: object properties: - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - type: - description: Rule type - enum: - - saved_query + count: + description: Popularity count for the field. + type: integer + customDescription: + description: Custom description for the field. + maxLength: 300 type: string - required: - - type - - saved_id - Security_Solution_Detections_API_SavedQueryRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_SavedQueryRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateFields - Security_Solution_Detections_API_SetAlertsStatusByIds: + customLabel: + description: Custom label for the field. + type: string + Data_views_fieldformats: + description: A map of field formats by field name. type: object - properties: - signal_ids: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - minItems: 1 - type: array - status: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertStatus' - required: - - signal_ids - - status - Security_Solution_Detections_API_SetAlertsStatusByQuery: + Data_views_namespaces: + description: >- + An array of space identifiers for sharing the data view between multiple + spaces. + items: + default: default + type: string + type: array + Data_views_runtimefieldmap: + description: A map of runtime field definitions by field name. type: object properties: - conflicts: - default: abort - enum: - - abort - - proceed - type: string - query: - additionalProperties: true + script: type: object - status: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertStatus' - required: - - query - - status - Security_Solution_Detections_API_SetAlertTags: - type: object - properties: - tags_to_add: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTags' - tags_to_remove: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTags' + properties: + source: + description: Script for the runtime field. + type: string + type: + description: Mapping type of the runtime field. + type: string required: - - tags_to_add - - tags_to_remove - Security_Solution_Detections_API_SetupGuide: - type: string - Security_Solution_Detections_API_Severity: - description: Severity of the rule - enum: - - low - - medium - - high - - critical - type: string - Security_Solution_Detections_API_SeverityMapping: - description: Overrides generated alerts' severity with values from the source event + - script + - type + Data_views_sourcefilters: + description: The array of field names you want to filter out in Discover. items: type: object properties: - field: - type: string - operator: - enum: - - equals - type: string - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' value: type: string required: - - field - - operator - - severity - value type: array - Security_Solution_Detections_API_SiemErrorResponse: + Data_views_swap_data_view_request_object: + title: Data view reference swap request type: object properties: - message: + delete: + description: Deletes referenced saved object if all references are removed. + type: boolean + forId: + description: Limit the affected saved objects to one or more by identifier. + oneOf: + - type: string + - items: + type: string + type: array + forType: + description: Limit the affected saved objects by type. type: string - status_code: - type: integer + fromId: + description: The saved object reference to change. + type: string + fromType: + description: > + Specify the type of the saved object reference to alter. The default + value is `index-pattern` for data views. + type: string + toId: + description: New saved object reference value to replace the old value. + type: string + required: + - fromId + - toId + Data_views_timefieldname: + description: 'The timestamp field name, which you use for time-based data views.' + type: string + Data_views_title: + description: >- + Comma-separated list of data streams, indices, and aliases that you want + to search. Supports wildcards (`*`). + type: string + Data_views_type: + description: 'When set to `rollup`, identifies the rollup data views.' + type: string + Data_views_typemeta: + description: >- + When you use rollup indices, contains the field list for the rollup data + view API endpoints. + type: object + properties: + aggs: + description: A map of rollup restrictions by aggregation type and field name. + type: object + params: + description: Properties for retrieving rollup fields. + type: object + required: + - aggs + - params + Data_views_typemeta_response: + description: >- + When you use rollup indices, contains the field list for the rollup data + view API endpoints. + nullable: true + type: object + properties: + aggs: + description: A map of rollup restrictions by aggregation type and field name. + type: object + params: + description: Properties for retrieving rollup fields. + type: object + Data_views_update_data_view_request_object: + title: Update data view request + type: object + properties: + data_view: + description: > + The data view properties you want to update. Only the specified + properties are updated in the data view. Unspecified fields stay as + they are persisted. + type: object + properties: + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object + name: + type: string + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + type: + $ref: '#/components/schemas/Data_views_type' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta' + refresh_fields: + default: false + description: Reloads the data view fields after the data view is updated. + type: boolean required: - - status_code - - message - Security_Solution_Detections_API_SortOrder: - enum: - - asc - - desc - type: string - Security_Solution_Detections_API_Threat: + - data_view + Fleet_agent: + title: Agent type: object properties: - framework: - description: Relevant attack framework + access_api_key: type: string - tactic: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatTactic' - technique: - description: Array containing information on the attack techniques (optional) + access_api_key_id: + type: string + active: + type: boolean + components: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatTechnique + $ref: '#/components/schemas/Fleet_agent_component' type: array + default_api_key: + type: string + default_api_key_id: + type: string + enrolled_at: + type: string + id: + type: string + last_checkin: + type: string + local_metadata: + $ref: '#/components/schemas/Fleet_agent_metadata' + metrics: + type: object + properties: + cpu_avg: + description: >- + Average agent CPU usage during the last 5 minutes, number + between 0-1 + type: number + memory_size_byte_avg: + description: Average agent memory consumption during the last 5 minutes + type: number + policy_id: + type: string + policy_revision: + type: number + status: + $ref: '#/components/schemas/Fleet_agent_status' + type: + $ref: '#/components/schemas/Fleet_agent_type' + unenrolled_at: + type: string + unenrollment_started_at: + type: string + user_provided_metadata: + $ref: '#/components/schemas/Fleet_agent_metadata' required: - - framework - - tactic - Security_Solution_Detections_API_ThreatArray: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threat' - type: array - Security_Solution_Detections_API_ThreatFilters: - items: - description: >- - Query and filter context array used to filter documents from the - Elasticsearch index containing the threat values - type: array - Security_Solution_Detections_API_ThreatIndex: - items: - type: string - type: array - Security_Solution_Detections_API_ThreatIndicatorPath: - description: >- - Defines the path to the threat indicator in the indicator documents - (optional) - type: string - Security_Solution_Detections_API_ThreatMapping: - items: - type: object - properties: - entries: - items: + - type + - active + - enrolled_at + - id + - status + Fleet_agent_action: + oneOf: + - properties: + ack_data: + type: string + data: + type: string + type: + enum: + - UNENROLL + - UPGRADE + - POLICY_REASSIGN + type: string + - properties: + data: type: object properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: + log_level: enum: - - mapping + - debug + - info + - warning + - error + nullable: true type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - required: - - field - - type - - value - type: array - required: - - entries - minItems: 1 - type: array - Security_Solution_Detections_API_ThreatMatchRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleResponseFields - Security_Solution_Detections_API_ThreatMatchRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields - Security_Solution_Detections_API_ThreatMatchRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateFields - Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThreatMatchRuleOptionalFields: - type: object - properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - concurrent_searches: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ConcurrentSearches - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - items_per_search: - $ref: '#/components/schemas/Security_Solution_Detections_API_ItemsPerSearch' - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - threat_filters: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatFilters' - threat_indicator_path: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatIndicatorPath - threat_language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThreatMatchRulePatchFields: - allOf: - - type: object - properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threat_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatIndex - threat_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMapping - threat_query: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatQuery type: - description: Rule type - enum: - - threat_match type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields - Security_Solution_Detections_API_ThreatMatchRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRulePatchFields - Security_Solution_Detections_API_ThreatMatchRuleRequiredFields: + title: Agent action + Fleet_agent_component: + title: Agent component type: object properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threat_index: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatIndex' - threat_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatMapping' - threat_query: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatQuery' + id: + type: string + message: + type: string + status: + $ref: '#/components/schemas/Fleet_agent_component_status' type: - description: Rule type - enum: - - threat_match type: string - required: - - type - - query - - threat_query - - threat_mapping - - threat_index - Security_Solution_Detections_API_ThreatMatchRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_ThreatMatchRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateFields - Security_Solution_Detections_API_ThreatQuery: - description: Query to run + units: + items: + $ref: '#/components/schemas/Fleet_agent_component_unit' + type: array + Fleet_agent_component_status: + enum: + - starting + - configuring + - healthy + - degraded + - failed + - stopping + - stopped + title: Agent component status type: string - Security_Solution_Detections_API_ThreatSubtechnique: + Fleet_agent_component_unit: + title: Agent component unit type: object properties: id: - description: Subtechnique ID type: string - name: - description: Subtechnique name + message: + type: string + payload: + type: object + status: + $ref: '#/components/schemas/Fleet_agent_component_status' + type: + $ref: '#/components/schemas/Fleet_agent_component_unit_type' + Fleet_agent_component_unit_type: + enum: + - input + - output + title: Agent component unit type + type: string + Fleet_agent_diagnostics: + title: Agent diagnostics + type: object + properties: + actionId: + type: string + createTime: + type: string + filePath: type: string - reference: - description: Subtechnique reference + id: + type: string + name: type: string + status: + enum: + - READY + - AWAITING_UPLOAD + - DELETED + - IN_PROGRESS required: - id - name - - reference - Security_Solution_Detections_API_ThreatTactic: + - createTime + - filePath + - actionId + - status + Fleet_agent_get_by_actions: + items: + items: + type: string + type: array + title: Agents get by action ids + type: array + Fleet_agent_metadata: + title: Agent metadata + type: object + Fleet_agent_policy: + title: Agent Policy type: object properties: + advanced_settings: + description: >- + Advanced settings stored in the agent policy, e.g. + agent_limits_go_max_procs + nullable: true + type: object + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + agents: + type: number + data_output_id: + nullable: true + type: string + description: + type: string + download_source_id: + nullable: true + type: string + fleet_server_host_id: + nullable: true + type: string + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array id: - description: Tactic ID + type: string + inactivity_timeout: + type: integer + is_protected: + description: >- + Indicates whether the agent policy has tamper protection enabled. + Default false. + type: boolean + keep_monitoring_alive: + description: >- + When set to true, monitoring will be enabled but logs/metrics + collection will be disabled + nullable: true + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string + type: array + monitoring_output_id: + nullable: true type: string name: - description: Tactic name type: string - reference: - description: Tactic reference + namespace: + type: string + overrides: + description: >- + Override settings that are defined in the agent policy. Input + settings cannot be overridden. The override option should be used + only in unusual circumstances and not as a routine procedure. + nullable: true + type: object + package_policies: + description: >- + This field is present only when retrieving a single agent policy, or + when retrieving a list of agent policies with the ?full=true + parameter + items: + $ref: '#/components/schemas/Fleet_package_policy' + type: array + revision: + type: number + supports_agentless: + description: >- + Indicates whether the agent policy supports agentless integrations. + Only allowed in a serverless environment. + type: boolean + unenroll_timeout: + type: integer + unprivileged_agents: + type: number + updated_by: + type: string + updated_on: + format: date-time type: string required: - id + - status - name - - reference - Security_Solution_Detections_API_ThreatTechnique: + - namespace + Fleet_agent_policy_create_request: + title: Create agent policy request type: object properties: - id: - description: Technique ID + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + data_output_id: + nullable: true type: string - name: - description: Technique name + description: type: string - reference: - description: Technique reference + download_source_id: + nullable: true + type: string + fleet_server_host_id: + nullable: true type: string - subtechnique: - description: Array containing more specific information on the attack technique + force: + description: Force agent policy creation even if packages are not verified. + type: boolean + global_data_tags: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatSubtechnique + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array + id: + type: string + inactivity_timeout: + type: integer + is_protected: + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string type: array + monitoring_output_id: + nullable: true + type: string + name: + type: string + namespace: + type: string + unenroll_timeout: + type: integer required: - - id - name - - reference - Security_Solution_Detections_API_Threshold: - type: object - properties: - cardinality: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdCardinality - field: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdField' - value: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdValue' - required: - - field - - value - Security_Solution_Detections_API_ThresholdAlertSuppression: - type: object - properties: - duration: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionDuration - required: - - duration - Security_Solution_Detections_API_ThresholdCardinality: - items: - type: object - properties: - field: - type: string - value: - minimum: 0 - type: integer - required: - - field - - value - type: array - Security_Solution_Detections_API_ThresholdField: - description: Field to aggregate on + - namespace + Fleet_agent_policy_full: oneOf: - - type: string - - items: - type: string - type: array - Security_Solution_Detections_API_ThresholdRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleResponseFields - Security_Solution_Detections_API_ThresholdRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleDefaultableFields - Security_Solution_Detections_API_ThresholdRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateFields - Security_Solution_Detections_API_ThresholdRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThresholdRuleOptionalFields: - type: object - properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdAlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - Security_Solution_Detections_API_ThresholdRulePatchFields: - allOf: - type: object properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threshold: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threshold' - type: - description: Rule type - enum: - - threshold + item: type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleDefaultableFields - Security_Solution_Detections_API_ThresholdRulePatchProps: - allOf: - type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRulePatchFields - Security_Solution_Detections_API_ThresholdRuleRequiredFields: + item: + $ref: '#/components/schemas/Fleet_full_agent_policy' + title: Agent policy full response + type: object + Fleet_agent_policy_update_request: + title: Update agent policy request type: object properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threshold: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threshold' - type: - description: Rule type - enum: - - threshold + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + data_output_id: + nullable: true + type: string + description: + type: string + download_source_id: + nullable: true + type: string + fleet_server_host_id: + nullable: true + type: string + force: + description: Force agent policy creation even if packages are not verified. + type: boolean + inactivity_timeout: + type: integer + is_protected: + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string + type: array + monitoring_output_id: + nullable: true + type: string + name: + type: string + namespace: type: string + unenroll_timeout: + type: integer required: - - type - - query - - threshold - Security_Solution_Detections_API_ThresholdRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_ThresholdRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateFields - Security_Solution_Detections_API_ThresholdValue: - description: Threshold value - minimum: 1 - type: integer - Security_Solution_Detections_API_ThrottleForBulkActions: - description: >- - The condition for throttling the notification: 'rule', 'no_actions', or - time duration + - name + - namespace + Fleet_agent_status: enum: - - rule - - 1h - - 1d - - 7d - type: string - Security_Solution_Detections_API_TiebreakerField: - description: Sets a secondary field for sorting events - type: string - Security_Solution_Detections_API_TimelineTemplateId: - description: Timeline template ID - type: string - Security_Solution_Detections_API_TimelineTemplateTitle: - description: Timeline template title - type: string - Security_Solution_Detections_API_TimestampField: - description: Contains the event timestamp used for sorting a sequence of events - type: string - Security_Solution_Detections_API_TimestampOverride: - description: Sets the time field used to query indices + - offline + - error + - online + - inactive + - warning + title: Elastic Agent status type: string - Security_Solution_Detections_API_TimestampOverrideFallbackDisabled: - description: Disables the fallback to the event's @timestamp field - type: boolean - Security_Solution_Detections_API_UUID: - description: A universally unique identifier - format: uuid + Fleet_agent_type: + enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY + title: Agent type type: string - Security_Solution_Detections_API_WarningSchema: + Fleet_bulk_install_packages_response: + title: Bulk install packages response type: object properties: - actionPath: - type: string - buttonLabel: - type: string - message: - type: string - type: - type: string + items: + items: + type: object + properties: + name: + type: string + version: + type: string + type: array + response: + deprecated: true + items: + type: object + properties: + name: + type: string + version: + type: string + type: array required: - - type - - message - - actionPath - Security_Solution_Endpoint_Exceptions_API_EndpointList: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionList - - additionalProperties: false - type: object - Security_Solution_Endpoint_Exceptions_API_EndpointListItem: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItem - Security_Solution_Endpoint_Exceptions_API_ExceptionList: + - items + Fleet_bulk_upgrade_agents: + title: Bulk upgrade agents type: object properties: - _version: - type: string - created_at: - format: date-time - type: string - created_by: - type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListDescription - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListId - immutable: + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + force: + description: 'Force upgrade, skipping validation (should be used with caution)' + type: boolean + rollout_duration_seconds: + description: rolling upgrade window duration in seconds + type: number + skipRateLimitCheck: + description: Skip rate limit check for upgrade type: boolean - list_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListTags - tie_breaker_id: - type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListType - updated_at: - format: date-time + source_uri: + description: alternative upgrade binary download url type: string - updated_by: + start_time: + description: start time of upgrade in ISO 8601 format type: string version: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListVersion + description: version to upgrade to + type: string required: - - id - - list_id - - type - - name - - description - - immutable - - namespace_type + - agents - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListDescription: - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - description: 'Human readable string identifier, e.g. `trusted-linux-processes`' - Security_Solution_Endpoint_Exceptions_API_ExceptionListId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItem: + Fleet_data_stream: + title: Data stream type: object properties: - _version: + dashboard: + items: + type: object + properties: + id: + type: string + title: + type: string + type: array + dataset: type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - created_at: - format: date-time + index: type: string - created_by: + last_activity_ms: + type: number + namespace: type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time + package: type: string - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - tie_breaker_id: + package_version: type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - updated_at: - format: date-time + size_in_bytes: + type: number + size_in_bytes_formatted: type: string - updated_by: + type: type: string - required: - - id - - item_id - - list_id - - type - - name - - description - - entries - - namespace_type - - comments - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemComment: + Fleet_download_sources: + title: Download Source type: object properties: - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - created_at: - format: date-time + host: type: string - created_by: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - updated_at: - format: date-time type: string - updated_by: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString + is_default: + type: boolean + name: + type: string + proxy_id: + description: >- + The ID of the proxy to use for this download source. See the proxies + API for more information. + nullable: true + type: string required: - - id - - comment - - created_at - - created_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemComment - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription: + - is_default + - name + - host + Fleet_elasticsearch_asset_type: + enum: + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy + title: Elasticsearch asset type type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntry: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryList - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNested - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchWildcard - discriminator: - propertyName: type - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntry - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists: + Fleet_enrollment_api_key: + title: Enrollment API key type: object properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - exists + active: + type: boolean + api_key: type: string - required: - - type - - field - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryList: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - list: - type: object - properties: - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ListId - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ListType - required: - - id - - type - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - list + api_key_id: type: string - required: - - type - - field - - list - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match + created_at: type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match_any + id: type: string - value: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - minItems: 1 - type: array - required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchWildcard: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - wildcard + name: + type: string + policy_id: type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNested: + - id + - api_key_id + - api_key + - active + - created_at + Fleet_fleet_server_host: + title: Fleet Server Host type: object properties: - entries: + host_urls: items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNestedEntryItem - minItems: 1 + type: string type: array - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - type: - enum: - - nested + id: type: string - required: - - type - - field - - entries - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNestedEntryItem: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator: - enum: - - excluded - - included - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta: - additionalProperties: true - type: object - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType: - enum: - - simple - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListMeta: - additionalProperties: true - type: object - Security_Solution_Endpoint_Exceptions_API_ExceptionListName: - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType: - enum: - - linux - - macos - - windows - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListTags: - items: - type: string - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListType: - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListVersion: - minimum: 1 - type: integer - Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType: - description: > - Determines whether the exception container is available in all Kibana - spaces or just the space - - in which it is created, where: - - - - `single`: Only available in the Kibana space in which it is created. - - - `agnostic`: Available in all Kibana spaces. - enum: - - agnostic - - single - type: string - Security_Solution_Endpoint_Exceptions_API_FindEndpointListItemsFilter: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ListId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ListType: - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Endpoint_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse: - type: object - properties: - error: + is_default: + type: boolean + is_internal: + type: boolean + is_preconfigured: + type: boolean + name: type: string - message: + proxy_id: type: string - statusCode: - type: integer required: - - statusCode - - error - - message - Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse: + - fleet_server_hosts + - id + - is_default + - is_preconfigured + - host_urls + Fleet_fleet_settings_enrollment_response: + title: Fleet settings response type: object properties: - message: - type: string - status_code: - type: integer + download_source: + $ref: '#/components/schemas/Fleet_download_sources' + fleet_server: + type: object + properties: + has_active: + type: boolean + host: + $ref: '#/components/schemas/Fleet_fleet_server_host' + host_proxy: + $ref: '#/components/schemas/Fleet_proxies' + policies: + items: + type: object + properties: + download_source_id: + type: string + fleet_server_host_id: + type: string + has_fleet_server: + type: boolean + id: + type: string + is_default_fleet_server: + type: boolean + is_managed: + type: boolean + name: + type: string + required: + - id + - name + - is_managed + type: array + required: + - agent_policies + - has_active required: - - status_code - - message - Security_Solution_Endpoint_Management_API_ActionLogRequestQuery: + - fleet_server + Fleet_fleet_settings_response: + title: Fleet settings response type: object properties: - end_date: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndDate - page: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Page' - page_size: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PageSize - start_date: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_StartDate - Security_Solution_Endpoint_Management_API_ActionStateSuccessResponse: + item: + $ref: '#/components/schemas/Fleet_settings' + required: + - item + Fleet_fleet_setup_response: + title: Fleet Setup response type: object properties: - body: - type: object - properties: - data: - type: object - properties: - canEncrypt: - type: boolean - required: - - data + isInitialized: + type: boolean + nonFatalErrors: + items: + type: object + properties: + message: + type: string + name: + type: string + required: + - name + - message + type: array required: - - body - Security_Solution_Endpoint_Management_API_ActionStatusSuccessResponse: + - isInitialized + - nonFatalErrors + Fleet_fleet_status_response: + title: Fleet status response type: object properties: - body: - type: object - properties: - data: - type: object - properties: - agent_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId - pending_actions: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionsSchema - required: - - agent_id - - pending_actions - required: - - data - required: - - body - Security_Solution_Endpoint_Management_API_AgentId: - description: Agent ID - type: string - Security_Solution_Endpoint_Management_API_AgentIds: - minLength: 1 - oneOf: - - items: - minLength: 1 + isReady: + type: boolean + missing_optional_features: + items: + enum: + - encrypted_saved_object_encryption_key_required + type: string + type: array + missing_requirements: + items: + enum: + - tls_required + - api_keys + - fleet_admin_user + - fleet_server type: string - maxItems: 50 - minItems: 1 type: array - - minLength: 1 + package_verification_key_id: type: string - Security_Solution_Endpoint_Management_API_AgentTypes: - enum: - - endpoint - - sentinel_one - - crowdstrike - type: string - Security_Solution_Endpoint_Management_API_AlertIds: - description: A list of alerts ids. - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NonEmptyString - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_CaseIds: - description: Case IDs to be updated (cannot contain empty strings) - items: - minLength: 1 - type: string - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_Command: - description: The command to be executed (cannot be an empty string) - enum: - - isolate - - unisolate - - kill-process - - suspend-process - - running-processes - - get-file - - execute - - upload - - scan - minLength: 1 - type: string - Security_Solution_Endpoint_Management_API_Commands: - items: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Command' - type: array - Security_Solution_Endpoint_Management_API_Comment: - description: Optional comment - type: string - Security_Solution_Endpoint_Management_API_EndDate: - description: End date - type: string - Security_Solution_Endpoint_Management_API_EndpointIds: - description: List of endpoint IDs (cannot contain empty strings) - items: - minLength: 1 - type: string - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_ExecuteRouteRequestBody: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object - properties: - parameters: - type: object - properties: - command: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Command - timeout: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Timeout - required: - - command - required: - - parameters - Security_Solution_Endpoint_Management_API_GetEndpointActionListRouteQuery: + required: + - isReady + - missing_requirements + - missing_optional_features + Fleet_full_agent_policy: + title: Full agent policy type: object properties: - agentIds: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentIds - agentTypes: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - commands: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Commands - endDate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndDate - page: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Page' - pageSize: - default: 10 - description: Number of items per page - maximum: 10000 - minimum: 1 - type: integer - startDate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_StartDate - types: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Types' - userIds: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UserIds - withOutputs: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_WithOutputs - Security_Solution_Endpoint_Management_API_GetFileRouteRequestBody: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object - properties: - parameters: - type: object + agent: + nullable: true + type: string + fleet: + oneOf: + - type: object properties: - path: + hosts: + items: + type: string + type: array + proxy_headers: {} + proxy_url: type: string - required: - - path - required: - - parameters - Security_Solution_Endpoint_Management_API_GetProcessesRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_IsolateRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object - properties: - parameters: - oneOf: - - type: object + ssl: + type: object properties: - pid: - minimum: 1 - type: integer - - type: object + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + renegotiation: + type: string + verification_mode: + type: string + - type: object + properties: + kibana: + type: object properties: - entity_id: - minLength: 1 + hosts: + items: + type: string + type: array + path: type: string - required: - - parameters - Security_Solution_Endpoint_Management_API_ListRequestQuery: - type: object - properties: - hostStatuses: - items: - enum: - - healthy - - offline - - updating - - inactive - - unenrolled - type: string - type: array - kuery: - nullable: true - type: string - page: - default: 0 - description: Page number - minimum: 0 - type: integer - pageSize: - default: 10 - description: Number of items per page - maximum: 10000 - minimum: 1 - type: integer - sortDirection: - enum: - - asc - - desc - nullable: true + protocol: + type: string + id: type: string - sortField: - enum: - - enrolled_at - - metadata.host.hostname - - host_status - - metadata.Endpoint.policy.applied.name - - metadata.Endpoint.policy.applied.status - - metadata.host.os.name - - metadata.host.ip - - metadata.agent.version - - last_checkin + inputs: type: string - required: - - hostStatuses - Security_Solution_Endpoint_Management_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Endpoint_Management_API_NoParametersRequestSchema: - type: object - properties: - body: + output_permissions: + additionalProperties: + type: object + properties: + data: + $ref: >- + #/components/schemas/Fleet_full_agent_policy_output_permissions + output: + type: integer type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids + outputs: + additionalProperties: + $ref: '#/components/schemas/Fleet_full_agent_policy_output' + type: object + revision: + type: number + secret_references: + items: + type: object + properties: + id: + type: string + type: array required: - - body - Security_Solution_Endpoint_Management_API_Page: - default: 1 - description: Page number - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_PageSize: - default: 10 - description: Number of items per page - maximum: 100 - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_Parameters: - description: Optional parameters object - type: object - Security_Solution_Endpoint_Management_API_PendingActionDataType: - type: integer - Security_Solution_Endpoint_Management_API_PendingActionsSchema: - oneOf: - - type: object - properties: - execute: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - get-file: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - isolate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - kill-process: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - running-processes: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - scan: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - suspend-process: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - unisolate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - upload: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType + - id + - outputs + - inputs + Fleet_full_agent_policy_input: + allOf: - additionalProperties: true type: object - Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse: - type: object - properties: - note: - type: string - Security_Solution_Endpoint_Management_API_ScanRouteRequestBody: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object properties: - parameters: + data_stream: type: object properties: - path: + namespace: type: string required: - - path + - namespace + id: + type: string + meta: + additionalProperties: true + type: object + properties: + package: + type: object + properties: + name: + type: string + version: + type: string + required: + - name + - version + name: + type: string + revision: + type: number + streams: + $ref: '#/components/schemas/Fleet_full_agent_policy_input_stream' + type: + type: string + use_output: + type: string required: - - parameters - Security_Solution_Endpoint_Management_API_StartDate: - description: Start date - type: string - Security_Solution_Endpoint_Management_API_SuccessResponse: - type: object - properties: {} - Security_Solution_Endpoint_Management_API_Timeout: - description: The maximum timeout value in milliseconds (optional) - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_Type: - description: Type of response action - enum: - - automated - - manual - type: string - Security_Solution_Endpoint_Management_API_Types: - description: List of types of response actions - items: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Type' - maxLength: 2 - minLength: 1 - type: array - Security_Solution_Endpoint_Management_API_UnisolateRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_UploadRouteRequestBody: + - id + - name + - revision + - type + - data_stream + - use_output + title: Full agent policy input + Fleet_full_agent_policy_input_stream: allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object + - additionalProperties: true + type: object properties: - file: - format: binary - type: string - parameters: + data_stream: type: object properties: - overwrite: - default: false - type: boolean + dataset: + type: string + type: + type: string + required: + - dataset + - type + id: + type: string required: - - parameters - - file - Security_Solution_Endpoint_Management_API_UserIds: - description: User IDs - oneOf: - - items: - minLength: 1 - type: string - minItems: 1 - type: array - - minLength: 1 + - id + - data_stream + title: Full agent policy input stream + Fleet_full_agent_policy_output: + title: Full agent policy + type: object + properties: + additionalProperties: + type: object + properties: + text: {} + ca_sha256: + nullable: true type: string - Security_Solution_Endpoint_Management_API_WithOutputs: - description: Shows detailed outputs for an action response - oneOf: - - items: - minLength: 1 + hosts: + items: type: string - minItems: 1 type: array - - minLength: 1 - type: string - Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadErrorItem: - type: object - properties: - index: - type: integer - message: + proxy_headers: {} + proxy_url: type: string + type: {} required: - - message - - index - Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadStats: + - type + - hosts + - ca_sha256 + Fleet_full_agent_policy_output_permissions: + additionalProperties: + type: object + properties: + data: + type: object + properties: + cluster: + items: + type: string + type: array + indices: + items: + type: object + properties: + names: + items: + type: string + type: array + privileges: + items: + type: string + type: array + type: array + packagePolicyName: + type: string + title: Full agent policy output permissions + Fleet_get_agent_tags_response: + title: Get Agent Tags response type: object properties: - failed: - type: integer - successful: - type: integer + items: + items: + type: string + type: array + Fleet_get_agents_response: + title: Get Agent response + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_agent' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_agent' + type: array + page: + type: number + perPage: + type: number + statusSummary: + type: object + properties: + degraded': + type: number + enrolling: + type: number + error: + type: number + inactive: + type: number + offline: + type: number + online: + type: number + unenrolled: + type: number + unenrolling: + type: number + updating: + type: number total: - type: integer + type: number required: - - successful - - failed + - items - total - Security_Solution_Entity_Analytics_API_AssetCriticalityLevel: - description: The criticality level of the asset. - enum: - - low_impact - - medium_impact - - high_impact - - extreme_impact - type: string - Security_Solution_Entity_Analytics_API_AssetCriticalityRecord: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - - type: object - properties: - '@timestamp': - description: The time the record was created or updated. - example: '2017-07-21T17:32:28Z' - format: date-time - type: string - required: - - '@timestamp' - Security_Solution_Entity_Analytics_API_AssetCriticalityRecordIdParts: - type: object + - page + - perPage + Fleet_get_bulk_assets_response: + deprecated: true properties: - id_field: - $ref: '#/components/schemas/Security_Solution_Entity_Analytics_API_IdField' - description: The field representing the ID. - example: host.name - id_value: - description: The ID value of the asset. - type: string + items: + items: + type: object + properties: + appLink: + type: string + attributes: + type: object + properties: + description: + type: string + title: + type: string + id: + type: string + type: + $ref: '#/components/schemas/Fleet_saved_object_type' + updatedAt: + type: string + type: array required: - - id_value - - id_field - Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecordIdParts - - type: object - properties: - criticality_level: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityLevel - required: - - criticality_level - Security_Solution_Entity_Analytics_API_IdField: - enum: - - host.name - - user.name - type: string - Security_Solution_Exceptions_API_CreateExceptionListItemComment: + - items + title: Bulk get assets response type: object - properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - comment - Security_Solution_Exceptions_API_CreateExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateExceptionListItemComment - type: array - Security_Solution_Exceptions_API_CreateRuleExceptionListItemComment: + Fleet_get_categories_response: + title: Get categories response type: object properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' + items: + items: + type: object + properties: + count: + type: number + id: + type: string + title: + type: string + required: + - id + - title + - count + type: array + response: + items: + deprecated: true + type: object + properties: + count: + type: number + id: + type: string + title: + type: string + required: + - id + - title + - count + type: array required: - - comment - Security_Solution_Exceptions_API_CreateRuleExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemComment - type: array - Security_Solution_Exceptions_API_CreateRuleExceptionListItemProps: + - items + Fleet_get_packages_response: + title: Get Packages response type: object properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time - type: string - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType + items: + items: + $ref: '#/components/schemas/Fleet_search_result' + type: array + response: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_search_result' + type: array required: - - type - - name - - description - - entries - Security_Solution_Exceptions_API_ExceptionList: + - items + Fleet_installation_info: + title: Installation info object type: object properties: - _version: - type: string created_at: - format: date-time type: string - created_by: + experimental_data_stream_features: + type: array + properties: + data_stream: + type: string + features: + type: object + properties: + doc_value_only_numeric: + nullable: true + type: boolean + doc_value_only_other: + nullable: true + type: boolean + synthetic_source: + nullable: true + type: boolean + tsdb: + nullable: true + type: boolean + install_format_schema_version: type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - immutable: - type: boolean - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta + install_kibana_space_id: + type: string + install_source: + enum: + - registry + - upload + - bundled + type: string + install_status: + enum: + - installed + - installing + - install_failed + type: string + installed_es: + type: object + properties: + deferred: + type: boolean + id: + type: string + type: + $ref: '#/components/schemas/Fleet_elasticsearch_asset_type' + installed_kibana: + type: object + properties: + id: + type: string + type: + $ref: '#/components/schemas/Fleet_kibana_saved_object_type' + latest_executed_state: + description: Latest successfully executed state in package install state machine + type: object + properties: + error: + type: string + name: + enum: + - create_restart_installation + - install_kibana_assets + - install_ilm_policies + - install_ml_model + - install_index_template_pipelines + - remove_legacy_templates + - update_current_write_indices + - install_transforms + - delete_previous_pipelines + - save_archive_entries_from_assets_map + - update_so + type: string + started_at: + type: string + latest_install_failed_attempts: + description: Latest failed install errors + items: + type: object + properties: + created_at: + type: string + error: + type: object + properties: + message: + type: string + name: + type: string + stack: + type: string + target_version: + type: string + type: array name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - tie_breaker_id: type: string + namespaces: + items: + type: string + type: array type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType + type: string updated_at: - format: date-time type: string - updated_by: + verification_key_id: + nullable: true + type: string + verification_status: + enum: + - verified + - unverified + - unknown type: string version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion + type: string required: - - id - - list_id - - type + - installed_kibana + - installed_es - name - - description - - immutable - - namespace_type - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Exceptions_API_ExceptionListDescription: + - install_status + - install_version + - install_started_at + - install_source + - verification_status + - latest_install_failed_attempts + Fleet_kibana_saved_object_type: + enum: + - dashboard + - visualization + - search + - index-pattern + - map + - lens + - ml-module + - security-rule + - csp_rule_template + title: Kibana saved object asset type type: string - Security_Solution_Exceptions_API_ExceptionListHumanId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - description: 'Human readable string identifier, e.g. `trusted-linux-processes`' - Security_Solution_Exceptions_API_ExceptionListId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItem: - type: object + Fleet_new_package_policy: + description: '' properties: - _version: - type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemCommentArray - created_at: - format: date-time - type: string - created_by: - type: string description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time type: string - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta + enabled: + type: boolean + inputs: + items: + type: object + properties: + config: + type: object + enabled: + type: boolean + processors: + items: + type: string + type: array + streams: + items: {} + type: array + type: + type: string + vars: + type: object + required: + - type + - enabled + type: array name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - tie_breaker_id: - type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType - updated_at: - format: date-time type: string - updated_by: + namespace: type: string - required: - - id - - item_id - - list_id - - type - - name - - description - - entries - - namespace_type - - comments - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Exceptions_API_ExceptionListItemComment: - type: object - properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - created_at: - format: date-time + output_id: type: string - created_by: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - updated_at: - format: date-time + overrides: + type: object + package: + type: object + properties: + name: + type: string + requires_root: + type: boolean + title: + type: string + version: + type: string + required: + - name + - version + policy_id: + deprecated: true type: string - updated_by: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' + policy_ids: + items: + type: string + type: array required: - - id - - comment - - created_at - - created_by - Security_Solution_Exceptions_API_ExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemComment - type: array - Security_Solution_Exceptions_API_ExceptionListItemDescription: - type: string - Security_Solution_Exceptions_API_ExceptionListItemEntry: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryList - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryExists - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryNested - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchWildcard + - inputs + - name + title: New package policy + type: object + Fleet_output_create_request: discriminator: + mapping: + elasticsearch: '#/components/schemas/Fleet_output_create_request_elasticsearch' + kafka: '#/components/schemas/Fleet_output_create_request_kafka' + logstash: '#/components/schemas/Fleet_output_create_request_logstash' + remote_elasticsearch: >- + #/components/schemas/Fleet_output_create_request_remote_elasticsearch propertyName: type - Security_Solution_Exceptions_API_ExceptionListItemEntryArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntry - type: array - Security_Solution_Exceptions_API_ExceptionListItemEntryExists: + oneOf: + - $ref: '#/components/schemas/Fleet_output_create_request_elasticsearch' + - $ref: '#/components/schemas/Fleet_output_create_request_kafka' + - $ref: '#/components/schemas/Fleet_output_create_request_logstash' + - $ref: >- + #/components/schemas/Fleet_output_create_request_remote_elasticsearch + title: Output + Fleet_output_create_request_elasticsearch: + title: elasticsearch type: object properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: + ca_sha256: + type: string + ca_trusted_fingerprint: + type: string + config: + type: object + config_yaml: + type: string + hosts: + items: + type: string + type: array + id: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + preset: enum: - - exists + - balanced + - custom + - throughput + - scale + - latency type: string - required: - - type - - field - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryList: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - list: + proxy_id: + type: string + shipper: type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_ListId' - type: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_ListType' - required: - - id - - type - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string type: enum: - - list + - elasticsearch type: string required: - - type - - field - - list - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatch: + - name + Fleet_output_create_request_kafka: + title: kafka type: object properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match + auth_type: type: string - value: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: + broker_timeout: + type: number + ca_sha256: + type: string + ca_trusted_fingerprint: + type: string + client_id: + type: string + compression: + type: string + compression_level: + type: number + config: + type: object + config_yaml: + type: string + connection_type: enum: - - match_any + - plaintext + - encryption type: string - value: + headers: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_NonEmptyString - minItems: 1 + type: object + properties: + key: + type: string + value: + type: string type: array - required: - - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatchWildcard: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - wildcard + hosts: + items: + type: string + type: array + id: type: string - value: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryNested: - type: object - properties: - entries: + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + key: + type: string + name: + type: string + partition: + type: string + password: + type: string + proxy_id: + type: string + random: + type: object + properties: + group_events: + type: number + required_acks: + type: number + round_robin: + type: object + properties: + group_events: + type: number + sasl: + type: object + properties: + mechanism: + type: string + secrets: + type: object + properties: + password: + type: string + ssl: + type: object + properties: + key: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + verification_mode: + enum: + - none + - full + - certificate + - strict + type: string + timeout: + type: number + topic: + type: string + topics: + deprecated: true + description: Use topic instead. items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryNestedEntryItem - minItems: 1 + type: object + properties: + topic: + type: string + when: + deprecated: true + description: >- + Deprecated, kafka output do not support conditionnal topics + anymore. + type: object + properties: + condition: + type: string + type: + type: string type: array - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' type: enum: - - nested + - kafka + type: string + username: + type: string + version: type: string required: + - name - type - - field - - entries - Security_Solution_Exceptions_API_ExceptionListItemEntryNestedEntryItem: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryExists - Security_Solution_Exceptions_API_ExceptionListItemEntryOperator: - enum: - - excluded - - included - type: string - Security_Solution_Exceptions_API_ExceptionListItemHumanId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemMeta: - additionalProperties: true - type: object - Security_Solution_Exceptions_API_ExceptionListItemName: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Exceptions_API_ExceptionListItemTags: - items: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - type: array - Security_Solution_Exceptions_API_ExceptionListItemType: - enum: - - simple - type: string - Security_Solution_Exceptions_API_ExceptionListMeta: - additionalProperties: true - type: object - Security_Solution_Exceptions_API_ExceptionListName: - type: string - Security_Solution_Exceptions_API_ExceptionListOsType: - enum: - - linux - - macos - - windows - type: string - Security_Solution_Exceptions_API_ExceptionListOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Exceptions_API_ExceptionListsImportBulkError: + - topics + - auth_type + - hosts + Fleet_output_create_request_logstash: + title: logstash type: object properties: - error: + ca_sha256: + type: string + ca_trusted_fingerprint: + type: string + config: type: object - properties: - message: - type: string - status_code: - type: integer - required: - - status_code - - message + config_yaml: + type: string + hosts: + items: + type: string + type: array id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - required: - - error - Security_Solution_Exceptions_API_ExceptionListsImportBulkErrorArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListsImportBulkError - type: array - Security_Solution_Exceptions_API_ExceptionListTags: - items: - type: string - type: array - Security_Solution_Exceptions_API_ExceptionListType: - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Exceptions_API_ExceptionListVersion: - minimum: 1 - type: integer - Security_Solution_Exceptions_API_ExceptionNamespaceType: - description: > - Determines whether the exception container is available in all Kibana - spaces or just the space - - in which it is created, where: - - - - `single`: Only available in the Kibana space in which it is created. - - - `agnostic`: Available in all Kibana spaces. - enum: - - agnostic - - single - type: string - Security_Solution_Exceptions_API_FindExceptionListItemsFilter: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_FindExceptionListsFilter: - type: string - Security_Solution_Exceptions_API_ListId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ListType: - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Exceptions_API_PlatformErrorResponse: - type: object - properties: - error: type: string - message: + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + proxy_id: type: string - statusCode: - type: integer - required: - - statusCode - - error - - message - Security_Solution_Exceptions_API_RuleId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_UUID' - Security_Solution_Exceptions_API_SiemErrorResponse: - type: object - properties: - message: + secrets: + type: object + properties: + ssl: + type: object + properties: + key: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - logstash type: string - status_code: - type: integer required: - - status_code - - message - Security_Solution_Exceptions_API_UpdateExceptionListItemComment: + - name + - hosts + - type + Fleet_output_create_request_remote_elasticsearch: + title: remote_elasticsearch type: object properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + secrets: + type: object + properties: + service_token: + type: string + service_token: + type: string + type: + enum: + - remote_elasticsearch + type: string required: - - comment - Security_Solution_Exceptions_API_UpdateExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_UpdateExceptionListItemComment - type: array - Security_Solution_Exceptions_API_UUID: - description: A universally unique identifier - format: uuid - type: string - Security_Solution_Lists_API_FindListItemsCursor: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_FindListItemsFilter: - type: string - Security_Solution_Lists_API_FindListsCursor: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_FindListsFilter: - type: string - Security_Solution_Lists_API_List: + - name + Fleet_output_update_request: + discriminator: + mapping: + elasticsearch: '#/components/schemas/Fleet_output_update_request_elasticsearch' + kafka: '#/components/schemas/Fleet_output_update_request_kafka' + logstash: '#/components/schemas/Fleet_output_update_request_logstash' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Fleet_output_update_request_elasticsearch' + - $ref: '#/components/schemas/Fleet_output_update_request_kafka' + - $ref: '#/components/schemas/Fleet_output_update_request_logstash' + title: Output + Fleet_output_update_request_elasticsearch: + title: elasticsearch type: object properties: - _version: - type: string - '@timestamp': - format: date-time + ca_sha256: type: string - created_at: - format: date-time + ca_trusted_fingerprint: type: string - created_by: - type: string - description: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListDescription' - deserializer: + config: + type: object + config_yaml: type: string + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - immutable: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: type: boolean - meta: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListMetadata' name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - serializer: type: string - tie_breaker_id: + preset: + enum: + - balanced + - custom + - throughput + - scale + - latency type: string - type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - updated_at: - format: date-time + proxy_id: type: string - updated_by: + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - elasticsearch type: string - version: - minimum: 1 - type: integer required: - - id - - type - name - - description - - immutable - - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Lists_API_ListDescription: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListId: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListItem: + - hosts + - type + Fleet_output_update_request_kafka: + title: kafka type: object properties: - _version: + auth_type: type: string - '@timestamp': - format: date-time + broker_timeout: + type: number + ca_sha256: type: string - created_at: - format: date-time + ca_trusted_fingerprint: + type: string + client_id: type: string - created_by: + compression: + type: string + compression_level: + type: number + config: + type: object + config_yaml: type: string - deserializer: + connection_type: + enum: + - plaintext + - encryption type: string + headers: + items: + type: object + properties: + key: + type: string + value: + type: string + type: array + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - list_id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemMetadata' - serializer: type: string - tie_breaker_id: + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + key: type: string - type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - updated_at: - format: date-time + name: type: string - updated_by: + partition: type: string - value: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemValue' - required: - - id - - type - - list_id - - value - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Lists_API_ListItemId: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListItemMetadata: - additionalProperties: true - type: object - Security_Solution_Lists_API_ListItemPrivileges: - type: object - properties: - application: - additionalProperties: - type: boolean - type: object - cluster: - additionalProperties: - type: boolean + password: + type: string + proxy_id: + type: string + random: type: object - has_all_requested: - type: boolean - index: - additionalProperties: - additionalProperties: - type: boolean - type: object + properties: + group_events: + type: number + required_acks: + type: number + round_robin: type: object - username: - type: string - required: - - username - - has_all_requested - - cluster - - index - - application - Security_Solution_Lists_API_ListItemValue: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListMetadata: - additionalProperties: true - type: object - Security_Solution_Lists_API_ListName: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListPrivileges: - type: object - properties: - application: - additionalProperties: - type: boolean + properties: + group_events: + type: number + sasl: type: object - cluster: - additionalProperties: - type: boolean + properties: + mechanism: + type: string + shipper: type: object - has_all_requested: - type: boolean - index: - additionalProperties: - additionalProperties: + properties: + compression_level: + type: number + disk_queue_compression_enabled: type: boolean - type: object + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + verification_mode: + enum: + - none + - full + - certificate + - strict + type: string + timeout: + type: number + topic: + type: string + topics: + deprecated: true + description: Use topic instead. + items: + type: object + properties: + topic: + type: string + when: + deprecated: true + description: >- + Deprecated, kafka output do not support conditionnal topics + anymore. + type: object + properties: + condition: + type: string + type: + type: string + type: array + type: + enum: + - kafka + type: string username: type: string + version: + type: string required: - - username - - has_all_requested - - cluster - - index - - application - Security_Solution_Lists_API_ListType: - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Lists_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Lists_API_PlatformErrorResponse: + - name + Fleet_output_update_request_logstash: + title: logstash type: object properties: - error: + ca_sha256: type: string - message: + ca_trusted_fingerprint: type: string - statusCode: - type: integer - required: - - statusCode - - error - - message - Security_Solution_Lists_API_SiemErrorResponse: - type: object - properties: - message: + config: + type: object + config_yaml: + type: string + hosts: + items: + type: string + type: array + id: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + proxy_id: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - logstash type: string - status_code: - type: integer required: - - status_code - - message - Security_Solution_Osquery_API_ArrayQueries: - items: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ArrayQueriesItem' - type: array - Security_Solution_Osquery_API_ArrayQueriesItem: - type: object - properties: - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PlatformOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_CreateLiveQueryRequestBody: + - name + Fleet_package_info: + title: Package information type: object properties: - agent_all: - type: boolean - agent_ids: - items: - type: string - type: array - agent_platforms: + assets: items: type: string type: array - agent_policy_ids: + categories: items: type: string type: array - alert_ids: + conditions: + type: object + properties: + elasticsearch: + type: object + properties: + subscription: + enum: + - basic + - gold + - platinum + - enterprise + type: string + kibana: + type: object + properties: + versions: + type: string + data_streams: items: - type: string + type: object + properties: + ingeset_pipeline: + type: string + name: + type: string + package: + type: string + release: + type: string + title: + type: string + type: + type: string + vars: + items: + type: object + properties: + default: + type: string + name: + type: string + required: + - name + - default + type: array + required: + - title + - name + - release + - ingeset_pipeline + - type + - package type: array - case_ids: + description: + type: string + download: + type: string + elasticsearch: + type: object + properties: + privileges: + type: object + properties: + cluster: + items: + type: string + type: array + format_version: + type: string + icons: items: type: string type: array - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - event_ids: + internal: + type: boolean + name: + type: string + path: + type: string + readme: + type: string + release: + deprecated: true + description: >- + release label is deprecated, derive from the version instead + (packages follow semver) + enum: + - experimental + - beta + - ga + type: string + screenshots: items: - type: string + type: object + properties: + path: + type: string + size: + type: string + src: + type: string + title: + type: string + type: + type: string + required: + - src + - path type: array - metadata: - nullable: true + source: type: object - pack_id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackIdOrUndefined' - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ArrayQueries' - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - saved_query_id: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SavedQueryIdOrUndefined - Security_Solution_Osquery_API_CreatePacksRequestBody: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - enabled: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_EnabledOrUndefined - name: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackName' - policy_ids: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PolicyIdsOrUndefined - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueries' - shards: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Shards' - Security_Solution_Osquery_API_CreateSavedQueryRequestBody: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - interval: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Interval' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_DefaultSuccessResponse: - type: object - properties: {} - Security_Solution_Osquery_API_Description: - type: string - Security_Solution_Osquery_API_DescriptionOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Description' - nullable: true - Security_Solution_Osquery_API_ECSMapping: - additionalProperties: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ECSMappingItem' - type: object - Security_Solution_Osquery_API_ECSMappingItem: - type: object - properties: - field: + properties: + license: + enum: + - Apache-2.0 + - Elastic-2.0 + type: string + title: + type: string + type: type: string - value: - oneOf: - - type: string - - items: - type: string - type: array - Security_Solution_Osquery_API_ECSMappingOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ECSMapping' - nullable: true - Security_Solution_Osquery_API_Enabled: - type: boolean - Security_Solution_Osquery_API_EnabledOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Enabled' - nullable: true - Security_Solution_Osquery_API_FindLiveQueryRequestQuery: - type: object - properties: - kuery: - $ref: '#/components/schemas/Security_Solution_Osquery_API_KueryOrUndefined' - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_FindPacksRequestQuery: - type: object - properties: - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_FindSavedQueryRequestQuery: - type: object - properties: - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_GetLiveQueryResultsRequestQuery: - type: object - properties: - kuery: - $ref: '#/components/schemas/Security_Solution_Osquery_API_KueryOrUndefined' - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_Id: - type: string - Security_Solution_Osquery_API_Interval: - type: string - Security_Solution_Osquery_API_IntervalOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Interval' - nullable: true - Security_Solution_Osquery_API_KueryOrUndefined: - nullable: true - type: string - Security_Solution_Osquery_API_ObjectQueries: - additionalProperties: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueriesItem' - type: object - Security_Solution_Osquery_API_ObjectQueriesItem: - type: object - properties: - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PlatformOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - saved_query_id: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SavedQueryIdOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_PackId: - type: string - Security_Solution_Osquery_API_PackIdOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' - nullable: true - Security_Solution_Osquery_API_PackName: - type: string - Security_Solution_Osquery_API_PageOrUndefined: - nullable: true - type: integer - Security_Solution_Osquery_API_PageSizeOrUndefined: - nullable: true - type: integer - Security_Solution_Osquery_API_Platform: - type: string - Security_Solution_Osquery_API_PlatformOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Platform' - nullable: true - Security_Solution_Osquery_API_PolicyIds: - items: - type: string - type: array - Security_Solution_Osquery_API_PolicyIdsOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PolicyIds' - nullable: true - Security_Solution_Osquery_API_Query: - type: string - Security_Solution_Osquery_API_QueryOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - nullable: true - Security_Solution_Osquery_API_Removed: - type: boolean - Security_Solution_Osquery_API_RemovedOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Removed' - nullable: true - Security_Solution_Osquery_API_SavedQueryId: - type: string - Security_Solution_Osquery_API_SavedQueryIdOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - nullable: true - Security_Solution_Osquery_API_Shards: - additionalProperties: - type: number - type: object - Security_Solution_Osquery_API_Snapshot: - type: boolean - Security_Solution_Osquery_API_SnapshotOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Snapshot' - nullable: true - Security_Solution_Osquery_API_SortOrderOrUndefined: - oneOf: - - nullable: true type: string - - enum: - - asc - - desc - Security_Solution_Osquery_API_SortOrUndefined: - nullable: true - type: string - Security_Solution_Osquery_API_UpdatePacksRequestBody: + required: + - name + - title + - version + - description + - type + - categories + - conditions + - assets + - format_version + - download + - path + Fleet_package_policy: + allOf: + - type: object + properties: + id: + type: string + inputs: + oneOf: + - items: {} + type: array + - type: object + revision: + type: number + required: + - id + - revision + - $ref: '#/components/schemas/Fleet_new_package_policy' + title: Package policy + Fleet_package_policy_request: + title: Package Policy Request type: object properties: description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - enabled: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_EnabledOrUndefined + description: Package policy description + example: my description + type: string + force: + description: >- + Force package policy creation even if package is not verified, or if + the agent policy is managed. + type: boolean id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + description: Package policy unique identifier + type: string + inputs: + additionalProperties: + type: object + properties: + enabled: + description: 'enable or disable that input, (default to true)' + type: boolean + streams: + additionalProperties: + type: object + properties: + enabled: + description: 'enable or disable that stream, (default to true)' + type: boolean + vars: + description: >- + Stream level variable (see integration documentation for + more information) + type: object + description: >- + Input streams (see integration documentation to know what + streams are available) + type: object + vars: + description: >- + Input level variable (see integration documentation for more + information) + type: object + description: >- + Package policy inputs (see integration documentation to know what + inputs are available) + example: + nginx-logfile: + enabled: true + streams: + nginx.access: + enabled: true + vars: + ignore_older: 72h + paths: + - /var/log/nginx/access.log* + preserve_original_event: false + tags: + - nginx-access + type: object + name: + description: Package policy name (should be unique) + example: nginx-123 + type: string + namespace: + description: >- + The package policy namespace. Leave blank to inherit the agent + policy's namespace. + example: customnamespace + type: string + overrides: + description: >- + Override settings that are defined in the package policy. The + override option should be used only in unusual circumstances and not + as a routine procedure. + nullable: true + type: object + properties: + inputs: + type: object + package: + type: object + properties: + name: + description: Package name + example: nginx + type: string + version: + description: Package version + example: 1.6.0 + type: string + required: + - name + - version + policy_id: + deprecated: true + description: Agent policy ID where that package policy will be added + example: agent-policy-id + type: string policy_ids: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PolicyIdsOrUndefined - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueries' - shards: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Shards' - Security_Solution_Osquery_API_UpdateSavedQueryRequestBody: + description: Agent policy IDs where that package policy will be added + example: + - agent-policy-id + items: + type: string + type: array + vars: + description: >- + Package root level variable (see integration documentation for more + information) + type: object + required: + - name + - package + Fleet_package_usage_stats: + title: Package usage stats type: object properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - interval: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_IntervalOrUndefined - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_Version: - type: string - Security_Solution_Osquery_API_VersionOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Version' - nullable: true - Security_Solution_Timeline_API_BareNote: + agent_policy_count: + type: integer + required: + - agent_policy_count + Fleet_proxies: + title: Fleet Proxy type: object properties: - created: - nullable: true - type: number - createdBy: - nullable: true + certificate: type: string - eventId: - nullable: true + certificate_authorities: type: string - note: - nullable: true + certificate_key: type: string - timelineId: - nullable: true + id: type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true + name: + type: string + proxy_headers: + type: object + url: type: string required: - - timelineId - Security_Solution_Timeline_API_ColumnHeaderResult: - type: object - properties: - aggregatable: - type: boolean - category: + - name + - url + Fleet_saved_object_type: + oneOf: + - enum: + - dashboard + - visualization + - search + - index_pattern + - map + - lens + - security_rule + - csp_rule_template + - ml_module + - tag + - osquery_pack_asset + - osquery_saved_query type: string - columnHeaderType: + - enum: + - index + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy + - ml_model type: string + title: Saved Object type + Fleet_search_result: + title: Search result + type: object + properties: description: type: string - example: - oneOf: - - type: string - - type: number - id: + download: type: string - indexes: - items: - type: string - type: array + icons: + type: string + installationInfo: + $ref: '#/components/schemas/Fleet_installation_info' name: type: string - placeholder: + path: type: string - searchable: - type: boolean - type: + savedObject: + deprecated: true + type: object + status: type: string - Security_Solution_Timeline_API_DataProviderQueryMatch: - type: object - properties: - enabled: - nullable: true - type: boolean - excluded: - nullable: true - type: boolean - id: - nullable: true + title: type: string - kqlQuery: - nullable: true + type: type: string - name: - nullable: true + version: type: string - queryMatch: - $ref: '#/components/schemas/Security_Solution_Timeline_API_QueryMatchResult' - Security_Solution_Timeline_API_DataProviderResult: + required: + - description + - download + - icons + - name + - path + - title + - type + - version + - status + Fleet_settings: + title: Settings type: object properties: - and: + fleet_server_hosts: + deprecated: true items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_DataProviderQueryMatch - nullable: true + type: string type: array - enabled: - nullable: true - type: boolean - excluded: - nullable: true + has_seen_add_data_notice: type: boolean id: - nullable: true type: string - kqlQuery: - nullable: true + prerelease_integrations_enabled: + type: boolean + required: + - fleet_server_hosts + - id + Fleet_upgrade_agent: + title: Upgrade agent + type: object + properties: + force: + description: 'Force upgrade, skipping validation (should be used with caution)' + type: boolean + skipRateLimitCheck: + description: Skip rate limit check for upgrade + type: boolean + source_uri: type: string - name: - nullable: true + version: type: string - queryMatch: - $ref: '#/components/schemas/Security_Solution_Timeline_API_QueryMatchResult' - nullable: true - type: - $ref: '#/components/schemas/Security_Solution_Timeline_API_DataProviderType' - nullable: true - Security_Solution_Timeline_API_DataProviderType: + required: + - version + Fleet_upgrade_agent_diff: + items: + items: + $ref: '#/components/schemas/Fleet_full_agent_policy_input' + type: array + title: Package policy Upgrade dryrun + type: array + Fleet_upgrade_diff: + items: + allOf: + - $ref: '#/components/schemas/Fleet_package_policy' + - allOf: + - $ref: '#/components/schemas/Fleet_new_package_policy' + - type: object + properties: + errors: + items: + type: object + properties: + key: + type: string + message: + type: string + type: array + missingVars: + items: + type: string + type: array + type: object + title: Package policy Upgrade dryrun + type: array + Kibana_HTTP_APIs_core_status_redactedResponse: + additionalProperties: false + description: A minimal representation of Kibana's operational status. + type: object + properties: + status: + additionalProperties: false + type: object + properties: + overall: + additionalProperties: false + type: object + properties: + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + required: + - level + required: + - overall + required: + - status + Kibana_HTTP_APIs_core_status_response: + additionalProperties: false description: >- - The type of data provider to create. Valid values are `default` and - `template`. - enum: - - default - - template - type: string - Security_Solution_Timeline_API_DocumentIds: - oneOf: - - items: - type: string - type: array - - type: string - Security_Solution_Timeline_API_FavoriteTimelineResponse: + Kibana's operational status as well as a detailed breakdown of plugin + statuses indication of various loads (like event loop utilization and + network traffic) at time of request. type: object properties: - code: - nullable: true - type: number - favorite: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResult - type: array - message: - nullable: true - type: string - savedObjectId: + metrics: + additionalProperties: false + description: Metric groups collected by Kibana. + type: object + properties: + collection_interval_in_millis: + description: The interval at which metrics should be collected. + type: number + elasticsearch_client: + additionalProperties: false + description: Current network metrics of Kibana's Elasticsearch client. + type: object + properties: + totalActiveSockets: + description: Count of network sockets currently in use. + type: number + totalIdleSockets: + description: Count of network sockets currently idle. + type: number + totalQueuedRequests: + description: Count of requests not yet assigned to sockets. + type: number + required: + - totalActiveSockets + - totalIdleSockets + - totalQueuedRequests + last_updated: + description: The time metrics were collected. + type: string + required: + - elasticsearch_client + - last_updated + - collection_interval_in_millis + name: + description: Kibana instance name. type: string - templateTimelineId: - nullable: true + status: + additionalProperties: false + type: object + properties: + core: + additionalProperties: false + description: Statuses of core Kibana services. + type: object + properties: + elasticsearch: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: >- + An unstructured set of extra metadata about this + service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + savedObjects: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: >- + An unstructured set of extra metadata about this + service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + required: + - elasticsearch + - savedObjects + overall: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + plugins: + additionalProperties: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + description: A dynamic mapping of plugin ID to plugin status. + type: object + required: + - overall + - core + - plugins + uuid: + description: >- + Unique, generated Kibana instance UUID. This UUID should persist + even if the Kibana process restarts. type: string - templateTimelineVersion: - nullable: true - type: number - timelineType: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' version: - type: string - required: - - savedObjectId - - version - Security_Solution_Timeline_API_FavoriteTimelineResult: - type: object - properties: - favoriteDate: - nullable: true - type: number - fullName: - nullable: true - type: string - userName: - nullable: true - type: string - Security_Solution_Timeline_API_FilterTimelineResult: - type: object - properties: - exists: - type: boolean - match_all: - type: string - meta: + additionalProperties: false type: object properties: - alias: - type: string - controlledBy: - type: string - disabled: - type: boolean - field: - type: string - formattedValue: + build_date: + description: The date and time of this build. type: string - index: + build_flavor: + description: >- + The build flavour determines configuration and behavior of + Kibana. On premise users will almost always run the + "traditional" flavour, while other flavours are reserved for + Elastic-specific use cases. + enum: + - serverless + - traditional type: string - key: + build_hash: + description: >- + A unique hash value representing the git commit of this Kibana + build. type: string - negate: + build_number: + description: >- + A monotonically increasing number, each subsequent build will + have a higher number. + type: number + build_snapshot: + description: Whether this build is a snapshot build. type: boolean - params: - type: string - type: - type: string - value: + number: + description: A semantic version number. type: string - missing: - type: string - query: - type: string - range: + required: + - number + - build_hash + - build_number + - build_snapshot + - build_flavor + - build_date + required: + - name + - uuid + - version + - status + - metrics + Machine_learning_APIs_mlSync200Response: + properties: + datafeedsAdded: + additionalProperties: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' + description: >- + If a saved object for an anomaly detection job is missing a datafeed + identifier, it is added when you run the sync machine learning saved + objects API. + type: object + datafeedsRemoved: + additionalProperties: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' + description: >- + If a saved object for an anomaly detection job references a datafeed + that no longer exists, it is deleted when you run the sync machine + learning saved objects API. + type: object + savedObjectsCreated: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsCreated + savedObjectsDeleted: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted + title: Successful sync API response + type: object + Machine_learning_APIs_mlSync4xxResponse: + properties: + error: + example: Unauthorized type: string - script: + message: type: string - Security_Solution_Timeline_API_ImportTimelineResult: + statusCode: + example: 401 + type: integer + title: Unsuccessful sync API response type: object + Machine_learning_APIs_mlSyncResponseAnomalyDetectors: + description: >- + The sync machine learning saved objects API response contains this + object when there are anomaly detection jobs affected by the + synchronization. There is an object for each relevant job, which + contains the synchronization status. properties: - errors: - items: - type: object - properties: - error: - type: object - properties: - message: - type: string - status_code: - type: number - id: - type: string - type: array success: - type: boolean - success_count: - type: number - timelines_installed: - type: number - timelines_updated: - type: number - Security_Solution_Timeline_API_ImportTimelines: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SavedTimeline' - - type: object - properties: - eventNotes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - nullable: true - type: array - globalNotes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - nullable: true - type: array - pinnedEventIds: - items: - type: string - nullable: true - type: array - savedObjectId: - nullable: true - type: string - version: - nullable: true - type: string - Security_Solution_Timeline_API_Note: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - - type: object - properties: - noteId: - type: string - version: - type: string - Security_Solution_Timeline_API_PinnedEvent: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for anomaly detection jobs type: object + Machine_learning_APIs_mlSyncResponseDatafeeds: + description: >- + The sync machine learning saved objects API response contains this + object when there are datafeeds affected by the synchronization. There + is an object for each relevant datafeed, which contains the + synchronization status. properties: - created: - nullable: true - type: number - createdBy: - nullable: true - type: string - eventId: - type: string - pinnedEventId: - type: string - timelineId: - type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true - type: string - version: - type: string - required: - - eventId - - pinnedEventId - - timelineId - - version - Security_Solution_Timeline_API_QueryMatchResult: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for datafeeds type: object + Machine_learning_APIs_mlSyncResponseDataFrameAnalytics: + description: >- + The sync machine learning saved objects API response contains this + object when there are data frame analytics jobs affected by the + synchronization. There is an object for each relevant job, which + contains the synchronization status. properties: - displayField: - nullable: true - type: string - displayValue: - nullable: true - type: string - field: - nullable: true - type: string - operator: - nullable: true - type: string - value: - nullable: true - type: string - Security_Solution_Timeline_API_Readable: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for data frame analytics jobs type: object + Machine_learning_APIs_mlSyncResponseSavedObjectsCreated: + description: >- + If saved objects are missing for machine learning jobs or trained + models, they are created when you run the sync machine learning saved + objects API. properties: - _data: - additionalProperties: true - type: object - _encoding: - type: string - _events: - additionalProperties: true - type: object - _eventsCount: - type: number - _maxListeners: - additionalProperties: true + anomaly-detector: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors + description: >- + If saved objects are missing for anomaly detection jobs, they are + created. type: object - _position: - type: number - _read: - additionalProperties: true + data-frame-analytics: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics + description: >- + If saved objects are missing for data frame analytics jobs, they are + created. type: object - _readableState: - additionalProperties: true + trained-model: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels + description: 'If saved objects are missing for trained models, they are created.' type: object - readable: - type: boolean - Security_Solution_Timeline_API_RowRendererId: - enum: - - alert - - alerts - - auditd - - auditd_file - - library - - netflow - - plain - - registry - - suricata - - system - - system_dns - - system_endgame_process - - system_file - - system_fim - - system_security_event - - system_socket - - threat_match - - zeek - type: string - Security_Solution_Timeline_API_SavedTimeline: + title: Sync API response for created saved objects type: object + Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted: + description: >- + If saved objects exist for machine learning jobs or trained models that + no longer exist, they are deleted when you run the sync machine learning + saved objects API. properties: - columns: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ColumnHeaderResult - nullable: true - type: array - created: - nullable: true - type: number - createdBy: - nullable: true - type: string - dataProviders: - items: + anomaly-detector: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_DataProviderResult - nullable: true - type: array - dataViewId: - nullable: true - type: string - dateRange: - nullable: true - type: object - properties: - end: - oneOf: - - type: string - - type: number - start: - oneOf: - - type: string - - type: number - description: - nullable: true - type: string - eqlOptions: - nullable: true + #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors + description: >- + If there are saved objects exist for nonexistent anomaly detection + jobs, they are deleted. type: object - properties: - eventCategoryField: - nullable: true - type: string - query: - nullable: true - type: string - size: - oneOf: - - nullable: true - type: string - - nullable: true - type: number - tiebreakerField: - nullable: true - type: string - timestampField: - nullable: true - type: string - eventType: - nullable: true - type: string - excludedRowRendererIds: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_RowRendererId' - nullable: true - type: array - favorite: - items: + data-frame-analytics: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResult - nullable: true - type: array - filters: - items: + #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics + description: >- + If there are saved objects exist for nonexistent data frame + analytics jobs, they are deleted. + type: object + trained-model: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FilterTimelineResult - nullable: true - type: array - indexNames: - items: - type: string - nullable: true - type: array - kqlMode: - nullable: true - type: string - kqlQuery: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SerializedFilterQueryResult - nullable: true - savedQueryId: - nullable: true - type: string - savedSearchId: - nullable: true - type: string - sort: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Sort' - nullable: true - status: - enum: - - active - - draft - - immutable - nullable: true - type: string - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timelineType: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' - nullable: true - title: - nullable: true - type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true - type: string - Security_Solution_Timeline_API_SerializedFilterQueryResult: - type: object - properties: - filterQuery: - nullable: true + #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels + description: >- + If there are saved objects exist for nonexistent trained models, + they are deleted. type: object - properties: - kuery: - nullable: true - type: object - properties: - expression: - nullable: true - type: string - kind: - nullable: true - type: string - serializedQuery: - nullable: true - type: string - Security_Solution_Timeline_API_Sort: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SortObject' - - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_SortObject' - type: array - Security_Solution_Timeline_API_SortFieldTimeline: - description: The field to sort the timelines by. - enum: - - title - - description - - updated - - created - type: string - Security_Solution_Timeline_API_SortObject: + title: Sync API response for deleted saved objects type: object - properties: - columnId: - nullable: true - type: string - columnType: - nullable: true - type: string - sortDirection: - nullable: true - type: string - Security_Solution_Timeline_API_TimelineResponse: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SavedTimeline' - - type: object - properties: - eventIdToNoteIds: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Note' - type: array - noteIds: - items: - type: string - type: array - notes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Note' - type: array - pinnedEventIds: - items: - type: string - type: array - pinnedEventsSaveObject: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_PinnedEvent - type: array - savedObjectId: - type: string - version: - type: string - required: - - savedObjectId - - version - Security_Solution_Timeline_API_TimelineStatus: - description: >- - The status of the timeline. Valid values are `active`, `draft`, and - `immutable`. - enum: - - active - - draft - - immutable - type: string - Security_Solution_Timeline_API_TimelineType: + Machine_learning_APIs_mlSyncResponseSuccess: + description: The success or failure of the synchronization. + type: boolean + Machine_learning_APIs_mlSyncResponseTrainedModels: description: >- - The type of timeline to create. Valid values are `default` and - `template`. - enum: - - default - - template - type: string + The sync machine learning saved objects API response contains this + object when there are trained models affected by the synchronization. + There is an object for each relevant trained model, which contains the + synchronization status. + properties: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for trained models + type: object Serverless_saved_objects_400_response: title: Bad request type: object @@ -25588,16 +18987,17 @@ components: type: object securitySchemes: apiKeyAuth: - description: > - These APIs use key-based authentication. You must create an API key and - use the encoded value in the request header. For example: - `Authorization: ApiKey base64AccessApiKey` + description: >- + You must create an API key and use the encoded value in the request + header. To learn about creating keys, go to [API + keys](https://www.elastic.co/docs/current/serverless/api-keys). in: header name: Authorization type: apiKey security: - apiKeyAuth: [] tags: + - name: alerting - description: > Configure APM agent keys to authorize requests from APM agents to the APM Server. @@ -25609,40 +19009,32 @@ tags: name: APM annotations - description: Connector APIs enable you to create and manage connectors. name: connectors + - name: Data streams - description: >- Data view APIs enable you to manage data views, formerly known as Kibana index patterns. name: data views + - name: Elastic Agent actions + - name: Elastic Agent binary download sources + - name: Elastic Agent policies + - name: Elastic Agent status + - name: Elastic Agents + - name: Elastic Package Manager (EPM) + - name: Fleet enrollment API keys + - name: Fleet internals + - name: Fleet Kubernetes + - name: Fleet outputs + - name: Fleet package policies + - name: Fleet proxies + - name: Fleet Server hosts + - name: Fleet service tokens + - name: Fleet uninstall tokens - description: Machine learning name: ml - description: >- Manage Kibana saved objects, including dashboards, visualizations, and more. name: saved objects - - description: Manage and interact with Security Assistant resources. - name: Security AI Assistant API - - description: >- - You can create rules that automatically turn events and external alerts - sent to Elastic Security into detection alerts. These alerts are displayed - on the Detections page. - name: Security Solution Detections API - - description: Interact with and manage endpoints running the Elastic Defend integration. - name: Security Solution Endpoint Management API - - description: '' - name: Security Solution Entity Analytics API - - description: >- - Exceptions API allows you to manage detection rule exceptions to prevent a - rule from generating an alert from incoming events even when the rule's - other criteria are met. - name: Security Solution Exceptions API - - description: 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.' - name: Security Solution Lists API - - description: 'Run live queries, manage packs and saved queries.' - name: Security Solution Osquery API - - description: >- - You can create Timelines and Timeline templates via the API, as well as - import new Timelines from an ndjson file. - name: Security Solution Timeline API - description: 'SLO APIs enable you to define, manage and track service-level objectives' name: slo - name: system diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 977a910dabf6b..dfe69b9be3400 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -47,168 +47,226 @@ info: For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html). license: - name: Elastic License 2.0 - url: 'https://www.elastic.co/licensing/elastic-license' + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/' title: Kibana APIs version: 1.0.2 + x-feedbackLink: + label: Feedback + url: >- + https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ servers: - url: 'https://{kibana_url}' variables: kibana_url: default: 'localhost:5601' paths: - /api/actions: + /agent_download_sources: get: - deprecated: true - description: Deprecated in 7.13.0. Use the get all connectors API instead. - operationId: legacyGetConnectors + operationId: get-download-sources responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - items: - $ref: '#/components/schemas/Connectors_action_response_properties' - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get all connectors + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_download_sources' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent binary download sources tags: - - connectors + - Elastic Agent binary download sources post: - deprecated: true - description: Deprecated in 7.13.0. Use the create connector API instead. - operationId: legacyCreateConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' + operationId: post-download-sources requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - title: Legacy create connector request properties type: object properties: - actionTypeId: - description: The connector type identifier. + host: type: string - config: - description: >- - The configuration for the connector. Configuration - properties vary depending on the connector type. - type: object + id: + type: string + is_default: + type: boolean name: - description: The display name for the connector. type: string - secrets: - description: > - The secrets configuration for the connector. Secrets - configuration properties vary depending on the connector - type. NOTE: Remember these values. You must provide them - each time you update the connector. - type: object - required: true + required: + - name + - host + - is_default responses: '200': - $ref: '#/components/responses/Connectors_200_actions' - '401': - $ref: '#/components/responses/Connectors_401' - summary: Create a connector + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create agent binary download source tags: - - connectors - '/api/actions/action/{actionId}': + - Elastic Agent binary download sources + '/agent_download_sources/{sourceId}': delete: - deprecated: true - description: > - Deprecated in 7.13.0. Use the delete connector API instead. WARNING: - When you delete a connector, it cannot be recovered. - operationId: legacyDeleteConnector + operationId: delete-download-source parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_action_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: - '204': - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Delete a connector + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + id: + type: string + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent binary download source by ID tags: - - connectors + - Elastic Agent binary download sources get: - deprecated: true - description: Deprecated in 7.13.0. Use the get connector API instead. - operationId: legacyGetConnector - parameters: - - $ref: '#/components/parameters/Connectors_action_id' + operationId: get-one-download-source responses: '200': - $ref: '#/components/responses/Connectors_200_actions' - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get connector information + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent binary download source by ID tags: - - connectors + - Elastic Agent binary download sources + parameters: + - in: path + name: sourceId + required: true + schema: + type: string put: - deprecated: true - description: Deprecated in 7.13.0. Use the update connector API instead. - operationId: legacyUpdateConnector + operationId: update-download-source parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_action_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - description: The properties vary depending on the connector type. + type: object properties: - config: - description: >- - The new connector configuration. Configuration properties - vary depending on the connector type. - type: object + host: + type: string + is_default: + type: boolean name: - description: The new name for the connector. type: string - secrets: - description: >- - The updated secrets configuration for the connector. Secrets - properties vary depending on the connector type. - type: object - title: Legacy update connector request body properties - type: object - required: true + required: + - name + - is_default + - host responses: '200': - $ref: '#/components/responses/Connectors_200_actions' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Update a connector + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_download_sources' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update agent binary download source by ID tags: - - connectors - '/api/actions/action/{actionId}/_execute': + - Elastic Agent binary download sources + /agent_policies: + get: + description: '' + operationId: agent-policy-list + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - description: >- + When set to true, retrieve the related package policies for each + agent policy. + in: query + name: full + schema: + type: boolean + - description: >- + When set to true, do not count how many agents are in the agent + policy, this can improve performance if you are searching over a + large number of agent policies. The "agents" property will always be + 0 if set to true. + in: query + name: noAgentCount + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_agent_policy' + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + - total + - page + - perPage + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent policies + tags: + - Elastic Agent policies post: - deprecated: true - description: Deprecated in 7.13.0. Use the run connector API instead. - operationId: legacyRunConnector + operationId: create-agent-policy parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_action_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - description: The properties vary depending on the connector type. - properties: - params: - description: >- - The parameters of the connector. Parameter properties vary - depending on the connector type. - type: object - required: - - params - title: Legacy run connector request body properties - type: object - required: true + $ref: '#/components/schemas/Fleet_agent_policy_create_request' responses: '200': content: @@ -216,448 +274,477 @@ paths: schema: type: object properties: - actionId: - type: string - data: - oneOf: - - additionalProperties: true - description: Information returned from the action. - type: object - - description: An array of information returned from the action. - items: - type: object - type: array - status: - description: The status of the action. - type: string - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Run a connector + item: + $ref: '#/components/schemas/Fleet_agent_policy' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create agent policy tags: - - connectors - /api/actions/connector: + - Elastic Agent policies + /agent_policies/_bulk_get: post: - description: The connector identifier is randomly generated. - operationId: createConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' + operationId: bulk-get-agent-policies + parameters: [] requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_email_connector_request - createIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_index_connector_request - createWebhookConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_webhook_connector_request - createXmattersConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_xmatters_connector_request schema: - $ref: '#/components/schemas/Connectors_create_connector_request' - required: true + type: object + properties: + full: + description: get full policies with package policies populated + type: boolean + ids: + description: list of agent policy ids + items: + type: string + type: array + ignoreMissing: + type: boolean + required: + - ids responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_email_connector_response - createIndexConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_index_connector_response - createWebhookConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_webhook_connector_response - createXmattersConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_xmatters_connector_response schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Create a connector with a random ID + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_agent_policy' + type: array + required: + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk get agent policies tags: - - connectors - /api/actions/connector_types: + - Elastic Agent policies + '/agent_policies/{agentPolicyId}': get: - operationId: getConnectorTypes - parameters: - - description: >- - A filter to limit the retrieved connector types to those that - support a specific feature (such as alerting or cases). - in: query - name: feature_id - schema: - $ref: '#/components/schemas/Connectors_features' + description: Get one agent policy + operationId: agent-policy-info + parameters: [] responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorTypesServerlessResponse: - $ref: >- - #/components/examples/Connectors_get_connector_types_generativeai_response schema: - description: The properties vary for each connector type. - items: - type: object - properties: - enabled: - description: >- - Indicates whether the connector type is enabled in - Kibana. - example: true - type: boolean - enabled_in_config: - description: >- - Indicates whether the connector type is enabled in the - Kibana configuration file. - example: true - type: boolean - enabled_in_license: - description: >- - Indicates whether the connector is enabled in the - license. - example: true - type: boolean - id: - $ref: '#/components/schemas/Connectors_connector_types' - is_system_action_type: - example: false - type: boolean - minimum_license_required: - description: The license that is required to use the connector type. - example: basic - type: string - name: - description: The name of the connector type. - example: Index - type: string - supported_feature_ids: - description: The features that are supported by the connector type. - example: - - alerting - - cases - - siem - items: - $ref: '#/components/schemas/Connectors_features' - type: array - title: Get connector types response body properties - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get all connector types - tags: - - connectors - '/api/actions/connector/{connectorId}': - delete: - operationId: deleteConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_connector_id' - responses: - '204': - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Delete a connector + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_policy' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent policy by ID tags: - - connectors - get: - operationId: getConnector + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string + put: + operationId: update-agent-policy parameters: - - $ref: '#/components/parameters/Connectors_connector_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_agent_policy_update_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorResponse: - $ref: '#/components/examples/Connectors_get_connector_response' schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Get a connector information + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_policy' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update agent policy by ID tags: - - connectors + - Elastic Agent policies + '/agent_policies/{agentPolicyId}/copy': + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string post: - operationId: createConnectorId + operationId: agent-policy-copy parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - description: > - A UUID v1 or v4 identifier for the connector. If you omit this - parameter, an identifier is randomly generated. - in: path - name: connectorId - required: true - schema: - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_create_index_connector_request schema: - $ref: '#/components/schemas/Connectors_create_connector_request' - required: true + type: object + properties: + description: + type: string + name: + type: string + required: + - name + description: '' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createIndexConnectorResponse: - $ref: >- - #/components/examples/Connectors_create_index_connector_response schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Create a connector + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_policy' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Copy agent policy by ID tags: - - connectors - put: - operationId: updateConnector - parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_connector_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateIndexConnectorRequest: - $ref: >- - #/components/examples/Connectors_update_index_connector_request - schema: - $ref: '#/components/schemas/Connectors_update_connector_request' + - Elastic Agent policies + '/agent_policies/{agentPolicyId}/download': + get: + operationId: agent-policy-download + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Download agent policy by ID + tags: + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId required: true + schema: + type: string + - in: query + name: download + required: false + schema: + type: string + - in: query + name: standalone + required: false + schema: + type: string + - in: query + name: kubernetes + required: false + schema: + type: string + '/agent_policies/{agentPolicyId}/full': + get: + operationId: agent-policy-full responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Connectors_connector_response_properties' - description: Indicates a successful call. + type: object + properties: + item: + oneOf: + - type: string + - $ref: '#/components/schemas/Fleet_agent_policy_full' + description: OK '400': - $ref: '#/components/responses/Connectors_401' - '401': - $ref: '#/components/responses/Connectors_401' - '404': - $ref: '#/components/responses/Connectors_404' - summary: Update a connector + $ref: '#/components/responses/Fleet_error' + summary: Get full agent policy by ID tags: - - connectors - '/api/actions/connector/{connectorId}/_execute': + - Elastic Agent policies + parameters: + - in: path + name: agentPolicyId + required: true + schema: + type: string + - in: query + name: download + required: false + schema: + type: string + - in: query + name: standalone + required: false + schema: + type: string + - in: query + name: kubernetes + required: false + schema: + type: string + /agent_policies/delete: + parameters: [] post: - description: > - You can use this API to test an action that involves interaction with - Kibana services or integrations with third-party systems. You must have - `read` privileges for the **Actions and Connectors** feature in the - **Management** section of the Kibana feature privileges. If you use an - index connector, you must also have `all`, `create`, `index`, or `write` - indices privileges. - operationId: runConnector + operationId: delete-agent-policy parameters: - - $ref: '#/components/parameters/Connectors_kbn_xsrf' - - $ref: '#/components/parameters/Connectors_connector_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - runCasesWebhookConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_cases_webhook_connector_request - runEmailConnectorRequest: - $ref: '#/components/examples/Connectors_run_email_connector_request' - runIndexConnectorRequest: - $ref: '#/components/examples/Connectors_run_index_connector_request' - runJiraConnectorRequest: - $ref: '#/components/examples/Connectors_run_jira_connector_request' - runPagerDutyConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_pagerduty_connector_request - runServerLogConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_server_log_connector_request - runServiceNowITOMConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_servicenow_itom_connector_request - runSlackConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_slack_api_connector_request - runSwimlaneConnectorRequest: - $ref: >- - #/components/examples/Connectors_run_swimlane_connector_request schema: - $ref: '#/components/schemas/Connectors_run_connector_request' - required: true + type: object + properties: + agentPolicyId: + type: string + force: + description: >- + bypass validation checks that can prevent agent policy + deletion + type: boolean + required: + - agentPolicyId responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - runCasesWebhookConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_cases_webhook_connector_response - runEmailConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_email_connector_response - runIndexConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_index_connector_response - runJiraConnectorResponse: - $ref: '#/components/examples/Connectors_run_jira_connector_response' - runPagerDutyConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_pagerduty_connector_response - runServerLogConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_server_log_connector_response - runServiceNowITOMConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_servicenow_itom_connector_response - runSlackConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_slack_api_connector_response - runSwimlaneConnectorResponse: - $ref: >- - #/components/examples/Connectors_run_swimlane_connector_response schema: type: object properties: - connector_id: - description: The identifier for the connector. - type: string - data: - oneOf: - - additionalProperties: true - description: Information returned from the action. - type: object - - description: An array of information returned from the action. - items: - type: object - type: array - status: - description: The status of the action. - enum: - - error - - ok + id: type: string + success: + type: boolean required: - - connector_id - - status - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Run a connector + - id + - success + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent policy by ID tags: - - connectors - /api/actions/connectors: + - Elastic Agent policies + /agent_status: get: - operationId: getConnectors + operationId: get-agent-status + parameters: + - in: query + name: policyId + required: false + schema: + type: string + - deprecated: true + in: query + name: kuery + required: false + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorsResponse: - $ref: '#/components/examples/Connectors_get_connectors_response' schema: - items: - $ref: >- - #/components/schemas/Connectors_connector_response_properties - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get all connectors + type: object + properties: + active: + type: integer + all: + type: integer + error: + type: integer + events: + type: integer + inactive: + type: integer + offline: + type: integer + online: + type: integer + other: + type: integer + total: + deprecated: true + type: integer + unenrolled: + type: integer + updating: + type: integer + required: + - active + - all + - error + - events + - inactive + - offline + - online + - other + - total + - updating + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent status summary tags: - - connectors - /api/actions/list_action_types: + - Elastic Agent status + /agent_status/data: + get: + operationId: get-agent-data + parameters: + - in: query + name: agentsIds + required: true + schema: + items: + type: string + type: array + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + items: + items: + additionalProperties: + type: object + properties: + data: + type: boolean + type: object + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get incoming agent data + tags: + - Elastic Agent status + /agent-status: get: deprecated: true - description: Deprecated in 7.13.0. Use the get all connector types API instead. - operationId: legacyGetConnectorTypes + operationId: get-agent-status-deprecated + parameters: + - in: query + name: policyId + required: false + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - description: The properties vary for each connector type. - items: - type: object - properties: - enabled: - description: >- - Indicates whether the connector type is enabled in - Kibana. - type: boolean - enabledInConfig: - description: >- - Indicates whether the connector type is enabled in the - Kibana `.yml` file. - type: boolean - enabledInLicense: - description: >- - Indicates whether the connector is enabled in the - license. - example: true - type: boolean - id: - description: The unique identifier for the connector type. - type: string - minimumLicenseRequired: - description: The license that is required to use the connector type. - type: string - name: - description: The name of the connector type. - type: string - title: Legacy get connector types response body properties - type: array - description: Indicates a successful call. - '401': - $ref: '#/components/responses/Connectors_401' - summary: Get connector types + type: object + properties: + error: + type: integer + events: + type: integer + inactive: + type: integer + offline: + type: integer + online: + type: integer + other: + type: integer + total: + type: integer + updating: + type: integer + required: + - error + - events + - inactive + - offline + - online + - other + - total + - updating + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent status summary tags: - - connectors - /api/apm/agent_keys: + - Elastic Agent status + /agents: + get: + operationId: get-agents + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - $ref: '#/components/parameters/Fleet_show_inactive' + - $ref: '#/components/parameters/Fleet_show_upgradeable' + - $ref: '#/components/parameters/Fleet_sort_field' + - $ref: '#/components/parameters/Fleet_sort_order' + - $ref: '#/components/parameters/Fleet_with_metrics' + - in: query + name: getStatusSummary + required: false + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_get_agents_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agents + tags: + - Elastic Agents post: - description: Create a new agent key for APM. - operationId: createAgentKey + operationId: get-agents-by-actions + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - name: - type: string - privileges: + actionIds: items: - enum: - - 'event:write' - - 'config_agent:read' type: string type: array + required: + - policy_id required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_agent_get_by_actions' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agents by action ids + tags: + - Elastic Agents + '/agents/{agentId}': + delete: + operationId: delete-agent + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: @@ -665,53 +752,61 @@ paths: schema: type: object properties: - api_key: - type: string - encoded: - type: string - expiration: - format: int64 - type: integer - id: - type: string - name: + action: + enum: + - deleted type: string - description: Agent key created successfully - summary: Create an APM agent key + required: + - action + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete agent by ID tags: - - APM agent keys - '/api/apm/services/{serviceName}/annotation': - post: - description: Create a new annotation for a specific service. - operationId: createAnnotation + - Elastic Agents + get: + operationId: get-agent parameters: - - description: The name of the service - in: path - name: serviceName - required: true - schema: - type: string + - $ref: '#/components/parameters/Fleet_with_metrics' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent by ID + tags: + - Elastic Agents + parameters: + - in: path + name: agentId + required: true + schema: + type: string + put: + operationId: update-agent + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - '@timestamp': - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - version: - type: string tags: items: type: string type: array + user_provided_metadata: + type: object required: true responses: '200': @@ -720,70 +815,36 @@ paths: schema: type: object properties: - _id: - type: string - _index: - type: string - _source: - type: object - properties: - '@timestamp': - type: string - annotation: - type: string - event: - type: object - properties: - created: - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - name: - type: string - version: - type: string - tags: - items: - type: string - type: array - description: Annotation created successfully - summary: Create a service annotation + item: + $ref: '#/components/schemas/Fleet_agent' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update agent by ID tags: - - APM annotations - '/api/apm/services/{serviceName}/annotation/search': - get: - description: Search for annotations related to a specific service. - operationId: getAnnotation + - Elastic Agents + '/agents/{agentId}/actions': + parameters: + - in: path + name: agentId + required: true + schema: + type: string + post: + operationId: new-agent-action parameters: - - description: The name of the service - in: path - name: serviceName - required: true - schema: - type: string - - description: The environment to filter annotations by - in: query - name: environment - required: false - schema: - type: string - - description: The start date for the search - in: query - name: start - required: false - schema: - type: string - - description: The end date for the search - in: query - name: end - required: false - schema: - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + action: + $ref: '#/components/schemas/Fleet_agent_action' + required: true responses: '200': content: @@ -791,243 +852,199 @@ paths: schema: type: object properties: - annotations: + body: items: - type: object - properties: - '@timestamp': - type: number - id: - type: string - text: - type: string - type: - enum: - - version - type: string + type: number type: array - description: Successful response - summary: Search for annotations + headers: + type: string + statusCode: + type: number + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create agent action tags: - - APM annotations - /api/asset_criticality: - delete: - operationId: DeleteAssetCriticalityRecord + - Elastic Agent actions + '/agents/{agentId}/reassign': + parameters: + - in: path + name: agentId + required: true + schema: + type: string + post: + operationId: reassign-agent parameters: - - description: The ID value of the asset. - in: query - name: id_value - required: true - schema: - type: string - - description: The field representing the ID. - example: host.name - in: query - name: id_field - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_IdField - - description: If 'wait_for' the request will wait for the index refresh. - in: query - name: refresh - required: false - schema: - enum: - - wait_for - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + policy_id: + type: string + required: + - policy_id + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - deleted: - description: >- - If the record was deleted. If false the record did not - exist. - type: boolean - record: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - required: - - deleted - description: Successful response + description: OK '400': - description: Invalid request - summary: Delete Criticality Record + $ref: '#/components/responses/Fleet_error' + summary: Reassign agent tags: - - Security Solution Entity Analytics API - get: - operationId: GetAssetCriticalityRecord + - Elastic Agents + put: + deprecated: true + operationId: reassign-agent-deprecated parameters: - - description: The ID value of the asset. - in: query - name: id_value - required: true - schema: - type: string - - description: The field representing the ID. - example: host.name - in: query - name: id_field - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_IdField + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + policy_id: + type: string + required: + - policy_id + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - description: Successful response + type: object + description: OK '400': - description: Invalid request - '404': - description: Criticality record not found - summary: Get Criticality Record + $ref: '#/components/responses/Fleet_error' + summary: Reassign agent tags: - - Security Solution Entity Analytics API + - Elastic Agents + '/agents/{agentId}/request_diagnostics': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - operationId: CreateAssetCriticalityRecord + operationId: request-diagnostics-agent + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - - type: object - properties: - refresh: - description: >- - If 'wait_for' the request will wait for the index - refresh. - enum: - - wait_for - type: string - required: true + type: object + properties: + additional_metrics: + items: + oneOf: + - enum: + - CPU + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - description: Successful response + type: object + properties: + actionId: + type: string + description: OK '400': - description: Invalid request - summary: Create Criticality Record + $ref: '#/components/responses/Fleet_error' + summary: Request agent diagnostics tags: - - Security Solution Entity Analytics API - /api/asset_criticality/bulk: + - Elastic Agents + '/agents/{agentId}/unenroll': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - operationId: BulkUpsertAssetCriticalityRecords + operationId: unenroll-agent + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - example: - records: - - criticality_level: low_impact - id_field: host.name - id_value: host-1 - - criticality_level: medium_impact - id_field: host.name - id_value: host-2 type: object properties: - records: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - maxItems: 1000 - minItems: 1 - type: array - required: - - records + force: + type: boolean + revoke: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - example: - errors: - - index: 0 - message: Invalid ID field - stats: - failed: 1 - successful: 1 - total: 2 + type: object + description: OK + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: type: object properties: - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadErrorItem - type: array - stats: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadStats - required: - - errors - - stats - description: Bulk upload successful - '413': - description: File too large - summary: >- - Bulk upsert asset criticality data, creating or updating records as - needed + error: + type: string + message: + type: string + statusCode: + enum: + - 400 + type: number + description: BAD REQUEST + summary: Unenroll agent tags: - - Security Solution Entity Analytics API - /api/asset_criticality/list: + - Elastic Agents + '/agents/{agentId}/upgrade': + parameters: + - in: path + name: agentId + required: true + schema: + type: string post: - operationId: FindAssetCriticalityRecords + operationId: upgrade-agent parameters: - - description: The field to sort by. - in: query - name: sort_field - required: false - schema: - enum: - - id_value - - id_field - - criticality_level - - \@timestamp - type: string - - description: The order to sort by. - in: query - name: sort_direction - required: false - schema: - enum: - - asc - - desc - type: string - - description: The page number to return. - in: query - name: page - required: false - schema: - minimum: 1 - type: integer - - description: The number of records to return per page. - in: query - name: per_page - required: false - schema: - maximum: 1000 - minimum: 1 - type: integer - - description: The kuery to filter by. - in: query - name: kuery - required: false - schema: - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_upgrade_agent' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_upgrade_agent' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Upgrade agent + tags: + - Elastic Agents + '/agents/{agentId}/uploads': + get: + operationId: list-agent-uploads responses: '200': content: @@ -1035,197 +1052,241 @@ paths: schema: type: object properties: - page: - minimum: 1 - type: integer - per_page: - maximum: 1000 - minimum: 1 - type: integer - records: - items: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecord - type: array - total: - minimum: 0 - type: integer - required: - - records - - page - - per_page - - total - description: Bulk upload successful - summary: 'List asset criticality data, filtering and sorting as needed' + body: + type: object + properties: + item: + items: + $ref: '#/components/schemas/Fleet_agent_diagnostics' + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent uploads tags: - - Security Solution Entity Analytics API - /api/data_views: + - Elastic Agents + parameters: + - in: path + name: agentId + required: true + schema: + type: string + /agents/action_status: get: - operationId: getAllDataViewsDefault + operationId: agents-action-status + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - in: query + name: errorSize + schema: + default: 5 + type: integer responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getAllDataViewsResponse: - $ref: '#/components/examples/Data_views_get_data_views_response' schema: type: object properties: - data_view: + items: items: type: object properties: - id: + actionId: type: string - name: + cancellationTime: type: string - namespaces: + completionTime: + type: string + creationTime: + description: creation time of action + type: string + expiration: + type: string + latestErrors: + description: >- + latest errors that happened when the agents executed + the action items: - type: string + type: object + properties: + agentId: + type: string + error: + type: string + timestamp: + type: string type: array - title: + nbAgentsAck: + description: number of agents that acknowledged the action + type: number + nbAgentsActionCreated: + description: number of agents included in action from kibana + type: number + nbAgentsActioned: + description: number of agents actioned + type: number + nbAgentsFailed: + description: number of agents that failed to execute the action + type: number + newPolicyId: + description: new policy id (POLICY_REASSIGN action) type: string - typeMeta: - type: object + policyId: + description: policy id (POLICY_CHANGE action) + type: string + revision: + description: new policy revision (POLICY_CHANGE action) + type: string + startTime: + description: start time of action (scheduled actions) + type: string + status: + enum: + - COMPLETE + - EXPIRED + - CANCELLED + - FAILED + - IN_PROGRESS + - ROLLOUT_PASSED + type: string + type: + enum: + - POLICY_REASSIGN + - UPGRADE + - UNENROLL + - FORCE_UNENROLL + - UPDATE_TAGS + - CANCEL + - REQUEST_DIAGNOSTICS + - SETTINGS + - POLICY_CHANGE + - INPUT_ACTION + type: string + version: + description: agent version number (UPGRADE action) + type: string + required: + - actionId + - complete + - nbAgentsActioned + - nbAgentsActionCreated + - nbAgentsAck + - nbAgentsFailed + - status + - creationTime + - type type: array - description: Indicates a successful call. + required: + - items + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Get all data views + $ref: '#/components/responses/Fleet_error' + summary: Get agent action status tags: - - data views - /api/data_views/data_view: + - Elastic Agent actions + '/agents/actions/{actionId}/cancel': + parameters: + - in: path + name: actionId + required: true + schema: + type: string post: - operationId: createDataViewDefaultw + operationId: agent-action-cancel parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createDataViewRequest: - $ref: '#/components/examples/Data_views_create_data_view_request' - schema: - $ref: '#/components/schemas/Data_views_create_data_view_request_object' - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_agent_action' + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Create a data view - tags: - - data views - '/api/data_views/data_view/{viewId}': - delete: - description: | - WARNING: When you delete a data view, it cannot be recovered. - operationId: deleteDataViewDefault - parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' - responses: - '204': - description: Indicates a successful call. - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Delete a data view - tags: - - data views - get: - operationId: getDataViewDefault - parameters: - - $ref: '#/components/parameters/Data_views_view_id' - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - getDataViewResponse: - $ref: '#/components/examples/Data_views_get_data_view_response' - schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Get a data view + $ref: '#/components/responses/Fleet_error' + summary: Cancel agent action tags: - - data views + - Elastic Agent actions + /agents/bulk_reassign: post: - operationId: updateDataViewDefault + operationId: bulk-reassign-agents parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateDataViewRequest: - $ref: '#/components/examples/Data_views_update_data_view_request' + example: + agents: 'fleet-agents.policy_id : ("policy1" or "policy2")' + policy_id: policy_id schema: - $ref: '#/components/schemas/Data_views_update_data_view_request_object' - required: true + type: object + properties: + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + policy_id: + description: new agent policy id + type: string + required: + - policy_id + - agents responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_data_view_response_object' - description: Indicates a successful call. + type: object + properties: + actionId: + type: string + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update a data view + $ref: '#/components/responses/Fleet_error' + summary: Bulk reassign agents tags: - - data views - '/api/data_views/data_view/{viewId}/fields': + - Elastic Agents + /agents/bulk_request_diagnostics: post: - description: > - Update fields presentation metadata such as count, customLabel, - customDescription, and format. - operationId: updateFieldsMetadataDefault + operationId: bulk-request-diagnostics parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateFieldsMetadataRequest: - $ref: '#/components/examples/Data_views_update_field_metadata_request' + example: + agents: 'fleet-agents.policy_id : ("policy1" or "policy2")' schema: type: object properties: - fields: - description: The field object. - type: object + additional_metrics: + items: + oneOf: + - enum: + - CPU + type: string + type: array + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + batchSize: + type: number required: - - fields - required: true + - agents responses: '200': content: @@ -1233,87 +1294,106 @@ paths: schema: type: object properties: - acknowledged: - type: boolean - description: Indicates a successful call. + actionId: + type: string + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update data view fields metadata + $ref: '#/components/responses/Fleet_error' + summary: Bulk request diagnostics from agents tags: - - data views - '/api/data_views/data_view/{viewId}/runtime_field': + - Elastic Agents + /agents/bulk_unenroll: post: - operationId: createRuntimeFieldDefault + operationId: bulk-unenroll-agents parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - createRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_create_runtime_field_request' + example: + agents: + - agent1 + - agent2 + force: false + revoke: true schema: type: object properties: - name: - description: | - The name for a runtime field. - type: string - runtimeField: - description: | - The runtime field definition object. - type: object + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + force: + description: Unenrolls hosted agents too + type: boolean + includeInactive: + description: >- + When passing agents by KQL query, unenrolls inactive agents + too + type: boolean + revoke: + description: Revokes API keys of agents + type: boolean required: - - name - - runtimeField - required: true + - agents responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. - summary: Create a runtime field + properties: + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk unenroll agents tags: - - data views - put: - operationId: createUpdateRuntimeFieldDefault + - Elastic Agents + /agents/bulk_update_agent_tags: + post: + operationId: bulk-update-agent-tags parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' - - description: | - The ID of the data view fields you want to update. - in: path - name: viewId - required: true - schema: - type: string + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_create_runtime_field_request' + example: + agents: + - agent1 + - agent2 + tagsToAdd: + - newTag + tagsToRemove: + - existingTag schema: type: object properties: - name: - description: | - The name for a runtime field. - type: string - runtimeField: - description: | - The runtime field definition object. - type: object + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + batchSize: + type: number + tagsToAdd: + items: + type: string + type: array + tagsToRemove: + items: + type: string + type: array required: - - name - - runtimeField - required: true + - agents responses: '200': content: @@ -1321,245 +1401,322 @@ paths: schema: type: object properties: - data_view: - type: object - fields: - items: - type: object - type: array - description: Indicates a successful call. + actionId: + type: string + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk update agent tags + tags: + - Elastic Agents + /agents/bulk_upgrade: + post: + operationId: bulk-upgrade-agents + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + example: + agents: + - agent1 + - agent2 + rollout_duration_seconds: 3600 + source_uri: 'https://artifacts.elastic.co/downloads/beats/elastic-agent' + start_time: '2022-08-03T14:00:00.000Z' + version: 8.4.0 + schema: + $ref: '#/components/schemas/Fleet_bulk_upgrade_agents' + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Create or update a runtime field + type: object + properties: + actionId: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk upgrade agents tags: - - data views - '/api/data_views/data_view/{viewId}/runtime_field/{fieldName}': + - Elastic Agents + '/agents/files/{fileId}': delete: - operationId: deleteRuntimeFieldDefault - parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + operationId: delete-agent-upload-file responses: '200': - description: Indicates a successful call. - '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Delete a runtime field from a data view + type: object + properties: + body: + type: object + properties: + deleted: + type: boolean + id: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete file uploaded by agent tags: - - data views + - Elastic Agents + parameters: + - in: path + name: fileId + required: true + schema: + type: string + '/agents/files/{fileId}/{fileName}': get: - operationId: getRuntimeFieldDefault - parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + operationId: get-agent-upload-file responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getRuntimeFieldResponse: - $ref: '#/components/examples/Data_views_get_runtime_field_response' schema: type: object properties: - data_view: + body: type: object - fields: - items: - type: object - type: array - description: Indicates a successful call. - '404': + properties: + items: + type: object + properties: + body: {} + headers: {} + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get file uploaded by agent + tags: + - Elastic Agents + parameters: + - in: path + name: fileId + required: true + schema: + type: string + - in: path + name: fileName + required: true + schema: + type: string + /agents/setup: + get: + operationId: get-agents-setup-status + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_404_response' - description: Object is not found. - summary: Get a runtime field + $ref: '#/components/schemas/Fleet_fleet_status_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get agent setup info tags: - - data views + - Elastic Agents post: - operationId: updateRuntimeFieldDefault + operationId: setup-agents parameters: - - $ref: '#/components/parameters/Data_views_field_name' - - $ref: '#/components/parameters/Data_views_view_id' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/Data_views_update_runtime_field_request' schema: type: object properties: - runtimeField: - description: | - The runtime field definition object. - - You can update following fields: - - - `type` - - `script` - type: object + admin_password: + type: string + admin_username: + type: string required: - - runtimeField - required: true + - admin_username + - admin_password responses: '200': - description: Indicates a successful call. - '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Update a runtime field + $ref: '#/components/schemas/Fleet_fleet_setup_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Initiate agent setup tags: - - data views - /api/data_views/default: + - Elastic Agents + /agents/tags: get: - operationId: getDefaultDataViewDefault + operationId: get-agent-tags responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getDefaultDataViewResponse: - $ref: >- - #/components/examples/Data_views_get_default_data_view_response schema: - type: object - properties: - data_view_id: - type: string - description: Indicates a successful call. + $ref: '#/components/schemas/Fleet_get_agent_tags_response' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List agent tags + tags: + - Elastic Agents + /api/actions: + get: + deprecated: true + description: Deprecated in 7.13.0. Use the get all connectors API instead. + operationId: legacyGetConnectors + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Get the default data view + items: + $ref: '#/components/schemas/Connectors_action_response_properties' + type: array + description: Indicates a successful call. + '401': + $ref: '#/components/responses/Connectors_401' + summary: Get all connectors tags: - - data views + - connectors post: - operationId: setDefaultDatailViewDefault + deprecated: true + description: Deprecated in 7.13.0. Use the create connector API instead. + operationId: legacyCreateConnector parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - setDefaultDataViewRequest: - $ref: '#/components/examples/Data_views_set_default_data_view_request' schema: + title: Legacy create connector request properties type: object properties: - data_view_id: - description: > - The data view identifier. NOTE: The API does not validate - whether it is a valid identifier. Use `null` to unset the - default data view. - nullable: true + actionTypeId: + description: The connector type identifier. type: string - force: - default: false - description: Update an existing default data view identifier. - type: boolean - required: - - data_view_id + config: + description: >- + The configuration for the connector. Configuration + properties vary depending on the connector type. + type: object + name: + description: The display name for the connector. + type: string + secrets: + description: > + The secrets configuration for the connector. Secrets + configuration properties vary depending on the connector + type. NOTE: Remember these values. You must provide them + each time you update the connector. + type: object required: true responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - acknowledged: - type: boolean - description: Indicates a successful call. - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Data_views_400_response' - description: Bad request - summary: Set the default data view + $ref: '#/components/responses/Connectors_200_actions' + '401': + $ref: '#/components/responses/Connectors_401' + summary: Create a connector tags: - - data views - /api/data_views/swap_references: - post: + - connectors + '/api/actions/action/{actionId}': + delete: + deprecated: true description: > - Changes saved object references from one data view identifier to - another. WARNING: Misuse can break large numbers of saved objects! - Practicing with a backup is recommended. - operationId: swapDataViewsDefault + Deprecated in 7.13.0. Use the delete connector API instead. WARNING: + When you delete a connector, it cannot be recovered. + operationId: legacyDeleteConnector parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_action_id' + responses: + '204': + description: Indicates a successful call. + '401': + $ref: '#/components/responses/Connectors_401' + summary: Delete a connector + tags: + - connectors + get: + deprecated: true + description: Deprecated in 7.13.0. Use the get connector API instead. + operationId: legacyGetConnector + parameters: + - $ref: '#/components/parameters/Connectors_action_id' + responses: + '200': + $ref: '#/components/responses/Connectors_200_actions' + '401': + $ref: '#/components/responses/Connectors_401' + summary: Get connector information + tags: + - connectors + put: + deprecated: true + description: Deprecated in 7.13.0. Use the update connector API instead. + operationId: legacyUpdateConnector + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_action_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - swapDataViewRequest: - $ref: '#/components/examples/Data_views_swap_data_view_request' schema: - $ref: '#/components/schemas/Data_views_swap_data_view_request_object' + description: The properties vary depending on the connector type. + properties: + config: + description: >- + The new connector configuration. Configuration properties + vary depending on the connector type. + type: object + name: + description: The new name for the connector. + type: string + secrets: + description: >- + The updated secrets configuration for the connector. Secrets + properties vary depending on the connector type. + type: object + title: Legacy update connector request body properties + type: object required: true responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - deleteStatus: - type: object - properties: - deletePerformed: - type: boolean - remainingRefs: - type: integer - result: - items: - type: object - properties: - id: - description: A saved object identifier. - type: string - type: - description: The saved object type. - type: string - type: array - description: Indicates a successful call. - summary: Swap saved object references + $ref: '#/components/responses/Connectors_200_actions' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Update a connector tags: - - data views - /api/data_views/swap_references/_preview: + - connectors + '/api/actions/action/{actionId}/_execute': post: - description: > - Preview the impact of swapping saved object references from one data - view identifier to another. - operationId: previewSwapDataViewsDefault + deprecated: true + description: Deprecated in 7.13.0. Use the run connector API instead. + operationId: legacyRunConnector parameters: - - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_action_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - previewSwapDataViewRequest: - $ref: >- - #/components/examples/Data_views_preview_swap_data_view_request schema: - $ref: '#/components/schemas/Data_views_swap_data_view_request_object' + description: The properties vary depending on the connector type. + properties: + params: + description: >- + The parameters of the connector. Parameter properties vary + depending on the connector type. + type: object + required: + - params + title: Legacy run connector request body properties + type: object required: true responses: '200': @@ -1568,970 +1725,1999 @@ paths: schema: type: object properties: - result: - items: - type: object - properties: - id: - description: A saved object identifier. - type: string - type: - description: The saved object type. - type: string - type: array + actionId: + type: string + data: + oneOf: + - additionalProperties: true + description: Information returned from the action. + type: object + - description: An array of information returned from the action. + items: + type: object + type: array + status: + description: The status of the action. + type: string description: Indicates a successful call. - summary: Preview a saved object reference swap + '401': + $ref: '#/components/responses/Connectors_401' + summary: Run a connector tags: - - data views - /api/detection_engine/index: - delete: - operationId: DeleteAlertsIndex + - connectors + /api/actions/connector: + post: + description: The connector identifier is randomly generated. + operationId: createConnector + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_email_connector_request + createIndexConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_index_connector_request + createWebhookConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_webhook_connector_request + createXmattersConnectorRequest: + $ref: >- + #/components/examples/Connectors_create_xmatters_connector_request + schema: + $ref: '#/components/schemas/Connectors_create_connector_request' + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_email_connector_response + createIndexConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_index_connector_response + createWebhookConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_webhook_connector_response + createXmattersConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_xmatters_connector_response schema: - type: object - properties: - acknowledged: - type: boolean - required: - - acknowledged - description: Successful response + $ref: '#/components/schemas/Connectors_connector_response_properties' + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Not enough permissions response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: string - description: Index does not exist response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Delete an alerts index + $ref: '#/components/responses/Connectors_401' + summary: Create a connector with a random ID tags: - - Security Solution Detections API - - Alert index API + - connectors + /api/actions/connector_types: get: - operationId: ReadAlertsIndex + operationId: getConnectorTypes + parameters: + - description: >- + A filter to limit the retrieved connector types to those that + support a specific feature (such as alerting or cases). + in: query + name: feature_id + schema: + $ref: '#/components/schemas/Connectors_features' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorTypesServerlessResponse: + $ref: >- + #/components/examples/Connectors_get_connector_types_generativeai_response schema: - type: object - properties: - index_mapping_outdated: - nullable: true - type: boolean - name: - type: string - required: - - name - - index_mapping_outdated - description: Successful response + description: The properties vary for each connector type. + items: + type: object + properties: + enabled: + description: >- + Indicates whether the connector type is enabled in + Kibana. + example: true + type: boolean + enabled_in_config: + description: >- + Indicates whether the connector type is enabled in the + Kibana configuration file. + example: true + type: boolean + enabled_in_license: + description: >- + Indicates whether the connector is enabled in the + license. + example: true + type: boolean + id: + $ref: '#/components/schemas/Connectors_connector_types' + is_system_action_type: + example: false + type: boolean + minimum_license_required: + description: The license that is required to use the connector type. + example: basic + type: string + name: + description: The name of the connector type. + example: Index + type: string + supported_feature_ids: + description: The features that are supported by the connector type. + example: + - alerting + - cases + - siem + items: + $ref: '#/components/schemas/Connectors_features' + type: array + title: Get connector types response body properties + type: array + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Not enough permissions response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Reads the alert index name if it exists + $ref: '#/components/responses/Connectors_401' + summary: Get all connector types tags: - - Security Solution Detections API - - Alert index API - post: - operationId: CreateAlertsIndex + - connectors + '/api/actions/connector/{connectorId}': + delete: + operationId: deleteConnector + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_connector_id' responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - acknowledged: - type: boolean - required: - - acknowledged - description: Successful response + '204': + description: Indicates a successful call. '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Not enough permissions response + $ref: '#/components/responses/Connectors_401' '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Create an alerts index + $ref: '#/components/responses/Connectors_404' + summary: Delete a connector tags: - - Security Solution Detections API - - Alert index API - /api/detection_engine/privileges: + - connectors get: - description: > - Retrieves whether or not the user is authenticated, and the user's - Kibana - - space and index privileges, which determine if the user can create an - - index for the Elastic Security alerts generated by - - detection engine rules. - operationId: ReadPrivileges - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - has_encryption_key: - type: boolean - is_authenticated: - type: boolean - required: - - is_authenticated - - has_encryption_key - description: Successful response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Returns user privileges for the Kibana space - tags: - - Security Solution Detections API - - Privileges API - /api/detection_engine/rules: - delete: - description: Delete a detection rule using the `rule_id` or `id` field. - operationId: DeleteRule + operationId: getConnector parameters: - - description: The rule's `id` value. - in: query - name: id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - - description: The rule's `rule_id` value. - in: query - name: rule_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId + - $ref: '#/components/parameters/Connectors_connector_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorResponse: + $ref: '#/components/examples/Connectors_get_connector_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse + $ref: '#/components/schemas/Connectors_connector_response_properties' description: Indicates a successful call. - summary: Delete a detection rule + '401': + $ref: '#/components/responses/Connectors_401' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Get a connector information tags: - - Security Solution Detections API - - Rules API - get: - description: Retrieve a detection rule using the `rule_id` or `id` field. - operationId: ReadRule + - connectors + post: + operationId: createConnectorId parameters: - - description: The rule's `id` value. - in: query - name: id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - - description: The rule's `rule_id` value. - in: query - name: rule_id - required: false + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - description: > + A UUID v1 or v4 identifier for the connector. If you omit this + parameter, an identifier is randomly generated. + in: path + name: connectorId + required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Retrieve a detection rule - tags: - - Security Solution Detections API - - Rules API - patch: - description: >- - Update specific fields of an existing detection rule using the `rule_id` - or `id` field. - operationId: PatchRule + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePatchProps - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: + examples: + createIndexConnectorRequest: $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse - description: Indicates a successful call. - summary: Patch a detection rule - tags: - - Security Solution Detections API - - Rules API - post: - description: Create a new detection rule. - operationId: CreateRule - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: + #/components/examples/Connectors_create_index_connector_request schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleCreateProps + $ref: '#/components/schemas/Connectors_create_connector_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createIndexConnectorResponse: + $ref: >- + #/components/examples/Connectors_create_index_connector_response schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse + $ref: '#/components/schemas/Connectors_connector_response_properties' description: Indicates a successful call. - summary: Create a detection rule + '401': + $ref: '#/components/responses/Connectors_401' + summary: Create a connector tags: - - Security Solution Detections API - - Rules API + - connectors put: - description: > - Update a detection rule using the `rule_id` or `id` field. The original - rule is replaced, and all unspecified fields are deleted. - - > info - - > You cannot modify the `id` or `rule_id` values. - operationId: UpdateRule + operationId: updateConnector + parameters: + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_connector_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateIndexConnectorRequest: + $ref: >- + #/components/examples/Connectors_update_index_connector_request schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleUpdateProps + $ref: '#/components/schemas/Connectors_update_connector_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse + $ref: '#/components/schemas/Connectors_connector_response_properties' description: Indicates a successful call. - summary: Update a detection rule + '400': + $ref: '#/components/responses/Connectors_401' + '401': + $ref: '#/components/responses/Connectors_401' + '404': + $ref: '#/components/responses/Connectors_404' + summary: Update a connector tags: - - Security Solution Detections API - - Rules API - /api/detection_engine/rules/_bulk_action: + - connectors + '/api/actions/connector/{connectorId}/_execute': post: - description: >- - Apply a bulk action, such as bulk edit, duplicate, or delete, to - multiple detection rules. The bulk action is applied to all rules that - match the query or to the rules listed by their IDs. - operationId: PerformRulesBulkAction + description: > + You can use this API to test an action that involves interaction with + Kibana services or integrations with third-party systems. You must have + `read` privileges for the **Actions and Connectors** feature in the + **Management** section of the Kibana feature privileges. If you use an + index connector, you must also have `all`, `create`, `index`, or `write` + indices privileges. + operationId: runConnector parameters: - - description: Enables dry run mode for the request call. - in: query - name: dry_run - required: false - schema: - type: boolean + - $ref: '#/components/parameters/Connectors_kbn_xsrf' + - $ref: '#/components/parameters/Connectors_connector_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + runCasesWebhookConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_cases_webhook_connector_request + runEmailConnectorRequest: + $ref: '#/components/examples/Connectors_run_email_connector_request' + runIndexConnectorRequest: + $ref: '#/components/examples/Connectors_run_index_connector_request' + runJiraConnectorRequest: + $ref: '#/components/examples/Connectors_run_jira_connector_request' + runPagerDutyConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_pagerduty_connector_request + runServerLogConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_server_log_connector_request + runServiceNowITOMConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_servicenow_itom_connector_request + runSlackConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_slack_api_connector_request + runSwimlaneConnectorRequest: + $ref: >- + #/components/examples/Connectors_run_swimlane_connector_request schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDeleteRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDisableRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEnableRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkExportRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkDuplicateRules - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkManualRuleRun - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditRules + $ref: '#/components/schemas/Connectors_run_connector_request' + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + runCasesWebhookConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_cases_webhook_connector_response + runEmailConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_email_connector_response + runIndexConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_index_connector_response + runJiraConnectorResponse: + $ref: '#/components/examples/Connectors_run_jira_connector_response' + runPagerDutyConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_pagerduty_connector_response + runServerLogConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_server_log_connector_response + runServiceNowITOMConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_servicenow_itom_connector_response + runSlackConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_slack_api_connector_response + runSwimlaneConnectorResponse: + $ref: >- + #/components/examples/Connectors_run_swimlane_connector_response schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkExportActionResponse - description: OK - summary: Apply a bulk action to detection rules + type: object + properties: + connector_id: + description: The identifier for the connector. + type: string + data: + oneOf: + - additionalProperties: true + description: Information returned from the action. + type: object + - description: An array of information returned from the action. + items: + type: object + type: array + status: + description: The status of the action. + enum: + - error + - ok + type: string + required: + - connector_id + - status + description: Indicates a successful call. + '401': + $ref: '#/components/responses/Connectors_401' + summary: Run a connector tags: - - Security Solution Detections API - - Bulk API - /api/detection_engine/rules/_bulk_create: - post: - deprecated: true - description: Create new detection rules in bulk. - operationId: BulkCreateRules - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleCreateProps - type: array - description: 'A JSON array of rules, where each rule contains the required fields.' - required: true + - connectors + /api/actions/connectors: + get: + operationId: getConnectors responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorsResponse: + $ref: '#/components/examples/Connectors_get_connectors_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkCrudRulesResponse + items: + $ref: >- + #/components/schemas/Connectors_connector_response_properties + type: array description: Indicates a successful call. - summary: Create multiple detection rules + '401': + $ref: '#/components/responses/Connectors_401' + summary: Get all connectors tags: - - Security Solution Detections API - - Bulk API - /api/detection_engine/rules/_bulk_delete: - delete: + - connectors + /api/actions/list_action_types: + get: deprecated: true - description: Delete detection rules in bulk. - operationId: BulkDeleteRules - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - type: object - properties: - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - type: array - description: >- - A JSON array of `id` or `rule_id` fields of the rules you want to - delete. - required: true + description: Deprecated in 7.13.0. Use the get all connector types API instead. + operationId: legacyGetConnectorTypes responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkCrudRulesResponse + description: The properties vary for each connector type. + items: + type: object + properties: + enabled: + description: >- + Indicates whether the connector type is enabled in + Kibana. + type: boolean + enabledInConfig: + description: >- + Indicates whether the connector type is enabled in the + Kibana `.yml` file. + type: boolean + enabledInLicense: + description: >- + Indicates whether the connector is enabled in the + license. + example: true + type: boolean + id: + description: The unique identifier for the connector type. + type: string + minimumLicenseRequired: + description: The license that is required to use the connector type. + type: string + name: + description: The name of the connector type. + type: string + title: Legacy get connector types response body properties + type: array description: Indicates a successful call. - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Delete multiple detection rules + $ref: '#/components/responses/Connectors_401' + summary: Get connector types tags: - - Security Solution Detections API - - Bulk API - post: - deprecated: true - description: Deletes multiple rules. - operationId: BulkDeleteRulesPost - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - type: object - properties: - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - type: array - description: >- - A JSON array of `id` or `rule_id` fields of the rules you want to - delete. - required: true + - connectors + /api/alerting/_health: + get: + description: > + You must have `read` privileges for the **Management > Stack Rules** + feature or for at least one of the **Analytics > Discover**, **Analytics + > Machine Learning**, **Observability**, or **Security** features. + operationId: getAlertingHealth responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getAlertingHealthResponse: + $ref: '#/components/examples/Alerting_get_health_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkCrudRulesResponse + type: object + properties: + alerting_framework_health: + description: > + Three substates identify the health of the alerting + framework: `decryption_health`, `execution_health`, and + `read_health`. + type: object + properties: + decryption_health: + description: The timestamp and status of the rule decryption. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + execution_health: + description: The timestamp and status of the rule run. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + read_health: + description: The timestamp and status of the rule reading events. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + has_permanent_encryption_key: + description: >- + If `false`, the encrypted saved object plugin does not + have a permanent encryption key. + example: true + type: boolean + is_sufficiently_secure: + description: 'If `false`, security is enabled but TLS is not.' + example: true + type: boolean description: Indicates a successful call. - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Delete multiple detection rules + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get the alerting framework health tags: - - Security Solution Detections API - - Bulk API - /api/detection_engine/rules/_bulk_update: - patch: - deprecated: true - description: >- - Update specific fields of existing detection rules using the `rule_id` - or `id` field. - operationId: BulkPatchRules - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePatchProps - type: array - description: 'A JSON array of rules, where each rule contains the required fields.' - required: true + - alerting + /api/alerting/rule_types: + get: + description: > + If you have `read` privileges for one or more Kibana features, the API + response contains information about the appropriate rule types. For + example, there are rule types associated with the **Management > Stack + Rules** feature, **Analytics > Discover** and **Machine Learning** + features, **Observability** features, and **Security** features. To get + rule types associated with the **Stack Monitoring** feature, use the + `monitoring_user` built-in role. + operationId: getRuleTypes responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getRuleTypesResponse: + $ref: '#/components/examples/Alerting_get_rule_types_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkCrudRulesResponse - description: Indicates a successful call. - summary: Patch multiple detection rules - tags: - - Security Solution Detections API - - Bulk API - put: - deprecated: true - description: > - Update multiple detection rules using the `rule_id` or `id` field. The - original rules are replaced, and all unspecified fields are deleted. - - > info - - > You cannot modify the `id` or `rule_id` values. - operationId: BulkUpdateRules - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleUpdateProps - type: array - description: >- - A JSON array where each element includes the `id` or `rule_id` field - of the rule you want to update and the fields you want to modify. - required: true - responses: - '200': + items: + type: object + properties: + action_groups: + description: > + An explicit list of groups for which the rule type can + schedule actions, each with the action group's unique ID + and human readable name. Rule actions validation uses + this configuration to ensure that groups are valid. + items: + type: object + properties: + id: + type: string + name: + type: string + type: array + action_variables: + description: > + A list of action variables that the rule type makes + available via context and state in action parameter + templates, and a short human readable description. When + you create a rule in Kibana, it uses this information to + prompt you for these variables in action parameter + editors. + type: object + properties: + context: + items: + type: object + properties: + description: + type: string + name: + type: string + useWithTripleBracesInTemplates: + type: boolean + type: array + params: + items: + type: object + properties: + description: + type: string + name: + type: string + type: array + state: + items: + type: object + properties: + description: + type: string + name: + type: string + type: array + alerts: + description: > + Details for writing alerts as data documents for this + rule type. + type: object + properties: + context: + description: | + The namespace for this rule type. + enum: + - ml.anomaly-detection + - observability.apm + - observability.logs + - observability.metrics + - observability.slo + - observability.threshold + - observability.uptime + - security + - stack + type: string + dynamic: + description: Indicates whether new fields are added dynamically. + enum: + - 'false' + - runtime + - strict + - 'true' + type: string + isSpaceAware: + description: > + Indicates whether the alerts are space-aware. If + true, space-specific alert indices are used. + type: boolean + mappings: + type: object + properties: + fieldMap: + additionalProperties: + $ref: >- + #/components/schemas/Alerting_fieldmap_properties + description: > + Mapping information for each field supported in + alerts as data documents for this rule type. For + more information about mapping parameters, refer + to the Elasticsearch documentation. + type: object + secondaryAlias: + description: > + A secondary alias. It is typically used to support + the signals alias for detection rules. + type: string + shouldWrite: + description: > + Indicates whether the rule should write out alerts + as data. + type: boolean + useEcs: + description: > + Indicates whether to include the ECS component + template for the alerts. + type: boolean + useLegacyAlerts: + default: false + description: > + Indicates whether to include the legacy component + template for the alerts. + type: boolean + authorized_consumers: + description: >- + The list of the plugins IDs that have access to the rule + type. + type: object + properties: + alerts: + type: object + properties: + all: + type: boolean + read: + type: boolean + apm: + type: object + properties: + all: + type: boolean + read: + type: boolean + discover: + type: object + properties: + all: + type: boolean + read: + type: boolean + infrastructure: + type: object + properties: + all: + type: boolean + read: + type: boolean + logs: + type: object + properties: + all: + type: boolean + read: + type: boolean + ml: + type: object + properties: + all: + type: boolean + read: + type: boolean + monitoring: + type: object + properties: + all: + type: boolean + read: + type: boolean + siem: + type: object + properties: + all: + type: boolean + read: + type: boolean + slo: + type: object + properties: + all: + type: boolean + read: + type: boolean + stackAlerts: + type: object + properties: + all: + type: boolean + read: + type: boolean + uptime: + type: object + properties: + all: + type: boolean + read: + type: boolean + category: + description: >- + The rule category, which is used by features such as + category-specific maintenance windows. + enum: + - management + - observability + - securitySolution + type: string + default_action_group_id: + description: The default identifier for the rule type group. + type: string + does_set_recovery_context: + description: >- + Indicates whether the rule passes context variables to + its recovery action. + type: boolean + enabled_in_license: + description: >- + Indicates whether the rule type is enabled or disabled + based on the subscription. + type: boolean + has_alerts_mappings: + description: >- + Indicates whether the rule type has custom mappings for + the alert data. + type: boolean + has_fields_for_a_a_d: + type: boolean + id: + description: The unique identifier for the rule type. + type: string + is_exportable: + description: >- + Indicates whether the rule type is exportable in **Stack + Management > Saved Objects**. + type: boolean + minimum_license_required: + description: The subscriptions required to use the rule type. + example: basic + type: string + name: + description: The descriptive name of the rule type. + type: string + producer: + description: >- + An identifier for the application that produces this + rule type. + example: stackAlerts + type: string + recovery_action_group: + description: >- + An action group to use when an alert goes from an active + state to an inactive one. + type: object + properties: + id: + type: string + name: + type: string + rule_task_timeout: + example: 5m + type: string + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkCrudRulesResponse - description: Indicates a successful call. - summary: Update multiple detection rules + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get the rule types tags: - - Security Solution Detections API - - Bulk API - /api/detection_engine/rules/_export: - post: - description: > - Export detection rules to an `.ndjson` file. The following configuration - items are also included in the `.ndjson` file: - - - Actions - - - Exception lists - - > info - - > You cannot export prebuilt rules. - operationId: ExportRules + - alerting + '/api/alerting/rule/{id}': + delete: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2' parameters: - - description: Determines whether a summary of the exported rules is returned. - in: query - name: exclude_export_details - required: false + - description: The version of the API to use + in: header + name: elastic-api-version schema: - default: false - type: boolean - - description: File name for saving the exported rules. - in: query - name: file_name - required: false + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true schema: - default: export.ndjson type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - nullable: true - type: object - properties: - objects: - description: >- - Array of `rule_id` fields. Exports all rules when - unspecified. - items: - type: object - properties: - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - required: - - rule_id - type: array - required: - - objects - required: false responses: - '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: An `.ndjson` file containing the returned rules. - format: binary - type: string + '204': description: Indicates a successful call. - summary: Export detection rules + summary: Delete a rule tags: - - Security Solution Detections API - - Import/Export API - /api/detection_engine/rules/_find: + - alerting get: - description: >- - Retrieve a paginated list of detection rules. By default, the first page - is returned, with 20 results per page. - operationId: FindRules + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#0' parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false + - description: The version of the API to use + in: header + name: elastic-api-version schema: + default: '2023-10-31' + enum: + - '2023-10-31' type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_FindRulesSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Detections_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Rules per page - in: query - name: per_page - required: false + - description: The identifier for the rule. + in: path + name: id + required: true schema: - default: 20 - minimum: 0 - type: integer + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - data: + actions: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleResponse + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - summary: List all detection rules - tags: - - Security Solution Detections API - - Rules API - /api/detection_engine/rules/_import: - post: - description: > - Import detection rules from an `.ndjson` file, including actions and - exception lists. The request must include: - - - The `Content-Type: multipart/form-data` HTTP header. - - - A link to the `.ndjson` file containing the rules. - operationId: ImportRules - parameters: - - description: >- - Determines whether existing rules with the same `rule_id` are - overwritten. - in: query - name: overwrite - required: false - schema: - default: false - type: boolean - - description: >- - Determines whether existing exception lists with the same `list_id` - are overwritten. - in: query - name: overwrite_exceptions - required: false - schema: - default: false - type: boolean - - description: >- - Determines whether existing actions with the same - `kibana.alert.rule.actions.id` are overwritten. - in: query - name: overwrite_action_connectors - required: false - schema: - default: false - type: boolean - - description: Generates a new list ID for each imported exception list. - in: query - name: as_new_list - required: false - schema: - default: false - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - description: The `.ndjson` file containing the rules. - format: binary - type: string - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - action_connectors_errors: + active_snoozes: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema + description: List of active snoozes for the rule. + type: string type: array - action_connectors_success: + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true type: boolean - action_connectors_success_count: - minimum: 0 - type: integer - action_connectors_warnings: + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_WarningSchema + description: 'List of identifiers of muted alerts. ' + type: string type: array - errors: + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule type: array - exceptions_errors: + tags: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ErrorSchema + description: The tags for the rule. + type: string type: array - exceptions_success: - type: boolean - exceptions_success_count: - minimum: 0 - type: integer - rules_count: - minimum: 0 - type: integer - success: - type: boolean - success_count: - minimum: 0 - type: integer + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string required: - - exceptions_success - - exceptions_success_count - - exceptions_errors - - rules_count - - success - - success_count - - errors - - action_connectors_errors - - action_connectors_warnings - - action_connectors_success - - action_connectors_success_count + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision description: Indicates a successful call. - summary: Import detection rules + summary: Get rule details tags: - - Security Solution Detections API - - Import/Export API - '/api/detection_engine/rules/{id}/exceptions': + - alerting post: - operationId: CreateRuleExceptionListItems + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%3F%7D#0' parameters: - - description: Detection rule's identifier + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: >- + The identifier for the rule. If it is omitted, an ID is randomly + generated. in: path name: id - required: true + required: false schema: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_RuleId' + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - items: + actions: + default: [] items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemProps + additionalProperties: false + description: An action that runs under defined conditions. + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Conditions that affect whether the action runs. If you + specify multiple conditions, all conditions must be + met for the action to run. For example, if an alert + occurs within the specified time frame and matches the + query, the action runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL) as defined in the + `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the days + of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + description: >- + Defines the range of time in a day that the + action can run. If the `start` value is + `00:00` and the `end` value is `24:00`, + actions be generated all day. + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work but + lack built-in daylight savings time support + and are not recommended. + type: string + required: + - days + - hours + - timezone + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. Valid + values include: `onActionGroupChange`: Actions run + when the alert status changes; `onActiveAlert`: + Actions run when the alert becomes active and at + each check interval while the rule conditions are + met; `onThrottleInterval`: Actions run when the + alert becomes active and at the interval specified + in the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` at + both the rule and action level. The recommended + method is to set it for each action. If you set it + at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific + values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often an + alert generates repeated actions. It is specified + in seconds, minutes, hours, or days and is + applicable only if `notify_when` is set to + `onThrottleInterval`. NOTE: You cannot specify the + throttle interval at both the rule and action + level. The recommended method is to set it for + each action. If you set it at the rule level then + update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + default: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: A universally unique identifier (UUID) for the action. + type: string + required: + - id type: array - required: - - items - description: Rule exception list items - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates rule exception list items - tags: - - Security Solution Exceptions API - /api/detection_engine/rules/prepackaged: - put: - description: Install and update all Elastic prebuilt detection rules and Timelines. - operationId: InstallPrebuiltRulesAndTimelines - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - rules_installed: - description: The number of rules installed - minimum: 0 - type: integer - rules_updated: - description: The number of rules updated - minimum: 0 - type: integer - timelines_installed: - description: The number of timelines installed - minimum: 0 - type: integer - timelines_updated: - description: The number of timelines updated - minimum: 0 - type: integer - required: - - rules_installed - - rules_updated - - timelines_installed - - timelines_updated - description: Indicates a successful call - summary: Install prebuilt detection rules and Timelines - tags: - - Security Solution Detections API - - Prebuilt Rules API - /api/detection_engine/rules/prepackaged/_status: - get: - description: >- - Retrieve the status of all Elastic prebuilt detection rules and - Timelines. - operationId: ReadPrebuiltRulesAndTimelinesStatus + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, `infrastructure`, + `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, + `siem`, `stackAlerts`, or `uptime`. + type: string + enabled: + default: true + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + name: + description: >- + The name of the rule. While this name does not have to be + unique, a distinctive name can help you identify a rule. + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while the rule + conditions are met; `onThrottleInterval`: Actions run when + the alert becomes active and at the interval specified in + the throttle property while the rule conditions are met. + NOTE: You cannot specify `notify_when` at both the rule and + action level. The recommended method is to set it for each + action. If you set it at the rule level then update the rule + in Kibana, it is automatically changed to use + action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + type: object + rule_type_id: + description: The rule type identifier. + type: string + schedule: + additionalProperties: false + description: >- + The check interval, which specifies how frequently the rule + conditions are checked. + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, or + days. + type: string + required: + - interval + tags: + default: [] + description: The tags for the rule. + items: + type: string + type: array + throttle: + description: >- + Use the `throttle` property in the action `frequency` object + instead. The throttle interval, which defines how often an + alert generates repeated actions. NOTE: You cannot specify + the throttle interval at both the rule and action level. If + you set it at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific values. + nullable: true + type: string + required: + - name + - rule_type_id + - consumer + - schedule responses: '200': content: @@ -2540,2467 +3726,5338 @@ paths: additionalProperties: false type: object properties: - rules_custom_installed: - description: The total number of custom rules - minimum: 0 - type: integer - rules_installed: - description: The total number of installed prebuilt rules - minimum: 0 - type: integer - rules_not_installed: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: + items: + description: List of active snoozes for the rule. + type: string + type: array + alert_delay: + additionalProperties: false description: >- - The total number of available prebuilt rules that are not - installed - minimum: 0 - type: integer - rules_not_updated: - description: The total number of outdated prebuilt rules - minimum: 0 - type: integer - timelines_installed: - description: The total number of installed prebuilt timelines - minimum: 0 - type: integer - timelines_not_installed: + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: description: >- - The total number of available prebuilt timelines that are - not installed - minimum: 0 - type: integer - timelines_not_updated: - description: The total number of outdated prebuilt timelines - minimum: 0 - type: integer - required: - - rules_custom_installed - - rules_installed - - rules_not_installed - - rules_not_updated - - timelines_installed - - timelines_not_installed - - timelines_not_updated - description: Indicates a successful call - summary: Retrieve the status of prebuilt detection rules and Timelines - tags: - - Security Solution Detections API - - Prebuilt Rules API - /api/detection_engine/rules/preview: - post: - operationId: RulePreview - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - anyOf: - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewParams - discriminator: - propertyName: type - description: >- - An object containing tags to add or remove and alert ids the changes - will be applied - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - isAborted: + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. type: boolean - logs: + muted_alert_ids: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RulePreviewLogs + description: 'List of identifiers of muted alerts. ' + type: string type: array - previewId: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - required: - - logs - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Preview rule alerts generated on specified time range - tags: - - Security Solution Detections API - - Rule preview API - /api/detection_engine/signals/assignees: - post: - description: | - Assign users to detection alerts, and unassign them from alerts. - > info - > You cannot add and remove the same assignee in the same request. - operationId: SetAlertAssignees - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - assignees: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertAssignees - description: Details about the assignees to assign and unassign. - ids: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertIds - description: List of alerts ids to assign and unassign passed assignees. - required: - - assignees - - ids - required: true - responses: - '200': - description: Indicates a successful call. - '400': - description: Invalid request. - summary: Assign and unassign users from detection alerts - tags: - - Security Solution Detections API - /api/detection_engine/signals/finalize_migration: - post: - description: > - Finalize successful migrations of detection alerts. This replaces the - original index's alias with the successfully migrated index's alias. - - The endpoint is idempotent; therefore, it can safely be used to poll a - given migration and, upon completion, - - finalize it. - operationId: FinalizeAlertsMigration - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - migration_ids: - items: + name: + description: ' The name of the rule.' type: string - minItems: 1 - type: array - required: - - migration_ids - description: Array of `migration_id`s to finalize - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MigrationFinalizationResult - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Finalize detection alert migrations + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Create a rule tags: - - Security Solution Detections API - - Alerts migration API - /api/detection_engine/signals/migration: - delete: - description: > - Migrations favor data integrity over shard size. Consequently, unused or - orphaned indices are artifacts of - - the migration process. A successful migration will result in both the - old and new indices being present. - - As such, the old, orphaned index can (and likely should) be deleted. - - - While you can delete these indices manually, - - the endpoint accomplishes this task by applying a deletion policy to the - relevant index, causing it to be deleted - - after 30 days. It also deletes other artifacts specific to the migration - implementation. - operationId: AlertsMigrationCleanup + - alerting + put: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D#1' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - migration_ids: + actions: + default: [] items: - type: string - minItems: 1 + additionalProperties: false + description: An action that runs under defined conditions. + type: object + properties: + alerts_filter: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query Domain + Specific Language (DSL) as defined in the + `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the days + of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + description: >- + Defines the range of time in a day that the + action can run. If the `start` value is + `00:00` and the `end` value is `24:00`, + actions be generated all day. + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work but + lack built-in daylight savings time support + and are not recommended. + type: string + required: + - days + - hours + - timezone + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. Valid + values include: `onActionGroupChange`: Actions run + when the alert status changes; `onActiveAlert`: + Actions run when the alert becomes active and at + each check interval while the rule conditions are + met; `onThrottleInterval`: Actions run when the + alert becomes active and at the interval specified + in the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` at + both the rule and action level. The recommended + method is to set it for each action. If you set it + at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific + values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often an + alert generates repeated actions. It is specified + in seconds, minutes, hours, or days and is + applicable only if `notify_when` is set to + `onThrottleInterval`. NOTE: You cannot specify the + throttle interval at both the rule and action + level. The recommended method is to set it for + each action. If you set it at the rule level then + update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + default: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: A universally unique identifier (UUID) for the action. + type: string + required: + - id type: array - required: - - migration_ids - description: Array of `migration_id`s to cleanup - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MigrationCleanupResult - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Clean up detection alert migrations - tags: - - Security Solution Detections API - - Alerts migration API - post: - description: > - Initiate a migration of detection alerts. - - Migrations are initiated per index. While the process is neither - destructive nor interferes with existing data, it may be - resource-intensive. As such, it is recommended that you plan your - migrations accordingly. - operationId: CreateAlertsMigration - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - allOf: - - type: object + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object properties: - index: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - minItems: 1 - type: array + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number required: - - index - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsReindexOptions - description: Alerts migration parameters - required: true + - active + name: + description: >- + The name of the rule. While this name does not have to be + unique, a distinctive name can help you identify a rule. + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while the rule + conditions are met; `onThrottleInterval`: Actions run when + the alert becomes active and at the interval specified in + the throttle property while the rule conditions are met. + NOTE: You cannot specify `notify_when` at both the rule and + action level. The recommended method is to set it for each + action. If you set it at the rule level then update the rule + in Kibana, it is automatically changed to use + action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + type: object + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, or + days. + type: string + required: + - interval + tags: + default: [] + items: + description: The tags for the rule. + type: string + type: array + throttle: + description: >- + Use the `throttle` property in the action `frequency` object + instead. The throttle interval, which defines how often an + alert generates repeated actions. NOTE: You cannot specify + the throttle interval at both the rule and action level. If + you set it at the rule level then update the rule in Kibana, + it is automatically changed to use action-specific values. + nullable: true + type: string + required: + - name + - schedule responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: + additionalProperties: false type: object properties: - indices: + actions: items: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexMigrationSuccess - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexMigrationError - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SkippedAlertsIndexMigration + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params type: array - required: - - indices - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Initiate a detection alert migration - tags: - - Security Solution Detections API - - Alerts migration API - /api/detection_engine/signals/migration_status: - post: - description: >- - Retrieve indices that contain detection alerts of a particular age, - along with migration information for each of those indices. - operationId: ReadAlertsMigrationStatus - parameters: - - description: Maximum age of qualifying detection alerts - in: query - name: from - required: true - schema: - description: > - Time from which data is analyzed. For example, now-4200s means the - rule analyzes data from 70 minutes - - before its start time. Defaults to now-6m (analyzes data from 6 - minutes before the start time). - format: date-math - type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - indices: + active_snoozes: items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexMigrationStatus + description: List of active snoozes for the rule. + type: string + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string required: - - indices - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Retrieve the status of detection alert migrations + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Update a rule tags: - - Security Solution Detections API - - Alerts migration API - /api/detection_engine/signals/search: + - alerting + '/api/alerting/rule/{id}/_disable': post: - description: Find and/or aggregate detection alerts that match the given query. - operationId: SearchAlerts + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_disable#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - description: Elasticsearch query and aggregation request + additionalProperties: false + nullable: true type: object properties: - _source: - oneOf: - - type: boolean - - type: string - - items: - type: string - type: array - aggs: - additionalProperties: true - type: object - fields: - items: - type: string - type: array - query: - additionalProperties: true - type: object - runtime_mappings: - additionalProperties: true - type: object - size: - minimum: 0 - type: integer - sort: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSort - track_total_hits: + untrack: + description: Defines whether this rule's alerts should be untracked. type: boolean - description: Search and/or aggregation query - required: true + x-oas-optional: true responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: true - description: Elasticsearch search response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Find and/or aggregate detection alerts + '204': + description: Indicates a successful call. + summary: Disable a rule tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/signals/status: + - alerting + '/api/alerting/rule/{id}/_enable': post: - description: Set the status of one or more detection alerts. - operationId: SetAlertsStatus - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertsStatusByIds - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertsStatusByQuery - description: >- - An object containing desired status and explicit alert ids or a query - to select alerts - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: true - description: Elasticsearch update by query response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Set a detection alert status + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_enable#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string + responses: + '204': + description: Indicates a successful call. + summary: Enable a rule tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/signals/tags: + - alerting + '/api/alerting/rule/{id}/_mute_all': post: - description: | - And tags to detection alerts, and remove them from alerts. - > info - > You cannot add and remove the same alert tag in the same request. - operationId: SetAlertTags - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - ids: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertIds - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SetAlertTags - required: - - ids - - tags - description: >- - An object containing tags to add or remove and alert ids the changes - will be applied - required: true + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_mute_all#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: true - description: Elasticsearch update by query response - type: object - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_PlatformErrorResponse - description: Unsuccessful authentication response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SiemErrorResponse - description: Internal server error response - summary: Add and remove detection alert tags + '204': + description: Indicates a successful call. + summary: Mute all alerts tags: - - Security Solution Detections API - - Alerts API - /api/detection_engine/tags: - get: - description: List all unique tags from all detection rules. - operationId: ReadTags + - alerting + '/api/alerting/rule/{id}/_unmute_all': + post: + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_unmute_all#0' + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true + schema: + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - description: Indicates a successful call - summary: List all detection rule tags + '204': + description: Indicates a successful call. + summary: Unmute all alerts tags: - - Security Solution Detections API - - Tags API - /api/encrypted_saved_objects/_rotate_key: + - alerting + '/api/alerting/rule/{id}/_update_api_key': post: - description: > - Superuser role required. - - - If a saved object cannot be decrypted using the primary encryption key, - then Kibana will attempt to decrypt it using the specified - decryption-only keys. In most of the cases this overhead is negligible, - but if you're dealing with a large number of saved objects and - experiencing performance issues, you may want to rotate the encryption - key. - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: rotateEncryptionKey + operationId: '%2Fapi%2Falerting%2Frule%2F%7Bid%7D%2F_update_api_key#0' parameters: - - description: > - Specifies a maximum number of saved objects that Kibana can process - in a single batch. Bulk key rotation is an iterative process since - Kibana may not be able to fetch and process all required saved - objects in one go and splits processing into consequent batches. By - default, the batch size is 10000, which is also a maximum allowed - value. - in: query - name: batch_size - required: false + - description: The version of the API to use + in: header + name: elastic-api-version schema: - default: 10000 - type: number - - description: > - Limits encryption key rotation only to the saved objects with the - specified type. By default, Kibana tries to rotate the encryption - key for all saved object types that may contain encrypted - attributes. - in: query - name: type - required: false + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: id + required: true schema: type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - rotateEncryptionKeyResponse: - $ref: '#/components/examples/Saved_objects_key_rotation_response' - schema: - type: object - properties: - failed: - description: > - Indicates the number of the saved objects that were still - encrypted with one of the old encryption keys that Kibana - failed to re-encrypt with the primary key. - type: number - successful: - description: > - Indicates the total number of all encrypted saved objects - (optionally filtered by the requested `type`), regardless - of the key Kibana used for encryption. - - - NOTE: In most cases, `total` will be greater than - `successful` even if `failed` is zero. The reason is that - Kibana may not need or may not be able to rotate - encryption keys for all encrypted saved objects. - type: number - total: - description: > - Indicates the total number of all encrypted saved objects - (optionally filtered by the requested `type`), regardless - of the key Kibana used for encryption. - type: number + '204': description: Indicates a successful call. - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - '429': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - description: Already in progress. - summary: Rotate a key for encrypted saved objects + summary: Update the API key for a rule tags: - - saved objects - /api/endpoint_list: + - alerting + '/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute': post: - description: Creates an endpoint list or does nothing if the list already exists - operationId: CreateEndpointList + operationId: >- + %2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_mute#0 + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: rule_id + required: true + schema: + type: string + - description: The identifier for the alert. + in: path + name: alert_id + required: true + schema: + type: string responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Creates an endpoint list - /api/endpoint_list/items: - delete: - operationId: DeleteEndpointListItem + '204': + description: Indicates a successful call. + summary: Mute an alert + tags: + - alerting + '/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute': + post: + operationId: >- + %2Fapi%2Falerting%2Frule%2F%7Brule_id%7D%2Falert%2F%7Balert_id%7D%2F_unmute#0 + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The identifier for the rule. + in: path + name: rule_id + required: true + schema: + type: string + - description: The identifier for the alert. + in: path + name: alert_id + required: true + schema: + type: string + responses: + '204': + description: Indicates a successful call. + summary: Unmute an alert + tags: + - alerting + /api/alerting/rules/_find: + get: + operationId: '%2Fapi%2Falerting%2Frules%2F_find#0' parameters: - - description: Either `id` or `item_id` must be specified + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: The number of rules to return per page. in: query - name: id + name: per_page required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified + default: 10 + minimum: 0 + type: number + - description: The page number to return. in: query - name: item_id + name: page required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Deletes an endpoint list item - get: - operationId: ReadEndpointListItem - parameters: - - description: Either `id` or `item_id` must be specified + default: 1 + minimum: 1 + type: number + - description: >- + An Elasticsearch simple_query_string query that filters the objects + in the response. in: query - name: id + name: search required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified + type: string + - description: The default operator to use for the simple_query_string. in: query - name: item_id + name: default_search_operator required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem + default: OR + enum: + - OR + - AND + type: string + - description: The fields to perform the simple_query_string parsed query against. + in: query + name: search_fields + required: false + schema: + anyOf: + - items: + type: string type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Reads an endpoint list item - post: - operationId: CreateEndpointListItem - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - required: - - type - - name - - description - - entries - description: Exception list item's properties - required: true + - type: string + - description: >- + Determines which field is used to sort the results. The field must + exist in the `attributes` key of the response. + in: query + name: sort_field + required: false + schema: + type: string + - description: Determines the sort order. + in: query + name: sort_order + required: false + schema: + enum: + - asc + - desc + type: string + - description: >- + Filters the rules that have a relation with the reference objects + with a specific type and identifier. + in: query + name: has_reference + required: false + schema: + additionalProperties: false + nullable: true + type: object + properties: + id: + type: string + type: + type: string + required: + - type + - id + - in: query + name: fields + required: false + schema: + items: + description: The fields to return in the `attributes` key of the response. + type: string + type: array + - description: >- + A KQL string that you filter with an attribute from your saved + object. It should look like `savedObjectType.attributes.title: + "myTitle"`. However, if you used a direct attribute of a saved + object, such as `updatedAt`, you must define your filter, for + example, `savedObjectType.updatedAt > 2018-12-22`. + in: query + name: filter + required: false + schema: + type: string + - in: query + name: filter_consumers + required: false + schema: + items: + description: List of consumers to filter. + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': + additionalProperties: false + type: object + properties: + actions: + items: + additionalProperties: false + type: object + properties: + alerts_filter: + additionalProperties: false + description: >- + Defines a period that limits whether the action + runs. + type: object + properties: + query: + additionalProperties: false + type: object + properties: + dsl: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL). + type: string + filters: + description: >- + A filter written in Elasticsearch Query + Domain Specific Language (DSL) as defined in + the `kbn-es-query` package. + items: + additionalProperties: false + type: object + properties: + $state: + additionalProperties: false + type: object + properties: + store: + description: >- + A filter can be either specific to an + application context or applied globally. + enum: + - appState + - globalState + type: string + required: + - store + meta: + additionalProperties: {} + type: object + query: + additionalProperties: {} + type: object + required: + - meta + type: array + kql: + description: >- + A filter written in Kibana Query Language + (KQL). + type: string + required: + - kql + - filters + timeframe: + additionalProperties: false + type: object + properties: + days: + description: >- + Defines the days of the week that the action + can run, represented as an array of numbers. + For example, `1` represents Monday. An empty + array is equivalent to specifying all the + days of the week. + items: + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + type: integer + type: array + hours: + additionalProperties: false + type: object + properties: + end: + description: >- + The end of the time frame in 24-hour + notation (`hh:mm`). + type: string + start: + description: >- + The start of the time frame in 24-hour + notation (`hh:mm`). + type: string + required: + - start + - end + timezone: + description: >- + The ISO time zone for the `hours` values. + Values such as `UTC` and `UTC+1` also work + but lack built-in daylight savings time + support and are not recommended. + type: string + required: + - days + - hours + - timezone + connector_type_id: + description: >- + The type of connector. This property appears in + responses but cannot be set in requests. + type: string + frequency: + additionalProperties: false + type: object + properties: + notify_when: + description: >- + Indicates how often alerts generate actions. + Valid values include: `onActionGroupChange`: + Actions run when the alert status changes; + `onActiveAlert`: Actions run when the alert + becomes active and at each check interval while + the rule conditions are met; + `onThrottleInterval`: Actions run when the alert + becomes active and at the interval specified in + the throttle property while the rule conditions + are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The + recommended method is to set it for each action. + If you set it at the rule level then update the + rule in Kibana, it is automatically changed to + use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + summary: + description: Indicates whether the action is a summary. + type: boolean + throttle: + description: >- + The throttle interval, which defines how often + an alert generates repeated actions. It is + specified in seconds, minutes, hours, or days + and is applicable only if 'notify_when' is set + to 'onThrottleInterval'. NOTE: You cannot + specify the throttle interval at both the rule + and action level. The recommended method is to + set it for each action. If you set it at the + rule level then update the rule in Kibana, it is + automatically changed to use action-specific + values. + nullable: true + type: string + required: + - summary + - notify_when + - throttle + group: + description: >- + The group name, which affects when the action runs + (for example, when the threshold is met or when the + alert is recovered). Each rule type has a list of + valid action group names. If you don't need to group + actions, set to `default`. + type: string + id: + description: The identifier for the connector saved object. + type: string + params: + additionalProperties: {} + description: >- + The parameters for the action, which are sent to the + connector. The `params` are handled as Mustache + templates and passed a default set of context. + type: object + use_alert_data_for_template: + description: Indicates whether to use alert data as a template. + type: boolean + uuid: + description: >- + A universally unique identifier (UUID) for the + action. + type: string + required: + - id + - connector_type_id + - params + type: array + active_snoozes: + items: + description: List of active snoozes for the rule. + type: string + type: array + alert_delay: + additionalProperties: false + description: >- + Indicates that an alert occurs only when the specified + number of consecutive runs met the rule conditions. + type: object + properties: + active: + description: >- + The number of consecutive runs that must meet the rule + conditions. + type: number + required: + - active + api_key_created_by_user: + description: >- + Indicates whether the API key that is associated with the + rule was created by the user. + nullable: true + type: boolean + api_key_owner: + description: >- + The owner of the API key that is associated with the rule + and used to run background tasks. + nullable: true + type: string + consumer: + description: >- + The name of the application or feature that owns the rule. + For example: `alerts`, `apm`, `discover`, + `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, + `securitySolution`, `siem`, `stackAlerts`, or `uptime`. + type: string + created_at: + description: The date and time that the rule was created. + type: string + created_by: + description: The identifier for the user that created the rule. + nullable: true + type: string + enabled: + description: >- + Indicates whether you want to run the rule on an interval + basis after it is created. + type: boolean + execution_status: + additionalProperties: false + type: object + properties: + error: + additionalProperties: false + type: object + properties: + message: + description: Error message. + type: string + reason: + description: Reason for error. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + type: string + required: + - reason + - message + last_duration: + description: Duration of last execution of the rule. + type: number + last_execution_date: + description: The date and time when rule was executed last. + type: string + status: + description: Status of rule execution. + enum: + - ok + - active + - error + - warning + - pending + - unknown + type: string + warning: + additionalProperties: false + type: object + properties: + message: + description: Warning message. + type: string + reason: + description: Reason for warning. + enum: + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + type: string + required: + - reason + - message + required: + - status + - last_execution_date + id: + description: The identifier for the rule. + type: string + is_snoozed_until: + description: The date when the rule will no longer be snoozed. + nullable: true + type: string + last_run: + additionalProperties: false + nullable: true + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: Number of ignored alerts during last run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: Number of recovered alerts during last run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value could be + succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: Outcome message generated during last rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + mapped_params: + additionalProperties: {} + type: object + monitoring: + additionalProperties: false + description: Monitoring details of the rule. + type: object + properties: + run: + additionalProperties: false + description: Rule run details. + type: object + properties: + calculated_metrics: + additionalProperties: false + description: >- + Calculation of different percentiles and success + ratio. + type: object + properties: + p50: + type: number + p95: + type: number + p99: + type: number + success_ratio: + type: number + required: + - success_ratio + history: + description: History of the rule run. + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule run. + type: number + outcome: + additionalProperties: false + type: object + properties: + alerts_count: + additionalProperties: false + type: object + properties: + active: + description: Number of active alerts during last run. + nullable: true + type: number + ignored: + description: >- + Number of ignored alerts during last + run. + nullable: true + type: number + new: + description: Number of new alerts during last run. + nullable: true + type: number + recovered: + description: >- + Number of recovered alerts during last + run. + nullable: true + type: number + outcome: + description: >- + Outcome of last run of the rule. Value + could be succeeded, warning or failed. + enum: + - succeeded + - warning + - failed + type: string + outcome_msg: + items: + description: >- + Outcome message generated during last + rule run. + type: string + nullable: true + type: array + outcome_order: + description: Order of the outcome. + type: number + warning: + description: Warning of last rule execution. + enum: + - read + - decrypt + - execute + - unknown + - license + - timeout + - disabled + - validate + - maxExecutableActions + - maxAlerts + - maxQueuedActions + - ruleExecution + nullable: true + type: string + required: + - outcome + - alerts_count + success: + description: >- + Indicates whether the rule run was + successful. + type: boolean + timestamp: + description: Time of rule run. + type: number + required: + - success + - timestamp + type: array + last_run: + additionalProperties: false + type: object + properties: + metrics: + additionalProperties: false + type: object + properties: + duration: + description: Duration of most recent rule run. + type: number + gap_duration_s: + description: Duration in seconds of rule run gap. + nullable: true + type: number + total_alerts_created: + description: >- + Total number of alerts created during last + rule run. + nullable: true + type: number + total_alerts_detected: + description: >- + Total number of alerts detected during + last rule run. + nullable: true + type: number + total_indexing_duration_ms: + description: >- + Total time spent indexing documents during + last rule run in milliseconds. + nullable: true + type: number + total_search_duration_ms: + description: >- + Total time spent performing Elasticsearch + searches as measured by Kibana; includes + network latency and time spent serializing + or deserializing the request and response. + nullable: true + type: number + timestamp: + description: Time of the most recent rule run. + type: string + required: + - timestamp + - metrics + required: + - history + - calculated_metrics + - last_run + required: + - run + mute_all: + description: Indicates whether all alerts are muted. + type: boolean + muted_alert_ids: + items: + description: 'List of identifiers of muted alerts. ' + type: string + type: array + name: + description: ' The name of the rule.' + type: string + next_run: + description: Date and time of the next run of the rule. + nullable: true + type: string + notify_when: + description: >- + Indicates how often alerts generate actions. Valid values + include: `onActionGroupChange`: Actions run when the alert + status changes; `onActiveAlert`: Actions run when the + alert becomes active and at each check interval while the + rule conditions are met; `onThrottleInterval`: Actions run + when the alert becomes active and at the interval + specified in the throttle property while the rule + conditions are met. NOTE: You cannot specify `notify_when` + at both the rule and action level. The recommended method + is to set it for each action. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + nullable: true + type: string + params: + additionalProperties: {} + description: The parameters for the rule. + type: object + revision: + description: The rule revision number. + type: number + rule_type_id: + description: The rule type identifier. + type: string + running: + description: Indicates whether the rule is running. + nullable: true + type: boolean + schedule: + additionalProperties: false + type: object + properties: + interval: + description: >- + The interval is specified in seconds, minutes, hours, + or days. + type: string + required: + - interval + scheduled_task_id: + description: Identifier of the scheduled task. + type: string + snooze_schedule: + items: + additionalProperties: false + type: object + properties: + duration: + description: Duration of the rule snooze schedule. + type: number + id: + description: Identifier of the rule snooze schedule. + type: string + rRule: + additionalProperties: false + type: object + properties: + byhour: + items: + description: Indicates hours of the day to recur. + type: number + type: array + byminute: + items: + description: Indicates minutes of the hour to recur. + type: number + type: array + bymonth: + items: + description: >- + Indicates months of the year that this rule + should recur. + type: number + type: array + bymonthday: + items: + description: Indicates the days of the month to recur. + type: number + type: array + bysecond: + items: + description: Indicates seconds of the day to recur. + type: number + type: array + bysetpos: + items: + description: >- + A positive or negative integer affecting the + nth day of the month. For example, -2 combined + with `byweekday` of FR is 2nd to last Friday + of the month. It is recommended to not set + this manually and just use `byweekday`. + type: number + type: array + byweekday: + items: + anyOf: + - type: string + - type: number + description: >- + Indicates the days of the week to recur or + else nth-day-of-month strings. For example, + "+2TU" second Tuesday of month, "-1FR" last + Friday of the month, which are internally + converted to a `byweekday/bysetpos` + combination. + type: array + byweekno: + items: + description: Indicates number of the week hours to recur. + type: number + type: array + byyearday: + items: + description: >- + Indicates the days of the year that this rule + should recur. + type: number + type: array + count: + description: >- + Number of times the rule should recur until it + stops. + type: number + dtstart: + description: >- + Rule start date in Coordinated Universal Time + (UTC). + type: string + freq: + description: >- + Indicates frequency of the rule. Options are + YEARLY, MONTHLY, WEEKLY, DAILY. + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + type: integer + interval: + description: >- + Indicates the interval of frequency. For + example, 1 and YEARLY is every 1 year, 2 and + WEEKLY is every 2 weeks. + type: number + tzid: + description: Indicates timezone abbreviation. + type: string + until: + description: Recur the rule until this date. + type: string + wkst: + description: 'Indicates the start of week, defaults to Monday.' + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + type: string + required: + - dtstart + - tzid + skipRecurrences: + items: + description: Skips recurrence of rule on this date. + type: string + type: array + required: + - duration + - rRule + type: array + tags: + items: + description: The tags for the rule. + type: string + type: array + throttle: + deprecated: true + description: >- + Deprecated in 8.13.0. Use the `throttle` property in the + action `frequency` object instead. The throttle interval, + which defines how often an alert generates repeated + actions. NOTE: You cannot specify the throttle interval at + both the rule and action level. If you set it at the rule + level then update the rule in Kibana, it is automatically + changed to use action-specific values. + nullable: true + type: string + updated_at: + description: The date and time that the rule was updated most recently. + type: string + updated_by: + description: >- + The identifier for the user that updated this rule most + recently. + nullable: true + type: string + view_in_app_relative_url: + description: Relative URL to view rule in the app. + nullable: true + type: string + required: + - id + - enabled + - name + - tags + - rule_type_id + - consumer + - schedule + - actions + - params + - created_by + - updated_by + - created_at + - updated_at + - api_key_owner + - mute_all + - muted_alert_ids + - execution_status + - revision + description: Indicates a successful call. + summary: Get information about rules + tags: + - alerting + '/api/alerts/alert/{alertId}': + delete: + deprecated: true + description: > + Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After + you delete an alert, you cannot recover it. + operationId: legaryDeleteAlert + parameters: + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId + required: true + schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string + responses: + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '409': + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Delete an alert + tags: + - alerting + get: + deprecated: true + description: Deprecated in 7.13.0. Use the get rule API instead. + operationId: legacyGetAlert + parameters: + - description: The identifier for the alert. + in: path + name: alertId + required: true + schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item already exists - '500': + $ref: '#/components/schemas/Alerting_alert_response_properties' + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Creates an endpoint list item - put: - operationId: UpdateEndpointListItem + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get an alert by identifier + tags: + - alerting + post: + deprecated: true + description: Deprecated in 7.13.0. Use the create rule API instead. + operationId: legacyCreateAlert + parameters: + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: >- + An UUID v1 or v4 identifier for the alert. If this parameter is + omitted, the identifier is randomly generated. + in: path + name: alertId + required: true + schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + title: Legacy create alert request properties type: object properties: - _version: + actions: + items: + type: object + properties: + actionTypeId: + description: The identifier for the action type. + type: string + group: + description: > + Grouping actions is recommended for escalations for + different types of alert instances. If you don't need + this functionality, set it to `default`. + type: string + id: + description: The ID of the action saved object. + type: string + params: + description: > + The map to the `params` that the action type will + receive. `params` are handled as Mustache templates + and passed a default set of context. + type: object + required: + - actionTypeId + - group + - id + - params + type: array + alertTypeId: + description: >- + The ID of the alert type that you want to call when the + alert is scheduled to run. type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - description: Either `id` or `item_id` must be specified - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - description: Either `id` or `item_id` must be specified - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta + consumer: + description: >- + The name of the application that owns the alert. This name + has to match the Kibana feature name, as that dictates the + required role-based access control privileges. + type: string + enabled: + description: >- + Indicates if you want to run the alert on an interval basis + after it is created. + type: boolean name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - required: - - type - - name - - description - - entries - description: Exception list item's properties + description: A name to reference and search. + type: string + notifyWhen: + description: The condition for throttling the notification. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + params: + description: >- + The parameters to pass to the alert type executor `params` + value. This will also validate against the alert type params + validator, if defined. + type: object + schedule: + description: > + The schedule specifying when this alert should be run. A + schedule is structured such that the key specifies the + format you wish to use and its value specifies the schedule. + type: object + properties: + interval: + description: >- + The interval format specifies the interval in seconds, + minutes, hours or days at which the alert should run. + example: 10s + type: string + tags: + description: A list of keywords to reference and search. + items: + type: string + type: array + throttle: + description: > + How often this alert should fire the same actions. This will + prevent the alert from sending out the same notification + over and over. For example, if an alert with a schedule of 1 + minute stays in a triggered state for 90 minutes, setting a + throttle of `10m` or `1h` will prevent it from sending 90 + notifications during this period. + type: string + required: + - alertTypeId + - consumer + - name + - notifyWhen + - params + - schedule required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data + $ref: '#/components/schemas/Alerting_alert_response_properties' + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list item not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Updates an endpoint list item - /api/endpoint_list/items/_find: - get: - operationId: FindEndpointListItems + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Create an alert + tags: + - alerting + put: + deprecated: true + description: Deprecated in 7.13.0. Use the update rule API instead. + operationId: legacyUpdateAlert parameters: - - description: > - Filters the returned results according to the value of the specified - field, - - using the `:` syntax. - in: query - name: filter - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_FindEndpointListItemsFilter - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 0 - type: integer - - description: The number of exception list items to return per page - in: query - name: per_page - required: false - schema: - minimum: 0 - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId + required: true schema: - enum: - - desc - - asc + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + title: Legacy update alert request properties + type: object + properties: + actions: + items: + type: object + properties: + actionTypeId: + description: The identifier for the action type. + type: string + group: + description: > + Grouping actions is recommended for escalations for + different types of alert instances. If you don't need + this functionality, set it to `default`. + type: string + id: + description: The ID of the action saved object. + type: string + params: + description: > + The map to the `params` that the action type will + receive. `params` are handled as Mustache templates + and passed a default set of context. + type: object + required: + - actionTypeId + - group + - id + - params + type: array + name: + description: A name to reference and search. + type: string + notifyWhen: + description: The condition for throttling the notification. + enum: + - onActionGroupChange + - onActiveAlert + - onThrottleInterval + type: string + params: + description: >- + The parameters to pass to the alert type executor `params` + value. This will also validate against the alert type params + validator, if defined. + type: object + schedule: + description: > + The schedule specifying when this alert should be run. A + schedule is structured such that the key specifies the + format you wish to use and its value specifies the schedule. + type: object + properties: + interval: + description: >- + The interval format specifies the interval in seconds, + minutes, hours or days at which the alert should run. + example: 1d + type: string + tags: + description: A list of keywords to reference and search. + items: + type: string + type: array + throttle: + description: > + How often this alert should fire the same actions. This will + prevent the alert from sending out the same notification + over and over. For example, if an alert with a schedule of 1 + minute stays in a triggered state for 90 minutes, setting a + throttle of `10m` or `1h` will prevent it from sending 90 + notifications during this period. + type: string + required: + - name + - notifyWhen + - params + - schedule + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_EndpointListItem - type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - pit: - type: string - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Invalid input data + $ref: '#/components/schemas/Alerting_alert_response_properties' + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse - description: Insufficient privileges - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Endpoint list not found - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse - description: Internal server error - summary: Finds endpoint list items - /api/endpoint/action: - get: - description: Get a list of action requests and their responses - operationId: EndpointGetActionsList + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Update an alert + tags: + - alerting + '/api/alerts/alert/{alertId}/_disable': + post: + deprecated: true + description: Deprecated in 7.13.0. Use the disable rule API instead. + operationId: legacyDisableAlert parameters: - - in: query - name: query + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetEndpointActionListRouteQuery + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Actions List schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Disable an alert tags: - - Security Solution Endpoint Management API - '/api/endpoint/action_log/{agent_id}': - get: + - alerting + '/api/alerts/alert/{alertId}/_enable': + post: deprecated: true - description: Get action requests log - operationId: EndpointGetActionLog + description: Deprecated in 7.13.0. Use the enable rule API instead. + operationId: legacyEnableAlert parameters: - - in: path - name: agent_id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId - - in: query - name: query + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId required: true schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionLogRequestQuery + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get action requests log schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Enable an alert tags: - - Security Solution Endpoint Management API - /api/endpoint/action_status: - get: - description: Get action status - operationId: EndpointGetActionsStatus + - alerting + '/api/alerts/alert/{alertId}/_mute_all': + post: + deprecated: true + description: Deprecated in 7.13.0. Use the mute all alerts API instead. + operationId: legacyMuteAllAlertInstances parameters: - - in: query - name: query + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId required: true schema: - type: object - properties: - agent_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentIds + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionStatusSuccessResponse - description: OK - summary: Get Actions status schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Mute all alert instances tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}': - get: - description: Get action details - operationId: EndpointGetActionsDetails + - alerting + '/api/alerts/alert/{alertId}/_unmute_all': + post: + deprecated: true + description: Deprecated in 7.13.0. Use the unmute all alerts API instead. + operationId: legacyUnmuteAllAlertInstances parameters: - - in: path - name: action_id + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: The identifier for the alert. + in: path + name: alertId required: true schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Action details schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Unmute all alert instances tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}/file/{file_id}/download`': - get: - description: Download a file from an endpoint - operationId: EndpointFileDownload + - alerting + '/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute': + post: + deprecated: true + description: Deprecated in 7.13.0. Use the mute alert API instead. + operationId: legacyMuteAlertInstance parameters: - - in: path - name: action_id + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: An identifier for the alert. + in: path + name: alertId required: true schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string - - in: path - name: file_id + - description: An identifier for the alert instance. + in: path + name: alertInstanceId required: true schema: + example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: File Download schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Mute an alert instance tags: - - Security Solution Endpoint Management API - '/api/endpoint/action/{action_id}/file/{file_id}`': - get: - description: Get file info - operationId: EndpointFileInfo + - alerting + '/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute': + post: + deprecated: true + description: Deprecated in 7.13.0. Use the unmute alert API instead. + operationId: legacyUnmuteAlertInstance parameters: - - in: path - name: action_id + - $ref: '#/components/parameters/Alerting_kbn_xsrf' + - description: An identifier for the alert. + in: path + name: alertId required: true schema: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 type: string - - in: path - name: file_id + - description: An identifier for the alert instance. + in: path + name: alertInstanceId required: true schema: + example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 type: string responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: File Info schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/execute: - post: - description: Execute a given command on an endpoint - operationId: EndpointExecuteAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ExecuteRouteRequestBody - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Execute Action + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Unmute an alert instance tags: - - Security Solution Endpoint Management API - /api/endpoint/action/get_file: - post: - description: Get a file from an endpoint - operationId: EndpointGetFileAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetFileRouteRequestBody - required: true + - alerting + /api/alerts/alerts/_find: + get: + deprecated: true + description: > + Deprecated in 7.13.0. Use the find rules API instead. NOTE: Alert + `params` are stored as a flattened field type and analyzed as keywords. + As alerts change in Kibana, the results on each page of the response + also change. Use the find API for traditional paginated results, but + avoid using it to export large amounts of data. + operationId: legacyFindAlerts + parameters: + - description: The default operator to use for the `simple_query_string`. + example: OR + in: query + name: default_search_operator + schema: + default: OR + type: string + - description: The fields to return in the `attributes` key of the response. + in: query + name: fields + schema: + items: + type: string + type: array + - description: > + A KQL string that you filter with an attribute from your saved + object. It should look like `savedObjectType.attributes.title: + "myTitle"`. However, if you used a direct attribute of a saved + object, such as `updatedAt`, you must define your filter, for + example, `savedObjectType.updatedAt > 2018-12-22`. + in: query + name: filter + schema: + type: string + - description: >- + Filters the rules that have a relation with the reference objects + with a specific type and identifier. + in: query + name: has_reference + schema: + type: object + properties: + id: + type: string + type: + type: string + - description: The page number to return. + example: 1 + in: query + name: page + schema: + default: 1 + type: integer + - description: The number of alerts to return per page. + example: 20 + in: query + name: per_page + schema: + default: 20 + type: integer + - description: >- + An Elasticsearch `simple_query_string` query that filters the alerts + in the response. + in: query + name: search + schema: + type: string + - description: >- + The fields to perform the `simple_query_string` parsed query + against. + in: query + name: search_fields + schema: + oneOf: + - type: string + - items: + type: string + type: array + - description: > + Determines which field is used to sort the results. The field must + exist in the `attributes` key of the response. + in: query + name: sort_field + schema: + type: string + - description: Determines the sort order. + example: asc + in: query + name: sort_order + schema: + default: desc + enum: + - asc + - desc + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get File Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/isolate: - post: - description: Isolate an endpoint - operationId: EndpointIsolateAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_IsolateRouteRequestBody - required: true - responses: - '200': + type: object + properties: + data: + items: + $ref: '#/components/schemas/Alerting_alert_response_properties' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Isolate Action + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get a paginated set of alerts tags: - - Security Solution Endpoint Management API - /api/endpoint/action/kill_process: - post: - description: Kill a running process on an endpoint - operationId: EndpointKillProcessAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema - required: true + - alerting + /api/alerts/alerts/_health: + get: + deprecated: true + description: Deprecated in 7.13.0. Use the get alerting framework health API instead. + operationId: legacyGetAlertingHealth responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Kill process Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/running_procs: - post: - description: Get list of running processes on an endpoint - operationId: EndpointGetProcessesAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_GetProcessesRouteRequestBody - required: true - responses: - '200': + type: object + properties: + alertingFrameworkHealth: + description: > + Three substates identify the health of the alerting + framework: `decryptionHealth`, `executionHealth`, and + `readHealth`. + type: object + properties: + decryptionHealth: + description: The timestamp and status of the alert decryption. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + executionHealth: + description: The timestamp and status of the alert execution. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + readHealth: + description: The timestamp and status of the alert reading events. + type: object + properties: + status: + enum: + - error + - ok + - warn + example: ok + type: string + timestamp: + example: '2023-01-13T01:28:00.280Z' + format: date-time + type: string + hasPermanentEncryptionKey: + description: >- + If `false`, the encrypted saved object plugin does not + have a permanent encryption key. + example: true + type: boolean + isSufficientlySecure: + description: 'If `false`, security is enabled but TLS is not.' + example: true + type: boolean + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Running Processes Action + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get the alerting framework health tags: - - Security Solution Endpoint Management API - /api/endpoint/action/scan: - post: - description: Scan a file or directory - operationId: EndpointScanAction - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ScanRouteRequestBody - required: true + - alerting + /api/alerts/alerts/list_alert_types: + get: + deprecated: true + description: Deprecated in 7.13.0. Use the get rule types API instead. + operationId: legacyGetAlertTypes responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Scan Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/state: - get: - operationId: EndpointGetActionsState - responses: - '200': + items: + type: object + properties: + actionGroups: + description: > + An explicit list of groups for which the alert type can + schedule actions, each with the action group's unique ID + and human readable name. Alert actions validation uses + this configuration to ensure that groups are valid. + items: + type: object + properties: + id: + type: string + name: + type: string + type: array + actionVariables: + description: > + A list of action variables that the alert type makes + available via context and state in action parameter + templates, and a short human readable description. The + Alert UI will use this information to prompt users for + these variables in action parameter editors. + type: object + properties: + context: + items: + type: object + properties: + description: + type: string + name: + type: string + type: array + params: + items: + type: object + properties: + description: + type: string + name: + type: string + type: array + state: + items: + type: object + properties: + description: + type: string + name: + type: string + type: array + authorizedConsumers: + description: >- + The list of the plugins IDs that have access to the + alert type. + type: object + defaultActionGroupId: + description: The default identifier for the alert type group. + type: string + enabledInLicense: + description: >- + Indicates whether the rule type is enabled based on the + subscription. + type: boolean + id: + description: The unique identifier for the alert type. + type: string + isExportable: + description: >- + Indicates whether the alert type is exportable in Saved + Objects Management UI. + type: boolean + minimumLicenseRequired: + description: The subscriptions required to use the alert type. + type: string + name: + description: The descriptive name of the alert type. + type: string + producer: + description: >- + An identifier for the application that produces this + alert type. + type: string + recoveryActionGroup: + description: > + An action group to use when an alert instance goes from + an active state to an inactive one. If it is not + specified, the default recovered action group is used. + type: object + properties: + id: + type: string + name: + type: string + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ActionStateSuccessResponse - description: OK - summary: Get Action State schema + $ref: '#/components/schemas/Alerting_401_response' + description: Authorization information is missing or invalid. + summary: Get the alert types tags: - - Security Solution Endpoint Management API - /api/endpoint/action/suspend_process: + - alerting + /api/apm/agent_keys: post: - description: Suspend a running process on an endpoint - operationId: EndpointSuspendProcessAction + description: Create a new agent key for APM. + operationId: createAgentKey requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema + type: object + properties: + name: + type: string + privileges: + items: + enum: + - 'event:write' + - 'config_agent:read' + type: string + type: array required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Suspend process Action - tags: - - Security Solution Endpoint Management API - /api/endpoint/action/unisolate: - post: - description: Release an endpoint - operationId: EndpointUnisolateAction - requestBody: + type: object + properties: + api_key: + type: string + encoded: + type: string + expiration: + format: int64 + type: integer + id: + type: string + name: + type: string + description: Agent key created successfully + summary: Create an APM agent key + tags: + - APM agent keys + '/api/apm/services/{serviceName}/annotation': + post: + description: Create a new annotation for a specific service. + operationId: createAnnotation + parameters: + - description: The name of the service + in: path + name: serviceName + required: true + schema: + type: string + requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UnisolateRouteRequestBody + type: object + properties: + '@timestamp': + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + version: + type: string + tags: + items: + type: string + type: array required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Unisolate Action + type: object + properties: + _id: + type: string + _index: + type: string + _source: + type: object + properties: + '@timestamp': + type: string + annotation: + type: string + event: + type: object + properties: + created: + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + name: + type: string + version: + type: string + tags: + items: + type: string + type: array + description: Annotation created successfully + summary: Create a service annotation tags: - - Security Solution Endpoint Management API - /api/endpoint/action/upload: - post: - description: Upload a file to an endpoint - operationId: EndpointUploadAction + - APM annotations + '/api/apm/services/{serviceName}/annotation/search': + get: + description: Search for annotations related to a specific service. + operationId: getAnnotation + parameters: + - description: The name of the service + in: path + name: serviceName + required: true + schema: + type: string + - description: The environment to filter annotations by + in: query + name: environment + required: false + schema: + type: string + - description: The start date for the search + in: query + name: start + required: false + schema: + type: string + - description: The end date for the search + in: query + name: end + required: false + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + annotations: + items: + type: object + properties: + '@timestamp': + type: number + id: + type: string + text: + type: string + type: + enum: + - version + type: string + type: array + description: Successful response + summary: Search for annotations + tags: + - APM annotations + /api/cases: + delete: + description: > + You must have `read` or `all` privileges and the `delete` sub-feature + privilege for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases you're deleting. + operationId: deleteCaseDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_ids' + responses: + '204': + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Delete cases + tags: + - cases + patch: + description: > + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the + Kibana feature privileges, depending on the owner of the case you're + updating. + operationId: updateCaseDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseRequest: + $ref: '#/components/examples/Cases_update_case_request' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UploadRouteRequestBody - required: true + $ref: '#/components/schemas/Cases_update_case_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseResponse: + $ref: '#/components/examples/Cases_update_case_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Upload Action + items: + $ref: '#/components/schemas/Cases_case_response_properties' + type: array + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Update cases tags: - - Security Solution Endpoint Management API - /api/endpoint/isolate: + - cases post: - deprecated: true - operationId: EndpointIsolateRedirect + description: > + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the + Kibana feature privileges, depending on the owner of the case you're + creating. + operationId: createCaseDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createCaseRequest: + $ref: '#/components/examples/Cases_create_case_request' schema: - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids + $ref: '#/components/schemas/Cases_create_case_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createCaseResponse: + $ref: '#/components/examples/Cases_create_case_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - '308': - description: Permanent Redirect - headers: - Location: - description: Permanently redirects to "/api/endpoint/action/isolate" + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: schema: - example: /api/endpoint/action/isolate - type: string - summary: Permanently redirects to a new location + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Create a case tags: - - Security Solution Endpoint Management API - /api/endpoint/metadata: + - cases + /api/cases/_find: get: - operationId: GetEndpointMetadataList + description: > + You must have `read` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the cases you're seeking. + operationId: findCasesDefaultSpace parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ListRequestQuery + - $ref: '#/components/parameters/Cases_assignees' + - $ref: '#/components/parameters/Cases_category' + - $ref: '#/components/parameters/Cases_defaultSearchOperator' + - $ref: '#/components/parameters/Cases_from' + - $ref: '#/components/parameters/Cases_owner' + - $ref: '#/components/parameters/Cases_page_index' + - $ref: '#/components/parameters/Cases_page_size' + - $ref: '#/components/parameters/Cases_reporters' + - $ref: '#/components/parameters/Cases_search' + - $ref: '#/components/parameters/Cases_searchFields' + - $ref: '#/components/parameters/Cases_severity' + - $ref: '#/components/parameters/Cases_sortField' + - $ref: '#/components/parameters/Cases_sort_order' + - $ref: '#/components/parameters/Cases_status' + - $ref: '#/components/parameters/Cases_tags' + - $ref: '#/components/parameters/Cases_to' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + findCaseResponse: + $ref: '#/components/examples/Cases_find_case_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata List schema + type: object + properties: + cases: + items: + $ref: '#/components/schemas/Cases_case_response_properties' + maxItems: 10000 + type: array + count_closed_cases: + type: integer + count_in_progress_cases: + type: integer + count_open_cases: + type: integer + page: + type: integer + per_page: + type: integer + total: + type: integer + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Search cases tags: - - Security Solution Endpoint Management API - '/api/endpoint/metadata/{id}': + - cases + '/api/cases/{caseId}': get: - operationId: GetEndpointMetadata + description: > + You must have `read` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the case you're seeking. + operationId: getCaseDefaultSpace parameters: - - in: path - name: id - required: true - schema: - type: string + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_includeComments' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getDefaultCaseResponse: + $ref: '#/components/examples/Cases_get_case_response' + getDefaultObservabilityCaseReponse: + $ref: '#/components/examples/Cases_get_case_observability_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/metadata/transforms: - get: - operationId: GetEndpointMetadataTransform - responses: - '200': + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Metadata Transform schema + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case information tags: - - Security Solution Endpoint Management API - /api/endpoint/policy_response: + - cases + '/api/cases/{caseId}/alerts': get: - operationId: GetPolicyResponse + description: > + You must have `read` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the cases you're seeking. + operationId: getCaseAlertsDefaultSpace parameters: - - in: query - name: query - required: true - schema: - type: object - properties: - agentId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId + - $ref: '#/components/parameters/Cases_case_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getCaseAlertsResponse: + $ref: '#/components/examples/Cases_get_case_alerts_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Policy Response schema - tags: - - Security Solution Endpoint Management API - /api/endpoint/policy/summaries: - get: - deprecated: true - operationId: GetAgentPolicySummary - parameters: - - in: query - name: query - required: true - schema: - type: object - properties: - package_name: - type: string - policy_id: - nullable: true - type: string - responses: - '200': + items: + $ref: '#/components/schemas/Cases_alert_response_properties' + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get Agent Policy Summary schema + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get all alerts for a case tags: - - Security Solution Endpoint Management API - '/api/endpoint/protection_updates_note/{package_policy_id}': - get: - operationId: GetProtectionUpdatesNote + - cases + x-technical-preview: true + '/api/cases/{caseId}/comments': + delete: + description: > + Deletes all comments and alerts from a case. You must have `all` + privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases you're deleting. + operationId: deleteCaseCommentsDefaultSpace parameters: - - in: path - name: package_policy_id - required: true - schema: - type: string + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_case_id' responses: - '200': + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse - description: OK - summary: Get Protection Updates Note schema + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Delete all case comments and alerts tags: - - Security Solution Endpoint Management API - post: - operationId: CreateUpdateProtectionUpdatesNote + - cases + get: + deprecated: true + description: > + Deprecated in 8.1.0. This API is deprecated and will be removed in a + future release; instead, use the get case comment API, which requires a + comment identifier in the path. You must have `read` privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the cases with the comments you're seeking. + operationId: getAllCaseCommentsDefaultSpace parameters: - - in: path - name: package_policy_id - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - note: - type: string - required: true + - $ref: '#/components/parameters/Cases_case_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse - description: OK - summary: Create Update Protection Updates Note schema + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get all case comments tags: - - Security Solution Endpoint Management API - '/api/endpoint/suggestions/{suggestion_type}': - post: - operationId: GetEndpointSuggestions + - cases + patch: + description: > + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the case you're updating. + NOTE: You cannot change the comment type or the owner of a comment. + operationId: updateCaseCommentDefaultSpace parameters: - - in: path - name: suggestion_type - required: true - schema: - enum: - - eventFilters - type: string + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_case_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseCommentRequest: + $ref: '#/components/examples/Cases_update_comment_request' schema: - type: object - properties: - field: - type: string - fieldMeta: {} - filters: {} - query: - type: string - required: - - parameters + $ref: '#/components/schemas/Cases_update_case_comment_request' required: true responses: '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseCommentResponse: + $ref: '#/components/examples/Cases_update_comment_response' + schema: + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - summary: Get suggestions + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Update a case comment or alert tags: - - Security Solution Endpoint Management API - /api/endpoint/unisolate: + - cases post: - deprecated: true - operationId: EndpointUnisolateRedirect + description: > + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the case you're creating. + NOTE: Each case can have a maximum of 1,000 alerts. + operationId: addCaseCommentDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_case_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createCaseCommentRequest: + $ref: '#/components/examples/Cases_add_comment_request' schema: - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids + $ref: '#/components/schemas/Cases_add_case_comment_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createCaseCommentResponse: + $ref: '#/components/examples/Cases_add_comment_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_SuccessResponse - description: OK - '308': - description: Permanent Redirect - headers: - Location: - description: Permanently redirects to "/api/endpoint/action/unisolate" + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: schema: - example: /api/endpoint/action/unisolate - type: string - summary: Permanently redirects to a new location + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Add a case comment or alert tags: - - Security Solution Endpoint Management API - /api/exception_lists: - delete: - operationId: DeleteExceptionList + - cases + '/api/cases/{caseId}/comments/_find': + get: + description: > + Retrieves a paginated list of comments for a case. You must have `read` + privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases with the comments you're + seeking. + operationId: findCaseCommentsDefaultSpace parameters: - - description: Either `id` or `list_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Either `id` or `list_id` must be specified - in: query - name: list_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_page_index' + - $ref: '#/components/parameters/Cases_page_size' + - $ref: '#/components/parameters/Cases_sort_order' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Find case comments and alerts + tags: + - cases + '/api/cases/{caseId}/comments/{commentId}': + delete: + description: > + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the cases you're deleting. + operationId: deleteCaseCommentDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_comment_id' + responses: + '204': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Deletes an exception list + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Delete a case comment or alert tags: - - Security Solution Exceptions API + - cases get: - operationId: ReadExceptionList + description: > + You must have `read` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the cases with the + comments you're seeking. + operationId: getCaseCommentDefaultSpace parameters: - - description: Either `id` or `list_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Either `id` or `list_id` must be specified - in: query - name: list_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_comment_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: + examples: + getCaseCommentResponse: + $ref: '#/components/examples/Cases_get_comment_response' schema: oneOf: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse + #/components/schemas/Cases_alert_comment_response_properties - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + #/components/schemas/Cases_user_comment_response_properties + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves an exception list using its `id` or `list_id` field + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get a case comment or alert tags: - - Security Solution Exceptions API + - cases + '/api/cases/{caseId}/connector/{connectorId}/_push': post: - operationId: CreateExceptionList + description: > + You must have `all` privileges for the **Actions and Connectors** + feature in the **Management** section of the Kibana feature privileges. + You must also have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the case you're pushing. + operationId: pushCaseDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_connector_id' + - $ref: '#/components/parameters/Cases_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: + nullable: true type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType - version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion - default: 1 - required: - - name - - description - - type - description: Exception list's properties - required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + pushCaseResponse: + $ref: '#/components/examples/Cases_push_case_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + $ref: '#/components/schemas/Cases_case_response_properties' + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Push a case to an external service + tags: + - cases + '/api/cases/{caseId}/user_actions': + get: + deprecated: true + description: > + Returns all user activity for a case. Deprecated in 8.1.0. This API is + deprecated and will be removed in a future release; use the find user + actions API instead. You must have `read` privileges for the **Cases** + feature in the **Management**, **Observability**, or **Security** + section of the Kibana feature privileges, depending on the owner of the + case you're seeking. + operationId: getCaseActivityDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_case_id' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': + items: + $ref: '#/components/schemas/Cases_user_actions_response_properties' + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list already exists response - '500': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case activity + tags: + - cases + '/api/cases/{caseId}/user_actions/_find': + get: + description: > + Retrives a paginated list of user activity for a case. You must have + `read` privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the case you're seeking. + operationId: findCaseActivityDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_case_id' + - $ref: '#/components/parameters/Cases_page_index' + - $ref: '#/components/parameters/Cases_page_size' + - $ref: '#/components/parameters/Cases_sort_order' + - $ref: '#/components/parameters/Cases_user_action_types' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + findCaseActivityResponse: + $ref: '#/components/examples/Cases_find_case_activity_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates an exception list - tags: - - Security Solution Exceptions API - put: - operationId: UpdateExceptionList - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - _version: - type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType - version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion - required: - - name - - description - - type - description: Exception list's properties - required: true - responses: - '200': + type: object + properties: + page: + type: integer + perPage: + type: integer + total: + type: integer + userActions: + items: + $ref: >- + #/components/schemas/Cases_user_actions_find_response_properties + maxItems: 10000 + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Find case activity + tags: + - cases + '/api/cases/alerts/{alertId}': + get: + description: > + You must have `read` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on the owner of the cases you're seeking. + operationId: getCasesByAlertDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_alert_id' + - $ref: '#/components/parameters/Cases_owner' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + example: + - id: 06116b80-e1c3-11ec-be9b-9b1838238ee6 + title: security_case + items: + type: object + properties: + id: + description: The case identifier. + type: string + title: + description: The case title. + type: string + maxItems: 10000 + type: array + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get cases for an alert + tags: + - cases + x-technical-preview: true + /api/cases/configure: + get: + description: > + Get setting details such as the closure type, custom fields, templatse, + and the default connector for cases. You must have `read` privileges for + the **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on + where the cases were created. + operationId: getCaseConfigurationDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_owner' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getConfigurationResponse: + $ref: '#/components/examples/Cases_get_case_configuration_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': + items: + type: object + properties: + closure_type: + $ref: '#/components/schemas/Cases_closure_types' + connector: + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are + not used and are not propagated to individual cases, + therefore it is recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want + a default connector, use `none`. To retrieve + connector IDs, use the find connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a + default connector, use `none`. To retrieve connector + names, use the find connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + created_at: + example: '2022-06-01T17:07:17.767Z' + format: date-time + type: string + created_by: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + customFields: + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + description: > + A default value for the custom field. If the + `type` is `text`, the default value must be a + string. If the `type` is `toggle`, the default + value must be boolean. + oneOf: + - type: string + - type: boolean + key: + description: > + A unique key for the custom field. Must be lower + case and composed only of a-z, 0-9, '_', and '-' + characters. It is used in API calls to refer to a + specific custom field. + maxLength: 36 + minLength: 1 + type: string + label: + description: >- + The custom field label that is displayed in the + case. + maxLength: 50 + minLength: 1 + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + required: + description: > + Indicates whether the field is required. If + `false`, the custom field can be set to null or + omitted when a case is created or updated. + type: boolean + type: array + error: + example: null + nullable: true + type: string + id: + example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + type: string + mappings: + items: + type: object + properties: + action_type: + example: overwrite + type: string + source: + example: title + type: string + target: + example: summary + type: string + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + templates: + $ref: '#/components/schemas/Cases_templates' + updated_at: + example: '2022-06-01T19:58:48.169Z' + format: date-time + nullable: true + type: string + updated_by: + nullable: true + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + version: + example: WzIwNzMsMV0= + type: string + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Updates an exception list + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case settings tags: - - Security Solution Exceptions API - /api/exception_lists/_duplicate: + - cases post: - operationId: DuplicateExceptionList + description: > + Case settings include external connection details, custom fields, and + templates. Connectors are used to interface with external systems. You + must create a connector before you can use it in your cases. If you set + a default connector, it is automatically selected when you create cases + in Kibana. If you use the create case API, however, you must still + specify all of the connector details. You must have `all` privileges for + the **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on + where you are creating cases. + operationId: setCaseConfigurationDefaultSpace parameters: - - description: Exception list's human identifier - in: query - name: list_id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - - description: >- - Determines whether to include expired exceptions in the exported - list - in: query - name: include_expired_exceptions - required: true - schema: - default: 'true' - enum: - - 'true' - - 'false' - type: string + - $ref: '#/components/parameters/Cases_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + setCaseConfigRequest: + $ref: '#/components/examples/Cases_set_case_configuration_request' + schema: + $ref: '#/components/schemas/Cases_set_case_configuration_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + setCaseConfigResponse: + $ref: '#/components/examples/Cases_set_case_configuration_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + type: object + properties: + closure_type: + $ref: '#/components/schemas/Cases_closure_types' + connector: + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are not + used and are not propagated to individual cases, + therefore it is recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want a + default connector, use `none`. To retrieve connector + IDs, use the find connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a + default connector, use `none`. To retrieve connector + names, use the find connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + created_at: + example: '2022-06-01T17:07:17.767Z' + format: date-time + type: string + created_by: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + customFields: + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + description: > + A default value for the custom field. If the `type` + is `text`, the default value must be a string. If + the `type` is `toggle`, the default value must be + boolean. + oneOf: + - type: string + - type: boolean + key: + description: > + A unique key for the custom field. Must be lower + case and composed only of a-z, 0-9, '_', and '-' + characters. It is used in API calls to refer to a + specific custom field. + maxLength: 36 + minLength: 1 + type: string + label: + description: >- + The custom field label that is displayed in the + case. + maxLength: 50 + minLength: 1 + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + required: + description: > + Indicates whether the field is required. If `false`, + the custom field can be set to null or omitted when + a case is created or updated. + type: boolean + type: array + error: + example: null + nullable: true + type: string + id: + example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + type: string + mappings: + items: + type: object + properties: + action_type: + example: overwrite + type: string + source: + example: title + type: string + target: + example: summary + type: string + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + templates: + $ref: '#/components/schemas/Cases_templates' + updated_at: + example: '2022-06-01T19:58:48.169Z' + format: date-time + nullable: true + type: string + updated_by: + nullable: true + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + version: + example: WzIwNzMsMV0= + type: string + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Add case settings + tags: + - cases + '/api/cases/configure/{configurationId}': + patch: + description: > + Updates setting details such as the closure type, custom fields, + templates, and the default connector for cases. Connectors are used to + interface with external systems. You must create a connector before you + can use it in your cases. You must have `all` privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on + where the case was created. + operationId: updateCaseConfigurationDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_kbn_xsrf' + - $ref: '#/components/parameters/Cases_configuration_id' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseConfigurationRequest: + $ref: '#/components/examples/Cases_update_case_configuration_request' + schema: + $ref: '#/components/schemas/Cases_update_case_configuration_request' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateCaseConfigurationResponse: + $ref: >- + #/components/examples/Cases_update_case_configuration_response schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '405': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list to duplicate not found response - '500': + type: object + properties: + closure_type: + $ref: '#/components/schemas/Cases_closure_types' + connector: + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are not + used and are not propagated to individual cases, + therefore it is recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want a + default connector, use `none`. To retrieve connector + IDs, use the find connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a + default connector, use `none`. To retrieve connector + names, use the find connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + created_at: + example: '2022-06-01T17:07:17.767Z' + format: date-time + type: string + created_by: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + customFields: + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + description: > + A default value for the custom field. If the `type` + is `text`, the default value must be a string. If + the `type` is `toggle`, the default value must be + boolean. + oneOf: + - type: string + - type: boolean + key: + description: > + A unique key for the custom field. Must be lower + case and composed only of a-z, 0-9, '_', and '-' + characters. It is used in API calls to refer to a + specific custom field. + maxLength: 36 + minLength: 1 + type: string + label: + description: >- + The custom field label that is displayed in the + case. + maxLength: 50 + minLength: 1 + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + required: + description: > + Indicates whether the field is required. If `false`, + the custom field can be set to null or omitted when + a case is created or updated. + type: boolean + type: array + error: + example: null + nullable: true + type: string + id: + example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + type: string + mappings: + items: + type: object + properties: + action_type: + example: overwrite + type: string + source: + example: title + type: string + target: + example: summary + type: string + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + templates: + $ref: '#/components/schemas/Cases_templates' + updated_at: + example: '2022-06-01T19:58:48.169Z' + format: date-time + nullable: true + type: string + updated_by: + nullable: true + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + version: + example: WzIwNzMsMV0= + type: string + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Duplicates an exception list + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Update case settings tags: - - Security Solution Exceptions API - /api/exception_lists/_export: - post: - description: Exports an exception list and its associated items to an .ndjson file - operationId: ExportExceptionList - parameters: - - description: Exception list's identifier - in: query - name: id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Exception list's human identifier - in: query - name: list_id - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - - description: >- - Determines whether to include expired exceptions in the exported - list - in: query - name: include_expired_exceptions - required: true - schema: - default: 'true' - enum: - - 'true' - - 'false' - type: string + - cases + /api/cases/configure/connectors/_find: + get: + description: > + Get information about connectors that are supported for use in cases. + You must have `read` privileges for the **Actions and Connectors** + feature in the **Management** section of the Kibana feature privileges. + operationId: findCaseConnectorsDefaultSpace responses: '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: >- - A `.ndjson` file containing specified exception list and its - items - format: binary - type: string - description: Successful response - '400': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + findConnectorResponse: + $ref: '#/components/examples/Cases_find_connector_response' schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response + items: + type: object + properties: + actionTypeId: + $ref: '#/components/schemas/Cases_connector_types' + config: + additionalProperties: true + type: object + properties: + apiUrl: + type: string + projectKey: + type: string + id: + type: string + isDeprecated: + type: boolean + isMissingSecrets: + type: boolean + isPreconfigured: + type: boolean + name: + type: string + referencedByCount: + type: integer + maxItems: 1000 + type: array + description: Indicates a successful call. '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case connectors + tags: + - cases + /api/cases/reporters: + get: + description: > + Returns information about the users who opened cases. You must have read + privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases. The API returns + information about the users as they existed at the time of the case + creation, including their name, full name, and email address. If any of + those details change thereafter or if a user is deleted, the information + returned by this API is unchanged. + operationId: getCaseReportersDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_owner' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getReportersResponse: + $ref: '#/components/examples/Cases_get_reporters_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': + items: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + maxItems: 10000 + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Exports an exception list + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case creators tags: - - Security Solution Exceptions API - /api/exception_lists/_find: + - cases + /api/cases/status: get: - operationId: FindExceptionLists + deprecated: true + description: > + Returns the number of cases that are open, closed, and in progress. + Deprecated in 8.1.0. This API is deprecated and will be removed in a + future release; use the find cases API instead. You must have `read` + privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases you're seeking. + operationId: getCaseStatusDefaultSpace parameters: - - description: > - Filters the returned results according to the value of the specified - field. - - - Uses the `so type.field name:field` value syntax, where `so type` - can be: - - - - `exception-list`: Specify a space-aware exception list. - - - `exception-list-agnostic`: Specify an exception list that is - shared across spaces. - in: query - name: filter - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_FindExceptionListsFilter - - description: > - Determines whether the returned containers are Kibana associated - with a Kibana space - - or available in all spaces (`agnostic` or `single`) - in: query - name: namespace_type - required: false - schema: - default: - - single - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - type: array - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 1 - type: integer - - description: The number of exception lists to return per page - in: query - name: per_page - required: false - schema: - minimum: 1 - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - type: string - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc - type: string + - $ref: '#/components/parameters/Cases_owner' responses: '200': content: @@ -5008,621 +9065,309 @@ paths: schema: type: object properties: - data: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - type: array - page: - minimum: 1 + count_closed_cases: type: integer - per_page: - minimum: 1 + count_in_progress_cases: type: integer - total: - minimum: 0 + count_open_cases: type: integer - required: - - data - - page - - per_page - - total - description: Successful response - '400': + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case status summary + tags: + - cases + /api/cases/tags: + get: + description: > + Aggregates and returns a list of case tags. You must have read + privileges for the **Cases** feature in the **Management**, + **Observability**, or **Security** section of the Kibana feature + privileges, depending on the owner of the cases you're seeking. + operationId: getCaseTagsDefaultSpace + parameters: + - $ref: '#/components/parameters/Cases_owner' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getTagsResponse: + $ref: '#/components/examples/Cases_get_tags_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + items: + type: string + maxItems: 10000 + type: array + description: Indicates a successful call. + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Finds exception lists - tags: - - Security Solution Exceptions API - /api/exception_lists/_import: - post: - description: Imports an exception list and associated items - operationId: ImportExceptionList - parameters: - - description: > - Determines whether existing exception lists with the same `list_id` - are overwritten. - - If any exception items have the same `item_id`, those are also - overwritten. - in: query - name: overwrite - required: false - schema: - default: false - type: boolean - - in: query - name: overwrite_exceptions - required: false - schema: - default: false - type: boolean - - in: query - name: overwrite_action_connectors - required: false - schema: - default: false - type: boolean - - description: > - Determines whether the list being imported will have a new `list_id` - generated. - - Additional `item_id`'s are generated for each exception item. Both - the exception - - list and its items are overwritten. - in: query - name: as_new_list - required: false - schema: - default: false - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - description: A `.ndjson` file containing the exception list - format: binary - type: string - required: true - responses: - '200': + $ref: '#/components/schemas/Cases_4xx_response' + description: Authorization information is missing or invalid. + summary: Get case tags + tags: + - cases + /api/data_views: + get: + operationId: getAllDataViewsDefault + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getAllDataViewsResponse: + $ref: '#/components/examples/Data_views_get_data_views_response' schema: type: object properties: - errors: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListsImportBulkErrorArray - success: - type: boolean - success_count: - minimum: 0 - type: integer - success_count_exception_list_items: - minimum: 0 - type: integer - success_count_exception_lists: - minimum: 0 - type: integer - success_exception_list_items: - type: boolean - success_exception_lists: - type: boolean - required: - - errors - - success - - success_count - - success_exception_lists - - success_count_exception_lists - - success_exception_list_items - - success_count_exception_list_items - description: Successful response + data_view: + items: + type: object + properties: + id: + type: string + name: + type: string + namespaces: + items: + type: string + type: array + title: + type: string + typeMeta: + type: object + type: array + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Imports an exception list + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Get all data views tags: - - Security Solution Exceptions API - /api/exception_lists/items: - delete: - operationId: DeleteExceptionListItem + - data views + /api/data_views/data_view: + post: + operationId: createDataViewDefaultw parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified - in: query - name: item_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createDataViewRequest: + $ref: '#/components/examples/Data_views_create_data_view_request' + schema: + $ref: '#/components/schemas/Data_views_create_data_view_request_object' + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Create a data view + tags: + - data views + '/api/data_views/data_view/{viewId}': + delete: + description: | + WARNING: When you delete a data view, it cannot be recovered. + operationId: deleteDataViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' + responses: + '204': + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Deletes an exception list item + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Delete a data view tags: - - Security Solution Exceptions API + - data views get: - operationId: ReadExceptionListItem + operationId: getDataViewDefault parameters: - - description: Either `id` or `item_id` must be specified - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - - description: Either `id` or `item_id` must be specified - in: query - name: item_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single + - $ref: '#/components/parameters/Data_views_view_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getDataViewResponse: + $ref: '#/components/examples/Data_views_get_data_view_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Gets an exception list item + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Get a data view tags: - - Security Solution Exceptions API + - data views post: - operationId: CreateExceptionListItem + operationId: updateDataViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateDataViewRequest: + $ref: '#/components/examples/Data_views_update_data_view_request' schema: - type: object - properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time - type: string - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType - required: - - list_id - - type - - name - - description - - entries - description: Exception list item's properties + $ref: '#/components/schemas/Data_views_update_data_view_request_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response + $ref: '#/components/schemas/Data_views_data_view_response_object' + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update a data view + tags: + - data views + '/api/data_views/data_view/{viewId}/fields': + post: + description: > + Update fields presentation metadata such as count, customLabel, + customDescription, and format. + operationId: updateFieldsMetadataDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateFieldsMetadataRequest: + $ref: '#/components/examples/Data_views_update_field_metadata_request' + schema: + type: object + properties: + fields: + description: The field object. + type: object + required: + - fields + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item already exists response - '500': + type: object + properties: + acknowledged: + type: boolean + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates an exception list item + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update data view fields metadata tags: - - Security Solution Exceptions API - put: - operationId: UpdateExceptionListItem + - data views + '/api/data_views/data_view/{viewId}/runtime_field': + post: + operationId: createRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - $ref: '#/components/parameters/Data_views_view_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + createRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_create_runtime_field_request' schema: type: object properties: - _version: - type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_UpdateExceptionListItemCommentArray - default: [] - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time - type: string - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - description: Either `id` or `item_id` must be specified - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - description: Either `id` or `item_id` must be specified - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType + description: | + The name for a runtime field. + type: string + runtimeField: + description: | + The runtime field definition object. + type: object required: - - type - name - - description - - entries - description: Exception list item's properties + - runtimeField required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Updates an exception list item + type: object + description: Indicates a successful call. + summary: Create a runtime field tags: - - Security Solution Exceptions API - /api/exception_lists/items/_find: - get: - operationId: FindExceptionListItems + - data views + put: + operationId: createUpdateRuntimeFieldDefault parameters: - - description: List's id - in: query - name: list_id + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + - description: | + The ID of the data view fields you want to update. + in: path + name: viewId required: true schema: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - type: array - - description: > - Filters the returned results according to the value of the specified - field, - - using the `:` syntax. - in: query - name: filter - required: false - schema: - default: [] - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_FindExceptionListItemsFilter - type: array - - description: > - Determines whether the returned containers are Kibana associated - with a Kibana space - - or available in all spaces (`agnostic` or `single`) - in: query - name: namespace_type - required: false - schema: - default: - - single - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - type: array - - in: query - name: search - required: false - schema: - type: string - - description: The page number to return - in: query - name: page - required: false - schema: - minimum: 0 - type: integer - - description: The number of exception list items to return per page - in: query - name: per_page - required: false - schema: - minimum: 0 - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_NonEmptyString - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_create_runtime_field_request' + schema: + type: object + properties: + name: + description: | + The name for a runtime field. + type: string + runtimeField: + description: | + The runtime field definition object. + type: object + required: + - name + - runtimeField + required: true responses: '200': content: @@ -5630,1575 +9375,1443 @@ paths: schema: type: object properties: - data: + data_view: + type: object + fields: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItem + type: object type: array - page: - minimum: 1 - type: integer - per_page: - minimum: 1 - type: integer - pit: - type: string - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - description: Successful response + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Create or update a runtime field + tags: + - data views + '/api/data_views/data_view/{viewId}/runtime_field/{fieldName}': + delete: + operationId: deleteRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' + responses: + '200': + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Finds exception list items + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Delete a runtime field from a data view tags: - - Security Solution Exceptions API - /api/exception_lists/summary: + - data views get: - operationId: ReadExceptionListSummary + operationId: getRuntimeFieldDefault parameters: - - description: Exception list's identifier generated upon creation - in: query - name: id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - - description: Exception list's human readable identifier - in: query - name: list_id - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - - in: query - name: namespace_type - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - - description: Search filter clause - in: query - name: filter - required: false - schema: - type: string + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getRuntimeFieldResponse: + $ref: '#/components/examples/Data_views_get_runtime_field_response' schema: type: object properties: - linux: - minimum: 0 - type: integer - macos: - minimum: 0 - type: integer - total: - minimum: 0 - type: integer - windows: - minimum: 0 - type: integer - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response + data_view: + type: object + fields: + items: + type: object + type: array + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves an exception list summary + $ref: '#/components/schemas/Data_views_404_response' + description: Object is not found. + summary: Get a runtime field tags: - - Security Solution Exceptions API - /api/exceptions/shared: + - data views post: - operationId: CreateSharedExceptionList + operationId: updateRuntimeFieldDefault + parameters: + - $ref: '#/components/parameters/Data_views_field_name' + - $ref: '#/components/parameters/Data_views_view_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuntimeFieldRequest: + $ref: '#/components/examples/Data_views_update_runtime_field_request' schema: type: object properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription - name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName + runtimeField: + description: | + The runtime field definition object. + + You can update following fields: + + - `type` + - `script` + type: object required: - - name - - description + - runtimeField required: true responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionList - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Exception list already exists response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_SiemErrorResponse - description: Internal server error response - summary: Creates a shared exception list - tags: - - Security Solution Exceptions API - /api/lists: - delete: - operationId: DeleteList - parameters: - - description: List's `id` value - in: query - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - in: query - name: deleteReferences - required: false - schema: - default: false - type: boolean - - in: query - name: ignoreReferences - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes a list + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Update a runtime field tags: - - Security Solution Lists API + - data views + /api/data_views/default: get: - operationId: ReadList - parameters: - - description: List's `id` value - in: query - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' + operationId: getDefaultDataViewDefault responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + getDefaultDataViewResponse: + $ref: >- + #/components/examples/Data_views_get_default_data_view_response schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + data_view_id: + type: string + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Retrieves a list using its id field + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Get the default data view tags: - - Security Solution Lists API - patch: - operationId: PatchList + - data views + post: + operationId: setDefaultDatailViewDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + setDefaultDataViewRequest: + $ref: '#/components/examples/Data_views_set_default_data_view_request' schema: type: object properties: - _version: + data_view_id: + description: > + The data view identifier. NOTE: The API does not validate + whether it is a valid identifier. Use `null` to unset the + default data view. + nullable: true type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - version: - minimum: 1 - type: integer + force: + default: false + description: Update an existing default data view identifier. + type: boolean required: - - id - description: List's properties + - data_view_id required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + acknowledged: + type: boolean + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': + $ref: '#/components/schemas/Data_views_400_response' + description: Bad request + summary: Set the default data view + tags: + - data views + /api/data_views/swap_references: + post: + description: > + Changes saved object references from one data view identifier to + another. WARNING: Misuse can break large numbers of saved objects! + Practicing with a backup is recommended. + operationId: swapDataViewsDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + swapDataViewRequest: + $ref: '#/components/examples/Data_views_swap_data_view_request' + schema: + $ref: '#/components/schemas/Data_views_swap_data_view_request_object' + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Patches a list + type: object + properties: + deleteStatus: + type: object + properties: + deletePerformed: + type: boolean + remainingRefs: + type: integer + result: + items: + type: object + properties: + id: + description: A saved object identifier. + type: string + type: + description: The saved object type. + type: string + type: array + description: Indicates a successful call. + summary: Swap saved object references tags: - - Security Solution Lists API + - data views + /api/data_views/swap_references/_preview: post: - operationId: CreateList + description: > + Preview the impact of swapping saved object references from one data + view identifier to another. + operationId: previewSwapDataViewsDefault + parameters: + - $ref: '#/components/parameters/Data_views_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: + examples: + previewSwapDataViewRequest: + $ref: >- + #/components/examples/Data_views_preview_swap_data_view_request schema: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - deserializer: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - serializer: - type: string - type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - version: - default: 1 - minimum: 1 - type: integer - required: - - name - - description - - type - description: List's properties + $ref: '#/components/schemas/Data_views_swap_data_view_request_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response - '400': + type: object + properties: + result: + items: + type: object + properties: + id: + description: A saved object identifier. + type: string + type: + description: The saved object type. + type: string + type: array + description: Indicates a successful call. + summary: Preview a saved object reference swap + tags: + - data views + /api/encrypted_saved_objects/_rotate_key: + post: + description: > + Superuser role required. + + + If a saved object cannot be decrypted using the primary encryption key, + then Kibana will attempt to decrypt it using the specified + decryption-only keys. In most of the cases this overhead is negligible, + but if you're dealing with a large number of saved objects and + experiencing performance issues, you may want to rotate the encryption + key. + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: rotateEncryptionKey + parameters: + - description: > + Specifies a maximum number of saved objects that Kibana can process + in a single batch. Bulk key rotation is an iterative process since + Kibana may not be able to fetch and process all required saved + objects in one go and splits processing into consequent batches. By + default, the batch size is 10000, which is also a maximum allowed + value. + in: query + name: batch_size + required: false + schema: + default: 10000 + type: number + - description: > + Limits encryption key rotation only to the saved objects with the + specified type. By default, Kibana tries to rotate the encryption + key for all saved object types that may contain encrypted + attributes. + in: query + name: type + required: false + schema: + type: string + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + rotateEncryptionKeyResponse: + $ref: '#/components/examples/Saved_objects_key_rotation_response' schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + type: object + properties: + failed: + description: > + Indicates the number of the saved objects that were still + encrypted with one of the old encryption keys that Kibana + failed to re-encrypt with the primary key. + type: number + successful: + description: > + Indicates the total number of all encrypted saved objects + (optionally filtered by the requested `type`), regardless + of the key Kibana used for encryption. + + + NOTE: In most cases, `total` will be greater than + `successful` even if `failed` is zero. The reason is that + Kibana may not need or may not be able to rotate + encryption keys for all encrypted saved objects. + type: number + total: + description: > + Indicates the total number of all encrypted saved objects + (optionally filtered by the requested `type`), regardless + of the key Kibana used for encryption. + type: number + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + '429': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': + type: object + description: Already in progress. + summary: Rotate a key for encrypted saved objects + tags: + - saved objects + /api/ml/saved_objects/sync: + get: + description: > + Synchronizes Kibana saved objects for machine learning jobs and trained + models in the default space. You must have `all` privileges for the + **Machine Learning** feature in the **Analytics** section of the Kibana + feature privileges. This API runs automatically when you start Kibana + and periodically thereafter. + operationId: mlSync + parameters: + - $ref: '#/components/parameters/Machine_learning_APIs_simulateParam' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + syncExample: + $ref: '#/components/examples/Machine_learning_APIs_mlSyncExample' schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List already exists response - '500': + $ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response' + description: Indicates a successful call + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates a list + $ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse' + description: Authorization information is missing or invalid. + summary: Sync saved objects in the default space tags: - - Security Solution Lists API - put: - operationId: UpdateList + - ml + /api/saved_objects/_bulk_create: + post: + deprecated: true + operationId: bulkCreateSavedObjects + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - description: 'When true, overwrites the document with the same identifier.' + in: query + name: overwrite + schema: + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - _version: - type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListDescription - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListMetadata - name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - version: - minimum: 1 - type: integer - required: - - id - - name - - description - description: List's properties + items: + type: object + type: array required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Updates a list + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Create saved objects tags: - - Security Solution Lists API - /api/lists/_find: - get: - operationId: FindLists + - saved objects + /api/saved_objects/_bulk_delete: + post: + deprecated: true + description: | + WARNING: When you delete a saved object, it cannot be recovered. + operationId: bulkDeleteSavedObjects parameters: - - description: The page number to return - in: query - name: page - required: false - schema: - type: integer - - description: The number of lists to return per page - in: query - name: per_page - required: false - schema: - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc - type: string - - description: > - Returns the list that come after the last list returned in the - previous call - - (use the cursor value returned in the previous call). This parameter - uses - - the `tie_breaker_id` field to ensure all lists are sorted and - returned correctly. - in: query - name: cursor - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_FindListsCursor' + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - description: > - Filters the returned results according to the value of the specified - field, - - using the : syntax. + When true, force delete objects that exist in multiple namespaces. + Note that the option applies to the whole request. Use the delete + object API to specify per-object deletion behavior. TIP: Use this if + you attempted to delete objects and received an HTTP 400 error with + the following message: "Unable to delete saved object that exists in + multiple namespaces, use the force option to delete it anyway". + WARNING: When you bulk delete objects that exist in multiple + namespaces, the API also deletes legacy url aliases that reference + the object. These requests are batched to minimise the impact but + they can place a heavy load on Kibana. Make sure you limit the + number of objects that exist in multiple namespaces in a single bulk + delete operation. in: query - name: filter - required: false + name: force schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_FindListsFilter' + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + items: + type: object + type: array + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - cursor: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListsCursor - data: - items: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - - cursor - description: Successful response + description: > + Indicates a successful call. NOTE: This HTTP response code indicates + that the bulk operation succeeded. Errors pertaining to individual + objects will be returned in the response body. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Finds lists + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Delete saved objects tags: - - Security Solution Lists API - /api/lists/index: - delete: - operationId: DeleteListIndex + - saved objects + /api/saved_objects/_bulk_get: + post: + deprecated: true + operationId: bulkGetSavedObjects + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + items: + type: object + type: array + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - acknowledged: - type: boolean - required: - - acknowledged - description: Successful response + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes list data streams + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Get saved objects tags: - - Security Solution Lists API - get: - operationId: ReadListIndex + - saved objects + /api/saved_objects/_bulk_resolve: + post: + deprecated: true + description: > + Retrieve multiple Kibana saved objects by identifier using any legacy + URL aliases if they exist. Under certain circumstances when Kibana is + upgraded, saved object migrations may necessitate regenerating some + object IDs to enable new features. When an object's ID is regenerated, a + legacy URL alias is created for that object, preserving its old ID. In + such a scenario, that object can be retrieved by the bulk resolve API + using either its new ID or its old ID. + operationId: bulkResolveSavedObjects + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + items: + type: object + type: array + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - list_index: - type: boolean - list_item_index: - type: boolean - required: - - list_index - - list_item_index - description: Successful response + description: > + Indicates a successful call. NOTE: This HTTP response code indicates + that the bulk operation succeeded. Errors pertaining to individual + objects will be returned in the response body. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream(s) not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Get list data stream existence status + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Resolve saved objects tags: - - Security Solution Lists API + - saved objects + /api/saved_objects/_bulk_update: post: - operationId: CreateListIndex + deprecated: true + description: Update the attributes for multiple Kibana saved objects. + operationId: bulkUpdateSavedObjects + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + items: + type: object + type: array + required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - properties: - acknowledged: - type: boolean - required: - - acknowledged - description: Successful response + description: > + Indicates a successful call. NOTE: This HTTP response code indicates + that the bulk operation succeeded. Errors pertaining to individual + objects will be returned in the response body. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Update saved objects + tags: + - saved objects + /api/saved_objects/_export: + post: + description: > + Retrieve sets of saved objects that you want to import into Kibana. + + You must include `type` or `objects` in the request body. + + + Exported saved objects are not backwards compatible and cannot be + imported into an older version of Kibana. + + + NOTE: The `savedObjects.maxImportExportSize` configuration setting + limits the number of saved objects which may be exported. + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: exportSavedObjectsDefault + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + exportSavedObjectsRequest: + $ref: '#/components/examples/Saved_objects_export_objects_request' + schema: + type: object + properties: + excludeExportDetails: + default: false + description: Do not add export details entry at the end of the stream. + type: boolean + includeReferencesDeep: + description: >- + Includes all of the referenced objects in the exported + objects. + type: boolean + objects: + description: A list of objects to export. + items: + type: object + type: array + type: + description: >- + The saved object types to include in the export. Use `*` to + export all the types. + oneOf: + - type: string + - items: + type: string + type: array + required: true + responses: + '200': content: - application/json; Elastic-Api-Version=2023-10-31: + application/x-ndjson; Elastic-Api-Version=2023-10-31: + examples: + exportSavedObjectsResponse: + $ref: '#/components/examples/Saved_objects_export_objects_response' schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List data stream exists response - '500': + additionalProperties: true + type: object + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates necessary list data streams + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request. + summary: Export saved objects tags: - - Security Solution Lists API - /api/lists/items: - delete: - operationId: DeleteListItem + - saved objects + /api/saved_objects/_find: + get: + deprecated: true + description: Retrieve a paginated set of Kibana saved objects. + operationId: findSavedObjects parameters: - - description: Required if `list_id` and `value` are not specified + - description: > + An aggregation structure, serialized as a string. The field format + is similar to filter, meaning that to use a saved object type + attribute in the aggregation, the `savedObjectType.attributes.title: + "myTitle"` format must be used. For root fields, the syntax is + `savedObjectType.rootField`. NOTE: As objects change in Kibana, the + results on each page of the response also change. Use the find API + for traditional paginated results, but avoid using it to export + large amounts of data. in: query - name: id - required: false + name: aggs schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + type: string + - description: The default operator to use for the `simple_query_string`. in: query - name: list_id - required: false + name: default_search_operator schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + type: string + - description: The fields to return in the attributes key of the response. in: query - name: value - required: false + name: fields + schema: + oneOf: + - type: string + - type: array + - description: > + The filter is a KQL string with the caveat that if you filter with + an attribute from your saved object type, it should look like that: + `savedObjectType.attributes.title: "myTitle"`. However, if you use a + root attribute of a saved object such as `updated_at`, you will have + to define your filter like that: `savedObjectType.updated_at > + 2018-12-22`. + in: query + name: filter schema: type: string - description: >- - Determines when changes made by the request are made visible to - search + Filters to objects that do not have a relationship with the type and + identifier combination. in: query - name: refresh - required: false + name: has_no_reference + schema: + type: object + - description: >- + The operator to use for the `has_no_reference` parameter. Either + `OR` or `AND`. Defaults to `OR`. + in: query + name: has_no_reference_operator schema: - default: 'false' - enum: - - 'true' - - 'false' - - wait_for type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Deletes a list item - tags: - - Security Solution Lists API - get: - operationId: ReadListItem - parameters: - - description: Required if `list_id` and `value` are not specified + - description: >- + Filters to objects that have a relationship with the type and ID + combination. in: query - name: id - required: false + name: has_reference schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + type: object + - description: >- + The operator to use for the `has_reference` parameter. Either `OR` + or `AND`. Defaults to `OR`. in: query - name: list_id - required: false + name: has_reference_operator schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: Required if `id` is not specified + type: string + - description: The page of objects to return. in: query - name: value - required: false + name: page + schema: + type: integer + - description: The number of objects to return per page. + in: query + name: per_page + schema: + type: integer + - description: >- + An Elasticsearch `simple_query_string` query that filters the + objects in the response. + in: query + name: search + schema: + type: string + - description: >- + The fields to perform the `simple_query_string` parsed query + against. + in: query + name: search_fields + schema: + oneOf: + - type: string + - type: array + - description: > + Sorts the response. Includes "root" and "type" fields. "root" fields + exist for all saved objects, such as "updated_at". "type" fields are + specific to an object type, such as fields returned in the + attributes key of the response. When a single type is defined in the + type parameter, the "root" and "type" fields are allowed, and + validity checks are made in that order. When multiple types are + defined in the type parameter, only "root" fields are allowed. + in: query + name: sort_field schema: type: string + - description: The saved object types to include. + in: query + name: type + required: true + schema: + oneOf: + - type: string + - type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - description: Successful response + type: object + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Gets a list item + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request + summary: Search for saved objects tags: - - Security Solution Lists API - patch: - operationId: PatchListItem + - saved objects + /api/saved_objects/_import: + post: + description: > + Create sets of Kibana saved objects from a file created by the export + API. + + Saved objects can be imported only into the same version, a newer minor + on the same major, or the next major. Exported saved objects are not + backwards compatible and cannot be imported into an older version of + Kibana. + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: importSavedObjectsDefault + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - description: > + Creates copies of saved objects, regenerates each object ID, and + resets the origin. When used, potential conflict errors are avoided. + NOTE: This option cannot be used with the `overwrite` and + `compatibilityMode` options. + in: query + name: createNewCopies + required: false + schema: + type: boolean + - description: > + Overwrites saved objects when they already exist. When used, + potential conflict errors are automatically resolved by overwriting + the destination object. NOTE: This option cannot be used with the + `createNewCopies` option. + in: query + name: overwrite + required: false + schema: + type: boolean + - description: > + Applies various adjustments to the saved objects that are being + imported to maintain compatibility between different Kibana + versions. Use this option only if you encounter issues with imported + saved objects. NOTE: This option cannot be used with the + `createNewCopies` option. + in: query + name: compatibilityMode + required: false + schema: + type: boolean requestBody: content: - application/json; Elastic-Api-Version=2023-10-31: + multipart/form-data; Elastic-Api-Version=2023-10-31: + examples: + importObjectsRequest: + $ref: '#/components/examples/Saved_objects_import_objects_request' schema: type: object properties: - _version: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - refresh: - description: >- - Determines when changes made by the request are made visible - to search - enum: - - 'true' - - 'false' - - wait_for - type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue - required: - - id - description: List item's properties + file: + description: > + A file exported using the export API. NOTE: The + `savedObjects.maxImportExportSize` configuration setting + limits the number of saved objects which may be included in + this file. Similarly, the + `savedObjects.maxImportPayloadBytes` setting limits the + overall size of the file that can be imported. required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + importObjectsResponse: + $ref: '#/components/examples/Saved_objects_import_objects_response' schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response + type: object + properties: + errors: + description: > + Indicates the import was unsuccessful and specifies the + objects that failed to import. + + + NOTE: One object may result in multiple errors, which + requires separate steps to resolve. For instance, a + `missing_references` error and conflict error. + items: + type: object + type: array + success: + description: > + Indicates when the import was successfully completed. When + set to false, some objects may not have been created. For + additional information, refer to the `errors` and + `successResults` properties. + type: boolean + successCount: + description: Indicates the number of successfully imported records. + type: integer + successResults: + description: > + Indicates the objects that are successfully imported, with + any metadata if applicable. + + + NOTE: Objects are created only when all resolvable errors + are addressed, including conflicts and missing references. + If objects are created as new copies, each entry in the + `successResults` array includes a `destinationId` + attribute. + items: + type: object + type: array + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Patches a list item + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request. + summary: Import saved objects tags: - - Security Solution Lists API + - saved objects + /api/saved_objects/_resolve_import_errors: post: - operationId: CreateListItem + description: > + To resolve errors from the Import objects API, you can: + + + * Retry certain saved objects + + * Overwrite specific saved objects + + * Change references to different saved objects + + + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + operationId: resolveImportErrors + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - description: > + Applies various adjustments to the saved objects that are being + imported to maintain compatibility between different Kibana + versions. When enabled during the initial import, also enable when + resolving import errors. This option cannot be used with the + `createNewCopies` option. + in: query + name: compatibilityMode + required: false + schema: + type: boolean + - description: > + Creates copies of the saved objects, regenerates each object ID, and + resets the origin. When enabled during the initial import, also + enable when resolving import errors. + in: query + name: createNewCopies + required: false + schema: + type: boolean requestBody: content: - application/json; Elastic-Api-Version=2023-10-31: + multipart/form-data; Elastic-Api-Version=2023-10-31: + examples: + resolveImportErrorsRequest: + $ref: >- + #/components/examples/Saved_objects_resolve_missing_reference_request schema: type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - list_id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - refresh: - description: >- - Determines when changes made by the request are made visible - to search - enum: - - 'true' - - 'false' - - wait_for + file: + description: The same file given to the import API. + format: binary type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue + retries: + description: >- + The retry operations, which can specify how to resolve + different types of errors. + items: + type: object + properties: + destinationId: + description: >- + Specifies the destination ID that the imported object + should have, if different from the current ID. + type: string + id: + description: The saved object ID. + type: string + ignoreMissingReferences: + description: >- + When set to `true`, ignores missing reference errors. + When set to `false`, does nothing. + type: boolean + overwrite: + description: >- + When set to `true`, the source object overwrites the + conflicting destination object. When set to `false`, + does nothing. + type: boolean + replaceReferences: + description: >- + A list of `type`, `from`, and `to` used to change the + object references. + items: + type: object + properties: + from: + type: string + to: + type: string + type: + type: string + type: array + type: + description: The saved object type. + type: string + required: + - type + - id + type: array required: - - list_id - - value - description: List item's properties + - retries required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: + examples: + resolveImportErrorsResponse: + $ref: >- + #/components/examples/Saved_objects_resolve_missing_reference_response schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response + type: object + properties: + errors: + description: > + Specifies the objects that failed to resolve. + + + NOTE: One object can result in multiple errors, which + requires separate steps to resolve. For instance, a + `missing_references` error and a `conflict` error. + items: + type: object + type: array + success: + description: > + Indicates a successful import. When set to `false`, some + objects may not have been created. For additional + information, refer to the `errors` and `successResults` + properties. + type: boolean + successCount: + description: | + Indicates the number of successfully resolved records. + type: number + successResults: + description: > + Indicates the objects that are successfully imported, with + any metadata if applicable. + + + NOTE: Objects are only created when all resolvable errors + are addressed, including conflict and missing references. + items: + type: object + type: array + description: Indicates a successful call. '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request. + summary: Resolve import errors + tags: + - saved objects + '/api/saved_objects/{type}': + post: + deprecated: true + description: Create a Kibana saved object with a randomly generated identifier. + operationId: createSavedObject + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - $ref: '#/components/parameters/Saved_objects_saved_object_type' + - description: 'If true, overwrites the document with the same identifier.' + in: query + name: overwrite + schema: + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + attributes: + $ref: '#/components/schemas/Saved_objects_attributes' + initialNamespaces: + $ref: '#/components/schemas/Saved_objects_initial_namespaces' + references: + $ref: '#/components/schemas/Saved_objects_references' + required: + - attributes + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + type: object + description: Indicates a successful call. + '409': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': + type: object + description: Indicates a conflict error. + summary: Create a saved object + tags: + - saved objects + '/api/saved_objects/{type}/{id}': + get: + deprecated: true + description: Retrieve a single Kibana saved object by identifier. + operationId: getSavedObject + parameters: + - $ref: '#/components/parameters/Saved_objects_saved_object_id' + - $ref: '#/components/parameters/Saved_objects_saved_object_type' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item already exists response - '500': + type: object + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Creates a list item + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request. + summary: Get a saved object tags: - - Security Solution Lists API - put: - operationId: UpdateListItem + - saved objects + post: + deprecated: true + description: >- + Create a Kibana saved object and specify its identifier instead of using + a randomly generated ID. + operationId: createSavedObjectId + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - $ref: '#/components/parameters/Saved_objects_saved_object_id' + - $ref: '#/components/parameters/Saved_objects_saved_object_type' + - description: 'If true, overwrites the document with the same identifier.' + in: query + name: overwrite + schema: + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - _version: - type: string - id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - meta: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemMetadata - value: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemValue + attributes: + $ref: '#/components/schemas/Saved_objects_attributes' + initialNamespaces: + $ref: '#/components/schemas/Saved_objects_initial_namespaces' + references: + $ref: '#/components/schemas/Saved_objects_initial_namespaces' required: - - id - - value - description: List item's properties + - attributes required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItem' - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + type: object + description: Indicates a successful call. + '409': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + type: object + description: Indicates a conflict error. + summary: Create a saved object + tags: + - saved objects + put: + deprecated: true + description: Update the attributes for Kibana saved objects. + operationId: updateSavedObject + parameters: + - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - $ref: '#/components/parameters/Saved_objects_saved_object_id' + - $ref: '#/components/parameters/Saved_objects_saved_object_type' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + required: true + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response + type: object + description: Indicates a successful call. '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List item not found response - '500': + type: object + description: Indicates the object was not found. + '409': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Updates a list item + type: object + description: Indicates a conflict error. + summary: Update a saved object tags: - - Security Solution Lists API - /api/lists/items/_export: - post: - description: Exports list item values from the specified list - operationId: ExportListItems + - saved objects + '/api/saved_objects/resolve/{type}/{id}': + get: + deprecated: true + description: > + Retrieve a single Kibana saved object by identifier using any legacy URL + alias if it exists. Under certain circumstances, when Kibana is + upgraded, saved object migrations may necessitate regenerating some + object IDs to enable new features. When an object's ID is regenerated, a + legacy URL alias is created for that object, preserving its old ID. In + such a scenario, that object can be retrieved using either its new ID or + its old ID. + operationId: resolveSavedObject parameters: - - description: List's id to export - in: query - name: list_id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' + - $ref: '#/components/parameters/Saved_objects_saved_object_id' + - $ref: '#/components/parameters/Saved_objects_saved_object_type' responses: '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: A `.txt` file containing list items from the specified list - format: binary - type: string - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List not found response - '500': + type: object + description: Indicates a successful call. + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Exports list items + $ref: '#/components/schemas/Saved_objects_400_response' + description: Bad request. + summary: Resolve a saved object tags: - - Security Solution Lists API - /api/lists/items/_find: + - saved objects + /api/status: get: - operationId: FindListItems + operationId: '%2Fapi%2Fstatus#0' parameters: - - description: List's id - in: query - name: list_id - required: true + - description: The version of the API to use + in: header + name: elastic-api-version schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: The page number to return + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: Set to "true" to get the response in v7 format. in: query - name: page + name: v7format required: false schema: - type: integer - - description: The number of list items to return per page + type: boolean + - description: Set to "true" to get the response in v8 format. in: query - name: per_page - required: false - schema: - type: integer - - description: Determines which field is used to sort the results - in: query - name: sort_field - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - - description: 'Determines the sort order, which can be `desc` or `asc`' - in: query - name: sort_order - required: false - schema: - enum: - - desc - - asc - type: string - - description: > - Returns the list that come after the last list returned in the - previous call - - (use the cursor value returned in the previous call). This parameter - uses - - the `tie_breaker_id` field to ensure all lists are sorted and - returned correctly. - in: query - name: cursor - required: false - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsCursor - - description: > - Filters the returned results according to the value of the specified - field, - - using the : syntax. - in: query - name: filter + name: v8format required: false schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsFilter + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - cursor: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_FindListItemsCursor - data: - items: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItem - type: array - page: - minimum: 0 - type: integer - per_page: - minimum: 0 - type: integer - total: - minimum: 0 - type: integer - required: - - data - - page - - per_page - - total - - cursor - description: Successful response - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse + anyOf: + - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse + description: >- + Kibana's operational status. A minimal response is sent for + unauthorized users. + description: Overall status is OK and Kibana should be functioning normally. + '503': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + anyOf: + - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' + - $ref: >- + #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse + description: >- + Kibana's operational status. A minimal response is sent for + unauthorized users. + description: >- + Kibana or some of it's essential services are unavailable. Kibana + may be degraded or unavailable. + summary: Get Kibana's current status + tags: + - system + /data_streams: + get: + operationId: data-streams-list + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': + type: object + properties: + data_streams: + items: + $ref: '#/components/schemas/Fleet_data_stream' + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List data streams + tags: + - Data streams + parameters: [] + /enrollment_api_keys: + get: + operationId: get-enrollment-api-keys + parameters: [] + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Finds list items + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + - page + - perPage + - total + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List enrollment API keys tags: - - Security Solution Lists API - /api/lists/items/_import: + - Fleet enrollment API keys post: - description: > - Imports a list of items from a `.txt` or `.csv` file. The maximum file - size is 9 million bytes. - - - You can import items to a new or existing list. - operationId: ImportListItems + operationId: create-enrollment-api-keys parameters: - - description: | - List's id. - - Required when importing to an existing list. - in: query - name: list_id - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - - description: > - Type of the importing list. - - - Required when importing a new list that is `list_id` is not - specified. - in: query - name: type - required: false - schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - - in: query - name: serializer - required: false - schema: - type: string - - in: query - name: deserializer - required: false - schema: - type: string - - description: >- - Determines when changes made by the request are made visible to - search - in: query - name: refresh - required: false - schema: - enum: - - 'true' - - 'false' - - wait_for - type: string - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - description: >- - A `.txt` or `.csv` file containing newline separated list - items - format: binary - type: string - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_Solution_Lists_API_List' - description: Successful response + type: object + properties: + action: + enum: + - created + type: string + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Create enrollment API key + tags: + - Fleet enrollment API keys + '/enrollment_api_keys/{keyId}': + delete: + operationId: delete-enrollment-api-key + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: List with specified list_id does not exist response - '500': + type: object + properties: + action: + enum: + - deleted + type: string + required: + - action + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete enrollment API key by ID + tags: + - Fleet enrollment API keys + get: + operationId: get-enrollment-api-key + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Imports list items + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment API key by ID tags: - - Security Solution Lists API - /api/lists/privileges: + - Fleet enrollment API keys + parameters: + - in: path + name: keyId + required: true + schema: + type: string + /enrollment-api-keys: get: - operationId: ReadListPrivileges + deprecated: true + operationId: get-enrollment-api-keys-deprecated + parameters: [] responses: '200': content: @@ -7206,201 +10819,249 @@ paths: schema: type: object properties: - is_authenticated: - type: boolean - listItems: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListItemPrivileges - lists: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_ListPrivileges + items: + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + type: array + page: + type: number + perPage: + type: number + total: + type: number required: - - lists - - listItems - - is_authenticated - description: Successful response + - items + - page + - perPage + - total + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List enrollment API keys + tags: + - Fleet enrollment API keys + post: + deprecated: true + operationId: create-enrollment-api-keys-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Invalid input data response - '401': + type: object + properties: + action: + enum: + - created + type: string + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create enrollment API key + tags: + - Fleet enrollment API keys + '/enrollment-api-keys/{keyId}': + delete: + deprecated: true + operationId: delete-enrollment-api-key-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Unsuccessful authentication response - '403': + type: object + properties: + action: + enum: + - deleted + type: string + required: + - action + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete enrollment API key by ID + tags: + - Fleet enrollment API keys + get: + deprecated: true + operationId: get-enrollment-api-key-deprecated + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_PlatformErrorResponse - description: Not enough privileges response - '500': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Lists_API_SiemErrorResponse - description: Internal server error response - summary: Gets list privileges + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_enrollment_api_key' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment API key by ID tags: - - Security Solution Lists API - /api/ml/saved_objects/sync: - get: - description: > - Synchronizes Kibana saved objects for machine learning jobs and trained - models in the default space. You must have `all` privileges for the - **Machine Learning** feature in the **Analytics** section of the Kibana - feature privileges. This API runs automatically when you start Kibana - and periodically thereafter. - operationId: mlSync - parameters: - - $ref: '#/components/parameters/Machine_learning_APIs_simulateParam' + - Fleet enrollment API keys + parameters: + - in: path + name: keyId + required: true + schema: + type: string + /epm/bulk_assets: + post: + operationId: bulk-get-assets + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + assetIds: + description: list of items necessary to fetch assets + items: + type: object + properties: + id: + type: string + type: + type: string + type: array + required: + - assetIds responses: '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - syncExample: - $ref: '#/components/examples/Machine_learning_APIs_mlSyncExample' - schema: - $ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response' - description: Indicates a successful call - '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse' - description: Authorization information is missing or invalid. - summary: Sync saved objects in the default space + $ref: '#/components/schemas/Fleet_get_bulk_assets_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk get assets tags: - - ml - /api/note: - delete: - operationId: DeleteNote - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - oneOf: - - nullable: true - type: object - properties: - noteId: - type: string - required: - - noteId - - type: object - properties: - noteIds: - items: - type: string - nullable: true - type: array - required: - - noteIds - description: The id of the note to delete. - required: true + - Elastic Package Manager (EPM) + /epm/categories: + get: + operationId: get-package-categories responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - description: Indicates the note was successfully deleted. - summary: Deletes a note from a timeline. + $ref: '#/components/schemas/Fleet_get_categories_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List package categories tags: - - Security Solution Timeline API - - 'access:securitySolution' + - Elastic Package Manager (EPM) + parameters: + - description: >- + Whether to include prerelease packages in categories count (e.g. beta, + rc, preview) + in: query + name: prerelease + schema: + default: false + type: boolean + - deprecated: true + in: query + name: experimental + schema: + default: false + type: boolean + - in: query + name: include_policy_templates + schema: + default: false + type: boolean + /epm/packages: get: - description: Gets notes - operationId: GetNotes + operationId: list-all-packages parameters: - - in: query - name: documentIds - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_DocumentIds' - - in: query - name: page - schema: - nullable: true - type: number - - in: query - name: perPage - schema: - nullable: true - type: number - - in: query - name: search + - description: >- + Whether to exclude the install status of each package. Enabling this + option will opt in to caching for the response via `cache-control` + headers. If you don't need up-to-date installation info for a + package, and are querying for a list of available packages, + providing this flag can improve performance substantially. + in: query + name: excludeInstallStatus schema: - nullable: true - type: string - - in: query - name: sortField + default: false + type: boolean + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease schema: - nullable: true - type: string - - in: query - name: sortOrder + default: false + type: boolean + - deprecated: true + in: query + name: experimental schema: - nullable: true - type: string + default: false + type: boolean - in: query - name: filter + name: category schema: - nullable: true type: string responses: '200': - description: Indicates the requested notes were returned. - summary: Get all notes for a given document. + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_get_packages_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List packages tags: - - Security Solution Timeline API - - 'access:securitySolution' - patch: - operationId: PersistNoteRoute + - Elastic Package Manager (EPM) + post: + description: '' + operationId: install-package-by-upload + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: avoid erroring out on unexpected mapping update errors + in: query + name: ignoreMappingUpdateErrors + schema: + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover + schema: + default: false + type: boolean requestBody: content: - application/json; Elastic-Api-Version=2023-10-31: + application/gzip; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - eventDataView: - nullable: true - type: string - eventIngested: - nullable: true - type: string - eventTimestamp: - nullable: true - type: string - note: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - noteId: - nullable: true - type: string - overrideOwner: - nullable: true - type: boolean - version: - nullable: true - type: string - required: - - note - description: The note to persist or update along with additional metadata. - required: true + format: binary + type: string + application/zip; Elastic-Api-Version=2023-10-31: + schema: + format: binary + type: string responses: '200': content: @@ -7408,362 +11069,759 @@ paths: schema: type: object properties: - data: + _meta: type: object properties: - persistNote: - type: object - properties: - code: - type: number - message: - type: string - note: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_Note - required: - - code - - message - - note - required: - - persistNote + install_source: + enum: + - upload + - registry + - bundled + type: string + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array required: - - data - description: Indicates the note was successfully created. - summary: Persists a note to a timeline. + - items + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + '429': + $ref: '#/components/responses/Fleet_error' + summary: Install by package by direct upload tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/osquery/live_queries: - get: - operationId: OsqueryFindLiveQueries + - Elastic Package Manager (EPM) + /epm/packages/_bulk: + post: + operationId: bulk-install-packages parameters: - - in: query - name: query - required: true + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindLiveQueryRequestQuery + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + description: force install to ignore package verification errors + type: boolean + packages: + description: list of packages to install + items: + oneOf: + - description: package name + type: string + - type: object + properties: + name: + description: package name + type: string + version: + description: package version + type: string + type: array + required: + - packages responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + $ref: '#/components/schemas/Fleet_bulk_install_packages_response' description: OK - summary: Find live queries + '400': + $ref: '#/components/responses/Fleet_error' + summary: Bulk install packages tags: - - Security Solution Osquery API - post: - operationId: OsqueryCreateLiveQuery + - Elastic Package Manager (EPM) + '/epm/packages/{pkgkey}': + delete: + deprecated: true + operationId: delete-package-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - in: path + name: pkgkey + required: true + schema: + type: string requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreateLiveQueryRequestBody - required: true + type: object + properties: + force: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + response: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - response description: OK - summary: Create a live query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete ackage tags: - - Security Solution Osquery API - '/api/osquery/live_queries/{id}': + - Elastic Package Manager (EPM) get: - operationId: OsqueryGetLiveQueryDetails + deprecated: true + operationId: get-package-deprecated parameters: - in: path - name: id + name: pkgkey required: true schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - - in: query - name: query + type: string + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease schema: - additionalProperties: true - type: object + default: false + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + allOf: + - properties: + response: + $ref: '#/components/schemas/Fleet_package_info' + - properties: + savedObject: + type: string + status: + enum: + - installed + - installing + - install_failed + - not_installed + type: string + required: + - status + - savedObject + type: object description: OK - summary: Get live query details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package tags: - - Security Solution Osquery API - '/api/osquery/live_queries/{id}/results/{actionId}': - get: - operationId: OsqueryGetLiveQueryResults + - Elastic Package Manager (EPM) + post: + deprecated: true + description: '' + operationId: install-package-deprecated parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' - in: path - name: id + name: pkgkey required: true schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - - in: path - name: actionId - required: true + type: string + - description: avoid erroring out on unexpected mapping update errors + in: query + name: ignoreMappingUpdateErrors schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - - in: query - name: query - required: true + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_GetLiveQueryResultsRequestQuery + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + response: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - response description: OK - summary: Get live query results + '400': + $ref: '#/components/responses/Fleet_error' + summary: Install package tags: - - Security Solution Osquery API - /api/osquery/packs: - get: - operationId: OsqueryFindPacks + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/{pkgVersion}': + delete: + operationId: delete-package parameters: - - in: query - name: query - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: delete package even if policies used by agents + in: query + name: force schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindPacksRequestQuery - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse - description: OK - summary: Find packs - tags: - - Security Solution Osquery API - post: - operationId: OsqueryCreatePacks + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreatePacksRequestBody - required: true + deprecated: true + type: object + properties: + force: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items description: OK - summary: Create a packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package tags: - - Security Solution Osquery API - '/api/osquery/packs/{id}': - delete: - operationId: OsqueryDeletePacks - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + - Elastic Package Manager (EPM) + get: + operationId: get-package responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + allOf: + - properties: + item: + $ref: '#/components/schemas/Fleet_package_info' + - properties: + keepPoliciesUpToDate: + type: boolean + latestVersion: + type: string + licensePath: + type: string + notice: + type: string + savedObject: + deprecated: true + type: object + status: + enum: + - installed + - installing + - install_failed + - not_installed + type: string + required: + - status + - savedObject + type: object description: OK - summary: Delete packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package tags: - - Security Solution Osquery API - get: - operationId: OsqueryGetPacksDetails + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - description: Ignore if the package is fails signature verification + in: query + name: ignoreUnverified + schema: + type: boolean + - description: >- + Return all fields from the package manifest, not just those supported + by the Elastic Package Registry + in: query + name: full + schema: + type: boolean + - description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + in: query + name: prerelease + schema: + default: false + type: boolean + post: + description: '' + operationId: install-package parameters: - - in: path - name: id - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - description: avoid erroring out on unexpected mapping update errors + in: query + name: ignoreMappingUpdateErrors schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + default: false + type: boolean + - description: >- + Skip data stream rollover during index template mapping or settings + update + in: query + name: skipDataStreamRollover + schema: + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + force: + type: boolean + ignore_constraints: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + _meta: + type: object + properties: + install_source: + enum: + - registry + - upload + - bundled + type: string + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items description: OK - summary: Get packs details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Install package tags: - - Security Solution Osquery API + - Elastic Package Manager (EPM) put: - operationId: OsqueryUpdatePacks - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' + description: '' + operationId: update-package requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_UpdatePacksRequestBody - required: true + type: object + properties: + keepPoliciesUpToDate: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + items: + items: + type: object + properties: + id: + type: string + type: + oneOf: + - $ref: >- + #/components/schemas/Fleet_kibana_saved_object_type + - $ref: >- + #/components/schemas/Fleet_elasticsearch_asset_type + required: + - id + - type + type: array + required: + - items description: OK - summary: Update packs + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update package settings tags: - - Security Solution Osquery API - /api/osquery/saved_queries: + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/{pkgVersion}/{filePath}': get: - operationId: OsqueryFindSavedQueries - parameters: - - in: query - name: query - required: true - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_FindSavedQueryRequestQuery + operationId: packages-get-file responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + body: + type: object + headers: + type: object + statusCode: + type: number description: OK - summary: Find saved queries + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package file tags: - - Security Solution Osquery API + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - in: path + name: filePath + required: true + schema: + type: string + '/epm/packages/{pkgName}/{pkgVersion}/transforms/authorize': post: - operationId: OsqueryCreateSavedQuery + description: '' + operationId: reauthorize-transforms + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - description: >- + Whether to include prerelease packages in categories count (e.g. + beta, rc, preview) + in: query + name: prerelease + schema: + default: false + type: boolean requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_CreateSavedQueryRequestBody - required: true + type: object + properties: + transforms: + items: + type: object + properties: + transformId: + type: string + type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + items: + items: + type: object + properties: + error: + type: string + success: + type: boolean + transformId: + type: string + required: + - transformId + - error + type: array + required: + - items description: OK - summary: Create a saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Authorize transforms tags: - - Security Solution Osquery API - '/api/osquery/saved_queries/{id}': - delete: - operationId: OsqueryDeleteSavedQuery - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' + - Elastic Package Manager (EPM) + '/epm/packages/{pkgName}/stats': + get: + operationId: get-package-stats responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + response: + $ref: '#/components/schemas/Fleet_package_usage_stats' + required: + - response description: OK - summary: Delete saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package stats tags: - - Security Solution Osquery API + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + /epm/packages/limited: get: - operationId: OsqueryGetSavedQueryDetails - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' + operationId: list-limited-packages responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + items: + items: + type: string + type: array description: OK - summary: Get saved query details + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get limited package list tags: - - Security Solution Osquery API - put: - operationId: OsqueryUpdateSavedQuery - parameters: - - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_UpdateSavedQueryRequestBody - required: true + - Elastic Package Manager (EPM) + parameters: [] + '/epm/templates/{pkgName}/{pkgVersion}/inputs': + get: + operationId: get-inputs-template responses: '200': - content: + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get inputs template + tags: + - Elastic Package Manager (EPM) + parameters: + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: true + schema: + type: string + - description: Format of response - json or yaml + in: query + name: format + schema: + enum: + - json + - yaml + - yml + type: string + - description: Specify if version is prerelease + in: query + name: prerelease + schema: + type: boolean + - description: Ignore if the package is fails signature verification + in: query + name: ignoreUnverified + schema: + type: boolean + /epm/verification_key_id: + get: + operationId: packages-get-verification-key-id + responses: + '200': + content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DefaultSuccessResponse + type: object + properties: + body: + type: object + properties: + id: + description: >- + the key ID of the GPG key used to verify package + signatures + nullable: true + type: string + headers: + type: object + statusCode: + type: number description: OK - summary: Update saved query + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get package signature verification key ID tags: - - Security Solution Osquery API - /api/pinned_event: - patch: - operationId: PersistPinnedEventRoute + - Elastic Package Manager (EPM) + parameters: [] + /fleet_server_hosts: + get: + operationId: get-fleet-server-hosts + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_fleet_server_host' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List Fleet Server hosts + tags: + - Fleet Server hosts + post: + operationId: post-fleet-server-hosts requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - eventId: + host_urls: + items: + type: string + type: array + id: type: string - pinnedEventId: - nullable: true + is_default: + type: boolean + is_internal: + type: boolean + name: type: string - timelineId: + proxy_id: + description: >- + The ID of the proxy to use for this fleet server host. See + the proxies API for more information. type: string required: - - eventId - - timelineId - description: The pinned event to persist or update along with additional metadata. - required: true + - name + - host_urls responses: '200': content: @@ -7771,128 +11829,122 @@ paths: schema: type: object properties: - data: - type: object - properties: - persistPinnedEventOnTimeline: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_PinnedEvent - - type: object - properties: - code: - type: number - message: - type: string - required: - - persistPinnedEventOnTimeline - required: - - data - description: Indicate the event was successfully pinned in the timeline. - summary: Persists a pinned event to a timeline. + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create Fleet Server host tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/saved_objects/_bulk_create: - post: - deprecated: true - operationId: bulkCreateSavedObjects + - Fleet Server hosts + '/fleet_server_hosts/{itemId}': + delete: + operationId: delete-fleet-server-hosts parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - description: 'When true, overwrites the document with the same identifier.' - in: query - name: overwrite - schema: - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - type: object - type: array - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. + properties: + id: + type: string + required: + - id + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete Fleet Server host by ID + tags: + - Fleet Server hosts + get: + operationId: get-one-fleet-server-hosts + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Create saved objects + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get Fleet Server host by ID tags: - - saved objects - /api/saved_objects/_bulk_delete: - post: - deprecated: true - description: | - WARNING: When you delete a saved object, it cannot be recovered. - operationId: bulkDeleteSavedObjects + - Fleet Server hosts + parameters: + - in: path + name: itemId + required: true + schema: + type: string + put: + operationId: update-fleet-server-hosts parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - description: > - When true, force delete objects that exist in multiple namespaces. - Note that the option applies to the whole request. Use the delete - object API to specify per-object deletion behavior. TIP: Use this if - you attempted to delete objects and received an HTTP 400 error with - the following message: "Unable to delete saved object that exists in - multiple namespaces, use the force option to delete it anyway". - WARNING: When you bulk delete objects that exist in multiple - namespaces, the API also deletes legacy url aliases that reference - the object. These requests are batched to minimise the impact but - they can place a heavy load on Kibana. Make sure you limit the - number of objects that exist in multiple namespaces in a single bulk - delete operation. - in: query - name: force - schema: - type: boolean + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - items: - type: object - type: array - required: true + type: object + properties: + host_urls: + items: + type: string + type: array + is_default: + type: boolean + is_internal: + type: boolean + name: + type: string + proxy_id: + description: >- + The ID of the proxy to use for this fleet server host. See + the proxies API for more information. + nullable: true + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: > - Indicates a successful call. NOTE: This HTTP response code indicates - that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. + properties: + item: + $ref: '#/components/schemas/Fleet_fleet_server_host' + required: + - item + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Delete saved objects + $ref: '#/components/responses/Fleet_error' + summary: Update Fleet Server host by ID tags: - - saved objects - /api/saved_objects/_bulk_get: + - Fleet Server hosts + /health_check: post: - deprecated: true - operationId: bulkGetSavedObjects + operationId: fleet-server-health-check parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - items: - type: object - type: array + type: object + properties: + host: + deprecated: true + type: string + id: + type: string + required: + - id required: true responses: '200': @@ -7900,879 +11952,548 @@ paths: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. + properties: + host: + deprecated: true + type: string + id: + description: Fleet Server host id + type: string + status: + type: string + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Get saved objects + $ref: '#/components/responses/Fleet_error' + summary: Fleet Server health check tags: - - saved objects - /api/saved_objects/_bulk_resolve: - post: - deprecated: true - description: > - Retrieve multiple Kibana saved objects by identifier using any legacy - URL aliases if they exist. Under certain circumstances when Kibana is - upgraded, saved object migrations may necessitate regenerating some - object IDs to enable new features. When an object's ID is regenerated, a - legacy URL alias is created for that object, preserving its old ID. In - such a scenario, that object can be retrieved by the bulk resolve API - using either its new ID or its old ID. - operationId: bulkResolveSavedObjects + - Fleet internals + /kubernetes: + get: + operationId: get-full-k8s-manifest parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - type: object - type: array - required: true + - in: query + name: download + required: false + schema: + type: boolean + - in: query + name: fleetServer + required: false + schema: + type: string + - in: query + name: enrolToken + required: false + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: > - Indicates a successful call. NOTE: This HTTP response code indicates - that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. + properties: + item: + type: string + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Resolve saved objects + $ref: '#/components/responses/Fleet_error' + summary: Get full K8s agent manifest tags: - - saved objects - /api/saved_objects/_bulk_update: + - Fleet Kubernetes + /logstash_api_keys: post: - deprecated: true - description: Update the attributes for multiple Kibana saved objects. - operationId: bulkUpdateSavedObjects + operationId: generate-logstash-api-key parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - items: - type: object - type: array - required: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: > - Indicates a successful call. NOTE: This HTTP response code indicates - that the bulk operation succeeded. Errors pertaining to individual - objects will be returned in the response body. + properties: + api_key: + type: string + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Generate Logstash API key + tags: + - Fleet outputs + /outputs: + get: + operationId: get-outputs + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Update saved objects + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_output_create_request' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: List outputs tags: - - saved objects - /api/saved_objects/_export: + - Fleet outputs post: - description: > - Retrieve sets of saved objects that you want to import into Kibana. - - You must include `type` or `objects` in the request body. - - - Exported saved objects are not backwards compatible and cannot be - imported into an older version of Kibana. - - - NOTE: The `savedObjects.maxImportExportSize` configuration setting - limits the number of saved objects which may be exported. - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: exportSavedObjectsDefault - parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' + operationId: post-outputs requestBody: content: application/json; Elastic-Api-Version=2023-10-31: - examples: - exportSavedObjectsRequest: - $ref: '#/components/examples/Saved_objects_export_objects_request' schema: - type: object - properties: - excludeExportDetails: - default: false - description: Do not add export details entry at the end of the stream. - type: boolean - includeReferencesDeep: - description: >- - Includes all of the referenced objects in the exported - objects. - type: boolean - objects: - description: A list of objects to export. - items: - type: object - type: array - type: - description: >- - The saved object types to include in the export. Use `*` to - export all the types. - oneOf: - - type: string - - items: - type: string - type: array + $ref: '#/components/schemas/Fleet_output_create_request' required: true responses: '200': content: - application/x-ndjson; Elastic-Api-Version=2023-10-31: - examples: - exportSavedObjectsResponse: - $ref: '#/components/examples/Saved_objects_export_objects_response' + application/json; Elastic-Api-Version=2023-10-31: schema: - additionalProperties: true type: object - description: Indicates a successful call. + properties: + item: + $ref: '#/components/schemas/Fleet_output_create_request' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Create output + tags: + - Fleet outputs + '/outputs/{outputId}': + delete: + operationId: delete-output + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request. - summary: Export saved objects + type: object + properties: + id: + type: string + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete output by ID tags: - - saved objects - /api/saved_objects/_find: + - Fleet outputs get: - deprecated: true - description: Retrieve a paginated set of Kibana saved objects. - operationId: findSavedObjects + operationId: get-output + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_output_create_request' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get output by ID + tags: + - Fleet outputs + parameters: + - in: path + name: outputId + required: true + schema: + type: string + put: + operationId: update-output parameters: - - description: > - An aggregation structure, serialized as a string. The field format - is similar to filter, meaning that to use a saved object type - attribute in the aggregation, the `savedObjectType.attributes.title: - "myTitle"` format must be used. For root fields, the syntax is - `savedObjectType.rootField`. NOTE: As objects change in Kibana, the - results on each page of the response also change. Use the find API - for traditional paginated results, but avoid using it to export - large amounts of data. - in: query - name: aggs - schema: - type: string - - description: The default operator to use for the `simple_query_string`. - in: query - name: default_search_operator - schema: - type: string - - description: The fields to return in the attributes key of the response. - in: query - name: fields - schema: - oneOf: - - type: string - - type: array - - description: > - The filter is a KQL string with the caveat that if you filter with - an attribute from your saved object type, it should look like that: - `savedObjectType.attributes.title: "myTitle"`. However, if you use a - root attribute of a saved object such as `updated_at`, you will have - to define your filter like that: `savedObjectType.updated_at > - 2018-12-22`. - in: query - name: filter - schema: - type: string - - description: >- - Filters to objects that do not have a relationship with the type and - identifier combination. - in: query - name: has_no_reference - schema: - type: object - - description: >- - The operator to use for the `has_no_reference` parameter. Either - `OR` or `AND`. Defaults to `OR`. - in: query - name: has_no_reference_operator - schema: - type: string - - description: >- - Filters to objects that have a relationship with the type and ID - combination. - in: query - name: has_reference - schema: - type: object - - description: >- - The operator to use for the `has_reference` parameter. Either `OR` - or `AND`. Defaults to `OR`. - in: query - name: has_reference_operator - schema: - type: string - - description: The page of objects to return. - in: query - name: page - schema: - type: integer - - description: The number of objects to return per page. - in: query - name: per_page - schema: - type: integer - - description: >- - An Elasticsearch `simple_query_string` query that filters the - objects in the response. - in: query - name: search - schema: - type: string - - description: >- - The fields to perform the `simple_query_string` parsed query - against. - in: query - name: search_fields - schema: - oneOf: - - type: string - - type: array - - description: > - Sorts the response. Includes "root" and "type" fields. "root" fields - exist for all saved objects, such as "updated_at". "type" fields are - specific to an object type, such as fields returned in the - attributes key of the response. When a single type is defined in the - type parameter, the "root" and "type" fields are allowed, and - validity checks are made in that order. When multiple types are - defined in the type parameter, only "root" fields are allowed. - in: query - name: sort_field - schema: - type: string - - description: The saved object types to include. - in: query - name: type - required: true - schema: - oneOf: - - type: string - - type: array + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_output_update_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. + properties: + item: + $ref: '#/components/schemas/Fleet_output_update_request' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Update output by ID + tags: + - Fleet outputs + '/outputs/{outputId}/health': + get: + operationId: get-output-health + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request - summary: Search for saved objects + type: object + properties: + message: + description: long message if unhealthy + type: string + state: + description: 'state of output, HEALTHY or DEGRADED' + type: string + timestamp: + description: timestamp of reported state + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get latest output health tags: - - saved objects - /api/saved_objects/_import: - post: - description: > - Create sets of Kibana saved objects from a file created by the export - API. - - Saved objects can be imported only into the same version, a newer minor - on the same major, or the next major. Exported saved objects are not - backwards compatible and cannot be imported into an older version of - Kibana. - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: importSavedObjectsDefault - parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - description: > - Creates copies of saved objects, regenerates each object ID, and - resets the origin. When used, potential conflict errors are avoided. - NOTE: This option cannot be used with the `overwrite` and - `compatibilityMode` options. - in: query - name: createNewCopies - required: false - schema: - type: boolean - - description: > - Overwrites saved objects when they already exist. When used, - potential conflict errors are automatically resolved by overwriting - the destination object. NOTE: This option cannot be used with the - `createNewCopies` option. - in: query - name: overwrite - required: false - schema: - type: boolean - - description: > - Applies various adjustments to the saved objects that are being - imported to maintain compatibility between different Kibana - versions. Use this option only if you encounter issues with imported - saved objects. NOTE: This option cannot be used with the - `createNewCopies` option. - in: query - name: compatibilityMode - required: false - schema: - type: boolean - requestBody: - content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - examples: - importObjectsRequest: - $ref: '#/components/examples/Saved_objects_import_objects_request' - schema: - type: object - properties: - file: - description: > - A file exported using the export API. NOTE: The - `savedObjects.maxImportExportSize` configuration setting - limits the number of saved objects which may be included in - this file. Similarly, the - `savedObjects.maxImportPayloadBytes` setting limits the - overall size of the file that can be imported. + - Fleet outputs + parameters: + - in: path + name: outputId required: true + schema: + type: string + /package_policies: + get: + operationId: get-package-policies + parameters: + - $ref: '#/components/parameters/Fleet_page_size' + - $ref: '#/components/parameters/Fleet_page_index' + - $ref: '#/components/parameters/Fleet_kuery' + - $ref: '#/components/parameters/Fleet_format' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - importObjectsResponse: - $ref: '#/components/examples/Saved_objects_import_objects_response' schema: type: object properties: - errors: - description: > - Indicates the import was unsuccessful and specifies the - objects that failed to import. - - - NOTE: One object may result in multiple errors, which - requires separate steps to resolve. For instance, a - `missing_references` error and conflict error. - items: - type: object - type: array - success: - description: > - Indicates when the import was successfully completed. When - set to false, some objects may not have been created. For - additional information, refer to the `errors` and - `successResults` properties. - type: boolean - successCount: - description: Indicates the number of successfully imported records. - type: integer - successResults: - description: > - Indicates the objects that are successfully imported, with - any metadata if applicable. - - - NOTE: Objects are created only when all resolvable errors - are addressed, including conflicts and missing references. - If objects are created as new copies, each entry in the - `successResults` array includes a `destinationId` - attribute. + items: items: - type: object + $ref: '#/components/schemas/Fleet_package_policy' type: array - description: Indicates a successful call. + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: List package policies + tags: + - Fleet package policies + parameters: [] + post: + operationId: create-package-policy + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_format' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_package_policy_request' + description: >- + You should use inputs as an object and not use the deprecated inputs + array. + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request. - summary: Import saved objects + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + '409': + $ref: '#/components/responses/Fleet_error' + summary: Create package policy tags: - - saved objects - /api/saved_objects/_resolve_import_errors: + - Fleet package policies + /package_policies/_bulk_get: post: - description: > - To resolve errors from the Import objects API, you can: - - - * Retry certain saved objects - - * Overwrite specific saved objects - - * Change references to different saved objects - - - This functionality is in technical preview and may be changed or removed - in a future release. Elastic will work to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. - operationId: resolveImportErrors + operationId: bulk-get-package-policies parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - description: > - Applies various adjustments to the saved objects that are being - imported to maintain compatibility between different Kibana - versions. When enabled during the initial import, also enable when - resolving import errors. This option cannot be used with the - `createNewCopies` option. - in: query - name: compatibilityMode - required: false - schema: - type: boolean - - description: > - Creates copies of the saved objects, regenerates each object ID, and - resets the origin. When enabled during the initial import, also - enable when resolving import errors. - in: query - name: createNewCopies - required: false - schema: - type: boolean + - $ref: '#/components/parameters/Fleet_format' requestBody: content: - multipart/form-data; Elastic-Api-Version=2023-10-31: - examples: - resolveImportErrorsRequest: - $ref: >- - #/components/examples/Saved_objects_resolve_missing_reference_request + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - file: - description: The same file given to the import API. - format: binary - type: string - retries: - description: >- - The retry operations, which can specify how to resolve - different types of errors. + ids: + description: list of package policy ids items: - type: object - properties: - destinationId: - description: >- - Specifies the destination ID that the imported object - should have, if different from the current ID. - type: string - id: - description: The saved object ID. - type: string - ignoreMissingReferences: - description: >- - When set to `true`, ignores missing reference errors. - When set to `false`, does nothing. - type: boolean - overwrite: - description: >- - When set to `true`, the source object overwrites the - conflicting destination object. When set to `false`, - does nothing. - type: boolean - replaceReferences: - description: >- - A list of `type`, `from`, and `to` used to change the - object references. - items: - type: object - properties: - from: - type: string - to: - type: string - type: - type: string - type: array - type: - description: The saved object type. - type: string - required: - - type - - id + type: string type: array + ignoreMissing: + type: boolean required: - - retries - required: true + - ids responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: - examples: - resolveImportErrorsResponse: - $ref: >- - #/components/examples/Saved_objects_resolve_missing_reference_response schema: type: object properties: - errors: - description: > - Specifies the objects that failed to resolve. - - - NOTE: One object can result in multiple errors, which - requires separate steps to resolve. For instance, a - `missing_references` error and a `conflict` error. + items: items: - type: object + $ref: '#/components/schemas/Fleet_package_policy' type: array - success: - description: > - Indicates a successful import. When set to `false`, some - objects may not have been created. For additional - information, refer to the `errors` and `successResults` - properties. - type: boolean - successCount: - description: | - Indicates the number of successfully resolved records. - type: number - successResults: - description: > - Indicates the objects that are successfully imported, with - any metadata if applicable. - - - NOTE: Objects are only created when all resolvable errors - are addressed, including conflict and missing references. - items: - type: object - type: array - description: Indicates a successful call. + required: + - items + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request. - summary: Resolve import errors + $ref: '#/components/responses/Fleet_error' + summary: Bulk get package policies tags: - - saved objects - '/api/saved_objects/{type}': - post: - deprecated: true - description: Create a Kibana saved object with a randomly generated identifier. - operationId: createSavedObject + - Fleet package policies + '/package_policies/{packagePolicyId}': + delete: + operationId: delete-package-policy parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - $ref: '#/components/parameters/Saved_objects_saved_object_type' - - description: 'If true, overwrites the document with the same identifier.' - in: query - name: overwrite + - in: query + name: force schema: type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - attributes: - $ref: '#/components/schemas/Saved_objects_attributes' - initialNamespaces: - $ref: '#/components/schemas/Saved_objects_initial_namespaces' - references: - $ref: '#/components/schemas/Saved_objects_references' - required: - - attributes - required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - description: Indicates a conflict error. - summary: Create a saved object + properties: + id: + type: string + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package policy by ID tags: - - saved objects - '/api/saved_objects/{type}/{id}': + - Fleet package policies get: - deprecated: true - description: Retrieve a single Kibana saved object by identifier. - operationId: getSavedObject + operationId: get-package-policy parameters: - - $ref: '#/components/parameters/Saved_objects_saved_object_id' - - $ref: '#/components/parameters/Saved_objects_saved_object_type' + - $ref: '#/components/parameters/Fleet_format' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + required: + - item + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request. - summary: Get a saved object + $ref: '#/components/responses/Fleet_error' + summary: Get package policy by ID tags: - - saved objects - post: - deprecated: true - description: >- - Create a Kibana saved object and specify its identifier instead of using - a randomly generated ID. - operationId: createSavedObjectId + - Fleet package policies + parameters: + - in: path + name: packagePolicyId + required: true + schema: + type: string + put: + operationId: update-package-policy parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - $ref: '#/components/parameters/Saved_objects_saved_object_id' - - $ref: '#/components/parameters/Saved_objects_saved_object_type' - - description: 'If true, overwrites the document with the same identifier.' - in: query - name: overwrite - schema: - type: boolean + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + - $ref: '#/components/parameters/Fleet_format' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - attributes: - $ref: '#/components/schemas/Saved_objects_attributes' - initialNamespaces: - $ref: '#/components/schemas/Saved_objects_initial_namespaces' - references: - $ref: '#/components/schemas/Saved_objects_initial_namespaces' - required: - - attributes - required: true + $ref: '#/components/schemas/Fleet_package_policy_request' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - description: Indicates a successful call. - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - description: Indicates a conflict error. - summary: Create a saved object + properties: + item: + $ref: '#/components/schemas/Fleet_package_policy' + sucess: + type: boolean + required: + - item + - sucess + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update package policy by ID tags: - - saved objects - put: - deprecated: true - description: Update the attributes for Kibana saved objects. - operationId: updateSavedObject + - Fleet package policies + /package_policies/delete: + post: + operationId: post-delete-package-policy parameters: - - $ref: '#/components/parameters/Saved_objects_kbn_xsrf' - - $ref: '#/components/parameters/Saved_objects_saved_object_id' - - $ref: '#/components/parameters/Saved_objects_saved_object_type' + - $ref: '#/components/parameters/Fleet_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object - required: true + properties: + force: + type: boolean + packagePolicyIds: + items: + type: string + type: array + required: + - packagePolicyIds responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - description: Indicates a successful call. - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - description: Indicates the object was not found. - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - description: Indicates a conflict error. - summary: Update a saved object + items: + type: object + properties: + id: + type: string + name: + type: string + success: + type: boolean + required: + - id + - success + type: array + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete package policy tags: - - saved objects - '/api/saved_objects/resolve/{type}/{id}': - get: - deprecated: true - description: > - Retrieve a single Kibana saved object by identifier using any legacy URL - alias if it exists. Under certain circumstances, when Kibana is - upgraded, saved object migrations may necessitate regenerating some - object IDs to enable new features. When an object's ID is regenerated, a - legacy URL alias is created for that object, preserving its old ID. In - such a scenario, that object can be retrieved using either its new ID or - its old ID. - operationId: resolveSavedObject - parameters: - - $ref: '#/components/parameters/Saved_objects_saved_object_id' - - $ref: '#/components/parameters/Saved_objects_saved_object_type' + - Fleet package policies + /package_policies/upgrade: + post: + operationId: upgrade-package-policy + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + packagePolicyIds: + items: + type: string + type: array + required: + - packagePolicyIds responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - description: Indicates a successful call. + items: + type: object + properties: + id: + type: string + name: + type: string + success: + type: boolean + required: + - id + - success + type: array + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Saved_objects_400_response' - description: Bad request. - summary: Resolve a saved object + $ref: '#/components/responses/Fleet_error' + '409': + $ref: '#/components/responses/Fleet_error' + summary: Upgrade package policy to a newer package version tags: - - saved objects - /api/security_ai_assistant/anonymization_fields/_bulk_action: + - Fleet package policies + /package_policies/upgrade/dryrun: post: - description: >- - The bulk action is applied to all anonymization fields that match the - filter or to the list of anonymization fields by their IDs. - operationId: PerformAnonymizationFieldsBulkAction + operationId: upgrade-package-policy-dry-run requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - create: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldCreateProps - type: array - delete: - type: object - properties: - ids: - description: Array of anonymization fields IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter anonymization fields - type: string - update: + packagePolicyIds: items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldUpdateProps + type: string type: array + packageVersion: + type: string + required: + - packagePolicyIds responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResponse - description: Indicates a successful call. + items: + type: object + properties: + agent_diff: + $ref: '#/components/schemas/Fleet_upgrade_agent_diff' + diff: + $ref: '#/components/schemas/Fleet_upgrade_diff' + hasErrors: + type: boolean + required: + - hasErrors + type: array + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Dry run package policy upgrade + tags: + - Fleet package policies + /proxies: + get: + operationId: get-fleet-proxies + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple anonymization fields - tags: - - Security AI Assistant API - - Bulk API - /api/security_ai_assistant/anonymization_fields/_find: - get: - description: Finds anonymization fields that match the given query. - operationId: FindAnonymizationFields - parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindAnonymizationFieldsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: AnonymizationFields per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - data: + items: items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse + $ref: '#/components/schemas/Fleet_proxies' type: array page: type: integer @@ -8780,1146 +12501,681 @@ paths: type: integer total: type: integer - required: - - page - - perPage - - total - - data - description: Successful response + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds anonymization fields that match the given query. + $ref: '#/components/responses/Fleet_error' + summary: List proxies tags: - - Security AI Assistant API - - AnonymizationFields API - /api/security_ai_assistant/chat/complete: + - Fleet proxies post: - description: Creates a model response for the given chat conversation. - operationId: ChatComplete + operationId: post-fleet-proxies requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatCompleteProps' - required: true + type: object + properties: + certificate: + type: string + certificate_authorities: + type: string + certificate_key: + type: string + id: + type: string + name: + type: string + proxy_headers: + type: object + url: + type: string + required: + - name + - url responses: '200': content: - application/octet-stream; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: schema: - format: binary - type: string - description: Indicates a successful call. + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_proxies' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Create proxy + tags: + - Fleet proxies + '/proxies/{itemId}': + delete: + operationId: delete-fleet-proxies + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: + id: type: string - statusCode: - type: number - description: Generic Error - summary: Creates a model response for the given chat conversation. + required: + - id + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Delete proxy by ID tags: - - Security AI Assistant API - - Chat Complete API - /api/security_ai_assistant/current_user/conversations: - post: - description: Create a conversation - operationId: CreateConversation - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationCreateProps - required: true + - Fleet proxies + get: + operationId: get-one-fleet-proxies responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. + type: object + properties: + item: + $ref: '#/components/schemas/Fleet_proxies' + required: + - item + description: OK '400': + $ref: '#/components/responses/Fleet_error' + summary: Get proxy by ID + tags: + - Fleet proxies + parameters: + - in: path + name: itemId + required: true + schema: + type: string + put: + operationId: update-fleet-proxies + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + certificate: + type: string + certificate_authorities: + type: string + certificate_key: + type: string + name: + type: string + proxy_headers: + type: object + url: + type: string + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Create a conversation + item: + $ref: '#/components/schemas/Fleet_proxies' + required: + - item + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update proxy by ID tags: - - Security AI Assistant API - - Conversation API - /api/security_ai_assistant/current_user/conversations/_find: + - Fleet proxies + '/s/{spaceId}/api/observability/slos': get: - description: Finds conversations that match the given query. - operationId: FindConversations + description: > + You must have the `read` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: findSlosOp parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - description: A valid kql query to filter the SLO with + example: 'slo.name:latency* and slo.tags : "prod"' in: query - name: filter - required: false + name: kqlQuery schema: type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindConversationsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number + - description: 'The page to use for pagination, must be greater or equal than 1' + example: 1 in: query name: page - required: false schema: default: 1 - minimum: 1 type: integer - - description: Conversations per page + - description: Number of SLOs returned by page + example: 25 in: query - name: per_page - required: false + name: perPage schema: - default: 20 - minimum: 0 + default: 25 + maximum: 5000 type: integer + - description: Sort by field + example: status + in: query + name: sortBy + schema: + default: status + enum: + - sli_value + - status + - error_budget_consumed + - error_budget_remaining + type: string + - description: Sort order + example: asc + in: query + name: sortDirection + schema: + default: asc + enum: + - asc + - desc + type: string + - description: >- + Hide stale SLOs from the list as defined by stale SLO threshold in + SLO settings + in: query + name: hideStale + schema: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response + $ref: '#/components/schemas/SLOs_find_slo_response' + description: Successful request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds conversations that match the given query. - tags: - - Security AI Assistant API - - Conversations API - '/api/security_ai_assistant/current_user/conversations/{id}': - delete: - description: Deletes a single conversation using the `id` field. - operationId: DeleteConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - responses: - '200': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Deletes a single conversation using the `id` field. - tags: - - Security AI Assistant API - - Conversation API - get: - description: Read a single conversation - operationId: ReadConversation - parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Read a single conversation + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Get a paginated list of SLOs tags: - - Security AI Assistant API - - Conversations API - put: - description: Update a single conversation - operationId: UpdateConversation + - slo + post: + description: > + You must have `all` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: createSloOp parameters: - - description: The conversation's `id` value. - in: path - name: id - required: true - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationUpdateProps + $ref: '#/components/schemas/SLOs_create_slo_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationResponse - description: Indicates a successful call. + $ref: '#/components/schemas/SLOs_create_slo_response' + description: Successful request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Update a conversation + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '409': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_409_response' + description: Conflict - The SLO id already exists + summary: Create an SLO tags: - - Security AI Assistant API - - Conversation API - /api/security_ai_assistant/prompts/_bulk_action: + - slo + '/s/{spaceId}/api/observability/slos/_delete_instances': post: - description: >- - The bulk action is applied to all prompts that match the filter or to - the list of prompts by their IDs. - operationId: PerformPromptsBulkAction + description: > + The deletion occurs for the specified list of `sloId` and `instanceId`. + You must have `all` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: deleteSloInstancesOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - create: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptCreateProps - type: array - delete: - type: object - properties: - ids: - description: Array of prompts IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter promps - type: string - update: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptUpdateProps - type: array + $ref: '#/components/schemas/SLOs_delete_slo_instances_request' + required: true responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse - description: Indicates a successful call. - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Applies a bulk action to multiple prompts + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + summary: Batch delete rollup and summary data tags: - - Security AI Assistant API - - Bulk API - /api/security_ai_assistant/prompts/_find: - get: - description: Finds prompts that match the given query. - operationId: FindPrompts + - slo + '/s/{spaceId}/api/observability/slos/{sloId}': + delete: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: deleteSloOp parameters: - - in: query - name: fields - required: false - schema: - items: - type: string - type: array - - description: Search query - in: query - name: filter - required: false - schema: - type: string - - description: Field to sort by - in: query - name: sort_field - required: false - schema: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_FindPromptsSortField - - description: Sort order - in: query - name: sort_order - required: false - schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: Prompts per page - in: query - name: per_page - required: false - schema: - default: 20 - minimum: 0 - type: integer + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptResponse - type: array - page: - type: integer - perPage: - type: integer - total: - type: integer - required: - - page - - perPage - - total - - data - description: Successful response - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - description: Generic Error - summary: Finds prompts that match the given query. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Delete an SLO tags: - - Security AI Assistant API - - Prompts API - /api/status: + - slo get: - operationId: /api/status#0 + description: > + You must have the `read` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: getSloOp parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: Set to "true" to get the response in v7 format. - in: query - name: v7format - required: false - schema: - type: boolean - - description: Set to "true" to get the response in v8 format. + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' + - description: the specific instanceId used by the summary calculation + example: host-abcde in: query - name: v8format - required: false + name: instanceId schema: - type: boolean + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - anyOf: - - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' - - $ref: >- - #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse - description: >- - Kibana's operational status. A minimal response is sent for - unauthorized users. - description: Overall status is OK and Kibana should be functioning normally. - '503': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - anyOf: - - $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' - - $ref: >- - #/components/schemas/Kibana_HTTP_APIs_core_status_redactedResponse - description: >- - Kibana's operational status. A minimal response is sent for - unauthorized users. - description: >- - Kibana or some of it's essential services are unavailable. Kibana - may be degraded or unavailable. - summary: Get Kibana's current status - tags: - - system - /api/timeline: - delete: - operationId: DeleteTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - savedObjectIds: - items: - type: string - type: array - searchIds: - description: >- - Saved search ids that should be deleted alongside the - timelines - items: - type: string - type: array - required: - - savedObjectIds - description: The ids of the timelines or timeline templates to delete. - required: true - responses: - '200': + $ref: '#/components/schemas/SLOs_slo_with_summary_response' + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - deleteTimeline: - type: boolean - required: - - deleteTimeline - required: - - data - description: Indicates the timeline was successfully deleted. - summary: Deletes one or more timelines or timeline templates. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - get: - operationId: GetTimeline - parameters: - - description: The ID of the template timeline to retrieve - in: query - name: template_timeline_id - schema: - type: string - - description: The ID of the timeline to retrieve - in: query - name: id - schema: - type: string - responses: - '200': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - getOneTimeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - nullable: true - required: - - getOneTimeline - required: - - data - description: Indicates that the (template) timeline was found and returned. - summary: >- - Get an existing saved timeline or timeline template. This API is used to - retrieve an existing saved timeline or timeline template. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - patch: - description: >- - Updates an existing timeline. This API is used to update the title, - description, date range, pinned events, pinned queries, and/or pinned - saved queries of an existing timeline. - operationId: PatchTimeline - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - timelineId: - nullable: true - type: string - version: - nullable: true - type: string - required: - - timelineId - - version - - timeline - description: The timeline updates along with the timeline ID and version. - required: true - responses: - '200': + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: >- - Indicates that the draft timeline was successfully created. In the - event the user already has a draft timeline, the existing draft - timeline is cleared and returned. - '405': + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: >- - Indicates that the user does not have the required access to create - a draft timeline. - summary: Updates an existing timeline. + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Get an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' - post: - operationId: CreateTimelines + - slo + put: + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: updateSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - status: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineStatus - nullable: true - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - timelineId: - nullable: true - type: string - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - nullable: true - version: - nullable: true - type: string - required: - - timeline - description: >- - The required timeline fields used to create a new timeline along with - optional fields that will be created if not provided. + $ref: '#/components/schemas/SLOs_update_slo_request' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - persistTimeline - required: - - data - description: Indicates the timeline was successfully created. - '405': + $ref: '#/components/schemas/SLOs_slo_definition_response' + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: Indicates that there was an error in the timeline creation. - summary: Creates a new timeline. - tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_draft: - get: - operationId: GetDraftTimelines - parameters: - - in: query - name: timelineType - required: true - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' - responses: - '200': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: Indicates that the draft timeline was successfully retrieved. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response '403': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - If a draft timeline was not found and we attempted to create one, it - indicates that the user does not have the required permissions to - create a draft timeline. - '409': + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - This should never happen, but if a draft timeline was not found and - we attempted to create one, it indicates that there is already a - draft timeline with the given timelineId. - summary: >- - Retrieves the draft timeline for the current user. If the user does not - have a draft timeline, an empty timeline is returned. + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Update an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/_reset': post: description: > - Retrieves a clean draft timeline. If a draft timeline does not exist, it - is created and returned. - operationId: CleanDraftTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - required: - - timelineType - description: >- - The type of timeline to create. Valid values are `default` and - `template`. - required: true + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: resetSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistTimeline: - type: object - properties: - timeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - required: - - timeline - required: - - persistTimeline - required: - - data - description: >- - Indicates that the draft timeline was successfully created. In the - event the user already has a draft timeline, the existing draft - timeline is cleared and returned. - '403': + $ref: '#/components/schemas/SLOs_slo_definition_response' + description: Successful request + '400': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - Indicates that the user does not have the required permissions to - create a draft timeline. - '409': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - message: - type: string - status_code: - type: number - description: >- - Indicates that there is already a draft timeline with the given - timelineId. - summary: Retrieves a draft timeline or timeline template. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Reset an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_export: + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/disable': post: - operationId: ExportTimelines + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: disableSloOp parameters: - - description: The name of the file to export - in: query - name: file_name - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - ids: - items: - type: string - nullable: true - type: array - description: The ids of the timelines to export - required: true + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: '200': - content: - application/ndjson; Elastic-Api-Version=2023-10-31: - schema: - description: NDJSON of the exported timelines - type: string - description: Indicates the timelines were successfully exported + description: Successful request '400': content: - application/ndjson; Elastic-Api-Version=2023-10-31: + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: Indicates that the export size limit was exceeded - summary: Exports timelines as an NDJSON file - tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_favorite: - patch: - operationId: PersistFavoriteRoute - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timelineId: - nullable: true - type: string - timelineType: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineType - nullable: true - required: - - timelineId - - templateTimelineId - - templateTimelineVersion - - timelineType - description: The required fields used to favorite a (template) timeline. - required: true - responses: - '200': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - persistFavorite: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResponse - required: - - persistFavorite - required: - - data - description: Indicates the favorite status was successfully updated. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response '403': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: >- - Indicates the user does not have the required permissions to persist - the favorite status. - summary: Persists a given users favorite status of a timeline. + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Disable an SLO tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_import: + - slo + '/s/{spaceId}/api/observability/slos/{sloId}/enable': post: - operationId: ImportTimelines - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - type: object - properties: - file: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_Readable - - type: object - properties: - hapi: - type: object - properties: - filename: - type: string - headers: - type: object - isImmutable: - enum: - - 'true' - - 'false' - type: string - required: - - filename - - headers - required: - - hapi - description: The timelines to import as a readable stream. - required: true + description: > + You must have the `write` privileges for the **SLOs** feature in the + **Observability** section of the Kibana feature privileges. + operationId: enableSloOp + parameters: + - $ref: '#/components/parameters/SLOs_kbn_xsrf' + - $ref: '#/components/parameters/SLOs_space_id' + - $ref: '#/components/parameters/SLOs_slo_id' responses: - '200': + '204': + description: Successful request + '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelineResult - required: - - data - description: Indicates the import of timelines was successful. - '400': + $ref: '#/components/schemas/SLOs_400_response' + description: Bad request + '401': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - body: - type: string - id: - type: string - statusCode: - type: number - description: >- - Indicates the import of timelines was unsuccessful because of an - invalid file extension. + $ref: '#/components/schemas/SLOs_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_403_response' + description: Unauthorized response '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/SLOs_404_response' + description: Not found response + summary: Enable an SLO + tags: + - slo + /service_tokens: + post: + operationId: generate-service-token + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - id: + name: type: string - statusCode: - type: number - description: >- - Indicates that we were unable to locate the saved object client - necessary to handle the import. - '409': + value: + type: string + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create service token + tags: + - Fleet service tokens + /service-tokens: + post: + deprecated: true + operationId: generate-service-token-deprecated + parameters: + - $ref: '#/components/parameters/Fleet_kbn_xsrf' + responses: + '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - body: + name: type: string - id: + value: type: string - statusCode: - type: number - description: Indicates the import of timelines was unsuccessful. - summary: Imports timelines. + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Create service token tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/_prepackaged: - post: - operationId: InstallPrepackedTimelines + - Fleet service tokens + /settings: + get: + operationId: get-settings + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Fleet_fleet_settings_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Get settings + tags: + - Fleet internals + put: + operationId: update-settings requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - prepackagedTimelines: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SavedTimeline - type: array - timelinesToInstall: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelines - nullable: true - type: array - timelinesToUpdate: + additional_yaml_config: + type: string + fleet_server_hosts: + description: Protocol and path must be the same for each URL items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelines - nullable: true + type: string type: array - required: - - timelinesToInstall - - timelinesToUpdate - - prepackagedTimelines - description: The timelines to install or update. - required: true + has_seen_add_data_notice: + type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ImportTimelineResult - required: - - data - description: Indicates the installation of prepackaged timelines was successful. - '500': - content: - 'application:json; Elastic-Api-Version=2023-10-31': - schema: - type: object - properties: - body: - type: string - statusCode: - type: number - description: >- - Indicates the installation of prepackaged timelines was - unsuccessful. - summary: Installs prepackaged timelines. + $ref: '#/components/schemas/Fleet_fleet_settings_response' + description: OK + '400': + $ref: '#/components/responses/Fleet_error' + summary: Update settings tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timeline/resolve: + - Fleet internals + /settings/enrollment: get: - operationId: ResolveTimeline + operationId: get-enrollment-settings parameters: - - description: The ID of the template timeline to resolve - in: query - name: template_timeline_id - schema: - type: string - - description: The ID of the timeline to resolve + - description: >- + An agent policy ID to scope the enrollment settings to. For example, + that policy's Fleet Server host, its proxy, download location, etc. + If not provided, the default Fleet Server policy is used (if any). in: query - name: id + name: agentPolicyId + required: false schema: type: string responses: @@ -9927,17909 +13183,13175 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - getOneTimeline: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - nullable: true - required: - - getOneTimeline - required: - - data - description: The (template) timeline has been found + $ref: '#/components/schemas/Fleet_fleet_settings_enrollment_response' + description: OK '400': - description: The request is missing parameters - '404': - description: The (template) timeline was not found - summary: Get an existing saved timeline or timeline template. + $ref: '#/components/responses/Fleet_error' + summary: Get enrollment settings tags: - - Security Solution Timeline API - - 'access:securitySolution' - /api/timelines: - get: - operationId: GetTimelines + - Fleet internals + /setup: + post: + operationId: setup parameters: - - description: >- - If true, only timelines that are marked as favorites by the user are - returned. - in: query - name: only_user_favorite - schema: - enum: - - 'true' - - 'false' - nullable: true - type: string - - in: query - name: timeline_type - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' - nullable: true - - in: query - name: sort_field - schema: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SortFieldTimeline - - in: query - name: sort_order - schema: - enum: - - asc - - desc - type: string - - in: query - name: page_size - schema: - nullable: true - type: string - - in: query - name: page_index - schema: - nullable: true - type: string - - in: query - name: search - schema: - nullable: true - type: string - - in: query - name: status - schema: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineStatus' - nullable: true + - $ref: '#/components/parameters/Fleet_kbn_xsrf' responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - data: - type: object - properties: - customTemplateTimelineCount: - type: number - defaultTimelineCount: - type: number - elasticTemplateTimelineCount: - type: number - favoriteCount: - type: number - templateTimelineCount: - type: number - timelines: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_TimelineResponse - type: array - totalCount: - type: number - required: - - timelines - - totalCount - - defaultTimelineCount - - templateTimelineCount - - favoriteCount - - elasticTemplateTimelineCount - - customTemplateTimelineCount - required: - - data - description: Indicates that the (template) timelines were found and returned. + $ref: '#/components/schemas/Fleet_fleet_setup_response' + description: OK '400': + $ref: '#/components/responses/Fleet_error' + '500': content: - 'application:json; Elastic-Api-Version=2023-10-31': + application/json; Elastic-Api-Version=2023-10-31: schema: type: object properties: - body: + message: type: string - statusCode: - type: number - description: Bad request. The user supplied invalid data. - summary: >- - This API is used to retrieve a list of existing saved timelines or - timeline templates. + description: Internal Server Error + summary: Initiate Fleet setup tags: - - Security Solution Timeline API - - 'access:securitySolution' - '/s/{spaceId}/api/observability/slos': + - Fleet internals + /uninstall_tokens: get: - description: > - You must have the `read` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: findSlosOp + operationId: get-uninstall-tokens parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - description: A valid kql query to filter the SLO with - example: 'slo.name:latency* and slo.tags : "prod"' - in: query - name: kqlQuery - schema: - type: string - - description: 'The page to use for pagination, must be greater or equal than 1' - example: 1 - in: query - name: page - schema: - default: 1 - type: integer - - description: Number of SLOs returned by page - example: 25 + - description: The number of items to return in: query name: perPage + required: false schema: - default: 25 - maximum: 5000 + default: 20 + minimum: 5 type: integer - - description: Sort by field - example: status - in: query - name: sortBy - schema: - default: status - enum: - - sli_value - - status - - error_budget_consumed - - error_budget_remaining - type: string - - description: Sort order - example: asc + - $ref: '#/components/parameters/Fleet_page_index' + - description: Partial match filtering for policy IDs in: query - name: sortDirection + name: policyId + required: false schema: - default: asc - enum: - - asc - - desc type: string - - description: >- - Hide stale SLOs from the list as defined by stale SLO threshold in - SLO settings - in: query - name: hideStale - schema: - type: boolean responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/SLOs_find_slo_response' - description: Successful request + type: object + properties: + items: + items: + type: object + properties: + created_at: + type: string + id: + type: string + policy_id: + type: string + required: + - id + - policy_id + - created_at + type: array + page: + type: number + perPage: + type: number + total: + type: number + required: + - items + - total + - page + - perPage + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Get a paginated list of SLOs + $ref: '#/components/responses/Fleet_error' + summary: List metadata for latest uninstall tokens per agent policy tags: - - slo - post: - description: > - You must have `all` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: createSloOp + - Fleet uninstall tokens + '/uninstall_tokens/{uninstallTokenId}': + get: + operationId: get-uninstall-token parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_create_slo_request' - required: true + - in: path + name: uninstallTokenId + required: true + schema: + type: string responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/SLOs_create_slo_response' - description: Successful request + type: object + properties: + item: + type: object + properties: + created_at: + type: string + id: + type: string + policy_id: + type: string + token: + type: string + required: + - id + - token + - policy_id + - created_at + required: + - item + description: OK '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '409': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_409_response' - description: Conflict - The SLO id already exists - summary: Create an SLO + $ref: '#/components/responses/Fleet_error' + summary: Get one decrypted uninstall token by its ID tags: - - slo - '/s/{spaceId}/api/observability/slos/_delete_instances': - post: - description: > - The deletion occurs for the specified list of `sloId` and `instanceId`. - You must have `all` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: deleteSloInstancesOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_delete_slo_instances_request' - required: true - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - summary: Batch delete rollup and summary data - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}': - delete: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: deleteSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Delete an SLO - tags: - - slo - get: - description: > - You must have the `read` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: getSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - - description: the specific instanceId used by the summary calculation - example: host-abcde - in: query - name: instanceId - schema: - type: string - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_with_summary_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Get an SLO - tags: - - slo - put: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: updateSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_update_slo_request' - required: true - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_definition_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Update an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/_reset': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: resetSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_slo_definition_response' - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Reset an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/disable': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: disableSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '200': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Disable an SLO - tags: - - slo - '/s/{spaceId}/api/observability/slos/{sloId}/enable': - post: - description: > - You must have the `write` privileges for the **SLOs** feature in the - **Observability** section of the Kibana feature privileges. - operationId: enableSloOp - parameters: - - $ref: '#/components/parameters/SLOs_kbn_xsrf' - - $ref: '#/components/parameters/SLOs_space_id' - - $ref: '#/components/parameters/SLOs_slo_id' - responses: - '204': - description: Successful request - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_400_response' - description: Bad request - '401': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_401_response' - description: Unauthorized response - '403': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_403_response' - description: Unauthorized response - '404': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/SLOs_404_response' - description: Not found response - summary: Enable an SLO - tags: - - slo -components: - examples: - Connectors_create_email_connector_request: - summary: Create an email connector. - value: - config: - from: tester@example.com - hasAuth: true - host: 'https://example.com' - port: 1025 - secure: false - service: other - connector_type_id: .email - name: email-connector-1 - secrets: - password: password - user: username - Connectors_create_email_connector_response: - summary: A new email connector. - value: - config: - clientId: null - from: tester@example.com - hasAuth: true - host: 'https://example.com' - oauthTokenUrl: null - port: 1025 - secure: false - service: other - tenantId: null - connector_type_id: .email - id: 90a82c60-478f-11ee-a343-f98a117c727f - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: email-connector-1 - Connectors_create_index_connector_request: - summary: Create an index connector. - value: - config: - index: test-index - connector_type_id: .index - name: my-connector - Connectors_create_index_connector_response: - summary: A new index connector. - value: - config: - executionTimeField: null - index: test-index - refresh: false - connector_type_id: .index - id: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-connector - Connectors_create_webhook_connector_request: - summary: Create a webhook connector with SSL authentication. - value: - config: - authType: webhook-authentication-ssl - certType: ssl-crt-key - method: post - url: 'https://example.com' - connector_type_id: .webhook - name: my-webhook-connector - secrets: - crt: QmFnIEF0dH... - key: LS0tLS1CRUdJ... - password: my-passphrase - Connectors_create_webhook_connector_response: - summary: A new webhook connector. - value: - config: - authType: webhook-authentication-ssl - certType: ssl-crt-key - hasAuth: true - headers: null - method: post - url: 'https://example.com' - verificationMode: full - connector_type_id: .webhook - id: 900eb010-3b9d-11ee-a642-8ffbb94e38bd - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-webhook-connector - Connectors_create_xmatters_connector_request: - summary: Create an xMatters connector with URL authentication. - value: - config: - usesBasic: false - connector_type_id: .xmatters - name: my-xmatters-connector - secrets: - secretsUrl: 'https://example.com?apiKey=xxxxx' - Connectors_create_xmatters_connector_response: - summary: A new xMatters connector. - value: - config: - configUrl: null - usesBasic: false - connector_type_id: .xmatters - id: 4d2d8da0-4d1f-11ee-9367-577408be4681 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-xmatters-connector - Connectors_get_connector_response: - summary: Get connector details. - value: - config: {} - connector_type_id: .server-log - id: df770e30-8b8b-11ed-a780-3b746c987a81 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my_server_log_connector - Connectors_get_connector_types_generativeai_response: - summary: A list of connector types for the `generativeAI` feature. - value: - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .gen-ai - is_system_action_type: false - minimum_license_required: enterprise - name: OpenAI - supported_feature_ids: - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .bedrock - is_system_action_type: false - minimum_license_required: enterprise - name: AWS Bedrock - supported_feature_ids: - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - enabled: true - enabled_in_config: true - enabled_in_license: true - id: .gemini - is_system_action_type: false - minimum_license_required: enterprise - name: Google Gemini - supported_feature_ids: - - generativeAIForSecurity - Connectors_get_connectors_response: - summary: A list of connectors - value: - - connector_type_id: .email - id: preconfigured-email-connector - is_deprecated: false - is_preconfigured: true - is_system_action: false - name: my-preconfigured-email-notification - referenced_by_count: 0 - - config: - executionTimeField: null - index: test-index - refresh: false - connector_type_id: .index - id: e07d0c80-8b8b-11ed-a780-3b746c987a81 - is_deprecated: false - is_missing_secrets: false - is_preconfigured: false - is_system_action: false - name: my-index-connector - referenced_by_count: 2 - Connectors_run_cases_webhook_connector_request: - summary: Run a Webhook - Case Management connector to create a case. - value: - params: - subAction: pushToService - subActionParams: - comments: - - comment: A comment about the incident. - commentId: 1 - incident: - description: Description of the incident. - id: caseID - severity: low - status: open - tags: - - tag1 - - tag2 - title: Case title - Connectors_run_cases_webhook_connector_response: - summary: >- - Response from a pushToService action for a Webhook - Case Management - connector. - value: - connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 - data: - comments: - - commentId: 1 - pushedDate: '2023-12-05T19:43:36.360Z' - id: 100665 - pushedDate: '2023-12-05T19:43:36.360Z' - title: TEST-29034 - url: 'https://example.com/browse/TEST-29034' - status: ok - Connectors_run_email_connector_request: - summary: Send an email message from an email connector. - value: - params: - bcc: - - user1@example.com - cc: - - user2@example.com - - user3@example.com - message: Test email message. - subject: Test message subject - to: - - user4@example.com - Connectors_run_email_connector_response: - summary: Response for sending a message from an email connector. - value: - connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 - data: - accepted: - - user1@example.com - - user2@example.com - - user3@example.com - - user4@example.com - envelope: - from: tester@example.com - to: - - user1@example.com - - user2@example.com - - user3@example.com - - user4@example.com - envelopeTime: 8 - messageId: <08a92d29-642a-0706-750c-de5996bd5cf3@example.com> - messageSize: 729 - messageTime: 3 - rejected: [] - response: 250 Message queued as QzEXKcGJ - status: ok - Connectors_run_index_connector_request: - summary: Run an index connector. - value: - params: - documents: - - id: my_doc_id - message: 'hello, world' - name: my_doc_name - Connectors_run_index_connector_response: - summary: Response from running an index connector. - value: - connector_id: fd38c600-96a5-11ed-bb79-353b74189cba - data: - errors: false - items: - - create: - _id: 4JtvwYUBrcyxt2NnfW3y - _index: my-index - _primary_term: 1 - _seq_no: 0 - _shards: - failed: 0 - successful: 1 - total: 2 - _version: 1 - result: created - status: 201 - took: 135 - status: ok - Connectors_run_jira_connector_request: - summary: Run a Jira connector to retrieve the list of issue types. - value: - params: - subAction: issueTypes - Connectors_run_jira_connector_response: - summary: Response from retrieving the list of issue types for a Jira connector. - value: - connector_id: b3aad810-edbe-11ec-82d1-11348ecbf4a6 - data: - - id: 10024 - name: Improvement - - id: 10006 - name: Task - - id: 10007 - name: Sub-task - - id: 10025 - name: New Feature - - id: 10023 - name: Bug - - id: 10000 - name: Epic - status: ok - Connectors_run_pagerduty_connector_request: - summary: Run a PagerDuty connector to trigger an alert. - value: - params: - customDetails: - my_data_1: test data - eventAction: trigger - links: - - href: 'http://example.com/pagerduty' - text: An example link - summary: A brief event summary - Connectors_run_pagerduty_connector_response: - summary: Response from running a PagerDuty connector. - value: - connector_id: 45de9f70-954f-4608-b12a-db7cf808e49d - data: - dedup_key: 5115e138b26b484a81eaea779faa6016 - message: Event processed - status: success - status: ok - Connectors_run_server_log_connector_request: - summary: Run a server log connector. - value: - params: - level: warn - message: Test warning message. - Connectors_run_server_log_connector_response: - summary: Response from running a server log connector. - value: - connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 - status: ok - Connectors_run_servicenow_itom_connector_request: - summary: Run a ServiceNow ITOM connector to retrieve the list of choices. - value: - params: - subAction: getChoices - subActionParams: - fields: - - severity - - urgency - Connectors_run_servicenow_itom_connector_response: - summary: >- - Response from retrieving the list of choices for a ServiceNow ITOM - connector. - value: - connector_id: 9d9be270-2fd2-11ed-b0e0-87533c532698 - data: - - dependent_value: '' - element: severity - label: Critical - value: 1 - - dependent_value: '' - element: severity - label: Major - value: 2 - - dependent_value: '' - element: severity - label: Minor - value: 3 - - dependent_value: '' - element: severity - label: Warning - value: 4 - - dependent_value: '' - element: severity - label: OK - value: 5 - - dependent_value: '' - element: severity - label: Clear - value: 0 - - dependent_value: '' - element: urgency - label: 1 - High - value: 1 - - dependent_value: '' - element: urgency - label: 2 - Medium - value: 2 - - dependent_value: '' - element: urgency - label: 3 - Low - value: 3 - status: ok - Connectors_run_slack_api_connector_request: - summary: >- - Run a Slack connector that uses the web API method to post a message on - a channel. - value: - params: - subAction: postMessage - subActionParams: - channelIds: - - C123ABC456 - text: A test message. - Connectors_run_slack_api_connector_response: - summary: Response from posting a message with a Slack connector. - value: - connector_id: .slack_api - data: - channel: C123ABC456 - message: - app_id: A01BC2D34EF - blocks: - - block_id: /NXe - elements: - - elements: - - text: A test message. - type: text - type: rich_text_section - type: rich_text - bot_id: B12BCDEFGHI - bot_profile: - app_id: A01BC2D34EF - deleted: false - icons: - image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png' - id: B12BCDEFGHI - name: test - team_id: T01ABCDE2F - updated: 1672169705 - team: T01ABCDE2F - text: A test message - ts: '1234567890.123456' - type: message - user: U12A345BC6D - ok: true - ts: '1234567890.123456' - status: ok - Connectors_run_swimlane_connector_request: - summary: Run a Swimlane connector to create an incident. - value: - params: - subAction: pushToService - subActionParams: - comments: - - comment: A comment about the incident. - commentId: 1 - incident: - caseId: '1000' - caseName: Case name - description: Description of the incident. - Connectors_run_swimlane_connector_response: - summary: Response from creating a Swimlane incident. - value: - connector_id: a4746470-2f94-11ed-b0e0-87533c532698 - data: - comments: - - commentId: 1 - pushedDate: '2022-09-08T16:52:27.865Z' - id: aKPmBHWzmdRQtx6Mx - pushedDate: '2022-09-08T16:52:27.866Z' - title: TEST-457 - url: >- - https://elastic.swimlane.url.us/record/aNcL2xniGHGpa2AHb/aKPmBHWzmdRQtx6Mx - status: ok - Connectors_update_index_connector_request: - summary: Update an index connector. - value: - config: - index: updated-index - name: updated-connector - Data_views_create_data_view_request: - summary: Create a data view with runtime fields. - value: - data_view: - name: My Logstash data view - runtimeFieldMap: - runtime_shape_name: - script: - source: 'emit(doc[''shape_name''].value)' - type: keyword - title: logstash-* - Data_views_create_runtime_field_request: - summary: Create a runtime field. - value: - name: runtimeFoo - runtimeField: - script: - source: 'emit(doc["foo"].value)' - type: long - Data_views_get_data_view_response: - summary: >- - The get data view API returns a JSON object that contains information - about the data view. - value: - data_view: - allowNoIndex: false - fieldAttrs: - products.manufacturer: - count: 1 - products.price: - count: 1 - products.product_name: - count: 1 - total_quantity: - count: 1 - fieldFormats: - products.base_price: - id: number - params: - pattern: '$0,0.00' - products.base_unit_price: - id: number - params: - pattern: '$0,0.00' - products.min_price: - id: number - params: - pattern: '$0,0.00' - products.price: - id: number - params: - pattern: '$0,0.00' - products.taxful_price: - id: number - params: - pattern: '$0,0.00' - products.taxless_price: - id: number - params: - pattern: '$0,0.00' - taxful_total_price: - id: number - params: - pattern: '$0,0.[00]' - taxless_total_price: - id: number - params: - pattern: '$0,0.00' - fields: - _id: - aggregatable: false - count: 0 - esTypes: - - _id - format: - id: string - isMapped: true - name: _id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _index: - aggregatable: true - count: 0 - esTypes: - - _index - format: - id: string - isMapped: true - name: _index - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _score: - aggregatable: false - count: 0 - format: - id: number - isMapped: true - name: _score - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: number - _source: - aggregatable: false - count: 0 - esTypes: - - _source - format: - id: _source - isMapped: true - name: _source - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: _source - category: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: category - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - category.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: category.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: category - type: string - currency: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: currency - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_birth_date: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: customer_birth_date - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - customer_first_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_first_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_first_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_first_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_first_name - type: string - customer_full_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_full_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_full_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_full_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_full_name - type: string - customer_gender: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_gender - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_id: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_last_name: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: customer_last_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - customer_last_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_last_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: customer_last_name - type: string - customer_phone: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: customer_phone - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - day_of_week: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: day_of_week - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - day_of_week_i: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: day_of_week_i - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - email: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: email - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - event.dataset: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: event.dataset - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.city_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.city_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.continent_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.continent_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.country_iso_code: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.country_iso_code - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - geoip.location: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: geoip.location - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - geoip.region_name: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: geoip.region_name - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - manufacturer: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: manufacturer - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - manufacturer.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: manufacturer.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: manufacturer - type: string - order_date: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: order_date - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - order_id: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: order_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - products._id: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: products._id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products._id.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products._id.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products._id - type: string - products.base_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.base_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.base_unit_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.base_unit_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.category: - aggregatable: false - count: 0 - esTypes: - - text - format: - id: string - isMapped: true - name: products.category - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.category.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.category.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.category - type: string - products.created_on: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: products.created_on - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - products.discount_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.discount_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.discount_percentage: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.discount_percentage - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.manufacturer: - aggregatable: false - count: 1 - esTypes: - - text - format: - id: string - isMapped: true - name: products.manufacturer - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.manufacturer.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.manufacturer.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.manufacturer - type: string - products.min_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.min_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.price: - aggregatable: true - count: 1 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.product_id: - aggregatable: true - count: 0 - esTypes: - - long - format: - id: number - isMapped: true - name: products.product_id - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.product_name: - aggregatable: false - count: 1 - esTypes: - - text - format: - id: string - isMapped: true - name: products.product_name - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.product_name.keyword: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.product_name.keyword - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - subType: - multi: - parent: products.product_name - type: string - products.quantity: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: products.quantity - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.sku: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: products.sku - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - products.tax_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.tax_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.taxful_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.taxful_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.taxless_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: products.taxless_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - products.unit_discount_amount: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - isMapped: true - name: products.unit_discount_amount - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - sku: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: sku - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - taxful_total_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.[00]' - isMapped: true - name: taxful_total_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - taxless_total_price: - aggregatable: true - count: 0 - esTypes: - - half_float - format: - id: number - params: - pattern: '$0,0.00' - isMapped: true - name: taxless_total_price - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - total_quantity: - aggregatable: true - count: 1 - esTypes: - - integer - format: - id: number - isMapped: true - name: total_quantity - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - total_unique_products: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: total_unique_products - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - type: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: type - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - user: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: user - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - name: Kibana Sample Data eCommerce - namespaces: - - default - runtimeFieldMap: {} - sourceFilters: [] - timeFieldName: order_date - title: kibana_sample_data_ecommerce - typeMeta: {} - version: WzUsMV0= - Data_views_get_data_views_response: - summary: The get all data views API returns a list of data views. - value: - data_view: - - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - name: Kibana Sample Data eCommerce - namespaces: - - default - title: kibana_sample_data_ecommerce - typeMeta: {} - - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - name: Kibana Sample Data Flights - namespaces: - - default - title: kibana_sample_data_flights - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: Kibana Sample Data Logs - namespaces: - - default - title: kibana_sample_data_logs - Data_views_get_default_data_view_response: - summary: The get default data view API returns the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - Data_views_get_runtime_field_response: - summary: >- - The get runtime field API returns a JSON object that contains - information about the runtime field (`hour_of_day`) and the data view - (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). - value: - data_view: - allowNoIndex: false - fieldAttrs: {} - fieldFormats: - AvgTicketPrice: - id: number - params: - pattern: '$0,0.[00]' - hour_of_day: - id: number - params: - pattern: '00' - fields: - _id: - aggregatable: false - count: 0 - esTypes: - - _id - format: - id: string - isMapped: true - name: _id - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _index: - aggregatable: true - count: 0 - esTypes: - - _index - format: - id: string - isMapped: true - name: _index - readFromDocValues: false - scripted: false - searchable: true - shortDotsEnable: false - type: string - _score: - aggregatable: false - count: 0 - format: - id: number - isMapped: true - name: _score - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: number - _source: - aggregatable: false - count: 0 - esTypes: - - _source - format: - id: _source - isMapped: true - name: _source - readFromDocValues: false - scripted: false - searchable: false - shortDotsEnable: false - type: _source - AvgTicketPrice: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - params: - pattern: '$0,0.[00]' - isMapped: true - name: AvgTicketPrice - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - Cancelled: - aggregatable: true - count: 0 - esTypes: - - boolean - format: - id: boolean - isMapped: true - name: Cancelled - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: boolean - Carrier: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Carrier - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - dayOfWeek: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: dayOfWeek - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - Dest: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Dest - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestAirportID: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestAirportID - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestCityName: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestCityName - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestCountry: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestCountry - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestLocation: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: DestLocation - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - DestRegion: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestRegion - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DestWeather: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: DestWeather - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - DistanceKilometers: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: DistanceKilometers - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - DistanceMiles: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: DistanceMiles - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - FlightDelay: - aggregatable: true - count: 0 - esTypes: - - boolean - format: - id: boolean - isMapped: true - name: FlightDelay - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: boolean - FlightDelayMin: - aggregatable: true - count: 0 - esTypes: - - integer - format: - id: number - isMapped: true - name: FlightDelayMin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - FlightDelayType: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightDelayType - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightNum: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightNum - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightTimeHour: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: FlightTimeHour - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - FlightTimeMin: - aggregatable: true - count: 0 - esTypes: - - float - format: - id: number - isMapped: true - name: FlightTimeMin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: number - hour_of_day: - aggregatable: true - count: 0 - esTypes: - - long - format: - id: number - params: - pattern: '00' - name: hour_of_day - readFromDocValues: false - runtimeField: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - scripted: false - searchable: true - shortDotsEnable: false - type: number - Origin: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: Origin - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginAirportID: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginAirportID - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginCityName: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginCityName - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginCountry: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginCountry - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginLocation: - aggregatable: true - count: 0 - esTypes: - - geo_point - format: - id: geo_point - params: - transform: wkt - isMapped: true - name: OriginLocation - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: geo_point - OriginRegion: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginRegion - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - OriginWeather: - aggregatable: true - count: 0 - esTypes: - - keyword - format: - id: string - isMapped: true - name: OriginWeather - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: string - timestamp: - aggregatable: true - count: 0 - esTypes: - - date - format: - id: date - isMapped: true - name: timestamp - readFromDocValues: true - scripted: false - searchable: true - shortDotsEnable: false - type: date - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - name: Kibana Sample Data Flights - runtimeFieldMap: - hour_of_day: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - sourceFilters: [] - timeFieldName: timestamp - title: kibana_sample_data_flights - version: WzM2LDJd - fields: - - aggregatable: true - count: 0 - esTypes: - - long - name: hour_of_day - readFromDocValues: false - runtimeField: - script: - source: 'emit(doc[''timestamp''].value.getHour());' - type: long - scripted: false - searchable: true - shortDotsEnable: false - type: number - Data_views_preview_swap_data_view_request: - summary: Preview swapping references from data view ID "abcd-efg" to "xyz-123". - value: - fromId: abcd-efg - toId: xyz-123 - Data_views_set_default_data_view_request: - summary: Set the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - force: true - Data_views_swap_data_view_request: - summary: >- - Swap references from data view ID "abcd-efg" to "xyz-123" and remove the - data view that is no longer referenced. - value: - delete: true - fromId: abcd-efg - toId: xyz-123 - Data_views_update_data_view_request: - summary: Update some properties for a data view. - value: - data_view: - allowNoIndex: false - name: Kibana Sample Data eCommerce - timeFieldName: order_date - title: kibana_sample_data_ecommerce - refresh_fields: true - Data_views_update_field_metadata_request: - summary: Update metadata for multiple fields. - value: - fields: - field1: - count: 123 - customLabel: Field 1 label - field2: - customDescription: Field 2 description - customLabel: Field 2 label - Data_views_update_runtime_field_request: - summary: Update an existing runtime field on a data view. - value: - runtimeField: - script: - source: 'emit(doc["bar"].value)' - Machine_learning_APIs_mlSyncExample: - summary: Two anomaly detection jobs required synchronization in this example. - value: - datafeedsAdded: {} - datafeedsRemoved: {} - savedObjectsCreated: - anomaly-detector: - myjob1: - success: true - myjob2: - success: true - savedObjectsDeleted: {} - Saved_objects_export_objects_request: - summary: Export a specific saved object. - value: - excludeExportDetails: true - includeReferencesDeep: false - objects: - - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 - type: map - Saved_objects_export_objects_response: - summary: >- - The export objects API response contains a JSON record for each exported - object. - value: - attributes: - description: '' - layerListJSON: >- - [{"id":"0hmz5","alpha":1,"sourceDescriptor":{"type":"EMS_TMS","isAutoSelect":true,"lightModeDefault":"road_map_desaturated"},"visible":true,"style":{},"type":"EMS_VECTOR_TILE","minZoom":0,"maxZoom":24},{"id":"edh66","label":"Total - Requests by - Destination","minZoom":0,"maxZoom":24,"alpha":0.5,"sourceDescriptor":{"type":"EMS_FILE","id":"world_countries","tooltipProperties":["name","iso2"]},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"__kbnjoin__count__673ff994-fc75-4c67-909b-69fcb0e1060e","origin":"join"},"color":"Greys","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"STATIC","options":{"size":10}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR","joins":[{"leftField":"iso2","right":{"type":"ES_TERM_SOURCE","id":"673ff994-fc75-4c67-909b-69fcb0e1060e","indexPatternTitle":"kibana_sample_data_logs","term":"geo.dest","indexPatternRefName":"layer_1_join_0_index_pattern","metrics":[{"type":"count","label":"web - logs - count"}],"applyGlobalQuery":true}}]},{"id":"gaxya","label":"Actual - Requests","minZoom":9,"maxZoom":24,"alpha":1,"sourceDescriptor":{"id":"b7486535-171b-4d3b-bb2e-33c1a0a2854c","type":"ES_SEARCH","geoField":"geo.coordinates","limit":2048,"filterByMapBounds":true,"tooltipProperties":["clientip","timestamp","host","request","response","machine.os","agent","bytes"],"indexPatternRefName":"layer_2_source_index_pattern","applyGlobalQuery":true,"scalingType":"LIMIT"},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"STATIC","options":{"color":"#2200ff"}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":2}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"bytes","origin":"source"},"minSize":1,"maxSize":23,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"},{"id":"tfi3f","label":"Total - Requests and - Bytes","minZoom":0,"maxZoom":9,"alpha":1,"sourceDescriptor":{"type":"ES_GEO_GRID","resolution":"COARSE","id":"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b","geoField":"geo.coordinates","requestType":"point","metrics":[{"type":"count","label":"web - logs - count"},{"type":"sum","field":"bytes"}],"indexPatternRefName":"layer_3_source_index_pattern","applyGlobalQuery":true},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"color":"Blues","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#cccccc"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"sum_of_bytes","origin":"source"},"minSize":7,"maxSize":25,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelText":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelSize":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"minSize":12,"maxSize":24,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"}] - mapStateJSON: >- - {"zoom":3.64,"center":{"lon":-88.92107,"lat":42.16337},"timeFilters":{"from":"now-7d","to":"now"},"refreshConfig":{"isPaused":true,"interval":0},"query":{"language":"kuery","query":""},"settings":{"autoFitToDataBounds":false}} - title: '[Logs] Total Requests and Bytes' - uiStateJSON: '{"isDarkMode":false}' - coreMigrationVersion: 8.8.0 - created_at: '2023-08-23T20:03:32.204Z' - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 - managed: false - references: - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_1_join_0_index_pattern - type: index-pattern - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_2_source_index_pattern - type: index-pattern - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - name: layer_3_source_index_pattern - type: index-pattern - type: map - typeMigrationVersion: 8.4.0 - updated_at: '2023-08-23T20:03:32.204Z' - version: WzEzLDFd - Saved_objects_import_objects_request: - value: - file: file.ndjson - Saved_objects_import_objects_response: - summary: >- - The import objects API response indicates a successful import and the - objects are created. Since these objects are created as new copies, each - entry in the successResults array includes a destinationId attribute. - value: - success: true - successCount: 1 - successResults: - - destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - managed: false - meta: - icon: indexPatternApp - title: Kibana Sample Data Logs - type: index-pattern - Saved_objects_key_rotation_response: - summary: Encryption key rotation using default parameters. - value: - failed: 0 - successful: 300 - total: 1000 - Saved_objects_resolve_missing_reference_request: - value: - file: file.ndjson - retries: - - id: my-pattern - overwrite: true - type: index-pattern - - destinationId: another-vis - id: my-vis - overwrite: true - type: visualization - - destinationId: yet-another-canvas - id: my-canvas - overwrite: true - type: canvas - - id: my-dashboard - type: dashboard - Saved_objects_resolve_missing_reference_response: - summary: Resolve missing reference errors. - value: - success: true - successCount: 3 - successResults: - - id: my-vis - meta: - icon: visualizeApp - title: Look at my visualization - type: visualization - - id: my-search - meta: - icon: searchApp - title: Look at my search - type: search - - id: my-dashboard - meta: - icon: dashboardApp - title: Look at my dashboard - type: dashboard - parameters: - Connectors_action_id: - description: An identifier for the action. - in: path - name: actionId - required: true - schema: - example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad - type: string - Connectors_connector_id: - description: An identifier for the connector. - in: path - name: connectorId - required: true - schema: - example: df770e30-8b8b-11ed-a780-3b746c987a81 - type: string - Connectors_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - Data_views_field_name: - description: The name of the runtime field. - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - Data_views_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - Data_views_view_id: - description: An identifier for the data view. - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - Machine_learning_APIs_simulateParam: - description: >- - When true, simulates the synchronization by returning only the list of - actions that would be performed. - example: 'true' - in: query - name: simulate - required: false - schema: - type: boolean - Saved_objects_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - Saved_objects_saved_object_id: - description: An identifier for the saved object. - in: path - name: id - required: true - schema: - type: string - Saved_objects_saved_object_type: - description: >- - Valid options include `visualization`, `dashboard`, `search`, - `index-pattern`, `config`. - in: path - name: type - required: true - schema: - type: string - SLOs_kbn_xsrf: - description: Cross-site request forgery protection - in: header - name: kbn-xsrf - required: true - schema: - type: string - SLOs_slo_id: - description: An identifier for the slo. - in: path - name: sloId - required: true - schema: - example: 9c235211-6834-11ea-a78c-6feb38a34414 - type: string - SLOs_space_id: - description: >- - An identifier for the space. If `/s/` and the identifier are omitted - from the path, the default space is used. - in: path - name: spaceId - required: true - schema: - example: default - type: string - responses: - Connectors_200_actions: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - $ref: '#/components/schemas/Connectors_action_response_properties' - description: Indicates a successful call. - Connectors_401: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - error: - enum: - - Unauthorized - example: Unauthorized - type: string - message: - type: string - statusCode: - enum: - - 401 - example: 401 - type: integer - title: Unauthorized response - type: object - description: Authorization information is missing or invalid. - Connectors_404: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - error: - enum: - - Not Found - example: Not Found - type: string - message: - example: >- - Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not - found - type: string - statusCode: - enum: - - 404 - example: 404 - type: integer - title: Not found response - type: object - description: Object is not found. - schemas: - Connectors_action_response_properties: - description: The properties vary depending on the action type. - properties: - actionTypeId: - type: string - config: - type: object - id: - type: string - isDeprecated: - description: Indicates whether the action type is deprecated. - type: boolean - isMissingSecrets: - description: Indicates whether secrets are missing for the action. - type: boolean - isPreconfigured: - description: Indicates whether it is a preconfigured action. - type: boolean - name: - type: string - title: Action response properties - type: object - Connectors_config_properties_bedrock: - description: Defines properties for connectors when type is `.bedrock`. - properties: - apiUrl: - description: The Amazon Bedrock request URL. - type: string - defaultModel: - default: 'anthropic.claude-3-5-sonnet-20240620-v1:0' - description: > - The generative artificial intelligence model for Amazon Bedrock to - use. Current support is for the Anthropic Claude models. - type: string - required: - - apiUrl - title: Connector request properties for an Amazon Bedrock connector - type: object - Connectors_config_properties_cases_webhook: - description: Defines properties for connectors when type is `.cases-webhook`. - type: object - properties: - createCommentJson: - description: > - A JSON payload sent to the create comment URL to create a case - comment. You can use variables to add Kibana Cases data to the - payload. The required variable is `case.comment`. Due to Mustache - template variables (the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated once the Mustache variables have - been placed when the REST method runs. Manually ensure that the JSON - is valid, disregarding the Mustache variables, so the later - validation will pass. - example: '{"body": {{{case.comment}}}}' - type: string - createCommentMethod: - default: put - description: > - The REST API HTTP request method to create a case comment in the - third-party system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - createCommentUrl: - description: > - The REST API URL to create a case comment by ID in the third-party - system. You can use a variable to add the external system ID to the - URL. If you are using the `xpack.actions.allowedHosts setting`, add - the hostname to the allowed hosts. - example: 'https://example.com/issue/{{{external.system.id}}}/comment' - type: string - createIncidentJson: - description: > - A JSON payload sent to the create case URL to create a case. You can - use variables to add case data to the payload. Required variables - are `case.title` and `case.description`. Due to Mustache template - variables (which is the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated after the Mustache variables have - been placed when REST method runs. Manually ensure that the JSON is - valid to avoid future validation errors; disregard Mustache - variables during your review. - example: >- - {"fields": {"summary": {{{case.title}}},"description": - {{{case.description}}},"labels": {{{case.tags}}}}} - type: string - createIncidentMethod: - default: post - description: > - The REST API HTTP request method to create a case in the third-party - system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - createIncidentResponseKey: - description: >- - The JSON key in the create external case response that contains the - case ID. - type: string - createIncidentUrl: - description: > - The REST API URL to create a case in the third-party system. If you - are using the `xpack.actions.allowedHosts` setting, add the hostname - to the allowed hosts. - type: string - getIncidentResponseExternalTitleKey: - description: >- - The JSON key in get external case response that contains the case - title. - type: string - getIncidentUrl: - description: > - The REST API URL to get the case by ID from the third-party system. - If you are using the `xpack.actions.allowedHosts` setting, add the - hostname to the allowed hosts. You can use a variable to add the - external system ID to the URL. Due to Mustache template variables - (the text enclosed in triple braces, for example, - `{{{case.title}}}`), the JSON is not validated when you create the - connector. The JSON is validated after the Mustache variables have - been placed when REST method runs. Manually ensure that the JSON is - valid, disregarding the Mustache variables, so the later validation - will pass. - example: 'https://example.com/issue/{{{external.system.id}}}' - type: string - hasAuth: - default: true - description: >- - If true, a username and password for login type authentication must - be provided. - type: boolean - headers: - description: > - A set of key-value pairs sent as headers with the request URLs for - the create case, update case, get case, and create comment methods. - type: string - updateIncidentJson: - description: > - The JSON payload sent to the update case URL to update the case. You - can use variables to add Kibana Cases data to the payload. Required - variables are `case.title` and `case.description`. Due to Mustache - template variables (which is the text enclosed in triple braces, for - example, `{{{case.title}}}`), the JSON is not validated when you - create the connector. The JSON is validated after the Mustache - variables have been placed when REST method runs. Manually ensure - that the JSON is valid to avoid future validation errors; disregard - Mustache variables during your review. - example: >- - {"fields": {"summary": {{{case.title}}},"description": - {{{case.description}}},"labels": {{{case.tags}}}}} - type: string - updateIncidentMethod: - default: put - description: > - The REST API HTTP request method to update the case in the - third-party system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - type: string - updateIncidentUrl: - description: > - The REST API URL to update the case by ID in the third-party system. - You can use a variable to add the external system ID to the URL. If - you are using the `xpack.actions.allowedHosts` setting, add the - hostname to the allowed hosts. - example: 'https://example.com/issue/{{{external.system.ID}}}' - type: string - viewIncidentUrl: - description: > - The URL to view the case in the external system. You can use - variables to add the external system ID or external system title to - the URL. - example: >- - https://testing-jira.atlassian.net/browse/{{{external.system.title}}} - type: string - required: - - createIncidentJson - - createIncidentResponseKey - - createIncidentUrl - - getIncidentResponseExternalTitleKey - - getIncidentUrl - - updateIncidentJson - - updateIncidentUrl - - viewIncidentUrl - title: Connector request properties for Webhook - Case Management connector - Connectors_config_properties_d3security: - description: Defines properties for connectors when type is `.d3security`. - properties: - url: - description: > - The D3 Security API request URL. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - url - title: Connector request properties for a D3 Security connector - type: object - Connectors_config_properties_email: - description: Defines properties for connectors when type is `.email`. - type: object - properties: - clientId: - description: > - The client identifier, which is a part of OAuth 2.0 client - credentials authentication, in GUID format. If `service` is - `exchange_server`, this property is required. - nullable: true - type: string - from: - description: > - The from address for all emails sent by the connector. It must be - specified in `user@host-name` format. - type: string - hasAuth: - default: true - description: > - Specifies whether a user and password are required inside the - secrets configuration. - type: boolean - host: - description: > - The host name of the service provider. If the `service` is - `elastic_cloud` (for Elastic Cloud notifications) or one of - Nodemailer's well-known email service providers, this property is - ignored. If `service` is `other`, this property must be defined. - type: string - oauthTokenUrl: - nullable: true - type: string - port: - description: > - The port to connect to on the service provider. If the `service` is - `elastic_cloud` (for Elastic Cloud notifications) or one of - Nodemailer's well-known email service providers, this property is - ignored. If `service` is `other`, this property must be defined. - type: integer - secure: - description: > - Specifies whether the connection to the service provider will use - TLS. If the `service` is `elastic_cloud` (for Elastic Cloud - notifications) or one of Nodemailer's well-known email service - providers, this property is ignored. - type: boolean - service: - description: | - The name of the email service. - enum: - - elastic_cloud - - exchange_server - - gmail - - other - - outlook365 - - ses - type: string - tenantId: - description: > - The tenant identifier, which is part of OAuth 2.0 client credentials - authentication, in GUID format. If `service` is `exchange_server`, - this property is required. - nullable: true - type: string - required: - - from - title: Connector request properties for an email connector - Connectors_config_properties_gemini: - description: Defines properties for connectors when type is `.gemini`. - properties: - apiUrl: - description: The Google Gemini request URL. - type: string - defaultModel: - default: gemini-1.5-pro-001 - description: >- - The generative artificial intelligence model for Google Gemini to - use. - type: string - gcpProjectID: - description: The Google ProjectID that has Vertex AI endpoint enabled. - type: string - gcpRegion: - description: The GCP region where the Vertex AI endpoint enabled. - type: string - required: - - apiUrl - - gcpRegion - - gcpProjectID - title: Connector request properties for an Google Gemini connector - type: object - Connectors_config_properties_genai: - description: Defines properties for connectors when type is `.gen-ai`. - discriminator: - mapping: - Azure OpenAI: '#/components/schemas/Connectors_config_properties_genai_azure' - OpenAI: '#/components/schemas/Connectors_config_properties_genai_openai' - propertyName: apiProvider - oneOf: - - $ref: '#/components/schemas/Connectors_config_properties_genai_azure' - - $ref: '#/components/schemas/Connectors_config_properties_genai_openai' - title: Connector request properties for an OpenAI connector - Connectors_config_properties_genai_azure: - description: > - Defines properties for connectors when type is `.gen-ai` and the API - provider is `Azure OpenAI'. - properties: - apiProvider: - description: The OpenAI API provider. - enum: - - Azure OpenAI - type: string - apiUrl: - description: The OpenAI API endpoint. - type: string - required: - - apiProvider - - apiUrl - title: >- - Connector request properties for an OpenAI connector that uses Azure - OpenAI - type: object - Connectors_config_properties_genai_openai: - description: > - Defines properties for connectors when type is `.gen-ai` and the API - provider is `OpenAI'. - properties: - apiProvider: - description: The OpenAI API provider. - enum: - - OpenAI - type: string - apiUrl: - description: The OpenAI API endpoint. - type: string - defaultModel: - description: The default model to use for requests. - type: string - required: - - apiProvider - - apiUrl - title: Connector request properties for an OpenAI connector - type: object - Connectors_config_properties_index: - description: Defines properties for connectors when type is `.index`. - type: object - properties: - executionTimeField: - default: null - description: A field that indicates when the document was indexed. - nullable: true - type: string - index: - description: The Elasticsearch index to be written to. - type: string - refresh: - default: false - description: > - The refresh policy for the write request, which affects when changes - are made visible to search. Refer to the refresh setting for - Elasticsearch document APIs. - type: boolean - required: - - index - title: Connector request properties for an index connector - Connectors_config_properties_jira: - description: Defines properties for connectors when type is `.jira`. - type: object - properties: - apiUrl: - description: The Jira instance URL. - type: string - projectKey: - description: The Jira project key. - type: string - required: - - apiUrl - - projectKey - title: Connector request properties for a Jira connector - Connectors_config_properties_opsgenie: - description: Defines properties for connectors when type is `.opsgenie`. - type: object - properties: - apiUrl: - description: > - The Opsgenie URL. For example, `https://api.opsgenie.com` or - `https://api.eu.opsgenie.com`. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - apiUrl - title: Connector request properties for an Opsgenie connector - Connectors_config_properties_pagerduty: - description: Defines properties for connectors when type is `.pagerduty`. - properties: - apiUrl: - description: The PagerDuty event URL. - example: 'https://events.pagerduty.com/v2/enqueue' - nullable: true - type: string - title: Connector request properties for a PagerDuty connector - type: object - Connectors_config_properties_resilient: - description: Defines properties for connectors when type is `.resilient`. - type: object - properties: - apiUrl: - description: The IBM Resilient instance URL. - type: string - orgId: - description: The IBM Resilient organization ID. - type: string - required: - - apiUrl - - orgId - title: Connector request properties for a IBM Resilient connector - Connectors_config_properties_sentinelone: - description: Defines properties for connectors when type is `.sentinelone`. - type: object - properties: - url: - description: > - The SentinelOne tenant URL. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. - type: string - required: - - url - title: Connector request properties for a SentinelOne connector - Connectors_config_properties_servicenow: - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - description: The ServiceNow instance URL. - type: string - clientId: - description: > - The client ID assigned to your OAuth application. This property is - required when `isOAuth` is `true`. - type: string - isOAuth: - default: false - description: > - The type of authentication to use. The default value is false, which - means basic authentication is used instead of open authorization - (OAuth). - type: boolean - jwtKeyId: - description: > - The key identifier assigned to the JWT verifier map of your OAuth - application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: > - The identifier to use for OAuth authentication. This identifier - should be the user field you selected when you created an OAuth JWT - API endpoint for external clients in your ServiceNow instance. For - example, if the selected user field is `Email`, the user identifier - should be the user's email address. This property is required when - `isOAuth` is `true`. - type: string - usesTableApi: - default: true - description: > - Determines whether the connector uses the Table API or the Import - Set API. This property is supported only for ServiceNow ITSM and - ServiceNow SecOps connectors. NOTE: If this property is set to - `false`, the Elastic application should be installed in ServiceNow. - type: boolean - required: - - apiUrl - title: Connector request properties for a ServiceNow ITSM connector - Connectors_config_properties_servicenow_itom: - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - description: The ServiceNow instance URL. - type: string - clientId: - description: > - The client ID assigned to your OAuth application. This property is - required when `isOAuth` is `true`. - type: string - isOAuth: - default: false - description: > - The type of authentication to use. The default value is false, which - means basic authentication is used instead of open authorization - (OAuth). - type: boolean - jwtKeyId: - description: > - The key identifier assigned to the JWT verifier map of your OAuth - application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: > - The identifier to use for OAuth authentication. This identifier - should be the user field you selected when you created an OAuth JWT - API endpoint for external clients in your ServiceNow instance. For - example, if the selected user field is `Email`, the user identifier - should be the user's email address. This property is required when - `isOAuth` is `true`. - type: string - required: - - apiUrl - title: Connector request properties for a ServiceNow ITSM connector - Connectors_config_properties_slack_api: - description: Defines properties for connectors when type is `.slack_api`. - properties: - allowedChannels: - description: A list of valid Slack channels. - items: - maxItems: 25 - type: object - properties: - id: - description: The Slack channel ID. - example: C123ABC456 - minLength: 1 - type: string - name: - description: The Slack channel name. - minLength: 1 - type: string - required: - - id - - name - type: array - title: Connector request properties for a Slack connector - type: object - Connectors_config_properties_swimlane: - description: Defines properties for connectors when type is `.swimlane`. - type: object - properties: - apiUrl: - description: The Swimlane instance URL. - type: string - appId: - description: The Swimlane application ID. - type: string - connectorType: - description: >- - The type of connector. Valid values are `all`, `alerts`, and - `cases`. - enum: - - all - - alerts - - cases - type: string - mappings: - description: The field mapping. - properties: - alertIdConfig: - description: Mapping for the alert ID. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Alert identifier mapping - type: object - caseIdConfig: - description: Mapping for the case ID. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case identifier mapping - type: object - caseNameConfig: - description: Mapping for the case name. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case name mapping - type: object - commentsConfig: - description: Mapping for the case comments. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case comment mapping - type: object - descriptionConfig: - description: Mapping for the case description. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Case description mapping - type: object - ruleNameConfig: - description: Mapping for the name of the alert's rule. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Rule name mapping - type: object - severityConfig: - description: Mapping for the severity. - properties: - fieldType: - description: The type of field in Swimlane. - type: string - id: - description: The identifier for the field in Swimlane. - type: string - key: - description: The key for the field in Swimlane. - type: string - name: - description: The name of the field in Swimlane. - type: string - required: - - fieldType - - id - - key - - name - title: Severity mapping - type: object - title: Connector mappings properties for a Swimlane connector - type: object - required: - - apiUrl - - appId - - connectorType - title: Connector request properties for a Swimlane connector - Connectors_config_properties_tines: - description: Defines properties for connectors when type is `.tines`. - properties: - url: - description: > - The Tines tenant URL. If you are using the - `xpack.actions.allowedHosts` setting, make sure this hostname is - added to the allowed hosts. - type: string - required: - - url - title: Connector request properties for a Tines connector - type: object - Connectors_config_properties_torq: - description: Defines properties for connectors when type is `.torq`. - properties: - webhookIntegrationUrl: - description: The endpoint URL of the Elastic Security integration in Torq. - type: string - required: - - webhookIntegrationUrl - title: Connector request properties for a Torq connector - type: object - Connectors_config_properties_webhook: - description: Defines properties for connectors when type is `.webhook`. - properties: - authType: - description: | - The type of authentication to use: basic, SSL, or none. - enum: - - webhook-authentication-basic - - webhook-authentication-ssl - nullable: true - type: string - ca: - description: > - A base64 encoded version of the certificate authority file that the - connector can trust to sign and validate certificates. This option - is available for all authentication types. - type: string - certType: - description: > - If the `authType` is `webhook-authentication-ssl`, specifies whether - the certificate authentication data is in a CRT and key file format - or a PFX file format. - enum: - - ssl-crt-key - - ssl-pfx - type: string - hasAuth: - description: > - If `true`, a user name and password must be provided for login type - authentication. - type: boolean - headers: - description: A set of key-value pairs sent as headers with the request. - nullable: true - type: object - method: - default: post - description: | - The HTTP request method, either `post` or `put`. - enum: - - post - - put - type: string - url: - description: > - The request URL. If you are using the `xpack.actions.allowedHosts` - setting, add the hostname to the allowed hosts. - type: string - verificationMode: - default: full - description: > - Controls the verification of certificates. Use `full` to validate - that the certificate has an issue date within the `not_before` and - `not_after` dates, chains to a trusted certificate authority (CA), - and has a hostname or IP address that matches the names within the - certificate. Use `certificate` to validate the certificate and - verify that it is signed by a trusted authority; this option does - not check the certificate hostname. Use `none` to skip certificate - validation. - enum: - - certificate - - full - - none - type: string - title: Connector request properties for a Webhook connector - type: object - Connectors_config_properties_xmatters: - description: Defines properties for connectors when type is `.xmatters`. - properties: - configUrl: - description: > - The request URL for the Elastic Alerts trigger in xMatters. It is - applicable only when `usesBasic` is `true`. - nullable: true - type: string - usesBasic: - default: true - description: >- - Specifies whether the connector uses HTTP basic authentication - (`true`) or URL authentication (`false`). - type: boolean - title: Connector request properties for an xMatters connector - type: object - Connectors_connector_response_properties: - description: The properties vary depending on the connector type. - discriminator: - mapping: - .bedrock: >- - #/components/schemas/Connectors_connector_response_properties_bedrock - .cases-webhook: >- - #/components/schemas/Connectors_connector_response_properties_cases_webhook - .d3security: >- - #/components/schemas/Connectors_connector_response_properties_d3security - .email: '#/components/schemas/Connectors_connector_response_properties_email' - .gemini: '#/components/schemas/Connectors_connector_response_properties_gemini' - .gen-ai: '#/components/schemas/Connectors_connector_response_properties_genai' - .index: '#/components/schemas/Connectors_connector_response_properties_index' - .jira: '#/components/schemas/Connectors_connector_response_properties_jira' - .opsgenie: >- - #/components/schemas/Connectors_connector_response_properties_opsgenie - .pagerduty: >- - #/components/schemas/Connectors_connector_response_properties_pagerduty - .resilient: >- - #/components/schemas/Connectors_connector_response_properties_resilient - .sentinelone: >- - #/components/schemas/Connectors_connector_response_properties_sentinelone - .server-log: >- - #/components/schemas/Connectors_connector_response_properties_serverlog - .servicenow: >- - #/components/schemas/Connectors_connector_response_properties_servicenow - .servicenow-itom: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_itom - .servicenow-sir: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_sir - .slack: >- - #/components/schemas/Connectors_connector_response_properties_slack_webhook - .slack_api: >- - #/components/schemas/Connectors_connector_response_properties_slack_api - .swimlane: >- - #/components/schemas/Connectors_connector_response_properties_swimlane - .teams: '#/components/schemas/Connectors_connector_response_properties_teams' - .tines: '#/components/schemas/Connectors_connector_response_properties_tines' - .torq: '#/components/schemas/Connectors_connector_response_properties_torq' - .webhook: >- - #/components/schemas/Connectors_connector_response_properties_webhook - .xmatters: >- - #/components/schemas/Connectors_connector_response_properties_xmatters - propertyName: connector_type_id - oneOf: - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_bedrock - - $ref: '#/components/schemas/Connectors_connector_response_properties_gemini' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_cases_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_d3security - - $ref: '#/components/schemas/Connectors_connector_response_properties_email' - - $ref: '#/components/schemas/Connectors_connector_response_properties_genai' - - $ref: '#/components/schemas/Connectors_connector_response_properties_index' - - $ref: '#/components/schemas/Connectors_connector_response_properties_jira' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_opsgenie - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_pagerduty - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_resilient - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_sentinelone - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_serverlog - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_itom - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_servicenow_sir - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_slack_api - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_slack_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_swimlane - - $ref: '#/components/schemas/Connectors_connector_response_properties_teams' - - $ref: '#/components/schemas/Connectors_connector_response_properties_tines' - - $ref: '#/components/schemas/Connectors_connector_response_properties_torq' - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_webhook - - $ref: >- - #/components/schemas/Connectors_connector_response_properties_xmatters - title: Connector response properties - Connectors_connector_response_properties_bedrock: - title: Connector response properties for an Amazon Bedrock connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - connector_type_id: - description: The type of connector. - enum: - - .bedrock - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - required: - - config - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_cases_webhook: - title: Connector request properties for a Webhook - Case Management connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - connector_type_id: - description: The type of connector. - enum: - - .cases-webhook - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_d3security: - title: Connector response properties for a D3 Security connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - connector_type_id: - description: The type of connector. - enum: - - .d3security - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_email: - title: Connector response properties for an email connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - connector_type_id: - description: The type of connector. - enum: - - .email - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_gemini: - title: Connector response properties for a Google Gemini connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - connector_type_id: - description: The type of connector. - enum: - - .gemini - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_genai: - title: Connector response properties for an OpenAI connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_genai' - connector_type_id: - description: The type of connector. - enum: - - .gen-ai - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_index: - title: Connector response properties for an index connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_index' - connector_type_id: - description: The type of connector. - enum: - - .index - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_jira: - title: Connector response properties for a Jira connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - connector_type_id: - description: The type of connector. - enum: - - .jira - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_opsgenie: - title: Connector response properties for an Opsgenie connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - connector_type_id: - description: The type of connector. - enum: - - .opsgenie - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_pagerduty: - title: Connector response properties for a PagerDuty connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - connector_type_id: - description: The type of connector. - enum: - - .pagerduty - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_resilient: - title: Connector response properties for a IBM Resilient connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - connector_type_id: - description: The type of connector. - enum: - - .resilient - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_sentinelone: - title: Connector response properties for a SentinelOne connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - connector_type_id: - description: The type of connector. - enum: - - .sentinelone - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_serverlog: - title: Connector response properties for a server log connector - type: object - properties: - config: - nullable: true - type: object - connector_type_id: - description: The type of connector. - enum: - - .server-log - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow: - title: Connector response properties for a ServiceNow ITSM connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow_itom: - title: Connector response properties for a ServiceNow ITOM connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-itom - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_servicenow_sir: - title: Connector response properties for a ServiceNow SecOps connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-sir - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_slack_api: - title: Connector response properties for a Slack connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - connector_type_id: - description: The type of connector. - enum: - - .slack_api - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_slack_webhook: - title: Connector response properties for a Slack connector - type: object - properties: - connector_type_id: - description: The type of connector. - enum: - - .slack - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_swimlane: - title: Connector response properties for a Swimlane connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - connector_type_id: - description: The type of connector. - enum: - - .swimlane - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_teams: - title: Connector response properties for a Microsoft Teams connector - type: object - properties: - config: - type: object - connector_type_id: - description: The type of connector. - enum: - - .teams - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_tines: - title: Connector response properties for a Tines connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - connector_type_id: - description: The type of connector. - enum: - - .tines - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_torq: - title: Connector response properties for a Torq connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - connector_type_id: - description: The type of connector. - enum: - - .torq - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_webhook: - title: Connector response properties for a Webhook connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - connector_type_id: - description: The type of connector. - enum: - - .webhook - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_response_properties_xmatters: - title: Connector response properties for an xMatters connector - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - connector_type_id: - description: The type of connector. - enum: - - .xmatters - type: string - id: - description: The identifier for the connector. - type: string - is_deprecated: - $ref: '#/components/schemas/Connectors_is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/Connectors_is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/Connectors_is_preconfigured' - is_system_action: - $ref: '#/components/schemas/Connectors_is_system_action' - name: - description: The display name for the connector. - type: string - referenced_by_count: - $ref: '#/components/schemas/Connectors_referenced_by_count' - required: - - connector_type_id - - id - - is_deprecated - - is_preconfigured - - name - Connectors_connector_types: - description: >- - The type of connector. For example, `.email`, `.index`, `.jira`, - `.opsgenie`, or `.server-log`. - enum: - - .bedrock - - .gemini - - .cases-webhook - - .d3security - - .email - - .gen-ai - - .index - - .jira - - .opsgenie - - .pagerduty - - .resilient - - .sentinelone - - .servicenow - - .servicenow-itom - - .servicenow-sir - - .server-log - - .slack - - .slack_api - - .swimlane - - .teams - - .tines - - .torq - - .webhook - - .xmatters - example: .server-log - title: Connector types - type: string - Connectors_create_connector_request: - description: The properties vary depending on the connector type. - discriminator: - mapping: - .bedrock: '#/components/schemas/Connectors_create_connector_request_bedrock' - .cases-webhook: >- - #/components/schemas/Connectors_create_connector_request_cases_webhook - .d3security: '#/components/schemas/Connectors_create_connector_request_d3security' - .email: '#/components/schemas/Connectors_create_connector_request_email' - .gemini: '#/components/schemas/Connectors_create_connector_request_gemini' - .gen-ai: '#/components/schemas/Connectors_create_connector_request_genai' - .index: '#/components/schemas/Connectors_create_connector_request_index' - .jira: '#/components/schemas/Connectors_create_connector_request_jira' - .opsgenie: '#/components/schemas/Connectors_create_connector_request_opsgenie' - .pagerduty: '#/components/schemas/Connectors_create_connector_request_pagerduty' - .resilient: '#/components/schemas/Connectors_create_connector_request_resilient' - .sentinelone: '#/components/schemas/Connectors_create_connector_request_sentinelone' - .server-log: '#/components/schemas/Connectors_create_connector_request_serverlog' - .servicenow: '#/components/schemas/Connectors_create_connector_request_servicenow' - .servicenow-itom: >- - #/components/schemas/Connectors_create_connector_request_servicenow_itom - .servicenow-sir: >- - #/components/schemas/Connectors_create_connector_request_servicenow_sir - .slack: >- - #/components/schemas/Connectors_create_connector_request_slack_webhook - .slack_api: '#/components/schemas/Connectors_create_connector_request_slack_api' - .swimlane: '#/components/schemas/Connectors_create_connector_request_swimlane' - .teams: '#/components/schemas/Connectors_create_connector_request_teams' - .tines: '#/components/schemas/Connectors_create_connector_request_tines' - .torq: '#/components/schemas/Connectors_create_connector_request_torq' - .webhook: '#/components/schemas/Connectors_create_connector_request_webhook' - .xmatters: '#/components/schemas/Connectors_create_connector_request_xmatters' - propertyName: connector_type_id - oneOf: - - $ref: '#/components/schemas/Connectors_create_connector_request_bedrock' - - $ref: '#/components/schemas/Connectors_create_connector_request_gemini' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_cases_webhook - - $ref: '#/components/schemas/Connectors_create_connector_request_d3security' - - $ref: '#/components/schemas/Connectors_create_connector_request_email' - - $ref: '#/components/schemas/Connectors_create_connector_request_genai' - - $ref: '#/components/schemas/Connectors_create_connector_request_index' - - $ref: '#/components/schemas/Connectors_create_connector_request_jira' - - $ref: '#/components/schemas/Connectors_create_connector_request_opsgenie' - - $ref: '#/components/schemas/Connectors_create_connector_request_pagerduty' - - $ref: '#/components/schemas/Connectors_create_connector_request_resilient' - - $ref: '#/components/schemas/Connectors_create_connector_request_sentinelone' - - $ref: '#/components/schemas/Connectors_create_connector_request_serverlog' - - $ref: '#/components/schemas/Connectors_create_connector_request_servicenow' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_servicenow_itom - - $ref: >- - #/components/schemas/Connectors_create_connector_request_servicenow_sir - - $ref: '#/components/schemas/Connectors_create_connector_request_slack_api' - - $ref: >- - #/components/schemas/Connectors_create_connector_request_slack_webhook - - $ref: '#/components/schemas/Connectors_create_connector_request_swimlane' - - $ref: '#/components/schemas/Connectors_create_connector_request_teams' - - $ref: '#/components/schemas/Connectors_create_connector_request_tines' - - $ref: '#/components/schemas/Connectors_create_connector_request_torq' - - $ref: '#/components/schemas/Connectors_create_connector_request_webhook' - - $ref: '#/components/schemas/Connectors_create_connector_request_xmatters' - title: Create connector request body properties - Connectors_create_connector_request_bedrock: - description: >- - The Amazon Bedrock connector uses axios to send a POST request to Amazon - Bedrock. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - connector_type_id: - description: The type of connector. - enum: - - .bedrock - example: .bedrock - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' - required: - - config - - connector_type_id - - name - - secrets - title: Create Amazon Bedrock connector request - type: object - Connectors_create_connector_request_cases_webhook: - description: > - The Webhook - Case Management connector uses axios to send POST, PUT, - and GET requests to a case management RESTful API web service. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - connector_type_id: - description: The type of connector. - enum: - - .cases-webhook - example: .cases-webhook - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' - required: - - config - - connector_type_id - - name - title: Create Webhook - Case Managment connector request - type: object - Connectors_create_connector_request_d3security: - description: > - The connector uses axios to send a POST request to a D3 Security - endpoint. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - connector_type_id: - description: The type of connector. - enum: - - .d3security - example: .d3security - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_d3security' - required: - - config - - connector_type_id - - name - - secrets - title: Create D3 Security connector request - type: object - Connectors_create_connector_request_email: - description: > - The email connector uses the SMTP protocol to send mail messages, using - an integration of Nodemailer. An exception is Microsoft Exchange, which - uses HTTP protocol for sending emails, Send mail. Email message text is - sent as both plain text and html text. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - connector_type_id: - description: The type of connector. - enum: - - .email - example: .email - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_email' - required: - - config - - connector_type_id - - name - - secrets - title: Create email connector request - type: object - Connectors_create_connector_request_gemini: - description: >- - The Google Gemini connector uses axios to send a POST request to Google - Gemini. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - connector_type_id: - description: The type of connector. - enum: - - .gemini - example: .gemini - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_gemini' - required: - - config - - connector_type_id - - name - - secrets - title: Create Google Gemini connector request - type: object - Connectors_create_connector_request_genai: - description: > - The OpenAI connector uses axios to send a POST request to either OpenAI - or Azure OpenAPI. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_genai' - connector_type_id: - description: The type of connector. - enum: - - .gen-ai - example: .gen-ai - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_genai' - required: - - config - - connector_type_id - - name - - secrets - title: Create OpenAI connector request - type: object - Connectors_create_connector_request_index: - description: The index connector indexes a document into Elasticsearch. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_index' - connector_type_id: - description: The type of connector. - enum: - - .index - example: .index - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - required: - - config - - connector_type_id - - name - title: Create index connector request - type: object - Connectors_create_connector_request_jira: - description: The Jira connector uses the REST API v2 to create Jira issues. - properties: + - Fleet uninstall tokens +components: + examples: + Alerting_get_health_response: + summary: Retrieve information about the health of the alerting framework. + value: + alerting_framework_health: + decryption_health: + status: ok + timestamp: '2023-01-13T01:28:00.280Z' + execution_health: + status: ok + timestamp: '2023-01-13T01:28:00.280Z' + read_health: + status: ok + timestamp: '2023-01-13T01:28:00.280Z' + has_permanent_encryption_key: true + is_sufficiently_secure: true + Alerting_get_rule_types_response: + summary: Retrieve rule types associated with Kibana machine learning features + value: + - action_groups: + - id: anomaly_score_match + name: Anomaly score matched the condition + - id: recovered + name: Recovered + action_variables: + context: + - description: The bucket timestamp of the anomaly + name: timestamp + - description: The bucket time of the anomaly in ISO8601 format + name: timestampIso8601 + - description: List of job IDs that triggered the alert + name: jobIds + - description: Alert info message + name: message + - description: Indicate if top hits contain interim results + name: isInterim + - description: Anomaly score at the time of the notification action + name: score + - description: Top records + name: topRecords + - description: Top influencers + name: topInfluencers + - description: URL to open in the Anomaly Explorer + name: anomalyExplorerUrl + useWithTripleBracesInTemplates: true + params: [] + state: [] + alerts: + context: ml.anomaly-detection + mappings: + fieldMap: + kibana.alert.anomaly_score: + array: false + type: double + required: false + kibana.alert.anomaly_timestamp: + array: false + type: date + required: false + kibana.alert.is_interim: + array: false + type: boolean + required: false + kibana.alert.job_id: + array: false + type: keyword + required: true + kibana.alert.top_influencers: + array: true + dynamic: false + type: object + 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 + required: false + kibana.alert.top_records: + array: true + dynamic: false + type: object + 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 + required: false + shouldWrite: true + authorized_consumers: + alerts: + all: true + read: true + apm: + all: true + read: true + discover: + all: true + read: true + infrastructure: + all: true + read: true + logs: + all: true + read: true + ml: + all: true + read: true + monitoring: + all: true + read: true + siem: + all: true + read: true + slo: + all: true + read: true + stackAlerts: + all: true + read: true + uptime: + all: true + read: true + category: management + default_action_group_id: anomaly_score_match + does_set_recovery_context: true + enabled_in_license: true + has_alerts_mappings: true + has_fields_for_a_a_d: false + id: xpack.ml.anomaly_detection_alert + is_exportable: true + minimum_license_required: platinum + name: Anomaly detection alert + producer: ml + recovery_action_group: + id: recovered + name: Recovered + rule_task_timeout: 5m + - action_groups: + - id: anomaly_detection_realtime_issue + name: Issue detected + - id: recovered + name: Recovered + action_variables: + context: + - description: Results of the rule execution + name: results + - description: Alert info message + name: message + params: [] + state: [] + authorized_consumers: + alerts: + all: true + read: true + apm: + all: true + read: true + discover: + all: true + read: true + infrastructure: + all: true + read: true + logs: + all: true + read: true + ml: + all: true + read: true + monitoring: + all: true + read: true + siem: + all: true + read: true + slo: + all: true + read: true + stackAlerts: + all: true + read: true + uptime: + all: true + read: true + category: management + default_action_group_id: anomaly_detection_realtime_issue + does_set_recovery_context: true + enabled_in_license: true + has_alerts_mappings: false + has_fields_for_a_a_d: false + id: xpack.ml.anomaly_detection_jobs_health + is_exportable: true + minimum_license_required: platinum + name: Anomaly detection jobs health + producer: ml + recovery_action_group: + id: recovered + name: Recovered + rule_task_timeout: 5m + Cases_add_comment_request: + summary: Adds a comment to a case. + value: + comment: A new comment. + owner: cases + type: user + Cases_add_comment_response: + summary: >- + The add comment to case API returns a JSON object that contains details + about the case and its comments. + value: + assignees: [] + category: null + closed_at: null + closed_by: null + comments: + - comment: A new comment. + created_at: '2022-10-02T00:49:47.716Z' + created_by: + email: null + full_name: null + username: elastic + id: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 + owner: cases + type: user + version: WzIwNDMxLDFd + connector: + fields: null + id: none + name: none + type: .none + created_at: '2022-03-24T00:37:03.906Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: Field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: true + description: A case description. + duration: null + external_service: null + id: 293f1bc0-74f6-11ea-b83a-553aecdb28b6 + owner: cases + settings: + syncAlerts: false + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + totalAlerts: 0 + totalComment: 1 + updated_at: '2022-06-03T00:49:47.716Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzIzMzgsMV0= + Cases_create_case_request: + summary: Create a security case that uses a Jira connector. + value: + connector: + fields: + issueType: '10006' + parent: null + priority: High + id: 131d4448-abe0-4789-939d-8ef60680b498 + name: My connector + type: .jira + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + description: A case description. + owner: cases + settings: + syncAlerts: true + tags: + - tag-1 + title: Case title 1 + Cases_create_case_response: + summary: >- + The create case API returns a JSON object that contains details about + the case. + value: + assignees: [] + closed_at: null + closed_by: null + comments: [] + connector: + fields: + issueType: '10006' + parent: null + priority: High + id: 131d4448-abe0-4789-939d-8ef60680b498 + name: My connector + type: .jira + created_at: '2022-10-13T15:33:50.604Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null + description: A case description. + duration: null + external_service: null + id: 66b9aa00-94fa-11ea-9f74-e7e108796192 + owner: cases + settings: + syncAlerts: true + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + totalAlerts: 0 + totalComment: 0 + updated_at: null + updated_by: null + version: WzUzMiwxXQ== + Cases_find_case_activity_response: + summary: Retrieves all activity for a case + value: + page: 1 + perPage: 20 + total: 3 + userActions: + - action: create + comment_id: null + created_at: '2023-10-20T01:17:22.150Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: b4cd0770-07c9-11ed-a5fd-47154cb8767e + owner: cases + payload: + assignees: [] + category: null + connector: + fields: null + id: none + name: none + type: .none + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null + description: A case description. + owner: cases + settings: + syncAlerts: false + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + type: create_case + version: WzM1ODg4LDFd + - action: create + comment_id: 578608d0-03b1-11ed-920c-974bfa104448 + created_at: '2023-10-14T20:12:53.354Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 57af14a0-03b1-11ed-920c-974bfa104448 + owner: cases + payload: + comment: A new comment + owner: cases + type: user + type: comment + version: WzM1ODg4LDFa + - action: add + comment_id: null + created_at: '2023-10-20T01:10:28.238Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 573c6980-6123-11ed-aa41-81a0a61fe447 + owner: cases + payload: + assignees: + uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + type: assignees + version: WzM1ODg4LDFb + Cases_find_case_response: + summary: >- + Retrieve the first five cases with the `tag-1` tag, in ascending order + by last update time. + value: + cases: + - assignees: [] + category: null + closed_at: null + closed_by: null + comments: [] + connector: + fields: null + id: none + name: none + type: .none + created_at: '2023-10-12T00:16:36.371Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null + description: Case description + duration: null + external_service: null + id: abed3a70-71bd-11ea-a0b2-c51ea50a58e2 + owner: cases + settings: + syncAlerts: true + severity: low + status: open + tags: + - tag-1 + title: Case title + totalAlerts: 0 + totalComment: 1 + updated_at: '2023-10-12T00:27:58.162Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzExMCwxXQ== + count_closed_cases: 0 + count_in_progress_cases: 0 + count_open_cases: 1 + page: 1 + per_page: 5 + total: 1 + Cases_find_connector_response: + summary: Retrieve information about the connectors and their settings. + value: + - actionTypeId: .jira + config: + apiUrl: 'https://elastic.atlassian.net/' + projectKey: ES + id: 61787f53-4eee-4741-8df6-8fe84fa616f7 + isDeprecated: false + isMissingSecrets: false + isPreconfigured: false + name: my-Jira + referencedByCount: 0 + Cases_get_case_alerts_response: + summary: Retrieves all alerts attached to a case + value: + - attached_at: '2022-07-25T20:09:40.963Z' + id: f6a7d0c3-d52d-432c-b2e6-447cd7fce04d + index: .alerts-observability.logs.alerts-default + Cases_get_case_configuration_response: + summary: Get the case configuration. + value: + - closure_type: close-by-user + connector: + fields: null + id: none + name: none + type: .none + created_at: '2024-07-01T17:07:17.767Z' + created_by: + email: null + full_name: null + username: elastic + customFields: + - defaultValue: Custom text field value. + key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + type: text + required: false + error: null + id: 856ee650-6c82-11ee-a20a-6164169afa58 + mappings: [] + owner: cases + templates: + - caseFields: + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + category: Default-category + connector: + fields: null + id: none + name: none + type: .none + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: Default text field value. + description: A default description for cases. + settings: + syncAlerts: false + tags: + - Default case tag + title: Default case title + description: A description of the template. + key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + tags: + - Template tag 1 + updated_at: null + updated_by: null + version: WzEyLDNd + Cases_get_case_observability_response: + summary: >- + Retrieves information about an Observability case including its alerts + and comments. + value: + assignees: + - uid: u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0 + category: null + closed_at: null + closed_by: null + comments: + - alertId: + - a6e12ac4-7bce-457b-84f6-d7ce8deb8446 + created_at: '2023-11-06T19:29:38.424Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 59d438d0-79a9-4864-8d4b-e63adacebf6e + index: + - .internal.alerts-observability.logs.alerts-default-000001 + owner: observability + pushed_at: null + pushed_by: null + rule: + id: 03e4eb87-62ca-4e5d-9570-3d7625e9669d + name: Observability rule + type: alert + updated_at: null + updated_by: null + version: WzY3LDJd + - comment: The first comment. + created_at: '2023-11-06T19:29:57.812Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: d99342d3-3aa3-4b80-90ec-a702607604f5 + owner: observability + pushed_at: null + pushed_by: null + type: user + updated_at: null + updated_by: null + version: WzcyLDJd + connector: + fields: null + id: none + name: none + type: .none + created_at: '2023-11-06T19:29:04.086Z' + created_by: + email: null + full_name: null + username: elastic + customFields: [] + description: An Observability case description. + duration: null + external_service: null + id: c3ff7550-def1-4e90-b6bc-c9969a4a09b1 + owner: observability + settings: + syncAlerts: false + severity: low + status: in-progress + tags: + - observability + - tag 1 + title: Observability case title 1 + totalAlerts: 1 + totalComment: 1 + updated_at: '2023-11-06T19:47:55.662Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzI0NywyXQ== + Cases_get_case_response: + summary: Retrieves information about a case including its comments. + value: + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + category: null + closed_at: null + closed_by: null + comments: + - comment: A new comment + created_at: '2023-10-13T15:40:32.335Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 2134c1d0-02c2-11ed-85f2-4f7c222ca2fa + owner: cases + pushed_at: null + pushed_by: null + type: user + updated_at: null + updated_by: null + version: WzM3LDFd + connector: + fields: null + id: none + name: none + type: .none + created_at: '2023-10-13T15:33:50.604Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null + description: A case description + duration: null + external_service: null + id: 31cdada0-02c1-11ed-85f2-4f7c222ca2fa + owner: cases + settings: + syncAlerts: true + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + totalAlerts: 0 + totalComment: 1 + updated_at: '2023-10-13T15:40:32.335Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzM2LDFd + Cases_get_comment_response: + summary: A single user comment retrieved from a case + value: + comment: A new comment + created_at: '2023-10-07T19:32:13.104Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 8048b460-fe2b-11ec-b15d-779a7c8bbcc3 + owner: cases + pushed_at: null + pushed_by: null + type: user + updated_at: null + updated_by: null + version: WzIzLDFd + Cases_get_reporters_response: + summary: A list of two users that opened cases + value: + - email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + - email: jdoe@example.com + full_name: Jane Doe + profile_uid: u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0 + username: jdoe + Cases_get_tags_response: + summary: A list of tags that are used in cases + value: + - observability + - security + - tag 1 + - tag 2 + Cases_push_case_response: + summary: >- + The push case API returns a JSON object with details about the case and + the external service. + value: + closed_at: null + closed_by: null + comments: [] + connector: + fields: + issueType: '10006' + parent: null + priority: Low + id: 09f8c0b0-0eda-11ed-bd18-65557fe66949 + name: My connector + type: .jira + created_at: '2022-07-29T00:59:39.444Z' + created_by: + email: null + full_name: null + username: elastic + description: A case description. + duration: null + external_service: + connector_id: 09f8c0b0-0eda-11ed-bd18-65557fe66949 + connector_name: My connector + external_id: '71926' + external_title: ES-554 + external_url: 'https://cases.jira.com' + pushed_at: '2022-07-29T01:20:58.436Z' + pushed_by: + email: null + full_name: null + username: elastic + id: b917f300-0ed9-11ed-bd18-65557fe66949 + owner: cases + settings: + syncAlerts: true + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + totalAlerts: 0 + totalComment: 0 + updated_at: '2022-07-29T01:20:58.436Z' + updated_by: + email: null + full_name: null + username: elastic + version: WzE3NjgsM10= + Cases_set_case_configuration_request: + summary: >- + Set the closure type, custom fields, and default connector for Stack + Management cases. + value: + closure_type: close-by-user + connector: + fields: null + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + customFields: + - defaultValue: My custom field default value. + key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + type: text + required: false + owner: cases + templates: + - caseFields: + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + category: Default-category + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A default description for cases. + tags: + - Default case tag + title: Default case title + description: A description of the template. + key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + tags: + - Template tag 1 + Cases_set_case_configuration_response: + summary: This is an example response for case settings. + value: + closure_type: close-by-user + connector: + fields: null + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + created_at: '2024-07-01T17:07:17.767Z' + created_by: + email: 'null,' + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - defaultValue: My custom field default value. + key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + type: text + required: false + error: null + id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + mappings: + - action_type: overwrite + source: title + target: summary + - action_type: overwrite + source: description + target: description + - action_type: append + source: comments + target: comments + - action_type: overwrite + source: tags + target: labels + owner: cases + templates: + - caseFields: + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + category: Default-category + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A default description for cases. + tags: + - Default case tag + title: Default case title + description: A description of the template. + key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + tags: + - Template tag 1 + updated_at: null + updated_by: null + version: WzIwNzMsMV0= + Cases_update_case_configuration_request: + summary: Update the case settings. + value: + closure_type: close-by-user + connector: + fields: null + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + customFields: + - defaultValue: A new default value. + key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + type: text + required: true + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + type: toggle + required: false + version: WzExOSw0XQ== + Cases_update_case_configuration_response: + summary: This is an example response when the case configuration was updated. + value: + closure_type: close-by-user + connector: + fields: null + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + created_at: '2024-07-01T17:07:17.767Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - defaultValue: A new default value. + key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + type: text + required: true + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + type: toggle + required: false + error: null + id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + mappings: + - action_type: overwrite + source: title + target: summary + - action_type: overwrite + source: description + target: description + - action_type: overwrite + source: tags + target: labels + - action_type: append + source: comments + target: comments + owner: cases + templates: [] + updated_at: '2024-07-19T00:52:42.401Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzI2LDNd + Cases_update_case_request: + summary: 'Update the case description, tags, and connector.' + value: + cases: + - connector: + fields: + issueType: '10006' + parent: null + priority: null + id: 131d4448-abe0-4789-939d-8ef60680b498 + name: My connector + type: .jira + customFields: + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + description: A case description. + id: a18b38a0-71b0-11ea-a0b2-c51ea50a58e2 + settings: + syncAlerts: true + tags: + - tag-1 + version: WzIzLDFd + Cases_update_case_response: + summary: >- + This is an example response when the case description, tags, and + connector were updated. + value: + - assignees: [] + category: null + closed_at: null + closed_by: null + comments: [] + connector: + fields: + issueType: '10006' + parent: null + priority: null + id: 131d4448-abe0-4789-939d-8ef60680b498 + name: My connector + type: .jira + created_at: '2023-10-13T09:16:17.416Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false + description: A case description. + duration: null + external_service: + connector_id: 05da469f-1fde-4058-99a3-91e4807e2de8 + connector_name: Jira + external_id: '10003' + external_title: IS-4 + external_url: 'https://hms.atlassian.net/browse/IS-4' + pushed_at: '2023-10-13T09:20:40.672Z' + pushed_by: + email: null + full_name: null + username: elastic + id: 66b9aa00-94fa-11ea-9f74-e7e108796192 + owner: cases + settings: + syncAlerts: true + severity: low + status: open + tags: + - tag-1 + title: Case title 1 + totalAlerts: 0 + totalComment: 0 + updated_at: '2023-10-13T09:48:33.043Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzU0OCwxXQ== + Cases_update_comment_request: + summary: Updates a comment of a case. + value: + comment: An updated comment. + id: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 + owner: cases + type: user + version: Wzk1LDFd + Cases_update_comment_response: + summary: >- + The add comment to case API returns a JSON object that contains details + about the case and its comments. + value: + assignees: [] + category: null + closed_at: null + closed_by: null + comments: + - comment: An updated comment. + created_at: '2023-10-24T00:37:10.832Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + id: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 + owner: cases + pushed_at: null + pushed_by: null + type: user + updated_at: '2023-10-24T01:27:06.210Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzIwNjM3LDFd + connector: + fields: null + id: none + name: none + type: .none + created_at: '2023-10-24T00:37:03.906Z' + created_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false + description: A case description. + duration: null + external_service: null + id: 293f1bc0-74f6-11ea-b83a-553aecdb28b6 + owner: cases + settings: + syncAlerts: false + severity: low + status: open + tags: + - tag 1 + title: Case title 1 + totalAlerts: 0 + totalComment: 1 + updated_at: '2023-10-24T01:27:06.210Z' + updated_by: + email: null + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + username: elastic + version: WzIwNjM2LDFd + Connectors_create_email_connector_request: + summary: Create an email connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - connector_type_id: - description: The type of connector. - enum: - - .jira - example: .jira - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + from: tester@example.com + hasAuth: true + host: 'https://example.com' + port: 1025 + secure: false + service: other + connector_type_id: .email + name: email-connector-1 secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_jira' - required: - - config - - connector_type_id - - name - - secrets - title: Create Jira connector request - type: object - Connectors_create_connector_request_opsgenie: - description: The Opsgenie connector uses the Opsgenie alert API. - properties: + password: password + user: username + Connectors_create_email_connector_response: + summary: A new email connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - connector_type_id: - description: The type of connector. - enum: - - .opsgenie - example: .opsgenie - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' - required: - - config - - connector_type_id - - name - - secrets - title: Create Opsgenie connector request - type: object - Connectors_create_connector_request_pagerduty: - description: > - The PagerDuty connector uses the v2 Events API to trigger, acknowledge, - and resolve PagerDuty alerts. - properties: + clientId: null + from: tester@example.com + hasAuth: true + host: 'https://example.com' + oauthTokenUrl: null + port: 1025 + secure: false + service: other + tenantId: null + connector_type_id: .email + id: 90a82c60-478f-11ee-a343-f98a117c727f + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: email-connector-1 + Connectors_create_index_connector_request: + summary: Create an index connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - connector_type_id: - description: The type of connector. - enum: - - .pagerduty - example: .pagerduty - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' - required: - - config - - connector_type_id - - name - - secrets - title: Create PagerDuty connector request - type: object - Connectors_create_connector_request_resilient: - description: >- - The IBM Resilient connector uses the RESILIENT REST v2 to create IBM - Resilient incidents. - properties: + index: test-index + connector_type_id: .index + name: my-connector + Connectors_create_index_connector_response: + summary: A new index connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - connector_type_id: - description: The type of connector. - enum: - - .resilient - example: .resilient - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_resilient' - required: - - config - - connector_type_id - - name - - secrets - title: Create IBM Resilient connector request - type: object - Connectors_create_connector_request_sentinelone: - description: > - The SentinelOne connector communicates with SentinelOne Management - Console via REST API. This functionality is in technical preview and may - be changed or removed in a future release. Elastic will work to fix any - issues, but features in technical preview are not subject to the support - SLA of official GA features. - title: Create SentinelOne connector request - type: object - properties: + executionTimeField: null + index: test-index + refresh: false + connector_type_id: .index + id: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-connector + Connectors_create_webhook_connector_request: + summary: Create a webhook connector with SSL authentication. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - connector_type_id: - description: The type of connector. - enum: - - .sentinelone - example: .sentinelone - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + authType: webhook-authentication-ssl + certType: ssl-crt-key + method: post + url: 'https://example.com' + connector_type_id: .webhook + name: my-webhook-connector secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' - required: - - config - - connector_type_id - - name - - secrets - x-technical-preview: true - Connectors_create_connector_request_serverlog: - description: This connector writes an entry to the Kibana server log. - properties: - connector_type_id: - description: The type of connector. - enum: - - .server-log - example: .server-log - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - required: - - connector_type_id - - name - title: Create server log connector request - type: object - Connectors_create_connector_request_servicenow: - description: > - The ServiceNow ITSM connector uses the import set API to create - ServiceNow incidents. You can use the connector for rule actions and - cases. - properties: + crt: QmFnIEF0dH... + key: LS0tLS1CRUdJ... + password: my-passphrase + Connectors_create_webhook_connector_response: + summary: A new webhook connector. + value: + config: + authType: webhook-authentication-ssl + certType: ssl-crt-key + hasAuth: true + headers: null + method: post + url: 'https://example.com' + verificationMode: full + connector_type_id: .webhook + id: 900eb010-3b9d-11ee-a642-8ffbb94e38bd + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-webhook-connector + Connectors_create_xmatters_connector_request: + summary: Create an xMatters connector with URL authentication. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow - example: .servicenow - type: string - name: - description: The display name for the connector. - example: my-connector - type: string + usesBasic: false + connector_type_id: .xmatters + name: my-xmatters-connector secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow ITSM connector request - type: object - Connectors_create_connector_request_servicenow_itom: - description: > - The ServiceNow ITOM connector uses the event API to create ServiceNow - events. You can use the connector for rule actions. - properties: + secretsUrl: 'https://example.com?apiKey=xxxxx' + Connectors_create_xmatters_connector_response: + summary: A new xMatters connector. + value: + config: + configUrl: null + usesBasic: false + connector_type_id: .xmatters + id: 4d2d8da0-4d1f-11ee-9367-577408be4681 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-xmatters-connector + Connectors_get_connector_response: + summary: Get connector details. + value: + config: {} + connector_type_id: .server-log + id: df770e30-8b8b-11ed-a780-3b746c987a81 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my_server_log_connector + Connectors_get_connector_types_generativeai_response: + summary: A list of connector types for the `generativeAI` feature. + value: + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .gen-ai + is_system_action_type: false + minimum_license_required: enterprise + name: OpenAI + supported_feature_ids: + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .bedrock + is_system_action_type: false + minimum_license_required: enterprise + name: AWS Bedrock + supported_feature_ids: + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - enabled: true + enabled_in_config: true + enabled_in_license: true + id: .gemini + is_system_action_type: false + minimum_license_required: enterprise + name: Google Gemini + supported_feature_ids: + - generativeAIForSecurity + Connectors_get_connectors_response: + summary: A list of connectors + value: + - connector_type_id: .email + id: preconfigured-email-connector + is_deprecated: false + is_preconfigured: true + is_system_action: false + name: my-preconfigured-email-notification + referenced_by_count: 0 + - config: + executionTimeField: null + index: test-index + refresh: false + connector_type_id: .index + id: e07d0c80-8b8b-11ed-a780-3b746c987a81 + is_deprecated: false + is_missing_secrets: false + is_preconfigured: false + is_system_action: false + name: my-index-connector + referenced_by_count: 2 + Connectors_run_cases_webhook_connector_request: + summary: Run a Webhook - Case Management connector to create a case. + value: + params: + subAction: pushToService + subActionParams: + comments: + - comment: A comment about the incident. + commentId: 1 + incident: + description: Description of the incident. + id: caseID + severity: low + status: open + tags: + - tag1 + - tag2 + title: Case title + Connectors_run_cases_webhook_connector_response: + summary: >- + Response from a pushToService action for a Webhook - Case Management + connector. + value: + connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 + data: + comments: + - commentId: 1 + pushedDate: '2023-12-05T19:43:36.360Z' + id: 100665 + pushedDate: '2023-12-05T19:43:36.360Z' + title: TEST-29034 + url: 'https://example.com/browse/TEST-29034' + status: ok + Connectors_run_email_connector_request: + summary: Send an email message from an email connector. + value: + params: + bcc: + - user1@example.com + cc: + - user2@example.com + - user3@example.com + message: Test email message. + subject: Test message subject + to: + - user4@example.com + Connectors_run_email_connector_response: + summary: Response for sending a message from an email connector. + value: + connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 + data: + accepted: + - user1@example.com + - user2@example.com + - user3@example.com + - user4@example.com + envelope: + from: tester@example.com + to: + - user1@example.com + - user2@example.com + - user3@example.com + - user4@example.com + envelopeTime: 8 + messageId: <08a92d29-642a-0706-750c-de5996bd5cf3@example.com> + messageSize: 729 + messageTime: 3 + rejected: [] + response: 250 Message queued as QzEXKcGJ + status: ok + Connectors_run_index_connector_request: + summary: Run an index connector. + value: + params: + documents: + - id: my_doc_id + message: 'hello, world' + name: my_doc_name + Connectors_run_index_connector_response: + summary: Response from running an index connector. + value: + connector_id: fd38c600-96a5-11ed-bb79-353b74189cba + data: + errors: false + items: + - create: + _id: 4JtvwYUBrcyxt2NnfW3y + _index: my-index + _primary_term: 1 + _seq_no: 0 + _shards: + failed: 0 + successful: 1 + total: 2 + _version: 1 + result: created + status: 201 + took: 135 + status: ok + Connectors_run_jira_connector_request: + summary: Run a Jira connector to retrieve the list of issue types. + value: + params: + subAction: issueTypes + Connectors_run_jira_connector_response: + summary: Response from retrieving the list of issue types for a Jira connector. + value: + connector_id: b3aad810-edbe-11ec-82d1-11348ecbf4a6 + data: + - id: 10024 + name: Improvement + - id: 10006 + name: Task + - id: 10007 + name: Sub-task + - id: 10025 + name: New Feature + - id: 10023 + name: Bug + - id: 10000 + name: Epic + status: ok + Connectors_run_pagerduty_connector_request: + summary: Run a PagerDuty connector to trigger an alert. + value: + params: + customDetails: + my_data_1: test data + eventAction: trigger + links: + - href: 'http://example.com/pagerduty' + text: An example link + summary: A brief event summary + Connectors_run_pagerduty_connector_response: + summary: Response from running a PagerDuty connector. + value: + connector_id: 45de9f70-954f-4608-b12a-db7cf808e49d + data: + dedup_key: 5115e138b26b484a81eaea779faa6016 + message: Event processed + status: success + status: ok + Connectors_run_server_log_connector_request: + summary: Run a server log connector. + value: + params: + level: warn + message: Test warning message. + Connectors_run_server_log_connector_response: + summary: Response from running a server log connector. + value: + connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 + status: ok + Connectors_run_servicenow_itom_connector_request: + summary: Run a ServiceNow ITOM connector to retrieve the list of choices. + value: + params: + subAction: getChoices + subActionParams: + fields: + - severity + - urgency + Connectors_run_servicenow_itom_connector_response: + summary: >- + Response from retrieving the list of choices for a ServiceNow ITOM + connector. + value: + connector_id: 9d9be270-2fd2-11ed-b0e0-87533c532698 + data: + - dependent_value: '' + element: severity + label: Critical + value: 1 + - dependent_value: '' + element: severity + label: Major + value: 2 + - dependent_value: '' + element: severity + label: Minor + value: 3 + - dependent_value: '' + element: severity + label: Warning + value: 4 + - dependent_value: '' + element: severity + label: OK + value: 5 + - dependent_value: '' + element: severity + label: Clear + value: 0 + - dependent_value: '' + element: urgency + label: 1 - High + value: 1 + - dependent_value: '' + element: urgency + label: 2 - Medium + value: 2 + - dependent_value: '' + element: urgency + label: 3 - Low + value: 3 + status: ok + Connectors_run_slack_api_connector_request: + summary: >- + Run a Slack connector that uses the web API method to post a message on + a channel. + value: + params: + subAction: postMessage + subActionParams: + channelIds: + - C123ABC456 + text: A test message. + Connectors_run_slack_api_connector_response: + summary: Response from posting a message with a Slack connector. + value: + connector_id: .slack_api + data: + channel: C123ABC456 + message: + app_id: A01BC2D34EF + blocks: + - block_id: /NXe + elements: + - elements: + - text: A test message. + type: text + type: rich_text_section + type: rich_text + bot_id: B12BCDEFGHI + bot_profile: + app_id: A01BC2D34EF + deleted: false + icons: + image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png' + id: B12BCDEFGHI + name: test + team_id: T01ABCDE2F + updated: 1672169705 + team: T01ABCDE2F + text: A test message + ts: '1234567890.123456' + type: message + user: U12A345BC6D + ok: true + ts: '1234567890.123456' + status: ok + Connectors_run_swimlane_connector_request: + summary: Run a Swimlane connector to create an incident. + value: + params: + subAction: pushToService + subActionParams: + comments: + - comment: A comment about the incident. + commentId: 1 + incident: + caseId: '1000' + caseName: Case name + description: Description of the incident. + Connectors_run_swimlane_connector_response: + summary: Response from creating a Swimlane incident. + value: + connector_id: a4746470-2f94-11ed-b0e0-87533c532698 + data: + comments: + - commentId: 1 + pushedDate: '2022-09-08T16:52:27.865Z' + id: aKPmBHWzmdRQtx6Mx + pushedDate: '2022-09-08T16:52:27.866Z' + title: TEST-457 + url: >- + https://elastic.swimlane.url.us/record/aNcL2xniGHGpa2AHb/aKPmBHWzmdRQtx6Mx + status: ok + Connectors_update_index_connector_request: + summary: Update an index connector. + value: config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-itom - example: .servicenow-itom - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow ITOM connector request - type: object - Connectors_create_connector_request_servicenow_sir: + index: updated-index + name: updated-connector + Data_views_create_data_view_request: + summary: Create a data view with runtime fields. + value: + data_view: + name: My Logstash data view + runtimeFieldMap: + runtime_shape_name: + script: + source: 'emit(doc[''shape_name''].value)' + type: keyword + title: logstash-* + Data_views_create_runtime_field_request: + summary: Create a runtime field. + value: + name: runtimeFoo + runtimeField: + script: + source: 'emit(doc["foo"].value)' + type: long + Data_views_get_data_view_response: + summary: >- + The get data view API returns a JSON object that contains information + about the data view. + value: + data_view: + allowNoIndex: false + fieldAttrs: + products.manufacturer: + count: 1 + products.price: + count: 1 + products.product_name: + count: 1 + total_quantity: + count: 1 + fieldFormats: + products.base_price: + id: number + params: + pattern: '$0,0.00' + products.base_unit_price: + id: number + params: + pattern: '$0,0.00' + products.min_price: + id: number + params: + pattern: '$0,0.00' + products.price: + id: number + params: + pattern: '$0,0.00' + products.taxful_price: + id: number + params: + pattern: '$0,0.00' + products.taxless_price: + id: number + params: + pattern: '$0,0.00' + taxful_total_price: + id: number + params: + pattern: '$0,0.[00]' + taxless_total_price: + id: number + params: + pattern: '$0,0.00' + fields: + _id: + aggregatable: false + count: 0 + esTypes: + - _id + format: + id: string + isMapped: true + name: _id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _index: + aggregatable: true + count: 0 + esTypes: + - _index + format: + id: string + isMapped: true + name: _index + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _score: + aggregatable: false + count: 0 + format: + id: number + isMapped: true + name: _score + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: number + _source: + aggregatable: false + count: 0 + esTypes: + - _source + format: + id: _source + isMapped: true + name: _source + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: _source + category: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: category + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + category.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: category.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: category + type: string + currency: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: currency + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_birth_date: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: customer_birth_date + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + customer_first_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_first_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_first_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_first_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_first_name + type: string + customer_full_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_full_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_full_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_full_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_full_name + type: string + customer_gender: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_gender + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_id: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_last_name: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: customer_last_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + customer_last_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_last_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: customer_last_name + type: string + customer_phone: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: customer_phone + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + day_of_week: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: day_of_week + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + day_of_week_i: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: day_of_week_i + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + email: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: email + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + event.dataset: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: event.dataset + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.city_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.city_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.continent_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.continent_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.country_iso_code: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.country_iso_code + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + geoip.location: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: geoip.location + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + geoip.region_name: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: geoip.region_name + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + manufacturer: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: manufacturer + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + manufacturer.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: manufacturer.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: manufacturer + type: string + order_date: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: order_date + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + order_id: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: order_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + products._id: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: products._id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products._id.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products._id.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products._id + type: string + products.base_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.base_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.base_unit_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.base_unit_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.category: + aggregatable: false + count: 0 + esTypes: + - text + format: + id: string + isMapped: true + name: products.category + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.category.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.category.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.category + type: string + products.created_on: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: products.created_on + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + products.discount_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.discount_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.discount_percentage: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.discount_percentage + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.manufacturer: + aggregatable: false + count: 1 + esTypes: + - text + format: + id: string + isMapped: true + name: products.manufacturer + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.manufacturer.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.manufacturer.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.manufacturer + type: string + products.min_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.min_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.price: + aggregatable: true + count: 1 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.product_id: + aggregatable: true + count: 0 + esTypes: + - long + format: + id: number + isMapped: true + name: products.product_id + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.product_name: + aggregatable: false + count: 1 + esTypes: + - text + format: + id: string + isMapped: true + name: products.product_name + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.product_name.keyword: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.product_name.keyword + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + subType: + multi: + parent: products.product_name + type: string + products.quantity: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: products.quantity + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.sku: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: products.sku + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + products.tax_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.tax_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.taxful_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.taxful_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.taxless_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: products.taxless_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + products.unit_discount_amount: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + isMapped: true + name: products.unit_discount_amount + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + sku: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: sku + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + taxful_total_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.[00]' + isMapped: true + name: taxful_total_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + taxless_total_price: + aggregatable: true + count: 0 + esTypes: + - half_float + format: + id: number + params: + pattern: '$0,0.00' + isMapped: true + name: taxless_total_price + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + total_quantity: + aggregatable: true + count: 1 + esTypes: + - integer + format: + id: number + isMapped: true + name: total_quantity + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + total_unique_products: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: total_unique_products + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + type: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: type + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + user: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: user + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + name: Kibana Sample Data eCommerce + namespaces: + - default + runtimeFieldMap: {} + sourceFilters: [] + timeFieldName: order_date + title: kibana_sample_data_ecommerce + typeMeta: {} + version: WzUsMV0= + Data_views_get_data_views_response: + summary: The get all data views API returns a list of data views. + value: + data_view: + - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + name: Kibana Sample Data eCommerce + namespaces: + - default + title: kibana_sample_data_ecommerce + typeMeta: {} + - id: d3d7af60-4c81-11e8-b3d7-01146121b73d + name: Kibana Sample Data Flights + namespaces: + - default + title: kibana_sample_data_flights + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: Kibana Sample Data Logs + namespaces: + - default + title: kibana_sample_data_logs + Data_views_get_default_data_view_response: + summary: The get default data view API returns the default data view identifier. + value: + data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + Data_views_get_runtime_field_response: + summary: >- + The get runtime field API returns a JSON object that contains + information about the runtime field (`hour_of_day`) and the data view + (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). + value: + data_view: + allowNoIndex: false + fieldAttrs: {} + fieldFormats: + AvgTicketPrice: + id: number + params: + pattern: '$0,0.[00]' + hour_of_day: + id: number + params: + pattern: '00' + fields: + _id: + aggregatable: false + count: 0 + esTypes: + - _id + format: + id: string + isMapped: true + name: _id + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _index: + aggregatable: true + count: 0 + esTypes: + - _index + format: + id: string + isMapped: true + name: _index + readFromDocValues: false + scripted: false + searchable: true + shortDotsEnable: false + type: string + _score: + aggregatable: false + count: 0 + format: + id: number + isMapped: true + name: _score + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: number + _source: + aggregatable: false + count: 0 + esTypes: + - _source + format: + id: _source + isMapped: true + name: _source + readFromDocValues: false + scripted: false + searchable: false + shortDotsEnable: false + type: _source + AvgTicketPrice: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + params: + pattern: '$0,0.[00]' + isMapped: true + name: AvgTicketPrice + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + Cancelled: + aggregatable: true + count: 0 + esTypes: + - boolean + format: + id: boolean + isMapped: true + name: Cancelled + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: boolean + Carrier: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Carrier + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + dayOfWeek: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: dayOfWeek + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + Dest: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Dest + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestAirportID: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestAirportID + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestCityName: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestCityName + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestCountry: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestCountry + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestLocation: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: DestLocation + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + DestRegion: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestRegion + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DestWeather: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: DestWeather + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + DistanceKilometers: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: DistanceKilometers + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + DistanceMiles: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: DistanceMiles + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + FlightDelay: + aggregatable: true + count: 0 + esTypes: + - boolean + format: + id: boolean + isMapped: true + name: FlightDelay + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: boolean + FlightDelayMin: + aggregatable: true + count: 0 + esTypes: + - integer + format: + id: number + isMapped: true + name: FlightDelayMin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + FlightDelayType: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightDelayType + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightNum: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightNum + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightTimeHour: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: FlightTimeHour + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + FlightTimeMin: + aggregatable: true + count: 0 + esTypes: + - float + format: + id: number + isMapped: true + name: FlightTimeMin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: number + hour_of_day: + aggregatable: true + count: 0 + esTypes: + - long + format: + id: number + params: + pattern: '00' + name: hour_of_day + readFromDocValues: false + runtimeField: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + scripted: false + searchable: true + shortDotsEnable: false + type: number + Origin: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: Origin + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginAirportID: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginAirportID + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginCityName: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginCityName + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginCountry: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginCountry + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginLocation: + aggregatable: true + count: 0 + esTypes: + - geo_point + format: + id: geo_point + params: + transform: wkt + isMapped: true + name: OriginLocation + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: geo_point + OriginRegion: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginRegion + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + OriginWeather: + aggregatable: true + count: 0 + esTypes: + - keyword + format: + id: string + isMapped: true + name: OriginWeather + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: string + timestamp: + aggregatable: true + count: 0 + esTypes: + - date + format: + id: date + isMapped: true + name: timestamp + readFromDocValues: true + scripted: false + searchable: true + shortDotsEnable: false + type: date + id: d3d7af60-4c81-11e8-b3d7-01146121b73d + name: Kibana Sample Data Flights + runtimeFieldMap: + hour_of_day: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + sourceFilters: [] + timeFieldName: timestamp + title: kibana_sample_data_flights + version: WzM2LDJd + fields: + - aggregatable: true + count: 0 + esTypes: + - long + name: hour_of_day + readFromDocValues: false + runtimeField: + script: + source: 'emit(doc[''timestamp''].value.getHour());' + type: long + scripted: false + searchable: true + shortDotsEnable: false + type: number + Data_views_preview_swap_data_view_request: + summary: Preview swapping references from data view ID "abcd-efg" to "xyz-123". + value: + fromId: abcd-efg + toId: xyz-123 + Data_views_set_default_data_view_request: + summary: Set the default data view identifier. + value: + data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f + force: true + Data_views_swap_data_view_request: + summary: >- + Swap references from data view ID "abcd-efg" to "xyz-123" and remove the + data view that is no longer referenced. + value: + delete: true + fromId: abcd-efg + toId: xyz-123 + Data_views_update_data_view_request: + summary: Update some properties for a data view. + value: + data_view: + allowNoIndex: false + name: Kibana Sample Data eCommerce + timeFieldName: order_date + title: kibana_sample_data_ecommerce + refresh_fields: true + Data_views_update_field_metadata_request: + summary: Update metadata for multiple fields. + value: + fields: + field1: + count: 123 + customLabel: Field 1 label + field2: + customDescription: Field 2 description + customLabel: Field 2 label + Data_views_update_runtime_field_request: + summary: Update an existing runtime field on a data view. + value: + runtimeField: + script: + source: 'emit(doc["bar"].value)' + Machine_learning_APIs_mlSyncExample: + summary: Two anomaly detection jobs required synchronization in this example. + value: + datafeedsAdded: {} + datafeedsRemoved: {} + savedObjectsCreated: + anomaly-detector: + myjob1: + success: true + myjob2: + success: true + savedObjectsDeleted: {} + Saved_objects_export_objects_request: + summary: Export a specific saved object. + value: + excludeExportDetails: true + includeReferencesDeep: false + objects: + - id: de71f4f0-1902-11e9-919b-ffe5949a18d2 + type: map + Saved_objects_export_objects_response: + summary: >- + The export objects API response contains a JSON record for each exported + object. + value: + attributes: + description: '' + layerListJSON: >- + [{"id":"0hmz5","alpha":1,"sourceDescriptor":{"type":"EMS_TMS","isAutoSelect":true,"lightModeDefault":"road_map_desaturated"},"visible":true,"style":{},"type":"EMS_VECTOR_TILE","minZoom":0,"maxZoom":24},{"id":"edh66","label":"Total + Requests by + Destination","minZoom":0,"maxZoom":24,"alpha":0.5,"sourceDescriptor":{"type":"EMS_FILE","id":"world_countries","tooltipProperties":["name","iso2"]},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"__kbnjoin__count__673ff994-fc75-4c67-909b-69fcb0e1060e","origin":"join"},"color":"Greys","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"STATIC","options":{"size":10}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR","joins":[{"leftField":"iso2","right":{"type":"ES_TERM_SOURCE","id":"673ff994-fc75-4c67-909b-69fcb0e1060e","indexPatternTitle":"kibana_sample_data_logs","term":"geo.dest","indexPatternRefName":"layer_1_join_0_index_pattern","metrics":[{"type":"count","label":"web + logs + count"}],"applyGlobalQuery":true}}]},{"id":"gaxya","label":"Actual + Requests","minZoom":9,"maxZoom":24,"alpha":1,"sourceDescriptor":{"id":"b7486535-171b-4d3b-bb2e-33c1a0a2854c","type":"ES_SEARCH","geoField":"geo.coordinates","limit":2048,"filterByMapBounds":true,"tooltipProperties":["clientip","timestamp","host","request","response","machine.os","agent","bytes"],"indexPatternRefName":"layer_2_source_index_pattern","applyGlobalQuery":true,"scalingType":"LIMIT"},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"STATIC","options":{"color":"#2200ff"}},"lineColor":{"type":"STATIC","options":{"color":"#FFFFFF"}},"lineWidth":{"type":"STATIC","options":{"size":2}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"bytes","origin":"source"},"minSize":1,"maxSize":23,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"},{"id":"tfi3f","label":"Total + Requests and + Bytes","minZoom":0,"maxZoom":9,"alpha":1,"sourceDescriptor":{"type":"ES_GEO_GRID","resolution":"COARSE","id":"8aaa65b5-a4e9-448b-9560-c98cb1c5ac5b","geoField":"geo.coordinates","requestType":"point","metrics":[{"type":"count","label":"web + logs + count"},{"type":"sum","field":"bytes"}],"indexPatternRefName":"layer_3_source_index_pattern","applyGlobalQuery":true},"visible":true,"style":{"type":"VECTOR","properties":{"fillColor":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"color":"Blues","fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"lineColor":{"type":"STATIC","options":{"color":"#cccccc"}},"lineWidth":{"type":"STATIC","options":{"size":1}},"iconSize":{"type":"DYNAMIC","options":{"field":{"name":"sum_of_bytes","origin":"source"},"minSize":7,"maxSize":25,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelText":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"labelSize":{"type":"DYNAMIC","options":{"field":{"name":"doc_count","origin":"source"},"minSize":12,"maxSize":24,"fieldMetaOptions":{"isEnabled":false,"sigma":3}}},"symbolizeAs":{"options":{"value":"circle"}},"icon":{"type":"STATIC","options":{"value":"marker"}}}},"type":"GEOJSON_VECTOR"}] + mapStateJSON: >- + {"zoom":3.64,"center":{"lon":-88.92107,"lat":42.16337},"timeFilters":{"from":"now-7d","to":"now"},"refreshConfig":{"isPaused":true,"interval":0},"query":{"language":"kuery","query":""},"settings":{"autoFitToDataBounds":false}} + title: '[Logs] Total Requests and Bytes' + uiStateJSON: '{"isDarkMode":false}' + coreMigrationVersion: 8.8.0 + created_at: '2023-08-23T20:03:32.204Z' + id: de71f4f0-1902-11e9-919b-ffe5949a18d2 + managed: false + references: + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_1_join_0_index_pattern + type: index-pattern + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_2_source_index_pattern + type: index-pattern + - id: 90943e30-9a47-11e8-b64d-95841ca0b247 + name: layer_3_source_index_pattern + type: index-pattern + type: map + typeMigrationVersion: 8.4.0 + updated_at: '2023-08-23T20:03:32.204Z' + version: WzEzLDFd + Saved_objects_import_objects_request: + value: + file: file.ndjson + Saved_objects_import_objects_response: + summary: >- + The import objects API response indicates a successful import and the + objects are created. Since these objects are created as new copies, each + entry in the successResults array includes a destinationId attribute. + value: + success: true + successCount: 1 + successResults: + - destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + managed: false + meta: + icon: indexPatternApp + title: Kibana Sample Data Logs + type: index-pattern + Saved_objects_key_rotation_response: + summary: Encryption key rotation using default parameters. + value: + failed: 0 + successful: 300 + total: 1000 + Saved_objects_resolve_missing_reference_request: + value: + file: file.ndjson + retries: + - id: my-pattern + overwrite: true + type: index-pattern + - destinationId: another-vis + id: my-vis + overwrite: true + type: visualization + - destinationId: yet-another-canvas + id: my-canvas + overwrite: true + type: canvas + - id: my-dashboard + type: dashboard + Saved_objects_resolve_missing_reference_response: + summary: Resolve missing reference errors. + value: + success: true + successCount: 3 + successResults: + - id: my-vis + meta: + icon: visualizeApp + title: Look at my visualization + type: visualization + - id: my-search + meta: + icon: searchApp + title: Look at my search + type: search + - id: my-dashboard + meta: + icon: dashboardApp + title: Look at my dashboard + type: dashboard + parameters: + Alerting_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Cases_alert_id: + description: An identifier for the alert. + in: path + name: alertId + required: true + schema: + example: 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 + type: string + Cases_assignees: description: > - The ServiceNow SecOps connector uses the import set API to create - ServiceNow security incidents. You can use the connector for rule - actions and cases. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - connector_type_id: - description: The type of connector. - enum: - - .servicenow-sir - example: .servicenow-sir - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - connector_type_id - - name - - secrets - title: Create ServiceNow SecOps connector request - type: object - Connectors_create_connector_request_slack_api: - description: The Slack connector uses an API method to send Slack messages. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - connector_type_id: - description: The type of connector. - enum: - - .slack_api - example: .slack_api - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' - required: - - connector_type_id - - name - - secrets - title: Create Slack connector request - type: object - Connectors_create_connector_request_slack_webhook: - description: The Slack connector uses Slack Incoming Webhooks. - properties: - connector_type_id: - description: The type of connector. - enum: - - .slack - example: .slack - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' - required: - - connector_type_id - - name - - secrets - title: Create Slack connector request - type: object - Connectors_create_connector_request_swimlane: + Filters the returned cases by assignees. Valid values are `none` or + unique identifiers for the user profiles. These identifiers can be found + by using the suggest user profile API. + in: query + name: assignees + schema: + oneOf: + - type: string + - items: + type: string + maxItems: 100 + type: array + Cases_case_id: description: >- - The Swimlane connector uses the Swimlane REST API to create Swimlane - records. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - connector_type_id: - description: The type of connector. - enum: - - .swimlane - example: .swimlane - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' - required: - - config - - connector_type_id - - name - - secrets - title: Create Swimlane connector request - type: object - Connectors_create_connector_request_teams: - description: The Microsoft Teams connector uses Incoming Webhooks. - properties: - connector_type_id: - description: The type of connector. - enum: - - .teams - example: .teams - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_teams' - required: - - connector_type_id - - name - - secrets - title: Create Microsoft Teams connector request - type: object - Connectors_create_connector_request_tines: + The identifier for the case. To retrieve case IDs, use the find cases + API. All non-ASCII characters must be URL encoded. + in: path + name: caseId + required: true + schema: + example: 9c235210-6834-11ea-a78c-6ffb38a34414 + type: string + Cases_category: + description: Filters the returned cases by category. + in: query + name: category + schema: + oneOf: + - example: my-category + type: string + - items: + type: string + maxItems: 100 + type: array + Cases_comment_id: description: > - The Tines connector uses Tines Webhook actions to send events via POST - request. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - connector_type_id: - description: The type of connector. - enum: - - .tines - example: .tines - type: string - name: - description: The display name for the connector. - example: my-connector - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_tines' - required: - - config - - connector_type_id - - name - - secrets - title: Create Tines connector request - type: object - Connectors_create_connector_request_torq: + The identifier for the comment. To retrieve comment IDs, use the get + case or find cases APIs. + in: path + name: commentId + required: true + schema: + example: 71ec1870-725b-11ea-a0b2-c51ea50a58e2 + type: string + Cases_configuration_id: + description: An identifier for the configuration. + in: path + name: configurationId + required: true + schema: + example: 3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9 + type: string + Cases_connector_id: + description: >- + An identifier for the connector. To retrieve connector IDs, use the find + connectors API. + in: path + name: connectorId + required: true + schema: + example: abed3a70-71bd-11ea-a0b2-c51ea50a58e2 + type: string + Cases_defaultSearchOperator: + description: he default operator to use for the simple_query_string. + example: OR + in: query + name: defaultSearchOperator + schema: + default: OR + type: string + Cases_from: description: > - The Torq connector uses a Torq webhook to trigger workflows with Kibana - actions. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - connector_type_id: - description: The type of connector. - enum: - - .torq - example: .torq - type: string - name: - description: The display name for the connector. - example: my-connector + Returns only cases that were created after a specific date. The date + must be specified as a KQL data range or date match expression. + in: query + name: from + schema: + example: now-1d + type: string + Cases_ids: + description: > + The cases that you want to removed. All non-ASCII characters must be URL + encoded. + example: d4e7abb0-b462-11ec-9a8d-698504725a43 + in: query + name: ids + required: true + schema: + items: + maxItems: 100 + minItems: 1 type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_torq' - required: - - config - - connector_type_id - - name - - secrets - title: Create Torq connector request - type: object - Connectors_create_connector_request_webhook: + type: array + Cases_includeComments: + deprecated: true + description: >- + Deprecated in 8.1.0. This parameter is deprecated and will be removed in + a future release. It determines whether case comments are returned. + in: query + name: includeComments + schema: + default: true + type: boolean + Cases_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Cases_owner: + description: > + A filter to limit the response to a specific set of applications. If + this parameter is omitted, the response contains information about all + the cases that the user has access to read. + example: cases + in: query + name: owner + schema: + oneOf: + - $ref: '#/components/schemas/Cases_owners' + - items: + $ref: '#/components/schemas/Cases_owners' + type: array + Cases_page_index: + description: The page number to return. + in: query + name: page + required: false + schema: + default: 1 + type: integer + Cases_page_size: + description: The number of items to return. Limited to 100 items. + in: query + name: perPage + required: false + schema: + default: 20 + maximum: 100 + type: integer + Cases_reporters: + description: Filters the returned cases by the user name of the reporter. + example: elastic + in: query + name: reporters + schema: + oneOf: + - type: string + - items: + type: string + maxItems: 100 + type: array + Cases_search: + description: >- + An Elasticsearch simple_query_string query that filters the objects in + the response. + in: query + name: search + schema: + type: string + Cases_searchFields: + description: The fields to perform the simple_query_string parsed query against. + in: query + name: searchFields + schema: + oneOf: + - $ref: '#/components/schemas/Cases_searchFieldsType' + - items: + $ref: '#/components/schemas/Cases_searchFieldsType' + type: array + Cases_severity: + description: The severity of the case. + in: query + name: severity + schema: + enum: + - critical + - high + - low + - medium + type: string + Cases_sort_order: + description: Determines the sort order. + in: query + name: sortOrder + required: false + schema: + default: desc + enum: + - asc + - desc + type: string + Cases_sortField: + description: Determines which field is used to sort the results. + example: updatedAt + in: query + name: sortField + schema: + default: createdAt + enum: + - createdAt + - updatedAt + - closedAt + - title + - category + - status + - severity + type: string + Cases_status: + description: Filters the returned cases by state. + example: open + in: query + name: status + schema: + enum: + - closed + - in-progress + - open + type: string + Cases_tags: + description: Filters the returned cases by tags. + example: tag-1 + in: query + name: tags + schema: + oneOf: + - type: string + - items: + type: string + maxItems: 100 + type: array + Cases_to: description: > - The Webhook connector uses axios to send a POST or PUT request to a web - service. - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - connector_type_id: - description: The type of connector. + Returns only cases that were created before a specific date. The date + must be specified as a KQL data range or date match expression. + example: now+1d + in: query + name: to + schema: + type: string + Cases_user_action_types: + description: Determines the types of user actions to return. + example: create_case + in: query + name: types + schema: + items: enum: - - .webhook - example: .webhook - type: string - name: - description: The display name for the connector. - example: my-connector + - action + - alert + - assignees + - attachment + - comment + - connector + - create_case + - description + - pushed + - settings + - severity + - status + - tags + - title + - user type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_webhook' - required: - - config - - connector_type_id - - name - - secrets - title: Create Webhook connector request - type: object - Connectors_create_connector_request_xmatters: - description: > - The xMatters connector uses the xMatters Workflow for Elastic to send - actionable alerts to on-call xMatters resources. + type: array + Connectors_action_id: + description: An identifier for the action. + in: path + name: actionId + required: true + schema: + example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad + type: string + Connectors_connector_id: + description: An identifier for the connector. + in: path + name: connectorId + required: true + schema: + example: df770e30-8b8b-11ed-a780-3b746c987a81 + type: string + Connectors_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Data_views_field_name: + description: The name of the runtime field. + in: path + name: fieldName + required: true + schema: + example: hour_of_day + type: string + Data_views_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Data_views_view_id: + description: An identifier for the data view. + in: path + name: viewId + required: true + schema: + example: ff959d40-b880-11e8-a6d9-e546fe2bba5f + type: string + Fleet_format: + description: Simplified or legacy format for package inputs + in: query + name: format + required: false + schema: + enum: + - simplified + - legacy + type: string + Fleet_kbn_xsrf: + description: Kibana's anti Cross-Site Request Forgery token. Can be any string value. + in: header + name: kbn-xsrf + required: true + schema: + type: string + Fleet_kuery: + in: query + name: kuery + required: false + schema: + type: string + Fleet_page_index: + in: query + name: page + required: false + schema: + default: 1 + type: integer + Fleet_page_size: + description: The number of items to return + in: query + name: perPage + required: false + schema: + default: 20 + type: integer + Fleet_show_inactive: + in: query + name: showInactive + required: false + schema: + type: boolean + Fleet_show_upgradeable: + in: query + name: showUpgradeable + required: false + schema: + type: boolean + Fleet_sort_field: + in: query + name: sortField + required: false + schema: + deprecated: true + type: string + Fleet_sort_order: + in: query + name: sortOrder + required: false + schema: + enum: + - asc + - desc + type: string + Fleet_with_metrics: + description: 'Return agent metrics, false by default' + in: query + name: withMetrics + required: false + schema: + type: boolean + Machine_learning_APIs_simulateParam: + description: >- + When true, simulates the synchronization by returning only the list of + actions that would be performed. + example: 'true' + in: query + name: simulate + required: false + schema: + type: boolean + Saved_objects_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + Saved_objects_saved_object_id: + description: An identifier for the saved object. + in: path + name: id + required: true + schema: + type: string + Saved_objects_saved_object_type: + description: >- + Valid options include `visualization`, `dashboard`, `search`, + `index-pattern`, `config`. + in: path + name: type + required: true + schema: + type: string + SLOs_kbn_xsrf: + description: Cross-site request forgery protection + in: header + name: kbn-xsrf + required: true + schema: + type: string + SLOs_slo_id: + description: An identifier for the slo. + in: path + name: sloId + required: true + schema: + example: 9c235211-6834-11ea-a78c-6feb38a34414 + type: string + SLOs_space_id: + description: >- + An identifier for the space. If `/s/` and the identifier are omitted + from the path, the default space is used. + in: path + name: spaceId + required: true + schema: + example: default + type: string + responses: + Connectors_200_actions: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Connectors_action_response_properties' + description: Indicates a successful call. + Connectors_401: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + error: + enum: + - Unauthorized + example: Unauthorized + type: string + message: + type: string + statusCode: + enum: + - 401 + example: 401 + type: integer + title: Unauthorized response + type: object + description: Authorization information is missing or invalid. + Connectors_404: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + error: + enum: + - Not Found + example: Not Found + type: string + message: + example: >- + Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not + found + type: string + statusCode: + enum: + - 404 + example: 404 + type: integer + title: Not found response + type: object + description: Object is not found. + Fleet_error: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + schemas: + Alerting_401_response: properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - connector_type_id: - description: The type of connector. + error: enum: - - .xmatters - example: .xmatters - type: string - name: - description: The display name for the connector. - example: my-connector + - Unauthorized + example: Unauthorized type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' - required: - - config - - connector_type_id - - name - - secrets - title: Create xMatters connector request - type: object - Connectors_features: - description: | - The feature that uses the connector. - enum: - - alerting - - cases - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - siem - - uptime - type: string - Connectors_is_deprecated: - description: Indicates whether the connector type is deprecated. - example: false - type: boolean - Connectors_is_missing_secrets: - description: >- - Indicates whether secrets are missing for the connector. Secrets - configuration properties vary depending on the connector type. - example: false - type: boolean - Connectors_is_preconfigured: - description: > - Indicates whether it is a preconfigured connector. If true, the `config` - and `is_missing_secrets` properties are omitted from the response. - example: false - type: boolean - Connectors_is_system_action: - description: Indicates whether the connector is used for system actions. - example: false - type: boolean - Connectors_referenced_by_count: - description: > - Indicates the number of saved objects that reference the connector. If - `is_preconfigured` is true, this value is not calculated. This property - is returned only by the get all connectors API. - example: 2 - type: integer - Connectors_run_connector_params_acknowledge_resolve_pagerduty: - description: Test an action that acknowledges or resolves a PagerDuty alert. - properties: - dedupKey: - description: The deduplication key for the PagerDuty alert. - maxLength: 255 + message: type: string - eventAction: - description: The type of event. + statusCode: enum: - - acknowledge - - resolve - type: string - required: - - dedupKey - - eventAction - title: PagerDuty connector parameters + - 401 + example: 401 + type: integer + title: Unsuccessful rule API response type: object - Connectors_run_connector_params_documents: - description: Test an action that indexes a document into Elasticsearch. - properties: - documents: - description: The documents in JSON format for index connectors. - items: - additionalProperties: true - type: object - type: array - required: - - documents - title: Index connector parameters + Alerting_alert_response_properties: + title: Legacy alert response properties type: object - Connectors_run_connector_params_message_email: - anyOf: - - required: - - bcc - - message - - subject - - required: - - cc - - message - - subject - - required: - - to - - message - - subject - description: > - Test an action that sends an email message. There must be at least one - recipient in `to`, `cc`, or `bcc`. properties: - bcc: - description: > - A list of "blind carbon copy" email addresses. Addresses can be - specified in `user@host-name` format or in name `` - format + actions: items: - type: string + type: object type: array - cc: - description: > - A list of "carbon copy" email addresses. Addresses can be specified - in `user@host-name` format or in name `` format + alertTypeId: + example: .index-threshold + type: string + apiKeyOwner: + example: elastic + nullable: true + type: string + createdAt: + description: The date and time that the alert was created. + example: '2022-12-05T23:36:58.284Z' + format: date-time + type: string + createdBy: + description: The identifier for the user that created the alert. + example: elastic + type: string + enabled: + description: Indicates whether the alert is currently enabled. + example: true + type: boolean + executionStatus: + type: object + properties: + lastExecutionDate: + example: '2022-12-06T00:13:43.890Z' + format: date-time + type: string + status: + example: ok + type: string + id: + description: The identifier for the alert. + example: b530fed0-74f5-11ed-9801-35303b735aef + type: string + muteAll: + example: false + type: boolean + mutedInstanceIds: items: type: string + nullable: true type: array - message: - description: The email message text. Markdown format is supported. + name: + description: The name of the alert. + example: my alert type: string - subject: - description: The subject line of the email. + notifyWhen: + example: onActionGroupChange type: string - to: - description: > - A list of email addresses. Addresses can be specified in - `user@host-name` format or in name `` format. + params: + additionalProperties: true + type: object + schedule: + type: object + properties: + interval: + type: string + scheduledTaskId: + example: b530fed0-74f5-11ed-9801-35303b735aef + type: string + tags: items: type: string type: array - title: Email connector parameters - type: object - Connectors_run_connector_params_message_serverlog: - description: Test an action that writes an entry to the Kibana server log. - properties: - level: - default: info - description: The log level of the message for server log connectors. - enum: - - debug - - error - - fatal - - info - - trace - - warn + throttle: + nullable: true type: string - message: - description: The message for server log connectors. + updatedAt: + example: '2022-12-05T23:36:58.284Z' type: string - required: - - message - title: Server log connector parameters - type: object - Connectors_run_connector_params_message_slack: - description: > - Test an action that sends a message to Slack. It is applicable only when - the connector type is `.slack`. - properties: - message: - description: >- - The Slack message text, which cannot contain Markdown, images, or - other advanced formatting. + updatedBy: + description: The identifier for the user that updated this alert most recently. + example: elastic + nullable: true type: string - required: - - message - title: Slack connector parameters + Alerting_fieldmap_properties: + title: Field map objects in the get rule types response type: object - Connectors_run_connector_params_trigger_pagerduty: - description: Test an action that triggers a PagerDuty alert. properties: - class: - description: The class or type of the event. - example: cpu load - type: string - component: - description: >- - The component of the source machine that is responsible for the - event. - example: eth0 - type: string - customDetails: - description: Additional details to add to the event. - type: object - dedupKey: + array: + description: Indicates whether the field is an array. + type: boolean + dynamic: + description: Indicates whether it is a dynamic field mapping. + type: boolean + format: description: > - All actions sharing this key will be associated with the same - PagerDuty alert. This value is used to correlate trigger and - resolution. - maxLength: 255 - type: string - eventAction: - description: The type of event. - enum: - - trigger - type: string - group: - description: The logical grouping of components of a service. - example: app-stack + Indicates the format of the field. For example, if the `type` is + `date_range`, the `format` can be + `epoch_millis||strict_date_optional_time`. type: string - links: - description: A list of links to add to the event. - items: - type: object - properties: - href: - description: The URL for the link. - type: string - text: - description: A plain text description of the purpose of the link. - type: string - type: array - severity: - default: info - description: The severity of the event on the affected system. - enum: - - critical - - error - - info - - warning + ignore_above: + description: >- + Specifies the maximum length of a string field. Longer strings are + not indexed or stored. + type: integer + index: + description: Indicates whether field values are indexed. + type: boolean + path: + description: TBD type: string - source: + properties: + additionalProperties: + type: object + properties: + type: + description: The data type for each object property. + type: string description: > - The affected system, such as a hostname or fully qualified domain - name. Defaults to the Kibana saved object id of the action. + Details about the object properties. This property is applicable + when `type` is `object`. + type: object + required: + description: Indicates whether the field is required. + type: boolean + scaling_factor: + description: > + The scaling factor to use when encoding values. This property is + applicable when `type` is `scaled_float`. Values will be multiplied + by this factor at index time and rounded to the closest long value. + type: integer + type: + description: Specifies the data type for the field. + example: scaled_float type: string - summary: - description: A summery of the event. - maxLength: 1024 + Cases_4xx_response: + properties: + error: + example: Unauthorized type: string - timestamp: - description: >- - An ISO-8601 timestamp that indicates when the event was detected or - generated. - format: date-time + message: type: string - required: - - eventAction - title: PagerDuty connector parameters + statusCode: + example: 401 + type: integer + title: Unsuccessful cases API response + type: object + Cases_action_types: + description: The type of action. + enum: + - assignees + - create_case + - comment + - connector + - delete_case + - description + - pushed + - tags + - title + - status + - settings + - severity + example: create_case + type: string + Cases_actions: + enum: + - add + - create + - delete + - push_to_service + - update + example: create + type: string + Cases_add_alert_comment_request_properties: + description: Defines properties for case comment requests when type is alert. type: object - Connectors_run_connector_request: - description: The properties vary depending on the connector type. properties: - params: - oneOf: - - $ref: >- - #/components/schemas/Connectors_run_connector_params_acknowledge_resolve_pagerduty - - $ref: '#/components/schemas/Connectors_run_connector_params_documents' - - $ref: >- - #/components/schemas/Connectors_run_connector_params_message_email - - $ref: >- - #/components/schemas/Connectors_run_connector_params_message_serverlog - - $ref: >- - #/components/schemas/Connectors_run_connector_params_message_slack - - $ref: >- - #/components/schemas/Connectors_run_connector_params_trigger_pagerduty - - description: Test an action that involves a subaction. - discriminator: - mapping: - addEvent: >- - #/components/schemas/Connectors_run_connector_subaction_addevent - closeAlert: >- - #/components/schemas/Connectors_run_connector_subaction_closealert - closeIncident: >- - #/components/schemas/Connectors_run_connector_subaction_closeincident - createAlert: >- - #/components/schemas/Connectors_run_connector_subaction_createalert - fieldsByIssueType: >- - #/components/schemas/Connectors_run_connector_subaction_fieldsbyissuetype - getChoices: >- - #/components/schemas/Connectors_run_connector_subaction_getchoices - getFields: >- - #/components/schemas/Connectors_run_connector_subaction_getfields - getIncident: >- - #/components/schemas/Connectors_run_connector_subaction_getincident - issue: >- - #/components/schemas/Connectors_run_connector_subaction_issue - issues: >- - #/components/schemas/Connectors_run_connector_subaction_issues - issueTypes: >- - #/components/schemas/Connectors_run_connector_subaction_issuetypes - pushToService: >- - #/components/schemas/Connectors_run_connector_subaction_pushtoservice - propertyName: subAction - oneOf: - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_addevent - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_closealert - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_closeincident - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_createalert - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_fieldsbyissuetype - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_getchoices - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_getfields - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_getincident - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_issue - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_issues - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_issuetypes - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_postmessage - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_pushtoservice - - $ref: >- - #/components/schemas/Connectors_run_connector_subaction_validchannelid - title: Subaction parameters + alertId: + $ref: '#/components/schemas/Cases_alert_identifiers' + index: + $ref: '#/components/schemas/Cases_alert_indices' + owner: + $ref: '#/components/schemas/Cases_owners' + rule: + $ref: '#/components/schemas/Cases_rule' + type: + description: The type of comment. + enum: + - alert + example: alert + type: string required: - - params - title: Run connector request body properties + - alertId + - index + - owner + - rule + - type + title: Add case comment request properties for alerts + Cases_add_case_comment_request: + description: >- + The add comment to case API request body varies depending on whether you + are adding an alert or a comment. + discriminator: + mapping: + alert: '#/components/schemas/Cases_add_alert_comment_request_properties' + user: '#/components/schemas/Cases_add_user_comment_request_properties' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Cases_add_alert_comment_request_properties' + - $ref: '#/components/schemas/Cases_add_user_comment_request_properties' + title: Add case comment request + Cases_add_user_comment_request_properties: + description: Defines properties for case comment requests when type is user. + properties: + comment: + description: The new comment. It is required only when `type` is `user`. + example: A new comment. + maxLength: 30000 + type: string + owner: + $ref: '#/components/schemas/Cases_owners' + type: + description: The type of comment. + enum: + - user + example: user + type: string + required: + - comment + - owner + - type + title: Add case comment request properties for user comments type: object - Connectors_run_connector_subaction_addevent: - description: The `addEvent` subaction for ServiceNow ITOM connectors. - title: The addEvent subaction + Cases_alert_comment_response_properties: + title: Add case comment response properties for alerts type: object properties: - subAction: - description: The action to test. - enum: - - addEvent + alertId: + items: + example: a6e12ac4-7bce-457b-84f6-d7ce8deb8446 + type: string + type: array + created_at: + example: '2023-11-06T19:29:38.424Z' + format: date-time type: string - subActionParams: - description: The set of configuration properties for the action. + created_by: type: object properties: - additional_info: - description: Additional information about the event. + email: + example: null + nullable: true type: string - description: - description: The details about the event. + full_name: + example: null + nullable: true type: string - event_class: - description: A specific instance of the source. + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 type: string - message_key: - description: >- - All actions sharing this key are associated with the same - ServiceNow alert. The default value is `:`. + username: + example: elastic + nullable: true type: string - metric_name: - description: The name of the metric. + required: + - email + - full_name + - username + id: + example: 73362370-ab1a-11ec-985f-97e55adae8b9 + type: string + index: + items: + example: .internal.alerts-security.alerts-default-000001 + type: string + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + pushed_at: + example: null + format: date-time + nullable: true + type: string + pushed_by: + nullable: true + type: object + properties: + email: + example: null + nullable: true type: string - node: - description: The host that the event was triggered for. + full_name: + example: null + nullable: true type: string - resource: - description: The name of the resource. + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 type: string - severity: - description: The severity of the event. + username: + example: elastic + nullable: true type: string - source: - description: The name of the event source type. + required: + - email + - full_name + - username + rule: + type: object + properties: + id: + description: The rule identifier. + example: 94d80550-aaf4-11ec-985f-97e55adae8b9 type: string - time_of_event: - description: The time of the event. + name: + description: The rule name. + example: security_rule type: string - type: - description: The type of event. + type: + enum: + - alert + example: alert + type: string + updated_at: + format: date-time + nullable: true + type: string + updated_by: + nullable: true + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true type: string + required: + - email + - full_name + - username + version: + example: WzMwNDgsMV0= + type: string required: - - subAction - Connectors_run_connector_subaction_closealert: - description: The `closeAlert` subaction for Opsgenie connectors. - title: The closeAlert subaction + - type + Cases_alert_identifiers: + description: > + The alert identifiers. It is required only when `type` is `alert`. You + can use an array of strings to add multiple alerts to a case, provided + that they all relate to the same rule; `index` must also be an array + with the same length or number of elements. Adding multiple alerts in + this manner is recommended rather than calling the API multiple times. + This functionality is in technical preview and may be changed or removed + in a future release. Elastic will work to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. + example: 6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42 + oneOf: + - type: string + - items: + type: string + maxItems: 1000 + type: array + title: Alert identifiers + x-technical-preview: true + Cases_alert_indices: + description: > + The alert indices. It is required only when `type` is `alert`. If you + are adding multiple alerts to a case, use an array of strings; the + position of each index name in the array must match the position of the + corresponding alert identifier in the `alertId` array. This + functionality is in technical preview and may be changed or removed in a + future release. Elastic will work to fix any issues, but features in + technical preview are not subject to the support SLA of official GA + features. + oneOf: + - type: string + - items: + type: string + maxItems: 1000 + type: array + title: Alert indices + x-technical-preview: true + Cases_alert_response_properties: type: object properties: - subAction: - description: The action to test. - enum: - - closeAlert + attached_at: + format: date-time + type: string + id: + description: The alert identifier. + type: string + index: + description: The alert index. + type: string + Cases_assignees: + description: An array containing users that are assigned to the case. + items: + type: object + properties: + uid: + description: >- + A unique identifier for the user profile. These identifiers can be + found by using the suggest user profile API. + example: u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0 + type: string + required: + - uid + maxItems: 10 + nullable: true + type: array + Cases_case_category: + description: A word or phrase that categorizes the case. + maxLength: 50 + type: string + Cases_case_description: + description: The description for the case. + maxLength: 30000 + type: string + Cases_case_response_closed_by_properties: + nullable: true + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true type: string - subActionParams: - type: object - properties: - alias: - description: >- - The unique identifier used for alert deduplication in Opsgenie. - The alias must match the value used when creating the alert. - type: string - note: - description: Additional information for the alert. - type: string - source: - description: The display name for the source of the alert. - type: string - user: - description: The display name for the owner. - type: string - required: - - alias required: - - subAction - - subActionParams - Connectors_run_connector_subaction_closeincident: - description: The `closeIncident` subaction for ServiceNow ITSM connectors. - title: The closeIncident subaction + - email + - full_name + - username + title: Case response properties for closed_by + type: object + Cases_case_response_created_by_properties: + title: Case response properties for created_by type: object properties: - subAction: - description: The action to test. - enum: - - closeIncident + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true type: string - subActionParams: - type: object - properties: - incident: - anyOf: - - required: - - correlation_id - - required: - - externalId - type: object - properties: - correlation_id: - default: '{{rule.id}}:{{alert.id}}' - description: > - An identifier that is assigned to the incident when it is - created by the connector. NOTE: If you use the default value - and the rule generates multiple alerts that use the same - alert IDs, the latest open incident for this correlation ID - is closed unless you specify the external ID. - maxLength: 100 - nullable: true - type: string - externalId: - description: >- - The unique identifier (`incidentId`) for the incident in - ServiceNow. - nullable: true - type: string - required: - - incident required: - - subAction - - subActionParams - Connectors_run_connector_subaction_createalert: - description: The `createAlert` subaction for Opsgenie connectors. - title: The createAlert subaction + - email + - full_name + - username + Cases_case_response_properties: + title: Case response properties type: object properties: - subAction: - description: The action to test. - enum: - - createAlert + assignees: + $ref: '#/components/schemas/Cases_assignees' + category: + description: The case category. + nullable: true type: string - subActionParams: - type: object - properties: - actions: - description: The custom actions available to the alert. - items: + closed_at: + format: date-time + nullable: true + type: string + closed_by: + $ref: '#/components/schemas/Cases_case_response_closed_by_properties' + comments: + description: An array of comment objects for the case. + items: + discriminator: + mapping: + alert: '#/components/schemas/Cases_alert_comment_response_properties' + user: '#/components/schemas/Cases_user_comment_response_properties' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Cases_alert_comment_response_properties' + - $ref: '#/components/schemas/Cases_user_comment_response_properties' + maxItems: 10000 + title: Case response properties for comments + type: array + connector: + discriminator: + mapping: + .cases-webhook: '#/components/schemas/Cases_connector_properties_cases_webhook' + .jira: '#/components/schemas/Cases_connector_properties_jira' + .none: '#/components/schemas/Cases_connector_properties_none' + .resilient: '#/components/schemas/Cases_connector_properties_resilient' + .servicenow: '#/components/schemas/Cases_connector_properties_servicenow' + .servicenow-sir: '#/components/schemas/Cases_connector_properties_servicenow_sir' + .swimlane: '#/components/schemas/Cases_connector_properties_swimlane' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Cases_connector_properties_none' + - $ref: '#/components/schemas/Cases_connector_properties_cases_webhook' + - $ref: '#/components/schemas/Cases_connector_properties_jira' + - $ref: '#/components/schemas/Cases_connector_properties_resilient' + - $ref: '#/components/schemas/Cases_connector_properties_servicenow' + - $ref: '#/components/schemas/Cases_connector_properties_servicenow_sir' + - $ref: '#/components/schemas/Cases_connector_properties_swimlane' + title: Case response properties for connectors + created_at: + example: '2022-05-13T09:16:17.416Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Cases_case_response_created_by_properties' + customFields: + description: Custom field values for the case. + items: + type: object + properties: + key: + description: > + The unique identifier for the custom field. The key value must + exist in the case configuration settings. type: string - type: array - alias: - description: The unique identifier used for alert deduplication in Opsgenie. - type: string - description: - description: >- - A description that provides detailed information about the - alert. - type: string - details: - additionalProperties: true - description: The custom properties of the alert. - example: - key1: value1 - key2: value2 - type: object - entity: - description: >- - The domain of the alert. For example, the application or server - name. - type: string - message: - description: The alert message. - type: string - note: - description: Additional information for the alert. - type: string - priority: - description: The priority level for the alert. - enum: - - P1 - - P2 - - P3 - - P4 - - P5 - type: string - responders: - description: > - The entities to receive notifications about the alert. If `type` - is `user`, either `id` or `username` is required. If `type` is - `team`, either `id` or `name` is required. - items: - type: object - properties: - id: - description: The identifier for the entity. - type: string - name: - description: The name of the entity. - type: string - type: - description: 'The type of responders, in this case `escalation`.' - enum: - - escalation - - schedule - - team - - user - type: string - username: - description: A valid email address for the user. - type: string - type: array - source: - description: The display name for the source of the alert. - type: string - tags: - description: The tags for the alert. - items: + type: + description: > + The custom field type. It must match the type specified in the + case configuration settings. + enum: + - text + - toggle type: string - type: array - user: - description: The display name for the owner. - type: string - visibleTo: - description: >- - The teams and users that the alert will be visible to without - sending a notification. Only one of `id`, `name`, or `username` - is required. - items: - type: object - properties: - id: - description: The identifier for the entity. - type: string - name: - description: The name of the entity. - type: string - type: - description: Valid values are `team` and `user`. - enum: - - team - - user - type: string - username: - description: >- - The user name. This property is required only when the - `type` is `user`. + value: + description: > + The custom field value. If the custom field is required, it + cannot be explicitly set to null. However, for cases that + existed when the required custom field was added, the default + value stored in Elasticsearch is `undefined`. The value + returned in the API and user interface in this case is `null`. + oneOf: + - maxLength: 160 + minLength: 1 + nullable: true type: string - required: - - type - type: array - required: - - message + - type: boolean + type: array + description: + example: A case description. + type: string + duration: + description: > + The elapsed time from the creation of the case to its closure (in + seconds). If the case has not been closed, the duration is set to + null. If the case was closed after less than half a second, the + duration is rounded down to zero. + example: 120 + nullable: true + type: integer + external_service: + $ref: '#/components/schemas/Cases_external_service' + id: + example: 66b9aa00-94fa-11ea-9f74-e7e108796192 + type: string + owner: + $ref: '#/components/schemas/Cases_owners' + settings: + $ref: '#/components/schemas/Cases_settings' + severity: + $ref: '#/components/schemas/Cases_case_severity' + status: + $ref: '#/components/schemas/Cases_case_status' + tags: + example: + - tag-1 + items: + type: string + type: array + title: + example: Case title 1 + type: string + totalAlerts: + example: 0 + type: integer + totalComment: + example: 0 + type: integer + updated_at: + format: date-time + nullable: true + type: string + updated_by: + $ref: '#/components/schemas/Cases_case_response_updated_by_properties' + version: + example: WzUzMiwxXQ== + type: string required: - - subAction - - subActionParams - Connectors_run_connector_subaction_fieldsbyissuetype: - description: The `fieldsByIssueType` subaction for Jira connectors. - title: The fieldsByIssueType subaction + - closed_at + - closed_by + - comments + - connector + - created_at + - created_by + - description + - duration + - external_service + - id + - owner + - settings + - severity + - status + - tags + - title + - totalAlerts + - totalComment + - updated_at + - updated_by + - version + Cases_case_response_pushed_by_properties: + nullable: true + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + title: Case response properties for pushed_by type: object + Cases_case_response_updated_by_properties: + nullable: true properties: - subAction: - description: The action to test. - enum: - - fieldsByIssueType + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true type: string - subActionParams: - type: object - properties: - id: - description: The Jira issue type identifier. - example: 10024 - type: string - required: - - id required: - - subAction - - subActionParams - Connectors_run_connector_subaction_getchoices: + - email + - full_name + - username + title: Case response properties for updated_by + type: object + Cases_case_severity: + default: low + description: The severity of the case. + enum: + - critical + - high + - low + - medium + type: string + Cases_case_status: + description: The status of the case. + enum: + - closed + - in-progress + - open + type: string + Cases_case_tags: + description: > + The words and phrases that help categorize cases. It can be an empty + array. + items: + maxLength: 256 + type: string + maxItems: 200 + type: array + Cases_case_title: + description: A title for the case. + maxLength: 160 + type: string + Cases_closure_types: description: >- - The `getChoices` subaction for ServiceNow ITOM, ServiceNow ITSM, and - ServiceNow SecOps connectors. - title: The getChoices subaction + Indicates whether a case is automatically closed when it is pushed to + external systems (`close-by-pushing`) or not automatically closed + (`close-by-user`). + enum: + - close-by-pushing + - close-by-user + example: close-by-user + type: string + Cases_connector_properties_cases_webhook: + description: Defines properties for connectors when type is `.cases-webhook`. type: object properties: - subAction: - description: The action to test. + fields: + example: null + nullable: true + type: string + id: + description: >- + The identifier for the connector. To retrieve connector IDs, use the + find connectors API. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. enum: - - getChoices + - .cases-webhook + example: .cases-webhook type: string - subActionParams: - description: The set of configuration properties for the action. + required: + - fields + - id + - name + - type + title: Create or upate case request properties for Cases Webhook connector + Cases_connector_properties_jira: + description: Defines properties for connectors when type is `.jira`. + type: object + properties: + fields: + description: >- + An object containing the connector fields. If you want to omit any + individual field, specify null as its value. type: object properties: - fields: - description: An array of fields. - items: - type: string - type: array + issueType: + description: The type of issue. + nullable: true + type: string + parent: + description: 'The key of the parent issue, when the issue type is sub-task.' + nullable: true + type: string + priority: + description: The priority of the issue. + nullable: true + type: string required: - - fields + - issueType + - parent + - priority + id: + description: >- + The identifier for the connector. To retrieve connector IDs, use the + find connectors API. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. + enum: + - .jira + example: .jira + type: string required: - - subAction - - subActionParams - Connectors_run_connector_subaction_getfields: - description: >- - The `getFields` subaction for Jira, ServiceNow ITSM, and ServiceNow - SecOps connectors. - title: The getFields subaction + - fields + - id + - name + - type + title: Create or update case request properties for a Jira connector + Cases_connector_properties_none: + description: Defines properties for connectors when type is `.none`. type: object properties: - subAction: - description: The action to test. + fields: + description: >- + An object containing the connector fields. To create a case without + a connector, specify null. To update a case to remove the connector, + specify null. + example: null + nullable: true + type: string + id: + description: >- + The identifier for the connector. To create a case without a + connector, use `none`. To update a case to remove the connector, + specify `none`. + example: none + type: string + name: + description: >- + The name of the connector. To create a case without a connector, use + `none`. To update a case to remove the connector, specify `none`. + example: none + type: string + type: + description: >- + The type of connector. To create a case without a connector, use + `.none`. To update a case to remove the connector, specify `.none`. enum: - - getFields + - .none + example: .none type: string required: - - subAction - Connectors_run_connector_subaction_getincident: - description: >- - The `getIncident` subaction for Jira, ServiceNow ITSM, and ServiceNow - SecOps connectors. + - fields + - id + - name + - type + title: Create or update case request properties for no connector + Cases_connector_properties_resilient: + description: Defines properties for connectors when type is `.resilient`. + type: object properties: - subAction: - description: The action to test. - enum: - - getIncident - type: string - subActionParams: + fields: + description: >- + An object containing the connector fields. If you want to omit any + individual field, specify null as its value. + nullable: true type: object properties: - externalId: - description: >- - The Jira, ServiceNow ITSM, or ServiceNow SecOps issue - identifier. - example: 71778 + issueTypes: + description: The type of incident. + items: + type: string + type: array + severityCode: + description: The severity code of the incident. type: string required: - - externalId + - issueTypes + - severityCode + id: + description: The identifier for the connector. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. + enum: + - .resilient + example: .resilient + type: string required: - - subAction - - subActionParams - title: The getIncident subaction - type: object - Connectors_run_connector_subaction_issue: - description: The `issue` subaction for Jira connectors. - title: The issue subaction + - fields + - id + - name + - type + title: Create case request properties for a IBM Resilient connector + Cases_connector_properties_servicenow: + description: Defines properties for connectors when type is `.servicenow`. type: object properties: - subAction: - description: The action to test. - enum: - - issue - type: string - subActionParams: + fields: + description: >- + An object containing the connector fields. If you want to omit any + individual field, specify null as its value. type: object properties: - id: - description: The Jira issue identifier. - example: 71778 + category: + description: The category of the incident. + nullable: true + type: string + impact: + description: The effect an incident had on business. + nullable: true + type: string + severity: + description: The severity of the incident. + nullable: true + type: string + subcategory: + description: The subcategory of the incident. + nullable: true + type: string + urgency: + description: The extent to which the incident resolution can be delayed. + nullable: true type: string required: - - id + - category + - impact + - severity + - subcategory + - urgency + id: + description: >- + The identifier for the connector. To retrieve connector IDs, use the + find connectors API. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. + enum: + - .servicenow + example: .servicenow + type: string required: - - subAction - Connectors_run_connector_subaction_issues: - description: The `issues` subaction for Jira connectors. - title: The issues subaction + - fields + - id + - name + - type + title: Create case request properties for a ServiceNow ITSM connector + Cases_connector_properties_servicenow_sir: + description: Defines properties for connectors when type is `.servicenow-sir`. type: object properties: - subAction: - description: The action to test. - enum: - - issues - type: string - subActionParams: + fields: + description: >- + An object containing the connector fields. If you want to omit any + individual field, specify null as its value. type: object properties: - title: - description: The title of the Jira issue. + category: + description: The category of the incident. + nullable: true + type: string + destIp: + description: >- + Indicates whether cases will send a comma-separated list of + destination IPs. + nullable: true + type: boolean + malwareHash: + description: >- + Indicates whether cases will send a comma-separated list of + malware hashes. + nullable: true + type: boolean + malwareUrl: + description: >- + Indicates whether cases will send a comma-separated list of + malware URLs. + nullable: true + type: boolean + priority: + description: The priority of the issue. + nullable: true + type: string + sourceIp: + description: >- + Indicates whether cases will send a comma-separated list of + source IPs. + nullable: true + type: boolean + subcategory: + description: The subcategory of the incident. + nullable: true type: string required: - - title + - category + - destIp + - malwareHash + - malwareUrl + - priority + - sourceIp + - subcategory + id: + description: >- + The identifier for the connector. To retrieve connector IDs, use the + find connectors API. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. + enum: + - .servicenow-sir + example: .servicenow-sir + type: string required: - - subAction - - subActionParams - Connectors_run_connector_subaction_issuetypes: - description: The `issueTypes` subaction for Jira connectors. - title: The issueTypes subaction + - fields + - id + - name + - type + title: Create case request properties for a ServiceNow SecOps connector + Cases_connector_properties_swimlane: + description: Defines properties for connectors when type is `.swimlane`. type: object properties: - subAction: - description: The action to test. + fields: + description: >- + An object containing the connector fields. If you want to omit any + individual field, specify null as its value. + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + nullable: true + type: string + required: + - caseId + id: + description: >- + The identifier for the connector. To retrieve connector IDs, use the + find connectors API. + type: string + name: + description: The name of the connector. + type: string + type: + description: The type of connector. enum: - - issueTypes + - .swimlane + example: .swimlane type: string required: - - subAction - Connectors_run_connector_subaction_postmessage: - description: > - Test an action that sends a message to Slack. It is applicable only when - the connector type is `.slack_api`. + - fields + - id + - name + - type + title: Create case request properties for a Swimlane connector + Cases_connector_types: + description: The type of connector. + enum: + - .cases-webhook + - .jira + - .none + - .resilient + - .servicenow + - .servicenow-sir + - .swimlane + example: .none + type: string + Cases_create_case_request: + description: >- + The create case API request body varies depending on the type of + connector. properties: - subAction: - description: The action to test. - enum: - - postMessage - type: string - subActionParams: - description: The set of configuration properties for the action. - type: object - properties: - channelIds: - description: > - The Slack channel identifier, which must be one of the - `allowedChannels` in the connector configuration. - items: + assignees: + $ref: '#/components/schemas/Cases_assignees' + category: + $ref: '#/components/schemas/Cases_case_category' + connector: + oneOf: + - $ref: '#/components/schemas/Cases_connector_properties_none' + - $ref: '#/components/schemas/Cases_connector_properties_cases_webhook' + - $ref: '#/components/schemas/Cases_connector_properties_jira' + - $ref: '#/components/schemas/Cases_connector_properties_resilient' + - $ref: '#/components/schemas/Cases_connector_properties_servicenow' + - $ref: '#/components/schemas/Cases_connector_properties_servicenow_sir' + - $ref: '#/components/schemas/Cases_connector_properties_swimlane' + customFields: + description: > + Custom field values for a case. Any optional custom fields that are + not specified in the request are set to null. + items: + type: object + properties: + key: + description: > + The unique identifier for the custom field. The key value must + exist in the case configuration settings. type: string - maxItems: 1 - type: array - channels: - deprecated: true - description: | - The name of a channel that your Slack app has access to. - items: + type: + description: > + The custom field type. It must match the type specified in the + case configuration settings. + enum: + - text + - toggle type: string - maxItems: 1 - type: array - text: - description: > - The Slack message text. If it is a Slack webhook connector, the - text cannot contain Markdown, images, or other advanced - formatting. If it is a Slack web API connector, it can contain - either plain text or block kit messages. - minLength: 1 - type: string + value: + description: > + The custom field value. If the custom field is required, it + cannot be explicitly set to null. However, for cases that + existed when the required custom field was added, the default + value stored in Elasticsearch is `undefined`. The value + returned in the API and user interface in this case is `null`. + oneOf: + - maxLength: 160 + minLength: 1 + nullable: true + type: string + - type: boolean + required: + - key + - type + - value + maxItems: 10 + minItems: 0 + type: array + description: + $ref: '#/components/schemas/Cases_case_description' + owner: + $ref: '#/components/schemas/Cases_owners' + settings: + $ref: '#/components/schemas/Cases_settings' + severity: + $ref: '#/components/schemas/Cases_case_severity' + tags: + $ref: '#/components/schemas/Cases_case_tags' + title: + $ref: '#/components/schemas/Cases_case_title' required: - - subAction - - subActionParams - title: The postMessage subaction + - connector + - description + - owner + - settings + - tags + - title + title: Create case request type: object - Connectors_run_connector_subaction_pushtoservice: - description: >- - The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow - SecOps, Swimlane, and Webhook - Case Management connectors. - title: The pushToService subaction + Cases_external_service: + nullable: true type: object properties: - subAction: - description: The action to test. - enum: - - pushToService + connector_id: type: string - subActionParams: - description: The set of configuration properties for the action. + connector_name: + type: string + external_id: + type: string + external_title: + type: string + external_url: + type: string + pushed_at: + format: date-time + type: string + pushed_by: + nullable: true type: object properties: - comments: - description: >- - Additional information that is sent to Jira, ServiceNow ITSM, - ServiceNow SecOps, or Swimlane. - items: - type: object - properties: - comment: - description: >- - A comment related to the incident. For example, describe - how to troubleshoot the issue. - type: string - commentId: - description: A unique identifier for the comment. - type: integer - type: array - incident: - description: >- - Information necessary to create or update a Jira, ServiceNow - ITSM, ServiveNow SecOps, or Swimlane incident. - type: object - properties: - alertId: - description: The alert identifier for Swimlane connectors. - type: string - caseId: - description: >- - The case identifier for the incident for Swimlane - connectors. - type: string - caseName: - description: The case name for the incident for Swimlane connectors. - type: string - category: - description: >- - The category of the incident for ServiceNow ITSM and - ServiceNow SecOps connectors. - type: string - correlation_display: - description: >- - A descriptive label of the alert for correlation purposes - for ServiceNow ITSM and ServiceNow SecOps connectors. - type: string - correlation_id: - description: > - The correlation identifier for the security incident for - ServiceNow ITSM and ServiveNow SecOps connectors. Connectors - using the same correlation ID are associated with the same - ServiceNow incident. This value determines whether a new - ServiceNow incident is created or an existing one is - updated. Modifying this value is optional; if not modified, - the rule ID and alert ID are combined as `{{ruleID}}:{{alert - ID}}` to form the correlation ID value in ServiceNow. The - maximum character length for this value is 100 characters. - NOTE: Using the default configuration of `{{ruleID}}:{{alert - ID}}` ensures that ServiceNow creates a separate incident - record for every generated alert that uses a unique alert - ID. If the rule generates multiple alerts that use the same - alert IDs, ServiceNow creates and continually updates a - single incident record for the alert. - type: string - description: - description: >- - The description of the incident for Jira, ServiceNow ITSM, - ServiceNow SecOps, Swimlane, and Webhook - Case Management - connectors. - type: string - dest_ip: - description: > - A list of destination IP addresses related to the security - incident for ServiceNow SecOps connectors. The IPs are added - as observables to the security incident. - oneOf: - - type: string - - items: - type: string - type: array - externalId: - description: > - The Jira, ServiceNow ITSM, or ServiceNow SecOps issue - identifier. If present, the incident is updated. Otherwise, - a new incident is created. + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + Cases_owners: + description: > + The application that owns the cases: Stack Management, Observability, or + Elastic Security. + enum: + - cases + - observability + - securitySolution + example: cases + type: string + Cases_payload_alert_comment: + type: object + properties: + comment: + type: object + properties: + alertId: + oneOf: + - example: 1c0b056b-cc9f-4b61-b5c9-cb801abd5e1d + type: string + - items: + type: string + type: array + index: + oneOf: + - example: .alerts-observability.logs.alerts-default type: string + - items: + type: string + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + rule: + type: object + properties: id: + description: The rule identifier. + example: 94d80550-aaf4-11ec-985f-97e55adae8b9 + type: string + name: + description: The rule name. + example: security_rule + type: string + type: + enum: + - alert + type: string + Cases_payload_assignees: + type: object + properties: + assignees: + $ref: '#/components/schemas/Cases_assignees' + Cases_payload_connector: + type: object + properties: + connector: + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a case + without a connector, specify null. If you want to omit any + individual field, specify null as its value. + example: null + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: description: >- - The external case identifier for Webhook - Case Management - connectors. + The category of the incident for ServiceNow ITSM and + ServiceNow SecOps connectors. type: string + destIp: + description: >- + Indicates whether cases will send a comma-separated list of + destination IPs for ServiceNow SecOps connectors. + nullable: true + type: boolean impact: - description: The impact of the incident for ServiceNow ITSM connectors. + description: >- + The effect an incident had on business for ServiceNow ITSM + connectors. type: string issueType: - description: >- - The type of incident for Jira connectors. For example, - 10006. To obtain the list of valid values, set `subAction` - to `issueTypes`. - type: integer - labels: - description: > - The labels for the incident for Jira connectors. NOTE: - Labels cannot contain spaces. + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. items: type: string type: array - malware_hash: + malwareHash: description: >- - A list of malware hashes related to the security incident - for ServiceNow SecOps connectors. The hashes are added as - observables to the security incident. - oneOf: - - type: string - - items: - type: string - type: array - malware_url: + Indicates whether cases will send a comma-separated list of + malware hashes for ServiceNow SecOps connectors. + nullable: true + type: boolean + malwareUrl: description: >- - A list of malware URLs related to the security incident for - ServiceNow SecOps connectors. The URLs are added as - observables to the security incident. - oneOf: - - type: string - - items: - type: string - type: array - type: string - otherFields: - additionalProperties: true - description: > - Custom field identifiers and their values for Jira - connectors. - maxProperties: 20 - type: object + Indicates whether cases will send a comma-separated list of + malware URLs for ServiceNow SecOps connectors. + nullable: true + type: boolean parent: description: >- - The ID or key of the parent issue for Jira connectors. - Applies only to `Sub-task` types of issues. + The key of the parent issue, when the issue type is sub-task + for Jira connectors. type: string priority: description: >- - The priority of the incident in Jira and ServiceNow SecOps + The priority of the issue for Jira and ServiceNow SecOps connectors. type: string - ruleName: - description: The rule name for Swimlane connectors. - type: string severity: - description: >- - The severity of the incident for ServiceNow ITSM and - Swimlane connectors. + description: The severity of the incident for ServiceNow ITSM connectors. type: string - short_description: - description: > - A short description of the incident for ServiceNow ITSM and - ServiceNow SecOps connectors. It is used for searching the - contents of the knowledge base. + severityCode: + description: >- + The severity code of the incident for IBM Resilient + connectors. type: string - source_ip: + sourceIp: description: >- - A list of source IP addresses related to the security - incident for ServiceNow SecOps connectors. The IPs are added - as observables to the security incident. - oneOf: - - type: string - - items: - type: string - type: array - status: + Indicates whether cases will send a comma-separated list of + source IPs for ServiceNow SecOps connectors. + nullable: true + type: boolean + subcategory: description: >- - The status of the incident for Webhook - Case Management + The subcategory of the incident for ServiceNow ITSM connectors. type: string - subcategory: + urgency: description: >- - The subcategory of the incident for ServiceNow ITSM and + The extent to which the incident resolution can be delayed + for ServiceNow ITSM connectors. + type: string + id: + description: >- + The identifier for the connector. To create a case without a + connector, use `none`. + example: none + type: string + name: + description: >- + The name of the connector. To create a case without a connector, + use `none`. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + Cases_payload_create_case: + type: object + properties: + assignees: + $ref: '#/components/schemas/Cases_assignees' + connector: + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a case + without a connector, specify null. If you want to omit any + individual field, specify null as its value. + example: null + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + description: >- + The category of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. type: string - summary: - description: A summary of the incident for Jira connectors. + destIp: + description: >- + Indicates whether cases will send a comma-separated list of + destination IPs for ServiceNow SecOps connectors. + nullable: true + type: boolean + impact: + description: >- + The effect an incident had on business for ServiceNow ITSM + connectors. type: string - tags: - description: A list of tags for Webhook - Case Management connectors. + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. items: type: string type: array - title: - description: > - A title for the incident for Jira and Webhook - Case - Management connectors. It is used for searching the contents - of the knowledge base. + malwareHash: + description: >- + Indicates whether cases will send a comma-separated list of + malware hashes for ServiceNow SecOps connectors. + nullable: true + type: boolean + malwareUrl: + description: >- + Indicates whether cases will send a comma-separated list of + malware URLs for ServiceNow SecOps connectors. + nullable: true + type: boolean + parent: + description: >- + The key of the parent issue, when the issue type is sub-task + for Jira connectors. type: string - urgency: - description: The urgency of the incident for ServiceNow ITSM connectors. + priority: + description: >- + The priority of the issue for Jira and ServiceNow SecOps + connectors. type: string - required: - - subAction - - subActionParams - Connectors_run_connector_subaction_validchannelid: - description: > - Retrieves information about a valid Slack channel identifier. It is - applicable only when the connector type is `.slack_api`. - properties: - subAction: - description: The action to test. - enum: - - validChannelId - type: string - subActionParams: - type: object - properties: - channelId: - description: The Slack channel identifier. - example: C123ABC456 - type: string - required: - - channelId - required: - - subAction - - subActionParams - title: The validChannelId subaction - type: object - Connectors_secrets_properties_bedrock: - description: Defines secrets for connectors when type is `.bedrock`. - properties: - accessKey: - description: The AWS access key for authentication. - type: string - secret: - description: The AWS secret for authentication. - type: string - required: - - accessKey - - secret - title: Connector secrets properties for an Amazon Bedrock connector - type: object - Connectors_secrets_properties_cases_webhook: - title: Connector secrets properties for Webhook - Case Management connector - type: object - properties: - password: - description: >- - The password for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - user: - description: >- - The username for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. - type: string - Connectors_secrets_properties_d3security: - description: Defines secrets for connectors when type is `.d3security`. - type: object - properties: - token: - description: The D3 Security token. - type: string - required: - - token - title: Connector secrets properties for a D3 Security connector - Connectors_secrets_properties_email: - description: Defines secrets for connectors when type is `.email`. - properties: - clientSecret: - description: > - The Microsoft Exchange Client secret for OAuth 2.0 client - credentials authentication. It must be URL-encoded. If `service` is - `exchange_server`, this property is required. - type: string - password: - description: > - The password for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. + severity: + description: The severity of the incident for ServiceNow ITSM connectors. + type: string + severityCode: + description: >- + The severity code of the incident for IBM Resilient + connectors. + type: string + sourceIp: + description: >- + Indicates whether cases will send a comma-separated list of + source IPs for ServiceNow SecOps connectors. + nullable: true + type: boolean + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM + connectors. + type: string + urgency: + description: >- + The extent to which the incident resolution can be delayed + for ServiceNow ITSM connectors. + type: string + id: + description: >- + The identifier for the connector. To create a case without a + connector, use `none`. + example: none + type: string + name: + description: >- + The name of the connector. To create a case without a connector, + use `none`. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + description: type: string - user: - description: > - The username for HTTP basic authentication. If `hasAuth` is set to - `true`, this property is required. + owner: + $ref: '#/components/schemas/Cases_owners' + settings: + $ref: '#/components/schemas/Cases_settings' + severity: + $ref: '#/components/schemas/Cases_case_severity' + status: + $ref: '#/components/schemas/Cases_case_status' + tags: + items: + example: + - tag-1 + type: string + type: array + title: type: string - title: Connector secrets properties for an email connector + Cases_payload_delete: + description: >- + If the `action` is `delete` and the `type` is `delete_case`, the payload + is nullable. + nullable: true type: object - Connectors_secrets_properties_gemini: - description: Defines secrets for connectors when type is `.gemini`. - properties: - credentialsJSON: - description: >- - The service account credentials JSON file. The service account - should have Vertex AI user IAM role assigned to it. - type: string - required: - - credentialsJSON - title: Connector secrets properties for a Google Gemini connector + Cases_payload_description: type: object - Connectors_secrets_properties_genai: - description: Defines secrets for connectors when type is `.gen-ai`. properties: - apiKey: - description: The OpenAI API key. + description: type: string - title: Connector secrets properties for an OpenAI connector + Cases_payload_pushed: type: object - Connectors_secrets_properties_jira: - description: Defines secrets for connectors when type is `.jira`. + properties: + externalService: + $ref: '#/components/schemas/Cases_external_service' + Cases_payload_settings: type: object properties: - apiToken: - description: The Jira API authentication token for HTTP basic authentication. - type: string - email: - description: The account email for HTTP Basic authentication. - type: string - required: - - apiToken - - email - title: Connector secrets properties for a Jira connector - Connectors_secrets_properties_opsgenie: - description: Defines secrets for connectors when type is `.opsgenie`. + settings: + $ref: '#/components/schemas/Cases_settings' + Cases_payload_severity: type: object properties: - apiKey: - description: The Opsgenie API authentication key for HTTP Basic authentication. - type: string - required: - - apiKey - title: Connector secrets properties for an Opsgenie connector - Connectors_secrets_properties_pagerduty: - description: Defines secrets for connectors when type is `.pagerduty`. + severity: + $ref: '#/components/schemas/Cases_case_severity' + Cases_payload_status: + type: object properties: - routingKey: - description: > - A 32 character PagerDuty Integration Key for an integration on a - service. - type: string - required: - - routingKey - title: Connector secrets properties for a PagerDuty connector + status: + $ref: '#/components/schemas/Cases_case_status' + Cases_payload_tags: type: object - Connectors_secrets_properties_resilient: - description: Defines secrets for connectors when type is `.resilient`. + properties: + tags: + example: + - tag-1 + items: + type: string + type: array + Cases_payload_title: type: object properties: - apiKeyId: - description: The authentication key ID for HTTP Basic authentication. - type: string - apiKeySecret: - description: The authentication key secret for HTTP Basic authentication. + title: type: string - required: - - apiKeyId - - apiKeySecret - title: Connector secrets properties for IBM Resilient connector - Connectors_secrets_properties_sentinelone: - description: Defines secrets for connectors when type is `.sentinelone`. + Cases_payload_user_comment: + type: object properties: - token: - description: The A SentinelOne API token. - type: string - required: - - token - title: Connector secrets properties for a SentinelOne connector + comment: + type: object + properties: + comment: + type: string + owner: + $ref: '#/components/schemas/Cases_owners' + type: + enum: + - user + type: string + Cases_rule: + description: > + The rule that is associated with the alerts. It is required only when + `type` is `alert`. This functionality is in technical preview and may be + changed or removed in a future release. Elastic will work to fix any + issues, but features in technical preview are not subject to the support + SLA of official GA features. + title: Alerting rule type: object - Connectors_secrets_properties_servicenow: - description: >- - Defines secrets for connectors when type is `.servicenow`, - `.servicenow-sir`, or `.servicenow-itom`. properties: - clientSecret: - description: >- - The client secret assigned to your OAuth application. This property - is required when `isOAuth` is `true`. - type: string - password: - description: >- - The password for HTTP basic authentication. This property is - required when `isOAuth` is `false`. - type: string - privateKey: - description: >- - The RSA private key that you created for use in ServiceNow. This - property is required when `isOAuth` is `true`. - type: string - privateKeyPassword: - description: >- - The password for the RSA private key. This property is required when - `isOAuth` is `true` and you set a password on your private key. + id: + description: The rule identifier. + example: 94d80550-aaf4-11ec-985f-97e55adae8b9 type: string - username: - description: >- - The username for HTTP basic authentication. This property is - required when `isOAuth` is `false`. + name: + description: The rule name. + example: security_rule type: string - title: >- - Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and - ServiceNow SecOps connectors - type: object - Connectors_secrets_properties_slack_api: - description: Defines secrets for connectors when type is `.slack`. - type: object + x-technical-preview: true + Cases_searchFieldsType: + description: The fields to perform the `simple_query_string` parsed query against. + enum: + - description + - title + type: string + Cases_set_case_configuration_request: + description: >- + External connection details, such as the closure type and default + connector for cases. properties: - token: - description: Slack bot user OAuth token. - type: string + closure_type: + $ref: '#/components/schemas/Cases_closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are not used and + are not propagated to individual cases, therefore it is + recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want a default + connector, use `none`. To retrieve connector IDs, use the find + connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a default + connector, use `none`. To retrieve connector names, use the find + connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + required: + - fields + - id + - name + - type + customFields: + description: Custom fields case configuration. + items: + type: object + properties: + defaultValue: + description: > + A default value for the custom field. If the `type` is `text`, + the default value must be a string. If the `type` is `toggle`, + the default value must be boolean. + oneOf: + - type: string + - type: boolean + key: + description: > + A unique key for the custom field. Must be lower case and + composed only of a-z, 0-9, '_', and '-' characters. It is used + in API calls to refer to a specific custom field. + maxLength: 36 + minLength: 1 + type: string + label: + description: The custom field label that is displayed in the case. + maxLength: 50 + minLength: 1 + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + required: + description: > + Indicates whether the field is required. If `false`, the + custom field can be set to null or omitted when a case is + created or updated. + type: boolean + required: + - key + - label + - required + - type + maxItems: 10 + minItems: 0 + type: array + owner: + $ref: '#/components/schemas/Cases_owners' + templates: + $ref: '#/components/schemas/Cases_templates' required: - - token - title: Connector secrets properties for a Web API Slack connector - Connectors_secrets_properties_slack_webhook: - description: Defines secrets for connectors when type is `.slack`. + - closure_type + - connector + - owner + title: Set case configuration request + type: object + Cases_settings: + description: An object that contains the case settings. type: object properties: - webhookUrl: - description: Slack webhook url. - type: string + syncAlerts: + description: Turns alert syncing on or off. + example: true + type: boolean required: - - webhookUrl - title: Connector secrets properties for a Webhook Slack connector - Connectors_secrets_properties_swimlane: - description: Defines secrets for connectors when type is `.swimlane`. - properties: - apiToken: - description: Swimlane API authentication token. - type: string - title: Connector secrets properties for a Swimlane connector + - syncAlerts + Cases_template_tags: + description: > + The words and phrases that help categorize templates. It can be an empty + array. + items: + maxLength: 256 + type: string + maxItems: 200 + type: array + Cases_templates: + items: + type: object + properties: + caseFields: + type: object + properties: + assignees: + $ref: '#/components/schemas/Cases_assignees' + category: + $ref: '#/components/schemas/Cases_case_category' + connector: + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are not + used and are not propagated to individual cases, therefore + it is recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want a + default connector, use `none`. To retrieve connector IDs, + use the find connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a default + connector, use `none`. To retrieve connector names, use + the find connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + customFields: + description: Custom field values in the template. + items: + type: object + properties: + key: + description: The unique key for the custom field. + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + value: + description: > + The default value for the custom field when a case uses + the template. If the `type` is `text`, the default value + must be a string. If the `type` is `toggle`, the default + value must be boolean. + oneOf: + - type: string + - type: boolean + type: array + x-technical-preview: true + description: + $ref: '#/components/schemas/Cases_case_description' + settings: + $ref: '#/components/schemas/Cases_settings' + severity: + $ref: '#/components/schemas/Cases_case_severity' + tags: + $ref: '#/components/schemas/Cases_case_tags' + title: + $ref: '#/components/schemas/Cases_case_title' + description: + description: A description for the template. + type: string + key: + description: > + A unique key for the template. Must be lower case and composed + only of a-z, 0-9, '_', and '-' characters. It is used in API calls + to refer to a specific template. + type: string + name: + description: The name of the template. + type: string + tags: + $ref: '#/components/schemas/Cases_template_tags' + type: array + x-technical-preview: true + Cases_update_alert_comment_request_properties: + description: Defines properties for case comment requests when type is alert. type: object - Connectors_secrets_properties_teams: - description: Defines secrets for connectors when type is `.teams`. properties: - webhookUrl: + alertId: + $ref: '#/components/schemas/Cases_alert_identifiers' + id: + description: > + The identifier for the comment. To retrieve comment IDs, use the get + comments API. + example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 + type: string + index: + $ref: '#/components/schemas/Cases_alert_indices' + owner: + $ref: '#/components/schemas/Cases_owners' + rule: + $ref: '#/components/schemas/Cases_rule' + type: + description: The type of comment. + enum: + - alert + example: alert + type: string + version: description: > - The URL of the incoming webhook. If you are using the - `xpack.actions.allowedHosts` setting, add the hostname to the - allowed hosts. + The current comment version. To retrieve version values, use the get + comments API. + example: Wzk1LDFd type: string required: - - webhookUrl - title: Connector secrets properties for a Microsoft Teams connector - type: object - Connectors_secrets_properties_tines: - description: Defines secrets for connectors when type is `.tines`. + - alertId + - id + - index + - owner + - rule + - type + - version + title: Update case comment request properties for alerts + Cases_update_case_comment_request: + description: >- + The update case comment API request body varies depending on whether you + are updating an alert or a comment. + discriminator: + mapping: + alert: '#/components/schemas/Cases_update_alert_comment_request_properties' + user: '#/components/schemas/Cases_update_user_comment_request_properties' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Cases_update_alert_comment_request_properties' + - $ref: '#/components/schemas/Cases_update_user_comment_request_properties' + title: Update case comment request + Cases_update_case_configuration_request: + description: > + You can update settings such as the closure type, custom fields, + templates, and the default connector for cases. properties: - email: - description: The email used to sign in to Tines. - type: string - token: - description: The Tines API token. + closure_type: + $ref: '#/components/schemas/Cases_closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + The fields specified in the case configuration are not used and + are not propagated to individual cases, therefore it is + recommended to set it to `null`. + nullable: true + type: object + id: + description: >- + The identifier for the connector. If you do not want a default + connector, use `none`. To retrieve connector IDs, use the find + connectors API. + example: none + type: string + name: + description: >- + The name of the connector. If you do not want a default + connector, use `none`. To retrieve connector names, use the find + connectors API. + example: none + type: string + type: + $ref: '#/components/schemas/Cases_connector_types' + required: + - fields + - id + - name + - type + customFields: + description: Custom fields case configuration. + items: + type: object + properties: + defaultValue: + description: > + A default value for the custom field. If the `type` is `text`, + the default value must be a string. If the `type` is `toggle`, + the default value must be boolean. + oneOf: + - type: string + - type: boolean + key: + description: > + A unique key for the custom field. Must be lower case and + composed only of a-z, 0-9, '_', and '-' characters. It is used + in API calls to refer to a specific custom field. + maxLength: 36 + minLength: 1 + type: string + label: + description: The custom field label that is displayed in the case. + maxLength: 50 + minLength: 1 + type: string + type: + description: The type of the custom field. + enum: + - text + - toggle + type: string + required: + description: > + Indicates whether the field is required. If `false`, the + custom field can be set to null or omitted when a case is + created or updated. + type: boolean + required: + - key + - label + - required + - type + type: array + templates: + $ref: '#/components/schemas/Cases_templates' + version: + description: > + The version of the connector. To retrieve the version value, use the + get configuration API. + example: WzIwMiwxXQ== type: string required: - - email - - token - title: Connector secrets properties for a Tines connector + - version + title: Update case configuration request type: object - Connectors_secrets_properties_torq: - description: Defines secrets for connectors when type is `.torq`. + Cases_update_case_request: + description: >- + The update case API request body varies depending on the type of + connector. properties: - token: - description: The secret of the webhook authentication header. - type: string + cases: + description: An array containing one or more case objects. + items: + type: object + properties: + assignees: + $ref: '#/components/schemas/Cases_assignees' + category: + $ref: '#/components/schemas/Cases_case_category' + connector: + oneOf: + - $ref: '#/components/schemas/Cases_connector_properties_none' + - $ref: >- + #/components/schemas/Cases_connector_properties_cases_webhook + - $ref: '#/components/schemas/Cases_connector_properties_jira' + - $ref: '#/components/schemas/Cases_connector_properties_resilient' + - $ref: '#/components/schemas/Cases_connector_properties_servicenow' + - $ref: >- + #/components/schemas/Cases_connector_properties_servicenow_sir + - $ref: '#/components/schemas/Cases_connector_properties_swimlane' + customFields: + description: > + Custom field values for a case. Any optional custom fields + that are not specified in the request are set to null. + items: + type: object + properties: + key: + description: > + The unique identifier for the custom field. The key + value must exist in the case configuration settings. + type: string + type: + description: > + The custom field type. It must match the type specified + in the case configuration settings. + enum: + - text + - toggle + type: string + value: + description: > + The custom field value. If the custom field is required, + it cannot be explicitly set to null. However, for cases + that existed when the required custom field was added, + the default value stored in Elasticsearch is + `undefined`. The value returned in the API and user + interface in this case is `null`. + oneOf: + - maxLength: 160 + minLength: 1 + nullable: true + type: string + - type: boolean + required: + - key + - type + - value + maxItems: 10 + minItems: 0 + type: array + description: + $ref: '#/components/schemas/Cases_case_description' + id: + description: The identifier for the case. + maxLength: 30000 + type: string + settings: + $ref: '#/components/schemas/Cases_settings' + severity: + $ref: '#/components/schemas/Cases_case_severity' + status: + $ref: '#/components/schemas/Cases_case_status' + tags: + $ref: '#/components/schemas/Cases_case_tags' + title: + $ref: '#/components/schemas/Cases_case_title' + version: + description: >- + The current version of the case. To determine this value, use + the get case or find cases APIs. + type: string + required: + - id + - version + maxItems: 100 + minItems: 1 + type: array required: - - token - title: Connector secrets properties for a Torq connector + - cases + title: Update case request type: object - Connectors_secrets_properties_webhook: - description: Defines secrets for connectors when type is `.webhook`. + Cases_update_user_comment_request_properties: + description: Defines properties for case comment requests when type is user. properties: - crt: - description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT - file. - type: string - key: - description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-crt-key`, it is a base64 encoded version of the KEY file. + comment: + description: The new comment. It is required only when `type` is `user`. + example: A new comment. + maxLength: 30000 type: string - password: + id: description: > - The password for HTTP basic authentication or the passphrase for the - SSL certificate files. If `hasAuth` is set to `true` and `authType` - is `webhook-authentication-basic`, this property is required. + The identifier for the comment. To retrieve comment IDs, use the get + comments API. + example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 type: string - pfx: - description: >- - If `authType` is `webhook-authentication-ssl` and `certType` is - `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + owner: + $ref: '#/components/schemas/Cases_owners' + type: + description: The type of comment. + enum: + - user + example: user type: string - user: + version: description: > - The username for HTTP basic authentication. If `hasAuth` is set to - `true` and `authType` is `webhook-authentication-basic`, this - property is required. + The current comment version. To retrieve version values, use the get + comments API. + example: Wzk1LDFd type: string - title: Connector secrets properties for a Webhook connector + required: + - comment + - id + - owner + - type + - version + title: Update case comment request properties for user comments + type: object + Cases_user_actions_find_response_properties: type: object - Connectors_secrets_properties_xmatters: - description: Defines secrets for connectors when type is `.xmatters`. properties: - password: - description: > - A user name for HTTP basic authentication. It is applicable only - when `usesBasic` is `true`. - type: string - secretsUrl: - description: > - The request URL for the Elastic Alerts trigger in xMatters with the - API key included in the URL. It is applicable only when `usesBasic` - is `false`. + action: + $ref: '#/components/schemas/Cases_actions' + comment_id: + example: 578608d0-03b1-11ed-920c-974bfa104448 + nullable: true type: string - user: - description: > - A password for HTTP basic authentication. It is applicable only when - `usesBasic` is `true`. + created_at: + example: '2022-05-13T09:16:17.416Z' + format: date-time type: string - title: Connector secrets properties for an xMatters connector - type: object - Connectors_update_connector_request: - description: The properties vary depending on the connector type. - oneOf: - - $ref: '#/components/schemas/Connectors_update_connector_request_bedrock' - - $ref: '#/components/schemas/Connectors_update_connector_request_gemini' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_cases_webhook - - $ref: '#/components/schemas/Connectors_update_connector_request_d3security' - - $ref: '#/components/schemas/Connectors_update_connector_request_email' - - $ref: '#/components/schemas/Connectors_create_connector_request_genai' - - $ref: '#/components/schemas/Connectors_update_connector_request_index' - - $ref: '#/components/schemas/Connectors_update_connector_request_jira' - - $ref: '#/components/schemas/Connectors_update_connector_request_opsgenie' - - $ref: '#/components/schemas/Connectors_update_connector_request_pagerduty' - - $ref: '#/components/schemas/Connectors_update_connector_request_resilient' - - $ref: '#/components/schemas/Connectors_update_connector_request_sentinelone' - - $ref: '#/components/schemas/Connectors_update_connector_request_serverlog' - - $ref: '#/components/schemas/Connectors_update_connector_request_servicenow' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_servicenow_itom - - $ref: '#/components/schemas/Connectors_update_connector_request_slack_api' - - $ref: >- - #/components/schemas/Connectors_update_connector_request_slack_webhook - - $ref: '#/components/schemas/Connectors_update_connector_request_swimlane' - - $ref: '#/components/schemas/Connectors_update_connector_request_teams' - - $ref: '#/components/schemas/Connectors_update_connector_request_tines' - - $ref: '#/components/schemas/Connectors_update_connector_request_torq' - - $ref: '#/components/schemas/Connectors_update_connector_request_webhook' - - $ref: '#/components/schemas/Connectors_update_connector_request_xmatters' - title: Update connector request body properties - Connectors_update_connector_request_bedrock: - title: Update Amazon Bedrock connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_bedrock' - name: - description: The display name for the connector. + created_by: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + id: + example: 22fd3e30-03b1-11ed-920c-974bfa104448 type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' - required: - - config - - name - Connectors_update_connector_request_cases_webhook: - title: Update Webhook - Case Managment connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' - name: - description: The display name for the connector. - example: my-connector + owner: + $ref: '#/components/schemas/Cases_owners' + payload: + oneOf: + - $ref: '#/components/schemas/Cases_payload_alert_comment' + - $ref: '#/components/schemas/Cases_payload_assignees' + - $ref: '#/components/schemas/Cases_payload_connector' + - $ref: '#/components/schemas/Cases_payload_create_case' + - $ref: '#/components/schemas/Cases_payload_delete' + - $ref: '#/components/schemas/Cases_payload_description' + - $ref: '#/components/schemas/Cases_payload_pushed' + - $ref: '#/components/schemas/Cases_payload_settings' + - $ref: '#/components/schemas/Cases_payload_severity' + - $ref: '#/components/schemas/Cases_payload_status' + - $ref: '#/components/schemas/Cases_payload_tags' + - $ref: '#/components/schemas/Cases_payload_title' + - $ref: '#/components/schemas/Cases_payload_user_comment' + type: + description: The type of action. + enum: + - assignees + - create_case + - comment + - connector + - description + - pushed + - tags + - title + - status + - settings + - severity + example: create_case type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' - required: - - config - - name - Connectors_update_connector_request_d3security: - title: Update D3 Security connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_d3security' - name: - description: The display name for the connector. + version: + example: WzM1ODg4LDFd type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_d3security' required: - - config - - name - - secrets - Connectors_update_connector_request_email: - title: Update email connector request + - action + - comment_id + - created_at + - created_by + - id + - owner + - payload + - type + - version + Cases_user_actions_response_properties: type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_email' - name: - description: The display name for the connector. + action: + $ref: '#/components/schemas/Cases_actions' + action_id: + example: 22fd3e30-03b1-11ed-920c-974bfa104448 type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_email' + case_id: + example: 22df07d0-03b1-11ed-920c-974bfa104448 + type: string + comment_id: + example: 578608d0-03b1-11ed-920c-974bfa104448 + nullable: true + type: string + created_at: + example: '2022-05-13T09:16:17.416Z' + format: date-time + type: string + created_by: + type: object + properties: + email: + example: null + nullable: true + type: string + full_name: + example: null + nullable: true + type: string + profile_uid: + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + type: string + username: + example: elastic + nullable: true + type: string + required: + - email + - full_name + - username + owner: + $ref: '#/components/schemas/Cases_owners' + payload: + oneOf: + - $ref: '#/components/schemas/Cases_payload_alert_comment' + - $ref: '#/components/schemas/Cases_payload_assignees' + - $ref: '#/components/schemas/Cases_payload_connector' + - $ref: '#/components/schemas/Cases_payload_create_case' + - $ref: '#/components/schemas/Cases_payload_delete' + - $ref: '#/components/schemas/Cases_payload_description' + - $ref: '#/components/schemas/Cases_payload_pushed' + - $ref: '#/components/schemas/Cases_payload_settings' + - $ref: '#/components/schemas/Cases_payload_severity' + - $ref: '#/components/schemas/Cases_payload_status' + - $ref: '#/components/schemas/Cases_payload_tags' + - $ref: '#/components/schemas/Cases_payload_title' + - $ref: '#/components/schemas/Cases_payload_user_comment' + type: + $ref: '#/components/schemas/Cases_action_types' required: - - config - - name - Connectors_update_connector_request_gemini: - title: Update Google Gemini connector request + - action + - action_id + - case_id + - comment_id + - created_at + - created_by + - owner + - payload + - type + Cases_user_comment_response_properties: + title: Case response properties for user comments type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_gemini' - name: - description: The display name for the connector. + comment: + example: A new comment. + type: string + created_at: + example: '2022-05-13T09:16:17.416Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Cases_case_response_created_by_properties' + id: + example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6 + type: string + owner: + $ref: '#/components/schemas/Cases_owners' + pushed_at: + example: null + format: date-time + nullable: true + type: string + pushed_by: + $ref: '#/components/schemas/Cases_case_response_pushed_by_properties' + type: + enum: + - user + example: user + type: string + updated_at: + example: null + format: date-time + nullable: true + type: string + updated_by: + $ref: '#/components/schemas/Cases_case_response_updated_by_properties' + version: + example: WzIwNDMxLDFd type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_gemini' required: - - config - - name - Connectors_update_connector_request_index: - title: Update index connector request - type: object + - type + Connectors_action_response_properties: + description: The properties vary depending on the action type. properties: + actionTypeId: + type: string config: - $ref: '#/components/schemas/Connectors_config_properties_index' + type: object + id: + type: string + isDeprecated: + description: Indicates whether the action type is deprecated. + type: boolean + isMissingSecrets: + description: Indicates whether secrets are missing for the action. + type: boolean + isPreconfigured: + description: Indicates whether it is a preconfigured action. + type: boolean name: - description: The display name for the connector. type: string - required: - - config - - name - Connectors_update_connector_request_jira: - title: Update Jira connector request + title: Action response properties type: object + Connectors_config_properties_bedrock: + description: Defines properties for connectors when type is `.bedrock`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_jira' - name: - description: The display name for the connector. + apiUrl: + description: The Amazon Bedrock request URL. + type: string + defaultModel: + default: 'anthropic.claude-3-5-sonnet-20240620-v1:0' + description: > + The generative artificial intelligence model for Amazon Bedrock to + use. Current support is for the Anthropic Claude models. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_jira' required: - - config - - name - - secrets - Connectors_update_connector_request_opsgenie: - title: Update Opsgenie connector request + - apiUrl + title: Connector request properties for an Amazon Bedrock connector + type: object + Connectors_config_properties_cases_webhook: + description: Defines properties for connectors when type is `.cases-webhook`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_opsgenie' - name: - description: The display name for the connector. + createCommentJson: + description: > + A JSON payload sent to the create comment URL to create a case + comment. You can use variables to add Kibana Cases data to the + payload. The required variable is `case.comment`. Due to Mustache + template variables (the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated once the Mustache variables have + been placed when the REST method runs. Manually ensure that the JSON + is valid, disregarding the Mustache variables, so the later + validation will pass. + example: '{"body": {{{case.comment}}}}' + type: string + createCommentMethod: + default: put + description: > + The REST API HTTP request method to create a case comment in the + third-party system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put + type: string + createCommentUrl: + description: > + The REST API URL to create a case comment by ID in the third-party + system. You can use a variable to add the external system ID to the + URL. If you are using the `xpack.actions.allowedHosts setting`, add + the hostname to the allowed hosts. + example: 'https://example.com/issue/{{{external.system.id}}}/comment' + type: string + createIncidentJson: + description: > + A JSON payload sent to the create case URL to create a case. You can + use variables to add case data to the payload. Required variables + are `case.title` and `case.description`. Due to Mustache template + variables (which is the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated after the Mustache variables have + been placed when REST method runs. Manually ensure that the JSON is + valid to avoid future validation errors; disregard Mustache + variables during your review. + example: >- + {"fields": {"summary": {{{case.title}}},"description": + {{{case.description}}},"labels": {{{case.tags}}}}} + type: string + createIncidentMethod: + default: post + description: > + The REST API HTTP request method to create a case in the third-party + system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put + type: string + createIncidentResponseKey: + description: >- + The JSON key in the create external case response that contains the + case ID. + type: string + createIncidentUrl: + description: > + The REST API URL to create a case in the third-party system. If you + are using the `xpack.actions.allowedHosts` setting, add the hostname + to the allowed hosts. + type: string + getIncidentResponseExternalTitleKey: + description: >- + The JSON key in get external case response that contains the case + title. + type: string + getIncidentUrl: + description: > + The REST API URL to get the case by ID from the third-party system. + If you are using the `xpack.actions.allowedHosts` setting, add the + hostname to the allowed hosts. You can use a variable to add the + external system ID to the URL. Due to Mustache template variables + (the text enclosed in triple braces, for example, + `{{{case.title}}}`), the JSON is not validated when you create the + connector. The JSON is validated after the Mustache variables have + been placed when REST method runs. Manually ensure that the JSON is + valid, disregarding the Mustache variables, so the later validation + will pass. + example: 'https://example.com/issue/{{{external.system.id}}}' + type: string + hasAuth: + default: true + description: >- + If true, a username and password for login type authentication must + be provided. + type: boolean + headers: + description: > + A set of key-value pairs sent as headers with the request URLs for + the create case, update case, get case, and create comment methods. + type: string + updateIncidentJson: + description: > + The JSON payload sent to the update case URL to update the case. You + can use variables to add Kibana Cases data to the payload. Required + variables are `case.title` and `case.description`. Due to Mustache + template variables (which is the text enclosed in triple braces, for + example, `{{{case.title}}}`), the JSON is not validated when you + create the connector. The JSON is validated after the Mustache + variables have been placed when REST method runs. Manually ensure + that the JSON is valid to avoid future validation errors; disregard + Mustache variables during your review. + example: >- + {"fields": {"summary": {{{case.title}}},"description": + {{{case.description}}},"labels": {{{case.tags}}}}} + type: string + updateIncidentMethod: + default: put + description: > + The REST API HTTP request method to update the case in the + third-party system. Valid values are `patch`, `post`, and `put`. + enum: + - patch + - post + - put + type: string + updateIncidentUrl: + description: > + The REST API URL to update the case by ID in the third-party system. + You can use a variable to add the external system ID to the URL. If + you are using the `xpack.actions.allowedHosts` setting, add the + hostname to the allowed hosts. + example: 'https://example.com/issue/{{{external.system.ID}}}' + type: string + viewIncidentUrl: + description: > + The URL to view the case in the external system. You can use + variables to add the external system ID or external system title to + the URL. + example: >- + https://testing-jira.atlassian.net/browse/{{{external.system.title}}} type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' required: - - config - - name - - secrets - Connectors_update_connector_request_pagerduty: - title: Update PagerDuty connector request - type: object + - createIncidentJson + - createIncidentResponseKey + - createIncidentUrl + - getIncidentResponseExternalTitleKey + - getIncidentUrl + - updateIncidentJson + - updateIncidentUrl + - viewIncidentUrl + title: Connector request properties for Webhook - Case Management connector + Connectors_config_properties_d3security: + description: Defines properties for connectors when type is `.d3security`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_pagerduty' - name: - description: The display name for the connector. + url: + description: > + The D3 Security API request URL. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' required: - - config - - name - - secrets - Connectors_update_connector_request_resilient: - title: Update IBM Resilient connector request + - url + title: Connector request properties for a D3 Security connector type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_resilient' - name: - description: The display name for the connector. - type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_resilient' - required: - - config - - name - - secrets - Connectors_update_connector_request_sentinelone: - title: Update SentinelOne connector request + Connectors_config_properties_email: + description: Defines properties for connectors when type is `.email`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_sentinelone' - name: - description: The display name for the connector. + clientId: + description: > + The client identifier, which is a part of OAuth 2.0 client + credentials authentication, in GUID format. If `service` is + `exchange_server`, this property is required. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' - required: - - config - - name - - secrets - Connectors_update_connector_request_serverlog: - title: Update server log connector request - type: object - properties: - name: - description: The display name for the connector. + from: + description: > + The from address for all emails sent by the connector. It must be + specified in `user@host-name` format. type: string - required: - - name - Connectors_update_connector_request_servicenow: - title: Update ServiceNow ITSM connector or ServiceNow SecOps request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow' - name: - description: The display name for the connector. + hasAuth: + default: true + description: > + Specifies whether a user and password are required inside the + secrets configuration. + type: boolean + host: + description: > + The host name of the service provider. If the `service` is + `elastic_cloud` (for Elastic Cloud notifications) or one of + Nodemailer's well-known email service providers, this property is + ignored. If `service` is `other`, this property must be defined. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' - required: - - config - - name - - secrets - Connectors_update_connector_request_servicenow_itom: - title: Create ServiceNow ITOM connector request - type: object - properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' - name: - description: The display name for the connector. + oauthTokenUrl: + nullable: true + type: string + port: + description: > + The port to connect to on the service provider. If the `service` is + `elastic_cloud` (for Elastic Cloud notifications) or one of + Nodemailer's well-known email service providers, this property is + ignored. If `service` is `other`, this property must be defined. + type: integer + secure: + description: > + Specifies whether the connection to the service provider will use + TLS. If the `service` is `elastic_cloud` (for Elastic Cloud + notifications) or one of Nodemailer's well-known email service + providers, this property is ignored. + type: boolean + service: + description: | + The name of the email service. + enum: + - elastic_cloud + - exchange_server + - gmail + - other + - outlook365 + - ses + type: string + tenantId: + description: > + The tenant identifier, which is part of OAuth 2.0 client credentials + authentication, in GUID format. If `service` is `exchange_server`, + this property is required. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - config - - name - - secrets - Connectors_update_connector_request_slack_api: - title: Update Slack connector request - type: object + - from + title: Connector request properties for an email connector + Connectors_config_properties_gemini: + description: Defines properties for connectors when type is `.gemini`. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_slack_api' - name: - description: The display name for the connector. + apiUrl: + description: The Google Gemini request URL. + type: string + defaultModel: + default: gemini-1.5-pro-001 + description: >- + The generative artificial intelligence model for Google Gemini to + use. + type: string + gcpProjectID: + description: The Google ProjectID that has Vertex AI endpoint enabled. + type: string + gcpRegion: + description: The GCP region where the Vertex AI endpoint enabled. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' required: - - name - - secrets - Connectors_update_connector_request_slack_webhook: - title: Update Slack connector request + - apiUrl + - gcpRegion + - gcpProjectID + title: Connector request properties for an Google Gemini connector type: object + Connectors_config_properties_genai: + description: Defines properties for connectors when type is `.gen-ai`. + discriminator: + mapping: + Azure OpenAI: '#/components/schemas/Connectors_config_properties_genai_azure' + OpenAI: '#/components/schemas/Connectors_config_properties_genai_openai' + propertyName: apiProvider + oneOf: + - $ref: '#/components/schemas/Connectors_config_properties_genai_azure' + - $ref: '#/components/schemas/Connectors_config_properties_genai_openai' + title: Connector request properties for an OpenAI connector + Connectors_config_properties_genai_azure: + description: > + Defines properties for connectors when type is `.gen-ai` and the API + provider is `Azure OpenAI'. properties: - name: - description: The display name for the connector. + apiProvider: + description: The OpenAI API provider. + enum: + - Azure OpenAI + type: string + apiUrl: + description: The OpenAI API endpoint. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' required: - - name - - secrets - Connectors_update_connector_request_swimlane: - title: Update Swimlane connector request + - apiProvider + - apiUrl + title: >- + Connector request properties for an OpenAI connector that uses Azure + OpenAI type: object + Connectors_config_properties_genai_openai: + description: > + Defines properties for connectors when type is `.gen-ai` and the API + provider is `OpenAI'. properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_swimlane' - name: - description: The display name for the connector. - example: my-connector + apiProvider: + description: The OpenAI API provider. + enum: + - OpenAI type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' - required: - - config - - name - - secrets - Connectors_update_connector_request_teams: - title: Update Microsoft Teams connector request + apiUrl: + description: The OpenAI API endpoint. + type: string + defaultModel: + description: The default model to use for requests. + type: string + required: + - apiProvider + - apiUrl + title: Connector request properties for an OpenAI connector + type: object + Connectors_config_properties_index: + description: Defines properties for connectors when type is `.index`. type: object properties: - name: - description: The display name for the connector. + executionTimeField: + default: null + description: A field that indicates when the document was indexed. + nullable: true type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_teams' + index: + description: The Elasticsearch index to be written to. + type: string + refresh: + default: false + description: > + The refresh policy for the write request, which affects when changes + are made visible to search. Refer to the refresh setting for + Elasticsearch document APIs. + type: boolean required: - - name - - secrets - Connectors_update_connector_request_tines: - title: Update Tines connector request + - index + title: Connector request properties for an index connector + Connectors_config_properties_jira: + description: Defines properties for connectors when type is `.jira`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_tines' - name: - description: The display name for the connector. + apiUrl: + description: The Jira instance URL. + type: string + projectKey: + description: The Jira project key. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_tines' required: - - config - - name - - secrets - Connectors_update_connector_request_torq: - title: Update Torq connector request + - apiUrl + - projectKey + title: Connector request properties for a Jira connector + Connectors_config_properties_opsgenie: + description: Defines properties for connectors when type is `.opsgenie`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_torq' - name: - description: The display name for the connector. + apiUrl: + description: > + The Opsgenie URL. For example, `https://api.opsgenie.com` or + `https://api.eu.opsgenie.com`. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - config - - name - - secrets - Connectors_update_connector_request_webhook: - title: Update Webhook connector request + - apiUrl + title: Connector request properties for an Opsgenie connector + Connectors_config_properties_pagerduty: + description: Defines properties for connectors when type is `.pagerduty`. + properties: + apiUrl: + description: The PagerDuty event URL. + example: 'https://events.pagerduty.com/v2/enqueue' + nullable: true + type: string + title: Connector request properties for a PagerDuty connector + type: object + Connectors_config_properties_resilient: + description: Defines properties for connectors when type is `.resilient`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_webhook' - name: - description: The display name for the connector. + apiUrl: + description: The IBM Resilient instance URL. + type: string + orgId: + description: The IBM Resilient organization ID. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - config - - name - - secrets - Connectors_update_connector_request_xmatters: - title: Update xMatters connector request + - apiUrl + - orgId + title: Connector request properties for a IBM Resilient connector + Connectors_config_properties_sentinelone: + description: Defines properties for connectors when type is `.sentinelone`. type: object properties: - config: - $ref: '#/components/schemas/Connectors_config_properties_xmatters' - name: - description: The display name for the connector. + url: + description: > + The SentinelOne tenant URL. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. type: string - secrets: - $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' required: - - config - - name - - secrets - Data_views_400_response: - title: Bad request + - url + title: Connector request properties for a SentinelOne connector + Connectors_config_properties_servicenow: + description: Defines properties for connectors when type is `.servicenow`. type: object properties: - error: - example: Bad Request + apiUrl: + description: The ServiceNow instance URL. type: string - message: + clientId: + description: > + The client ID assigned to your OAuth application. This property is + required when `isOAuth` is `true`. type: string - statusCode: - example: 400 - type: number + isOAuth: + default: false + description: > + The type of authentication to use. The default value is false, which + means basic authentication is used instead of open authorization + (OAuth). + type: boolean + jwtKeyId: + description: > + The key identifier assigned to the JWT verifier map of your OAuth + application. This property is required when `isOAuth` is `true`. + type: string + userIdentifierValue: + description: > + The identifier to use for OAuth authentication. This identifier + should be the user field you selected when you created an OAuth JWT + API endpoint for external clients in your ServiceNow instance. For + example, if the selected user field is `Email`, the user identifier + should be the user's email address. This property is required when + `isOAuth` is `true`. + type: string + usesTableApi: + default: true + description: > + Determines whether the connector uses the Table API or the Import + Set API. This property is supported only for ServiceNow ITSM and + ServiceNow SecOps connectors. NOTE: If this property is set to + `false`, the Elastic application should be installed in ServiceNow. + type: boolean required: - - statusCode - - error - - message - Data_views_404_response: + - apiUrl + title: Connector request properties for a ServiceNow ITSM connector + Connectors_config_properties_servicenow_itom: + description: Defines properties for connectors when type is `.servicenow`. type: object properties: - error: - enum: - - Not Found - example: Not Found + apiUrl: + description: The ServiceNow instance URL. type: string - message: - example: >- - Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] - not found + clientId: + description: > + The client ID assigned to your OAuth application. This property is + required when `isOAuth` is `true`. type: string - statusCode: - enum: - - 404 - example: 404 - type: integer - Data_views_allownoindex: - description: Allows the data view saved object to exist before the data is available. - type: boolean - Data_views_create_data_view_request_object: - title: Create data view request - type: object - properties: - data_view: - description: The data view object. - type: object - properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldAttrs: - additionalProperties: - $ref: '#/components/schemas/Data_views_fieldattrs' - type: object - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: - type: object - id: - type: string - name: - description: The data view name. - type: string - namespaces: - $ref: '#/components/schemas/Data_views_namespaces' - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' - type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - type: - $ref: '#/components/schemas/Data_views_type' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta' - version: - type: string - required: - - title - override: + isOAuth: default: false - description: >- - Override an existing data view if a data view with the provided - title already exists. + description: > + The type of authentication to use. The default value is false, which + means basic authentication is used instead of open authorization + (OAuth). type: boolean + jwtKeyId: + description: > + The key identifier assigned to the JWT verifier map of your OAuth + application. This property is required when `isOAuth` is `true`. + type: string + userIdentifierValue: + description: > + The identifier to use for OAuth authentication. This identifier + should be the user field you selected when you created an OAuth JWT + API endpoint for external clients in your ServiceNow instance. For + example, if the selected user field is `Email`, the user identifier + should be the user's email address. This property is required when + `isOAuth` is `true`. + type: string required: - - data_view - Data_views_data_view_response_object: - title: Data view response properties + - apiUrl + title: Connector request properties for a ServiceNow ITSM connector + Connectors_config_properties_slack_api: + description: Defines properties for connectors when type is `.slack_api`. + properties: + allowedChannels: + description: A list of valid Slack channels. + items: + maxItems: 25 + type: object + properties: + id: + description: The Slack channel ID. + example: C123ABC456 + minLength: 1 + type: string + name: + description: The Slack channel name. + minLength: 1 + type: string + required: + - id + - name + type: array + title: Connector request properties for a Slack connector + type: object + Connectors_config_properties_swimlane: + description: Defines properties for connectors when type is `.swimlane`. type: object properties: - data_view: - type: object + apiUrl: + description: The Swimlane instance URL. + type: string + appId: + description: The Swimlane application ID. + type: string + connectorType: + description: >- + The type of connector. Valid values are `all`, `alerts`, and + `cases`. + enum: + - all + - alerts + - cases + type: string + mappings: + description: The field mapping. properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldAttrs: - additionalProperties: - $ref: '#/components/schemas/Data_views_fieldattrs' + alertIdConfig: + description: Mapping for the alert ID. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Alert identifier mapping type: object - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: + caseIdConfig: + description: Mapping for the case ID. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case identifier mapping type: object - id: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - name: - description: The data view name. - type: string - namespaces: - $ref: '#/components/schemas/Data_views_namespaces' - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' + caseNameConfig: + description: Mapping for the case name. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case name mapping type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta_response' - version: - example: WzQ2LDJd - type: string - Data_views_fieldattrs: - description: A map of field attributes by field name. - type: object - properties: - count: - description: Popularity count for the field. - type: integer - customDescription: - description: Custom description for the field. - maxLength: 300 - type: string - customLabel: - description: Custom label for the field. + commentsConfig: + description: Mapping for the case comments. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case comment mapping + type: object + descriptionConfig: + description: Mapping for the case description. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Case description mapping + type: object + ruleNameConfig: + description: Mapping for the name of the alert's rule. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Rule name mapping + type: object + severityConfig: + description: Mapping for the severity. + properties: + fieldType: + description: The type of field in Swimlane. + type: string + id: + description: The identifier for the field in Swimlane. + type: string + key: + description: The key for the field in Swimlane. + type: string + name: + description: The name of the field in Swimlane. + type: string + required: + - fieldType + - id + - key + - name + title: Severity mapping + type: object + title: Connector mappings properties for a Swimlane connector + type: object + required: + - apiUrl + - appId + - connectorType + title: Connector request properties for a Swimlane connector + Connectors_config_properties_tines: + description: Defines properties for connectors when type is `.tines`. + properties: + url: + description: > + The Tines tenant URL. If you are using the + `xpack.actions.allowedHosts` setting, make sure this hostname is + added to the allowed hosts. type: string - Data_views_fieldformats: - description: A map of field formats by field name. - type: object - Data_views_namespaces: - description: >- - An array of space identifiers for sharing the data view between multiple - spaces. - items: - default: default - type: string - type: array - Data_views_runtimefieldmap: - description: A map of runtime field definitions by field name. + required: + - url + title: Connector request properties for a Tines connector type: object + Connectors_config_properties_torq: + description: Defines properties for connectors when type is `.torq`. properties: - script: - type: object - properties: - source: - description: Script for the runtime field. - type: string - type: - description: Mapping type of the runtime field. + webhookIntegrationUrl: + description: The endpoint URL of the Elastic Security integration in Torq. type: string required: - - script - - type - Data_views_sourcefilters: - description: The array of field names you want to filter out in Discover. - items: - type: object - properties: - value: - type: string - required: - - value - type: array - Data_views_swap_data_view_request_object: - title: Data view reference swap request + - webhookIntegrationUrl + title: Connector request properties for a Torq connector type: object + Connectors_config_properties_webhook: + description: Defines properties for connectors when type is `.webhook`. properties: - delete: - description: Deletes referenced saved object if all references are removed. + authType: + description: | + The type of authentication to use: basic, SSL, or none. + enum: + - webhook-authentication-basic + - webhook-authentication-ssl + nullable: true + type: string + ca: + description: > + A base64 encoded version of the certificate authority file that the + connector can trust to sign and validate certificates. This option + is available for all authentication types. + type: string + certType: + description: > + If the `authType` is `webhook-authentication-ssl`, specifies whether + the certificate authentication data is in a CRT and key file format + or a PFX file format. + enum: + - ssl-crt-key + - ssl-pfx + type: string + hasAuth: + description: > + If `true`, a user name and password must be provided for login type + authentication. type: boolean - forId: - description: Limit the affected saved objects to one or more by identifier. - oneOf: - - type: string - - items: - type: string - type: array - forType: - description: Limit the affected saved objects by type. + headers: + description: A set of key-value pairs sent as headers with the request. + nullable: true + type: object + method: + default: post + description: | + The HTTP request method, either `post` or `put`. + enum: + - post + - put type: string - fromId: - description: The saved object reference to change. + url: + description: > + The request URL. If you are using the `xpack.actions.allowedHosts` + setting, add the hostname to the allowed hosts. type: string - fromType: + verificationMode: + default: full description: > - Specify the type of the saved object reference to alter. The default - value is `index-pattern` for data views. + Controls the verification of certificates. Use `full` to validate + that the certificate has an issue date within the `not_before` and + `not_after` dates, chains to a trusted certificate authority (CA), + and has a hostname or IP address that matches the names within the + certificate. Use `certificate` to validate the certificate and + verify that it is signed by a trusted authority; this option does + not check the certificate hostname. Use `none` to skip certificate + validation. + enum: + - certificate + - full + - none type: string - toId: - description: New saved object reference value to replace the old value. + title: Connector request properties for a Webhook connector + type: object + Connectors_config_properties_xmatters: + description: Defines properties for connectors when type is `.xmatters`. + properties: + configUrl: + description: > + The request URL for the Elastic Alerts trigger in xMatters. It is + applicable only when `usesBasic` is `true`. + nullable: true type: string - required: - - fromId - - toId - Data_views_timefieldname: - description: 'The timestamp field name, which you use for time-based data views.' - type: string - Data_views_title: - description: >- - Comma-separated list of data streams, indices, and aliases that you want - to search. Supports wildcards (`*`). - type: string - Data_views_type: - description: 'When set to `rollup`, identifies the rollup data views.' - type: string - Data_views_typemeta: - description: >- - When you use rollup indices, contains the field list for the rollup data - view API endpoints. + usesBasic: + default: true + description: >- + Specifies whether the connector uses HTTP basic authentication + (`true`) or URL authentication (`false`). + type: boolean + title: Connector request properties for an xMatters connector + type: object + Connectors_connector_response_properties: + description: The properties vary depending on the connector type. + discriminator: + mapping: + .bedrock: >- + #/components/schemas/Connectors_connector_response_properties_bedrock + .cases-webhook: >- + #/components/schemas/Connectors_connector_response_properties_cases_webhook + .d3security: >- + #/components/schemas/Connectors_connector_response_properties_d3security + .email: '#/components/schemas/Connectors_connector_response_properties_email' + .gemini: '#/components/schemas/Connectors_connector_response_properties_gemini' + .gen-ai: '#/components/schemas/Connectors_connector_response_properties_genai' + .index: '#/components/schemas/Connectors_connector_response_properties_index' + .jira: '#/components/schemas/Connectors_connector_response_properties_jira' + .opsgenie: >- + #/components/schemas/Connectors_connector_response_properties_opsgenie + .pagerduty: >- + #/components/schemas/Connectors_connector_response_properties_pagerduty + .resilient: >- + #/components/schemas/Connectors_connector_response_properties_resilient + .sentinelone: >- + #/components/schemas/Connectors_connector_response_properties_sentinelone + .server-log: >- + #/components/schemas/Connectors_connector_response_properties_serverlog + .servicenow: >- + #/components/schemas/Connectors_connector_response_properties_servicenow + .servicenow-itom: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_itom + .servicenow-sir: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_sir + .slack: >- + #/components/schemas/Connectors_connector_response_properties_slack_webhook + .slack_api: >- + #/components/schemas/Connectors_connector_response_properties_slack_api + .swimlane: >- + #/components/schemas/Connectors_connector_response_properties_swimlane + .teams: '#/components/schemas/Connectors_connector_response_properties_teams' + .tines: '#/components/schemas/Connectors_connector_response_properties_tines' + .torq: '#/components/schemas/Connectors_connector_response_properties_torq' + .webhook: >- + #/components/schemas/Connectors_connector_response_properties_webhook + .xmatters: >- + #/components/schemas/Connectors_connector_response_properties_xmatters + propertyName: connector_type_id + oneOf: + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_bedrock + - $ref: '#/components/schemas/Connectors_connector_response_properties_gemini' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_cases_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_d3security + - $ref: '#/components/schemas/Connectors_connector_response_properties_email' + - $ref: '#/components/schemas/Connectors_connector_response_properties_genai' + - $ref: '#/components/schemas/Connectors_connector_response_properties_index' + - $ref: '#/components/schemas/Connectors_connector_response_properties_jira' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_opsgenie + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_pagerduty + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_resilient + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_sentinelone + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_serverlog + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_itom + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_servicenow_sir + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_slack_api + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_slack_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_swimlane + - $ref: '#/components/schemas/Connectors_connector_response_properties_teams' + - $ref: '#/components/schemas/Connectors_connector_response_properties_tines' + - $ref: '#/components/schemas/Connectors_connector_response_properties_torq' + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_webhook + - $ref: >- + #/components/schemas/Connectors_connector_response_properties_xmatters + title: Connector response properties + Connectors_connector_response_properties_bedrock: + title: Connector response properties for an Amazon Bedrock connector type: object properties: - aggs: - description: A map of rollup restrictions by aggregation type and field name. - type: object - params: - description: Properties for retrieving rollup fields. - type: object + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + connector_type_id: + description: The type of connector. + enum: + - .bedrock + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string required: - - aggs - - params - Data_views_typemeta_response: - description: >- - When you use rollup indices, contains the field list for the rollup data - view API endpoints. - nullable: true + - config + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_cases_webhook: + title: Connector request properties for a Webhook - Case Management connector type: object properties: - aggs: - description: A map of rollup restrictions by aggregation type and field name. - type: object - params: - description: Properties for retrieving rollup fields. - type: object - Data_views_update_data_view_request_object: - title: Update data view request + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' + connector_type_id: + description: The type of connector. + enum: + - .cases-webhook + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_d3security: + title: Connector response properties for a D3 Security connector type: object properties: - data_view: - description: > - The data view properties you want to update. Only the specified - properties are updated in the data view. Unspecified fields stay as - they are persisted. - type: object - properties: - allowNoIndex: - $ref: '#/components/schemas/Data_views_allownoindex' - fieldFormats: - $ref: '#/components/schemas/Data_views_fieldformats' - fields: - type: object - name: - type: string - runtimeFieldMap: - additionalProperties: - $ref: '#/components/schemas/Data_views_runtimefieldmap' - type: object - sourceFilters: - $ref: '#/components/schemas/Data_views_sourcefilters' - timeFieldName: - $ref: '#/components/schemas/Data_views_timefieldname' - title: - $ref: '#/components/schemas/Data_views_title' - type: - $ref: '#/components/schemas/Data_views_type' - typeMeta: - $ref: '#/components/schemas/Data_views_typemeta' - refresh_fields: - default: false - description: Reloads the data view fields after the data view is updated. - type: boolean + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + connector_type_id: + description: The type of connector. + enum: + - .d3security + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - data_view - Kibana_HTTP_APIs_core_status_redactedResponse: - additionalProperties: false - description: A minimal representation of Kibana's operational status. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_email: + title: Connector response properties for an email connector type: object properties: - status: - additionalProperties: false - type: object - properties: - overall: - additionalProperties: false - type: object - properties: - level: - description: Service status levels as human and machine readable values. - enum: - - available - - degraded - - unavailable - - critical - type: string - required: - - level - required: - - overall + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + connector_type_id: + description: The type of connector. + enum: + - .email + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - status - Kibana_HTTP_APIs_core_status_response: - additionalProperties: false - description: >- - Kibana's operational status as well as a detailed breakdown of plugin - statuses indication of various loads (like event loop utilization and - network traffic) at time of request. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_gemini: + title: Connector response properties for a Google Gemini connector type: object properties: - metrics: - additionalProperties: false - description: Metric groups collected by Kibana. - type: object - properties: - collection_interval_in_millis: - description: The interval at which metrics should be collected. - type: number - elasticsearch_client: - additionalProperties: false - description: Current network metrics of Kibana's Elasticsearch client. - type: object - properties: - totalActiveSockets: - description: Count of network sockets currently in use. - type: number - totalIdleSockets: - description: Count of network sockets currently idle. - type: number - totalQueuedRequests: - description: Count of requests not yet assigned to sockets. - type: number - required: - - totalActiveSockets - - totalIdleSockets - - totalQueuedRequests - last_updated: - description: The time metrics were collected. - type: string - required: - - elasticsearch_client - - last_updated - - collection_interval_in_millis + config: + $ref: '#/components/schemas/Connectors_config_properties_gemini' + connector_type_id: + description: The type of connector. + enum: + - .gemini + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' name: - description: Kibana instance name. - type: string - status: - additionalProperties: false - type: object - properties: - core: - additionalProperties: false - description: Statuses of core Kibana services. - type: object - properties: - elasticsearch: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: >- - An unstructured set of extra metadata about this - service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - savedObjects: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: >- - An unstructured set of extra metadata about this - service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - required: - - elasticsearch - - savedObjects - overall: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: Service status levels as human and machine readable values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: An unstructured set of extra metadata about this service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - plugins: - additionalProperties: - additionalProperties: false - type: object - properties: - detail: - description: Human readable detail of the service status. - type: string - documentationUrl: - description: A URL to further documentation regarding this service. - type: string - level: - description: >- - Service status levels as human and machine readable - values. - enum: - - available - - degraded - - unavailable - - critical - type: string - meta: - additionalProperties: {} - description: An unstructured set of extra metadata about this service. - type: object - summary: - description: A human readable summary of the service status. - type: string - required: - - level - - summary - - meta - description: A dynamic mapping of plugin ID to plugin status. - type: object - required: - - overall - - core - - plugins - uuid: - description: >- - Unique, generated Kibana instance UUID. This UUID should persist - even if the Kibana process restarts. + description: The display name for the connector. type: string - version: - additionalProperties: false - type: object - properties: - build_date: - description: The date and time of this build. - type: string - build_flavor: - description: >- - The build flavour determines configuration and behavior of - Kibana. On premise users will almost always run the - "traditional" flavour, while other flavours are reserved for - Elastic-specific use cases. - enum: - - serverless - - traditional - type: string - build_hash: - description: >- - A unique hash value representing the git commit of this Kibana - build. - type: string - build_number: - description: >- - A monotonically increasing number, each subsequent build will - have a higher number. - type: number - build_snapshot: - description: Whether this build is a snapshot build. - type: boolean - number: - description: A semantic version number. - type: string - required: - - number - - build_hash - - build_number - - build_snapshot - - build_flavor - - build_date + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured - name - - uuid - - version - - status - - metrics - Machine_learning_APIs_mlSync200Response: + Connectors_connector_response_properties_genai: + title: Connector response properties for an OpenAI connector + type: object properties: - datafeedsAdded: - additionalProperties: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' - description: >- - If a saved object for an anomaly detection job is missing a datafeed - identifier, it is added when you run the sync machine learning saved - objects API. - type: object - datafeedsRemoved: - additionalProperties: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' - description: >- - If a saved object for an anomaly detection job references a datafeed - that no longer exists, it is deleted when you run the sync machine - learning saved objects API. - type: object - savedObjectsCreated: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsCreated - savedObjectsDeleted: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted - title: Successful sync API response + config: + $ref: '#/components/schemas/Connectors_config_properties_genai' + connector_type_id: + description: The type of connector. + enum: + - .gen-ai + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_index: + title: Connector response properties for an index connector type: object - Machine_learning_APIs_mlSync4xxResponse: properties: - error: - example: Unauthorized + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + connector_type_id: + description: The type of connector. + enum: + - .index type: string - message: + id: + description: The identifier for the connector. type: string - statusCode: - example: 401 - type: integer - title: Unsuccessful sync API response - type: object - Machine_learning_APIs_mlSyncResponseAnomalyDetectors: - description: >- - The sync machine learning saved objects API response contains this - object when there are anomaly detection jobs affected by the - synchronization. There is an object for each relevant job, which - contains the synchronization status. - properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for anomaly detection jobs - type: object - Machine_learning_APIs_mlSyncResponseDatafeeds: - description: >- - The sync machine learning saved objects API response contains this - object when there are datafeeds affected by the synchronization. There - is an object for each relevant datafeed, which contains the - synchronization status. - properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for datafeeds + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_jira: + title: Connector response properties for a Jira connector type: object - Machine_learning_APIs_mlSyncResponseDataFrameAnalytics: - description: >- - The sync machine learning saved objects API response contains this - object when there are data frame analytics jobs affected by the - synchronization. There is an object for each relevant job, which - contains the synchronization status. properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for data frame analytics jobs + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + connector_type_id: + description: The type of connector. + enum: + - .jira + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_opsgenie: + title: Connector response properties for an Opsgenie connector type: object - Machine_learning_APIs_mlSyncResponseSavedObjectsCreated: - description: >- - If saved objects are missing for machine learning jobs or trained - models, they are created when you run the sync machine learning saved - objects API. properties: - anomaly-detector: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors - description: >- - If saved objects are missing for anomaly detection jobs, they are - created. - type: object - data-frame-analytics: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics - description: >- - If saved objects are missing for data frame analytics jobs, they are - created. - type: object - trained-model: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels - description: 'If saved objects are missing for trained models, they are created.' - type: object - title: Sync API response for created saved objects + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' + connector_type_id: + description: The type of connector. + enum: + - .opsgenie + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_pagerduty: + title: Connector response properties for a PagerDuty connector type: object - Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted: - description: >- - If saved objects exist for machine learning jobs or trained models that - no longer exist, they are deleted when you run the sync machine learning - saved objects API. properties: - anomaly-detector: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors - description: >- - If there are saved objects exist for nonexistent anomaly detection - jobs, they are deleted. - type: object - data-frame-analytics: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics - description: >- - If there are saved objects exist for nonexistent data frame - analytics jobs, they are deleted. - type: object - trained-model: - additionalProperties: - $ref: >- - #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels - description: >- - If there are saved objects exist for nonexistent trained models, - they are deleted. - type: object - title: Sync API response for deleted saved objects + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' + connector_type_id: + description: The type of connector. + enum: + - .pagerduty + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_resilient: + title: Connector response properties for a IBM Resilient connector type: object - Machine_learning_APIs_mlSyncResponseSuccess: - description: The success or failure of the synchronization. - type: boolean - Machine_learning_APIs_mlSyncResponseTrainedModels: - description: >- - The sync machine learning saved objects API response contains this - object when there are trained models affected by the synchronization. - There is an object for each relevant trained model, which contains the - synchronization status. properties: - success: - $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' - title: Sync API response for trained models - type: object - Saved_objects_400_response: - title: Bad request + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + connector_type_id: + description: The type of connector. + enum: + - .resilient + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' + required: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_sentinelone: + title: Connector response properties for a SentinelOne connector type: object properties: - error: + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + connector_type_id: + description: The type of connector. enum: - - Bad Request + - .sentinelone type: string - message: + id: + description: The identifier for the connector. type: string - statusCode: - enum: - - 400 - type: integer - required: - - error - - message - - statusCode - Saved_objects_attributes: - description: > - The data that you want to create. WARNING: When you create saved - objects, attributes are not validated, which allows you to pass - arbitrary and ill-formed data into the API that can break Kibana. Make - sure any data that you send to the API is properly formed. - type: object - Saved_objects_initial_namespaces: - description: > - Identifiers for the spaces in which this object is created. If this is - provided, the object is created only in the explicitly defined spaces. - If this is not provided, the object is created in the current space - (default behavior). For shareable object types (registered with - `namespaceType: 'multiple'`), this option can be used to specify one or - more spaces, including the "All spaces" identifier ('*'). For isolated - object types (registered with `namespaceType: 'single'` or - `namespaceType: 'multiple-isolated'`), this option can only be used to - specify a single space, and the "All spaces" identifier ('*') is not - allowed. For global object types (`registered with `namespaceType: - agnostic`), this option cannot be used. - type: array - Saved_objects_references: - description: > - Objects with `name`, `id`, and `type` properties that describe the other - saved objects that this object references. Use `name` in attributes to - refer to the other saved object, but never the `id`, which can update - automatically during migrations or import and export. - type: array - Security_AI_Assistant_API_AnonymizationFieldCreateProps: - type: object - properties: - allowed: - type: boolean - anonymized: - type: boolean - field: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - field - Security_AI_Assistant_API_AnonymizationFieldDetailsInError: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_serverlog: + title: Connector response properties for a server log connector type: object properties: + config: + nullable: true + type: object + connector_type_id: + description: The type of connector. + enum: + - .server-log + type: string id: + description: The identifier for the connector. type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_AnonymizationFieldResponse: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow: + title: Connector response properties for a ServiceNow ITSM connector type: object properties: - allowed: - type: boolean - anonymized: - type: boolean - createdAt: - type: string - createdBy: - type: string - field: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. + enum: + - .servicenow type: string id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - namespace: - description: Kibana space - type: string - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - updatedAt: + description: The identifier for the connector. type: string - updatedBy: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - field - Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason: - enum: - - ANONYMIZATION_FIELD_NOT_MODIFIED - type: string - Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipResult: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow_itom: + title: Connector response properties for a ServiceNow ITOM connector type: object properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + connector_type_id: + description: The type of connector. + enum: + - .servicenow-itom + type: string id: + description: The identifier for the connector. type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' name: + description: The display name for the connector. type: string - skip_reason: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - skip_reason - Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResponse: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_servicenow_sir: + title: Connector response properties for a ServiceNow SecOps connector type: object properties: - anonymization_fields_count: - type: integer - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_NormalizedAnonymizationFieldError - type: array - results: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResults - summary: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_BulkCrudActionSummary - required: - - results - - summary - message: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. + enum: + - .servicenow-sir type: string - status_code: - type: integer - success: - type: boolean + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - attributes - Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResults: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_slack_api: + title: Connector response properties for a Slack connector type: object properties: - created: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipResult - type: array - updated: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse - type: array + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + connector_type_id: + description: The type of connector. + enum: + - .slack_api + type: string + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - updated - - created - - deleted - - skipped - Security_AI_Assistant_API_AnonymizationFieldUpdateProps: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_slack_webhook: + title: Connector response properties for a Slack connector type: object properties: - allowed: - type: boolean - anonymized: - type: boolean + connector_type_id: + description: The type of connector. + enum: + - .slack + type: string id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_ApiConfig: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_swimlane: + title: Connector response properties for a Swimlane connector type: object properties: - actionTypeId: - description: action type id - type: string - connectorId: - description: connector id + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + connector_type_id: + description: The type of connector. + enum: + - .swimlane type: string - defaultSystemPromptId: - description: defaultSystemPromptId + id: + description: The identifier for the connector. type: string - model: - description: model + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string - provider: - $ref: '#/components/schemas/Security_AI_Assistant_API_Provider' - description: Provider - required: - - connectorId - - actionTypeId - Security_AI_Assistant_API_BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - failed - - skipped - - succeeded - - total - Security_AI_Assistant_API_ChatCompleteProps: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_teams: + title: Connector response properties for a Microsoft Teams connector type: object properties: - connectorId: - type: string - conversationId: - type: string - isStream: - type: boolean - langSmithApiKey: - type: string - langSmithProject: - type: string - messages: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' - type: array - model: + config: + type: object + connector_type_id: + description: The type of connector. + enum: + - .teams type: string - persist: - type: boolean - promptId: + id: + description: The identifier for the connector. type: string - responseLanguage: + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - messages - - persist - - connectorId - Security_AI_Assistant_API_ChatMessage: - description: AI assistant message. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_tines: + title: Connector response properties for a Tines connector type: object properties: - content: - description: Message content. + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + connector_type_id: + description: The type of connector. + enum: + - .tines type: string - data: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' - description: Message role. - required: - - role - Security_AI_Assistant_API_ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - Security_AI_Assistant_API_ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - Security_AI_Assistant_API_ConversationCreateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - description: The conversation id. + description: The identifier for the connector. type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - title: - description: The conversation title. + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - title - Security_AI_Assistant_API_ConversationResponse: + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_torq: + title: Connector response properties for a Torq connector type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' + connector_type_id: + description: The type of connector. + enum: + - .torq type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - title: - description: The conversation title. + description: The identifier for the connector. type: string - updatedAt: - description: The last time conversation was updated. + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - - title - - createdAt - - users - - namespace - - category - Security_AI_Assistant_API_ConversationSummary: + - is_deprecated + - is_preconfigured + - name + Connectors_connector_response_properties_webhook: + title: Connector response properties for a Webhook connector type: object properties: - confidence: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_ConversationConfidence - description: >- - How confident you are about this being a correct and useful - learning. - content: - description: Summary text of the conversation over time. + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + connector_type_id: + description: The type of connector. + enum: + - .webhook type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp summary was updated. - Security_AI_Assistant_API_ConversationUpdateProps: - type: object - properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - title: - description: The conversation title. + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: + - connector_type_id - id - Security_AI_Assistant_API_FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - Security_AI_Assistant_API_FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - Security_AI_Assistant_API_FindPromptsSortField: - enum: - - created_at - - is_default + - is_deprecated + - is_preconfigured - name - - updated_at - type: string - Security_AI_Assistant_API_Message: - description: AI assistant conversation message. + Connectors_connector_response_properties_xmatters: + title: Connector response properties for an xMatters connector type: object properties: - content: - description: Message content. + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + connector_type_id: + description: The type of connector. + enum: + - .xmatters type: string - isError: - description: Is error message. - type: boolean - reader: - $ref: '#/components/schemas/Security_AI_Assistant_API_Reader' - description: Message content. - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageRole' - description: Message role. - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp message was sent or received. - traceData: - $ref: '#/components/schemas/Security_AI_Assistant_API_TraceData' - description: trace Data + id: + description: The identifier for the connector. + type: string + is_deprecated: + $ref: '#/components/schemas/Connectors_is_deprecated' + is_missing_secrets: + $ref: '#/components/schemas/Connectors_is_missing_secrets' + is_preconfigured: + $ref: '#/components/schemas/Connectors_is_preconfigured' + is_system_action: + $ref: '#/components/schemas/Connectors_is_system_action' + name: + description: The display name for the connector. + type: string + referenced_by_count: + $ref: '#/components/schemas/Connectors_referenced_by_count' required: - - timestamp - - content - - role - Security_AI_Assistant_API_MessageData: - additionalProperties: true - type: object - Security_AI_Assistant_API_MessageRole: - description: Message role. + - connector_type_id + - id + - is_deprecated + - is_preconfigured + - name + Connectors_connector_types: + description: >- + The type of connector. For example, `.email`, `.index`, `.jira`, + `.opsgenie`, or `.server-log`. enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ + - .bedrock + - .gemini + - .cases-webhook + - .d3security + - .email + - .gen-ai + - .index + - .jira + - .opsgenie + - .pagerduty + - .resilient + - .sentinelone + - .servicenow + - .servicenow-itom + - .servicenow-sir + - .server-log + - .slack + - .slack_api + - .swimlane + - .teams + - .tines + - .torq + - .webhook + - .xmatters + example: .server-log + title: Connector types type: string - Security_AI_Assistant_API_NormalizedAnonymizationFieldError: - type: object + Connectors_create_connector_request: + description: The properties vary depending on the connector type. + discriminator: + mapping: + .bedrock: '#/components/schemas/Connectors_create_connector_request_bedrock' + .cases-webhook: >- + #/components/schemas/Connectors_create_connector_request_cases_webhook + .d3security: '#/components/schemas/Connectors_create_connector_request_d3security' + .email: '#/components/schemas/Connectors_create_connector_request_email' + .gemini: '#/components/schemas/Connectors_create_connector_request_gemini' + .gen-ai: '#/components/schemas/Connectors_create_connector_request_genai' + .index: '#/components/schemas/Connectors_create_connector_request_index' + .jira: '#/components/schemas/Connectors_create_connector_request_jira' + .opsgenie: '#/components/schemas/Connectors_create_connector_request_opsgenie' + .pagerduty: '#/components/schemas/Connectors_create_connector_request_pagerduty' + .resilient: '#/components/schemas/Connectors_create_connector_request_resilient' + .sentinelone: '#/components/schemas/Connectors_create_connector_request_sentinelone' + .server-log: '#/components/schemas/Connectors_create_connector_request_serverlog' + .servicenow: '#/components/schemas/Connectors_create_connector_request_servicenow' + .servicenow-itom: >- + #/components/schemas/Connectors_create_connector_request_servicenow_itom + .servicenow-sir: >- + #/components/schemas/Connectors_create_connector_request_servicenow_sir + .slack: >- + #/components/schemas/Connectors_create_connector_request_slack_webhook + .slack_api: '#/components/schemas/Connectors_create_connector_request_slack_api' + .swimlane: '#/components/schemas/Connectors_create_connector_request_swimlane' + .teams: '#/components/schemas/Connectors_create_connector_request_teams' + .tines: '#/components/schemas/Connectors_create_connector_request_tines' + .torq: '#/components/schemas/Connectors_create_connector_request_torq' + .webhook: '#/components/schemas/Connectors_create_connector_request_webhook' + .xmatters: '#/components/schemas/Connectors_create_connector_request_xmatters' + propertyName: connector_type_id + oneOf: + - $ref: '#/components/schemas/Connectors_create_connector_request_bedrock' + - $ref: '#/components/schemas/Connectors_create_connector_request_gemini' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_cases_webhook + - $ref: '#/components/schemas/Connectors_create_connector_request_d3security' + - $ref: '#/components/schemas/Connectors_create_connector_request_email' + - $ref: '#/components/schemas/Connectors_create_connector_request_genai' + - $ref: '#/components/schemas/Connectors_create_connector_request_index' + - $ref: '#/components/schemas/Connectors_create_connector_request_jira' + - $ref: '#/components/schemas/Connectors_create_connector_request_opsgenie' + - $ref: '#/components/schemas/Connectors_create_connector_request_pagerduty' + - $ref: '#/components/schemas/Connectors_create_connector_request_resilient' + - $ref: '#/components/schemas/Connectors_create_connector_request_sentinelone' + - $ref: '#/components/schemas/Connectors_create_connector_request_serverlog' + - $ref: '#/components/schemas/Connectors_create_connector_request_servicenow' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_servicenow_itom + - $ref: >- + #/components/schemas/Connectors_create_connector_request_servicenow_sir + - $ref: '#/components/schemas/Connectors_create_connector_request_slack_api' + - $ref: >- + #/components/schemas/Connectors_create_connector_request_slack_webhook + - $ref: '#/components/schemas/Connectors_create_connector_request_swimlane' + - $ref: '#/components/schemas/Connectors_create_connector_request_teams' + - $ref: '#/components/schemas/Connectors_create_connector_request_tines' + - $ref: '#/components/schemas/Connectors_create_connector_request_torq' + - $ref: '#/components/schemas/Connectors_create_connector_request_webhook' + - $ref: '#/components/schemas/Connectors_create_connector_request_xmatters' + title: Create connector request body properties + Connectors_create_connector_request_bedrock: + description: >- + The Amazon Bedrock connector uses axios to send a POST request to Amazon + Bedrock. properties: - anonymization_fields: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_AnonymizationFieldDetailsInError - type: array - err_code: + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + connector_type_id: + description: The type of connector. + enum: + - .bedrock + example: .bedrock type: string - message: + name: + description: The display name for the connector. + example: my-connector type: string - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' required: - - message - - status_code - - anonymization_fields - Security_AI_Assistant_API_NormalizedPromptError: + - config + - connector_type_id + - name + - secrets + title: Create Amazon Bedrock connector request type: object + Connectors_create_connector_request_cases_webhook: + description: > + The Webhook - Case Management connector uses axios to send POST, PUT, + and GET requests to a case management RESTful API web service. properties: - err_code: + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' + connector_type_id: + description: The type of connector. + enum: + - .cases-webhook + example: .cases-webhook type: string - message: + name: + description: The display name for the connector. + example: my-connector type: string - prompts: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptDetailsInError - type: array - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' required: - - message - - status_code - - prompts - Security_AI_Assistant_API_PromptCreateProps: + - config + - connector_type_id + - name + title: Create Webhook - Case Managment connector request type: object + Connectors_create_connector_request_d3security: + description: > + The connector uses axios to send a POST request to a D3 Security + endpoint. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + connector_type_id: + description: The type of connector. + enum: + - .d3security + example: .d3security type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean name: + description: The display name for the connector. + example: my-connector type: string - promptType: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_d3security' required: + - config + - connector_type_id - name - - content - - promptType - Security_AI_Assistant_API_PromptDetailsInError: + - secrets + title: Create D3 Security connector request type: object + Connectors_create_connector_request_email: + description: > + The email connector uses the SMTP protocol to send mail messages, using + an integration of Nodemailer. An exception is Microsoft Exchange, which + uses HTTP protocol for sending emails, Send mail. Email message text is + sent as both plain text and html text. properties: - id: + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + connector_type_id: + description: The type of connector. + enum: + - .email + example: .email type: string name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_email' required: - - id - Security_AI_Assistant_API_PromptResponse: + - config + - connector_type_id + - name + - secrets + title: Create email connector request type: object + Connectors_create_connector_request_gemini: + description: >- + The Google Gemini connector uses axios to send a POST request to Google + Gemini. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: - type: string - createdAt: - type: string - createdBy: - type: string - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - type: boolean - isNewConversationDefault: - type: boolean - name: - type: string - namespace: - description: Kibana space - type: string - promptType: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - updatedAt: + config: + $ref: '#/components/schemas/Connectors_config_properties_gemini' + connector_type_id: + description: The type of connector. + enum: + - .gemini + example: .gemini type: string - updatedBy: + name: + description: The display name for the connector. + example: my-connector type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_gemini' required: - - id + - config + - connector_type_id - name - - promptType - - content - Security_AI_Assistant_API_PromptsBulkActionSkipReason: - enum: - - PROMPT_FIELD_NOT_MODIFIED - type: string - Security_AI_Assistant_API_PromptsBulkActionSkipResult: + - secrets + title: Create Google Gemini connector request type: object + Connectors_create_connector_request_genai: + description: > + The OpenAI connector uses axios to send a POST request to either OpenAI + or Azure OpenAPI. properties: - id: + config: + $ref: '#/components/schemas/Connectors_config_properties_genai' + connector_type_id: + description: The type of connector. + enum: + - .gen-ai + example: .gen-ai type: string name: + description: The display name for the connector. + example: my-connector type: string - skip_reason: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipReason - required: - - id - - skip_reason - Security_AI_Assistant_API_PromptsBulkCrudActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_NormalizedPromptError - type: array - results: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResults - summary: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_BulkCrudActionSummary - required: - - results - - summary - message: - type: string - prompts_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - Security_AI_Assistant_API_PromptsBulkCrudActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' - type: array - deleted: - items: - type: string - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipResult - type: array - updated: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_genai' required: - - updated - - created - - deleted - - skipped - Security_AI_Assistant_API_PromptType: - description: Prompt type - enum: - - system - - quick - type: string - Security_AI_Assistant_API_PromptUpdateProps: + - config + - connector_type_id + - name + - secrets + title: Create OpenAI connector request type: object + Connectors_create_connector_request_index: + description: The index connector indexes a document into Elasticsearch. properties: - categories: - items: - type: string - type: array - color: - type: string - consumer: - type: string - content: + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + connector_type_id: + description: The type of connector. + enum: + - .index + example: .index type: string - id: + name: + description: The display name for the connector. + example: my-connector type: string - isDefault: - type: boolean - isNewConversationDefault: - type: boolean required: - - id - Security_AI_Assistant_API_Provider: - description: Provider - enum: - - OpenAI - - Azure OpenAI - type: string - Security_AI_Assistant_API_Reader: - additionalProperties: true - type: object - Security_AI_Assistant_API_Replacements: - additionalProperties: - type: string - description: Replacements object used to anonymize/deanomymize messsages - type: object - Security_AI_Assistant_API_SortOrder: - enum: - - asc - - desc - type: string - Security_AI_Assistant_API_TraceData: - description: trace Data + - config + - connector_type_id + - name + title: Create index connector request type: object + Connectors_create_connector_request_jira: + description: The Jira connector uses the REST API v2 to create Jira issues. properties: - traceId: - description: 'Could be any string, not necessarily a UUID' + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + connector_type_id: + description: The type of connector. + enum: + - .jira + example: .jira type: string - transactionId: - description: 'Could be any string, not necessarily a UUID' + name: + description: The display name for the connector. + example: my-connector type: string - Security_AI_Assistant_API_User: - description: 'Could be any string, not necessarily a UUID' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_jira' + required: + - config + - connector_type_id + - name + - secrets + title: Create Jira connector request type: object + Connectors_create_connector_request_opsgenie: + description: The Opsgenie connector uses the Opsgenie alert API. properties: - id: - description: User id + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' + connector_type_id: + description: The type of connector. + enum: + - .opsgenie + example: .opsgenie type: string name: - description: User name + description: The display name for the connector. + example: my-connector type: string - Security_Solution_Detections_API_AlertAssignees: - type: object - properties: - add: - description: A list of users ids to assign. - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - remove: - description: A list of users ids to unassign. - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' required: - - add - - remove - Security_Solution_Detections_API_AlertIds: - description: A list of alerts ids. - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - minItems: 1 - type: array - Security_Solution_Detections_API_AlertsIndex: - deprecated: true - description: (deprecated) Has no effect. - type: string - Security_Solution_Detections_API_AlertsIndexMigrationError: + - config + - connector_type_id + - name + - secrets + title: Create Opsgenie connector request type: object + Connectors_create_connector_request_pagerduty: + description: > + The PagerDuty connector uses the v2 Events API to trigger, acknowledge, + and resolve PagerDuty alerts. properties: - error: - type: object - properties: - message: - type: string - status_code: - type: string - required: - - message - - status_code - index: + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' + connector_type_id: + description: The type of connector. + enum: + - .pagerduty + example: .pagerduty + type: string + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' required: - - index - - error - Security_Solution_Detections_API_AlertsIndexMigrationSuccess: + - config + - connector_type_id + - name + - secrets + title: Create PagerDuty connector request type: object + Connectors_create_connector_request_resilient: + description: >- + The IBM Resilient connector uses the RESILIENT REST v2 to create IBM + Resilient incidents. properties: - index: - type: string - migration_id: + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + connector_type_id: + description: The type of connector. + enum: + - .resilient + example: .resilient type: string - migration_index: + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_resilient' required: - - index - - migration_id - - migration_index - Security_Solution_Detections_API_AlertsIndexNamespace: - description: Has no effect. - type: string - Security_Solution_Detections_API_AlertsReindexOptions: + - config + - connector_type_id + - name + - secrets + title: Create IBM Resilient connector request type: object - properties: - requests_per_second: - minimum: 1 - type: integer - size: - minimum: 1 - type: integer - slices: - minimum: 1 - type: integer - Security_Solution_Detections_API_AlertsSort: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSortCombinations - - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsSortCombinations - type: array - Security_Solution_Detections_API_AlertsSortCombinations: - anyOf: - - type: string - - additionalProperties: true - type: object - Security_Solution_Detections_API_AlertStatus: - enum: - - open - - closed - - acknowledged - - in-progress - type: string - Security_Solution_Detections_API_AlertSuppression: + Connectors_create_connector_request_sentinelone: + description: > + The SentinelOne connector communicates with SentinelOne Management + Console via REST API. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will work to fix any + issues, but features in technical preview are not subject to the support + SLA of official GA features. + title: Create SentinelOne connector request type: object properties: - duration: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionDuration - group_by: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionGroupBy - missing_fields_strategy: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionMissingFieldsStrategy + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + connector_type_id: + description: The type of connector. + enum: + - .sentinelone + example: .sentinelone + type: string + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' required: - - group_by - Security_Solution_Detections_API_AlertSuppressionDuration: - type: object + - config + - connector_type_id + - name + - secrets + x-technical-preview: true + Connectors_create_connector_request_serverlog: + description: This connector writes an entry to the Kibana server log. properties: - unit: + connector_type_id: + description: The type of connector. enum: - - s - - m - - h + - .server-log + example: .server-log + type: string + name: + description: The display name for the connector. + example: my-connector type: string - value: - minimum: 1 - type: integer - required: - - value - - unit - Security_Solution_Detections_API_AlertSuppressionGroupBy: - items: - type: string - maxItems: 3 - minItems: 1 - type: array - Security_Solution_Detections_API_AlertSuppressionMissingFieldsStrategy: - description: >- - Describes how alerts will be generated for documents with missing - suppress by fields: - - doNotSuppress - per each document a separate alert will be created - - suppress - only alert will be created per suppress by bucket - enum: - - doNotSuppress - - suppress - type: string - Security_Solution_Detections_API_AlertTag: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - Security_Solution_Detections_API_AlertTags: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTag' - type: array - Security_Solution_Detections_API_AlertVersion: - type: object - properties: - count: - type: integer - version: - type: integer required: - - version - - count - Security_Solution_Detections_API_AnomalyThreshold: - description: Anomaly threshold - minimum: 0 - type: integer - Security_Solution_Detections_API_BuildingBlockType: - description: >- - Determines if the rule acts as a building block. By default, - building-block alerts are not displayed in the UI. These rules are used - as a foundation for other rules that do generate alerts. Its value must - be default. - type: string - Security_Solution_Detections_API_BulkActionEditPayload: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadTags - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadIndexPatterns - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadInvestigationFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadTimeline - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadRuleActions - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayloadSchedule - Security_Solution_Detections_API_BulkActionEditPayloadIndexPatterns: + - connector_type_id + - name + title: Create server log connector request type: object + Connectors_create_connector_request_servicenow: + description: > + The ServiceNow ITSM connector uses the import set API to create + ServiceNow incidents. You can use the connector for rule actions and + cases. properties: - overwrite_data_views: - type: boolean - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. enum: - - add_index_patterns - - delete_index_patterns - - set_index_patterns + - .servicenow + example: .servicenow type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadInvestigationFields: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow ITSM connector request type: object + Connectors_create_connector_request_servicenow_itom: + description: > + The ServiceNow ITOM connector uses the event API to create ServiceNow + events. You can use the connector for rule actions. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + connector_type_id: + description: The type of connector. enum: - - add_investigation_fields - - delete_investigation_fields - - set_investigation_fields + - .servicenow-itom + example: .servicenow-itom type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadRuleActions: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow ITOM connector request type: object + Connectors_create_connector_request_servicenow_sir: + description: > + The ServiceNow SecOps connector uses the import set API to create + ServiceNow security incidents. You can use the connector for rule + actions and cases. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + connector_type_id: + description: The type of connector. enum: - - add_rule_actions - - set_rule_actions + - .servicenow-sir + example: .servicenow-sir type: string - value: - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NormalizedRuleAction - type: array - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThrottleForBulkActions - required: - - actions + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadSchedule: + - config + - connector_type_id + - name + - secrets + title: Create ServiceNow SecOps connector request type: object + Connectors_create_connector_request_slack_api: + description: The Slack connector uses an API method to send Slack messages. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + connector_type_id: + description: The type of connector. enum: - - set_schedule + - .slack_api + example: .slack_api type: string - value: - type: object - properties: - interval: - description: >- - Interval in which the rule runs. For example, `"1h"` means the - rule runs every hour. - example: 1h - pattern: '^[1-9]\d*[smh]$' - type: string - lookback: - description: Lookback time for the rule - example: 1h - pattern: '^[1-9]\d*[smh]$' - type: string - required: - - interval - - lookback + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadTags: + - connector_type_id + - name + - secrets + title: Create Slack connector request type: object + Connectors_create_connector_request_slack_webhook: + description: The Slack connector uses Slack Incoming Webhooks. properties: - type: + connector_type_id: + description: The type of connector. enum: - - add_tags - - delete_tags - - set_tags + - .slack + example: .slack type: string - value: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleTagArray' + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' required: - - type - - value - Security_Solution_Detections_API_BulkActionEditPayloadTimeline: + - connector_type_id + - name + - secrets + title: Create Slack connector request type: object + Connectors_create_connector_request_swimlane: + description: >- + The Swimlane connector uses the Swimlane REST API to create Swimlane + records. properties: - type: + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + connector_type_id: + description: The type of connector. enum: - - set_timeline + - .swimlane + example: .swimlane type: string - value: - type: object - properties: - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - required: - - timeline_id - - timeline_title + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' required: - - type - - value - Security_Solution_Detections_API_BulkActionsDryRunErrCode: - enum: - - IMMUTABLE - - MACHINE_LEARNING_AUTH - - MACHINE_LEARNING_INDEX_PATTERN - - ESQL_INDEX_PATTERN - - MANUAL_RULE_RUN_FEATURE - - MANUAL_RULE_RUN_DISABLED_RULE - type: string - Security_Solution_Detections_API_BulkActionSkipResult: + - config + - connector_type_id + - name + - secrets + title: Create Swimlane connector request type: object + Connectors_create_connector_request_teams: + description: The Microsoft Teams connector uses Incoming Webhooks. properties: - id: + connector_type_id: + description: The type of connector. + enum: + - .teams + example: .teams type: string name: + description: The display name for the connector. + example: my-connector type: string - skip_reason: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditSkipReason + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_teams' required: - - id - - skip_reason - Security_Solution_Detections_API_BulkCrudRulesResponse: - items: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - - $ref: '#/components/schemas/Security_Solution_Detections_API_ErrorSchema' - type: array - Security_Solution_Detections_API_BulkDeleteRules: + - connector_type_id + - name + - secrets + title: Create Microsoft Teams connector request type: object + Connectors_create_connector_request_tines: + description: > + The Tines connector uses Tines Webhook actions to send events via POST + request. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + connector_type_id: + description: The type of connector. enum: - - delete + - .tines + example: .tines type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_tines' required: - - action - Security_Solution_Detections_API_BulkDisableRules: + - config + - connector_type_id + - name + - secrets + title: Create Tines connector request type: object + Connectors_create_connector_request_torq: + description: > + The Torq connector uses a Torq webhook to trigger workflows with Kibana + actions. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' + connector_type_id: + description: The type of connector. enum: - - disable + - .torq + example: .torq type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - action - Security_Solution_Detections_API_BulkDuplicateRules: + - config + - connector_type_id + - name + - secrets + title: Create Torq connector request type: object + Connectors_create_connector_request_webhook: + description: > + The Webhook connector uses axios to send a POST or PUT request to a web + service. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + connector_type_id: + description: The type of connector. enum: - - duplicate - type: string - duplicate: - type: object - properties: - include_exceptions: - description: Whether to copy exceptions from the original rule - type: boolean - include_expired_exceptions: - description: Whether to copy expired exceptions from the original rule - type: boolean - required: - - include_exceptions - - include_expired_exceptions - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + - .webhook + example: .webhook type: string - required: - - action - Security_Solution_Detections_API_BulkEditActionResponse: - type: object - properties: - attributes: - type: object - properties: - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NormalizedRuleError - type: array - results: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionResults - summary: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkEditActionSummary - required: - - results - - summary - message: + name: + description: The display name for the connector. + example: my-connector type: string - rules_count: - type: integer - status_code: - type: integer - success: - type: boolean - required: - - attributes - Security_Solution_Detections_API_BulkEditActionResults: - type: object - properties: - created: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - deleted: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - skipped: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionSkipResult - type: array - updated: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleResponse' - type: array - required: - - updated - - created - - deleted - - skipped - Security_Solution_Detections_API_BulkEditActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - failed - - skipped - - succeeded - - total - Security_Solution_Detections_API_BulkEditRules: + - config + - connector_type_id + - name + - secrets + title: Create Webhook connector request type: object + Connectors_create_connector_request_xmatters: + description: > + The xMatters connector uses the xMatters Workflow for Elastic to send + actionable alerts to on-call xMatters resources. properties: - action: + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + connector_type_id: + description: The type of connector. enum: - - edit + - .xmatters + example: .xmatters type: string - edit: - description: Array of objects containing the edit operations - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionEditPayload - minItems: 1 - type: array - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' required: - - action - - edit - Security_Solution_Detections_API_BulkEditSkipReason: + - config + - connector_type_id + - name + - secrets + title: Create xMatters connector request + type: object + Connectors_features: + description: | + The feature that uses the connector. enum: - - RULE_NOT_MODIFIED + - alerting + - cases + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - siem + - uptime type: string - Security_Solution_Detections_API_BulkEnableRules: - type: object + Connectors_is_deprecated: + description: Indicates whether the connector type is deprecated. + example: false + type: boolean + Connectors_is_missing_secrets: + description: >- + Indicates whether secrets are missing for the connector. Secrets + configuration properties vary depending on the connector type. + example: false + type: boolean + Connectors_is_preconfigured: + description: > + Indicates whether it is a preconfigured connector. If true, the `config` + and `is_missing_secrets` properties are omitted from the response. + example: false + type: boolean + Connectors_is_system_action: + description: Indicates whether the connector is used for system actions. + example: false + type: boolean + Connectors_referenced_by_count: + description: > + Indicates the number of saved objects that reference the connector. If + `is_preconfigured` is true, this value is not calculated. This property + is returned only by the get all connectors API. + example: 2 + type: integer + Connectors_run_connector_params_acknowledge_resolve_pagerduty: + description: Test an action that acknowledges or resolves a PagerDuty alert. properties: - action: - enum: - - enable + dedupKey: + description: The deduplication key for the PagerDuty alert. + maxLength: 255 type: string - ids: - description: Array of rule IDs - items: - type: string - minItems: 1 - type: array - query: - description: Query to filter rules + eventAction: + description: The type of event. + enum: + - acknowledge + - resolve type: string required: - - action - Security_Solution_Detections_API_BulkExportActionResponse: - type: string - Security_Solution_Detections_API_BulkExportRules: + - dedupKey + - eventAction + title: PagerDuty connector parameters type: object + Connectors_run_connector_params_documents: + description: Test an action that indexes a document into Elasticsearch. properties: - action: - enum: - - export - type: string - ids: - description: Array of rule IDs + documents: + description: The documents in JSON format for index connectors. items: - type: string - minItems: 1 + additionalProperties: true + type: object type: array - query: - description: Query to filter rules - type: string required: - - action - Security_Solution_Detections_API_BulkManualRuleRun: + - documents + title: Index connector parameters type: object + Connectors_run_connector_params_message_email: + anyOf: + - required: + - bcc + - message + - subject + - required: + - cc + - message + - subject + - required: + - to + - message + - subject + description: > + Test an action that sends an email message. There must be at least one + recipient in `to`, `cc`, or `bcc`. properties: - action: - enum: - - run - type: string - ids: - description: Array of rule IDs + bcc: + description: > + A list of "blind carbon copy" email addresses. Addresses can be + specified in `user@host-name` format or in name `` + format items: type: string - minItems: 1 type: array - query: - description: Query to filter rules - type: string - run: - type: object - properties: - end_date: - description: End date of the manual rule run - type: string - start_date: - description: Start date of the manual rule run - type: string - required: - - start_date - required: - - action - - run - Security_Solution_Detections_API_ConcurrentSearches: - minimum: 1 - type: integer - Security_Solution_Detections_API_DataViewId: - type: string - Security_Solution_Detections_API_DefaultParams: - type: object - properties: - command: - enum: - - isolate + cc: + description: > + A list of "carbon copy" email addresses. Addresses can be specified + in `user@host-name` format or in name `` format + items: + type: string + type: array + message: + description: The email message text. Markdown format is supported. type: string - comment: + subject: + description: The subject line of the email. type: string - required: - - command - Security_Solution_Detections_API_EcsMapping: - additionalProperties: - type: object - properties: - field: + to: + description: > + A list of email addresses. Addresses can be specified in + `user@host-name` format or in name `` format. + items: type: string - value: - oneOf: - - type: string - - items: - type: string - type: array - type: object - Security_Solution_Detections_API_EndpointResponseAction: + type: array + title: Email connector parameters type: object + Connectors_run_connector_params_message_serverlog: + description: Test an action that writes an entry to the Kibana server log. properties: - action_type_id: + level: + default: info + description: The log level of the message for server log connectors. enum: - - .endpoint + - debug + - error + - fatal + - info + - trace + - warn + type: string + message: + description: The message for server log connectors. type: string - params: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_DefaultParams - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ProcessesParams required: - - action_type_id - - params - Security_Solution_Detections_API_EqlOptionalFields: - type: object - properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - event_category_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EventCategoryOverride - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - tiebreaker_field: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TiebreakerField - timestamp_field: - $ref: '#/components/schemas/Security_Solution_Detections_API_TimestampField' - Security_Solution_Detections_API_EqlQueryLanguage: - enum: - - eql - type: string - Security_Solution_Detections_API_EqlRequiredFields: + - message + title: Server log connector parameters type: object + Connectors_run_connector_params_message_slack: + description: > + Test an action that sends a message to Slack. It is applicable only when + the connector type is `.slack`. properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlQueryLanguage - description: Query language to use - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: EQL query to execute - type: - description: Rule type - enum: - - eql + message: + description: >- + The Slack message text, which cannot contain Markdown, images, or + other advanced formatting. type: string required: - - type - - query - - language - Security_Solution_Detections_API_EqlRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleResponseFields - Security_Solution_Detections_API_EqlRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateFields - Security_Solution_Detections_API_EqlRulePatchFields: - allOf: - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlQueryLanguage - description: Query language to use - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: EQL query to execute - type: - description: Rule type - enum: - - eql - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRulePatchFields - Security_Solution_Detections_API_EqlRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlOptionalFields - Security_Solution_Detections_API_EqlRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateFields - Security_Solution_Detections_API_ErrorSchema: - additionalProperties: false + - message + title: Slack connector parameters type: object + Connectors_run_connector_params_trigger_pagerduty: + description: Test an action that triggers a PagerDuty alert. properties: - error: + class: + description: The class or type of the event. + example: cpu load + type: string + component: + description: >- + The component of the source machine that is responsible for the + event. + example: eth0 + type: string + customDetails: + description: Additional details to add to the event. type: object - properties: - message: - type: string - status_code: - minimum: 400 - type: integer - required: - - status_code - - message - id: + dedupKey: + description: > + All actions sharing this key will be associated with the same + PagerDuty alert. This value is used to correlate trigger and + resolution. + maxLength: 255 + type: string + eventAction: + description: The type of event. + enum: + - trigger + type: string + group: + description: The logical grouping of components of a service. + example: app-stack + type: string + links: + description: A list of links to add to the event. + items: + type: object + properties: + href: + description: The URL for the link. + type: string + text: + description: A plain text description of the purpose of the link. + type: string + type: array + severity: + default: info + description: The severity of the event on the affected system. + enum: + - critical + - error + - info + - warning + type: string + source: + description: > + The affected system, such as a hostname or fully qualified domain + name. Defaults to the Kibana saved object id of the action. type: string - item_id: - minLength: 1 + summary: + description: A summery of the event. + maxLength: 1024 type: string - list_id: - minLength: 1 + timestamp: + description: >- + An ISO-8601 timestamp that indicates when the event was detected or + generated. + format: date-time type: string - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId required: - - error - Security_Solution_Detections_API_EsqlQueryLanguage: - enum: - - esql - type: string - Security_Solution_Detections_API_EsqlRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleResponseFields - Security_Solution_Detections_API_EsqlRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleRequiredFields - Security_Solution_Detections_API_EsqlRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateFields - Security_Solution_Detections_API_EsqlRuleOptionalFields: + - eventAction + title: PagerDuty connector parameters type: object + Connectors_run_connector_request: + description: The properties vary depending on the connector type. properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - Security_Solution_Detections_API_EsqlRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlQueryLanguage - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: ESQL query to execute - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - type: - description: Rule type - enum: - - esql - type: string - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - Security_Solution_Detections_API_EsqlRuleRequiredFields: + params: + oneOf: + - $ref: >- + #/components/schemas/Connectors_run_connector_params_acknowledge_resolve_pagerduty + - $ref: '#/components/schemas/Connectors_run_connector_params_documents' + - $ref: >- + #/components/schemas/Connectors_run_connector_params_message_email + - $ref: >- + #/components/schemas/Connectors_run_connector_params_message_serverlog + - $ref: >- + #/components/schemas/Connectors_run_connector_params_message_slack + - $ref: >- + #/components/schemas/Connectors_run_connector_params_trigger_pagerduty + - description: Test an action that involves a subaction. + discriminator: + mapping: + addEvent: >- + #/components/schemas/Connectors_run_connector_subaction_addevent + closeAlert: >- + #/components/schemas/Connectors_run_connector_subaction_closealert + closeIncident: >- + #/components/schemas/Connectors_run_connector_subaction_closeincident + createAlert: >- + #/components/schemas/Connectors_run_connector_subaction_createalert + fieldsByIssueType: >- + #/components/schemas/Connectors_run_connector_subaction_fieldsbyissuetype + getChoices: >- + #/components/schemas/Connectors_run_connector_subaction_getchoices + getFields: >- + #/components/schemas/Connectors_run_connector_subaction_getfields + getIncident: >- + #/components/schemas/Connectors_run_connector_subaction_getincident + issue: >- + #/components/schemas/Connectors_run_connector_subaction_issue + issues: >- + #/components/schemas/Connectors_run_connector_subaction_issues + issueTypes: >- + #/components/schemas/Connectors_run_connector_subaction_issuetypes + pushToService: >- + #/components/schemas/Connectors_run_connector_subaction_pushtoservice + propertyName: subAction + oneOf: + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_addevent + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_closealert + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_closeincident + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_createalert + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_fieldsbyissuetype + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_getchoices + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_getfields + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_getincident + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_issue + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_issues + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_issuetypes + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_postmessage + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_pushtoservice + - $ref: >- + #/components/schemas/Connectors_run_connector_subaction_validchannelid + title: Subaction parameters + required: + - params + title: Run connector request body properties + type: object + Connectors_run_connector_subaction_addevent: + description: The `addEvent` subaction for ServiceNow ITOM connectors. + title: The addEvent subaction type: object properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - description: ESQL query to execute - type: - description: Rule type + subAction: + description: The action to test. enum: - - esql + - addEvent type: string - required: - - type - - language - - query - Security_Solution_Detections_API_EsqlRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleRequiredFields - Security_Solution_Detections_API_EsqlRuleUpdateProps: - allOf: - - type: object + subActionParams: + description: The set of configuration properties for the action. + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType + additional_info: + description: Additional information about the event. + type: string description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' + description: The details about the event. + type: string + event_class: + description: A specific instance of the source. + type: string + message_key: + description: >- + All actions sharing this key are associated with the same + ServiceNow alert. The default value is `:`. + type: string + metric_name: + description: The name of the metric. + type: string + node: + description: The host that the event was triggered for. + type: string + resource: + description: The name of the resource. + type: string severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateFields - Security_Solution_Detections_API_EventCategoryOverride: - type: string - Security_Solution_Detections_API_ExceptionListType: - description: The exception type - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Detections_API_ExternalRuleSource: - description: >- - Type of rule source for externally sourced rules, i.e. rules that have - an external source, such as the Elastic Prebuilt rules repo. + description: The severity of the event. + type: string + source: + description: The name of the event source type. + type: string + time_of_event: + description: The time of the event. + type: string + type: + description: The type of event. + type: string + required: + - subAction + Connectors_run_connector_subaction_closealert: + description: The `closeAlert` subaction for Opsgenie connectors. + title: The closeAlert subaction type: object properties: - is_customized: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsExternalRuleCustomized - type: + subAction: + description: The action to test. enum: - - external + - closeAlert type: string + subActionParams: + type: object + properties: + alias: + description: >- + The unique identifier used for alert deduplication in Opsgenie. + The alias must match the value used when creating the alert. + type: string + note: + description: Additional information for the alert. + type: string + source: + description: The display name for the source of the alert. + type: string + user: + description: The display name for the owner. + type: string + required: + - alias required: - - type - - is_customized - Security_Solution_Detections_API_FindRulesSortField: - enum: - - created_at - - createdAt - - enabled - - execution_summary.last_execution.date - - execution_summary.last_execution.metrics.execution_gap_duration_s - - execution_summary.last_execution.metrics.total_indexing_duration_ms - - execution_summary.last_execution.metrics.total_search_duration_ms - - execution_summary.last_execution.status - - name - - risk_score - - riskScore - - severity - - updated_at - - updatedAt - type: string - Security_Solution_Detections_API_HistoryWindowStart: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - Security_Solution_Detections_API_IndexMigrationStatus: - type: object - properties: - index: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - is_outdated: - type: boolean - migrations: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MigrationStatus - type: array - signal_versions: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertVersion' - type: array - version: - type: integer - required: - - index - - version - - signal_versions - - migrations - - is_outdated - Security_Solution_Detections_API_IndexPatternArray: - items: - type: string - type: array - Security_Solution_Detections_API_InternalRuleSource: - description: >- - Type of rule source for internally sourced rules, i.e. created within - the Kibana apps. + - subAction + - subActionParams + Connectors_run_connector_subaction_closeincident: + description: The `closeIncident` subaction for ServiceNow ITSM connectors. + title: The closeIncident subaction type: object properties: - type: + subAction: + description: The action to test. enum: - - internal + - closeIncident type: string + subActionParams: + type: object + properties: + incident: + anyOf: + - required: + - correlation_id + - required: + - externalId + type: object + properties: + correlation_id: + default: '{{rule.id}}:{{alert.id}}' + description: > + An identifier that is assigned to the incident when it is + created by the connector. NOTE: If you use the default value + and the rule generates multiple alerts that use the same + alert IDs, the latest open incident for this correlation ID + is closed unless you specify the external ID. + maxLength: 100 + nullable: true + type: string + externalId: + description: >- + The unique identifier (`incidentId`) for the incident in + ServiceNow. + nullable: true + type: string + required: + - incident required: - - type - Security_Solution_Detections_API_InvestigationFields: - description: > - Schema for fields relating to investigation fields. These are user - defined fields we use to highlight - - in various features in the UI such as alert details flyout and - exceptions auto-population from alert. - - Added in PR #163235 - - Right now we only have a single field but anticipate adding more related - fields to store various - - configuration states such as `override` - where a user might say if they - want only these fields to - - display, or if they want these fields + the fields we select. When - expanding this field, it may look - - something like: - - ```typescript - - const investigationFields = z.object({ - field_names: NonEmptyArray(NonEmptyString), - override: z.boolean().optional(), - }); - - ``` + - subAction + - subActionParams + Connectors_run_connector_subaction_createalert: + description: The `createAlert` subaction for Opsgenie connectors. + title: The createAlert subaction type: object properties: - field_names: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - minItems: 1 - type: array - required: - - field_names - Security_Solution_Detections_API_InvestigationGuide: - description: Notes to help investigate alerts produced by the rule. - type: string - Security_Solution_Detections_API_IsExternalRuleCustomized: - description: >- - Determines whether an external/prebuilt rule has been customized by the - user (i.e. any of its fields have been modified and diverged from the - base value). - type: boolean - Security_Solution_Detections_API_IsRuleEnabled: - description: Determines whether the rule is enabled. - type: boolean - Security_Solution_Detections_API_IsRuleImmutable: - deprecated: true - description: >- - This field determines whether the rule is a prebuilt Elastic rule. It - will be replaced with the `rule_source` field. - type: boolean - Security_Solution_Detections_API_ItemsPerSearch: - minimum: 1 - type: integer - Security_Solution_Detections_API_KqlQueryLanguage: - enum: - - kuery - - lucene - type: string - Security_Solution_Detections_API_MachineLearningJobId: - description: Machine learning job ID - oneOf: - - type: string - - items: - type: string - minItems: 1 - type: array - Security_Solution_Detections_API_MachineLearningRule: - allOf: - - type: object + subAction: + description: The action to test. + enum: + - createAlert + type: string + subActionParams: + type: object properties: actions: + description: The custom actions available to the alert. items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction + type: string type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType + alias: + description: The unique identifier used for alert deduplication in Opsgenie. + type: string description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace + description: >- + A description that provides detailed information about the + alert. + type: string + details: + additionalProperties: true + description: The custom properties of the alert. + example: + key1: value1 + key2: value2 + type: object + entity: + description: >- + The domain of the alert. For example, the application or server + name. + type: string + message: + description: The alert message. + type: string note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: + description: Additional information for the alert. + type: string + priority: + description: The priority level for the alert. + enum: + - P1 + - P2 + - P3 + - P4 + - P5 + type: string + responders: + description: > + The entities to receive notifications about the alert. If `type` + is `user`, either `id` or `username` is required. If `type` is + `team`, either `id` or `name` is required. items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput + type: object + properties: + id: + description: The identifier for the entity. + type: string + name: + description: The name of the entity. + type: string + type: + description: 'The type of responders, in this case `escalation`.' + enum: + - escalation + - schedule + - team + - user + type: string + username: + description: A valid email address for the user. + type: string type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping + source: + description: The display name for the source of the alert. + type: string tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleResponseFields - Security_Solution_Detections_API_MachineLearningRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: + description: The tags for the alert. items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList + type: string type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: + user: + description: The display name for the owner. + type: string + visibleTo: + description: >- + The teams and users that the alert will be visible to without + sending a notification. Only one of `id`, `name`, or `username` + is required. items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput + type: object + properties: + id: + description: The identifier for the entity. + type: string + name: + description: The name of the entity. + type: string + type: + description: Valid values are `team` and `user`. + enum: + - team + - user + type: string + username: + description: >- + The user name. This property is required only when the + `type` is `user`. + type: string + required: + - type type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateFields - Security_Solution_Detections_API_MachineLearningRuleOptionalFields: + - message + required: + - subAction + - subActionParams + Connectors_run_connector_subaction_fieldsbyissuetype: + description: The `fieldsByIssueType` subaction for Jira connectors. + title: The fieldsByIssueType subaction type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - Security_Solution_Detections_API_MachineLearningRulePatchFields: - allOf: - - type: object + subAction: + description: The action to test. + enum: + - fieldsByIssueType + type: string + subActionParams: + type: object properties: - anomaly_threshold: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AnomalyThreshold - machine_learning_job_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningJobId - type: - description: Rule type - enum: - - machine_learning + id: + description: The Jira issue type identifier. + example: 10024 type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRulePatchProps: - allOf: - - type: object + required: + - id + required: + - subAction + - subActionParams + Connectors_run_connector_subaction_getchoices: + description: >- + The `getChoices` subaction for ServiceNow ITOM, ServiceNow ITSM, and + ServiceNow SecOps connectors. + title: The getChoices subaction + type: object + properties: + subAction: + description: The action to test. + enum: + - getChoices + type: string + subActionParams: + description: The set of configuration properties for the action. + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: + fields: + description: An array of fields. items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput + type: string type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRulePatchFields - Security_Solution_Detections_API_MachineLearningRuleRequiredFields: + required: + - fields + required: + - subAction + - subActionParams + Connectors_run_connector_subaction_getfields: + description: >- + The `getFields` subaction for Jira, ServiceNow ITSM, and ServiceNow + SecOps connectors. + title: The getFields subaction type: object properties: - anomaly_threshold: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AnomalyThreshold - machine_learning_job_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningJobId - type: - description: Rule type + subAction: + description: The action to test. enum: - - machine_learning + - getFields type: string required: - - type - - machine_learning_job_id - - anomaly_threshold - Security_Solution_Detections_API_MachineLearningRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleOptionalFields - Security_Solution_Detections_API_MachineLearningRuleUpdateProps: - allOf: - - type: object + - subAction + Connectors_run_connector_subaction_getincident: + description: >- + The `getIncident` subaction for Jira, ServiceNow ITSM, and ServiceNow + SecOps connectors. + properties: + subAction: + description: The action to test. + enum: + - getIncident + type: string + subActionParams: + type: object + properties: + externalId: + description: >- + The Jira, ServiceNow ITSM, or ServiceNow SecOps issue + identifier. + example: 71778 + type: string + required: + - externalId + required: + - subAction + - subActionParams + title: The getIncident subaction + type: object + Connectors_run_connector_subaction_issue: + description: The `issue` subaction for Jira connectors. + title: The issue subaction + type: object + properties: + subAction: + description: The action to test. + enum: + - issue + type: string + subActionParams: + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion + description: The Jira issue identifier. + example: 71778 + type: string required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateFields - Security_Solution_Detections_API_MaxSignals: - minimum: 1 - type: integer - Security_Solution_Detections_API_MigrationCleanupResult: + - id + required: + - subAction + Connectors_run_connector_subaction_issues: + description: The `issues` subaction for Jira connectors. + title: The issues subaction type: object properties: - destinationIndex: + subAction: + description: The action to test. + enum: + - issues type: string - error: + subActionParams: type: object properties: - message: + title: + description: The title of the Jira issue. + type: string + required: + - title + required: + - subAction + - subActionParams + Connectors_run_connector_subaction_issuetypes: + description: The `issueTypes` subaction for Jira connectors. + title: The issueTypes subaction + type: object + properties: + subAction: + description: The action to test. + enum: + - issueTypes + type: string + required: + - subAction + Connectors_run_connector_subaction_postmessage: + description: > + Test an action that sends a message to Slack. It is applicable only when + the connector type is `.slack_api`. + properties: + subAction: + description: The action to test. + enum: + - postMessage + type: string + subActionParams: + description: The set of configuration properties for the action. + type: object + properties: + channelIds: + description: > + The Slack channel identifier, which must be one of the + `allowedChannels` in the connector configuration. + items: + type: string + maxItems: 1 + type: array + channels: + deprecated: true + description: | + The name of a channel that your Slack app has access to. + items: + type: string + maxItems: 1 + type: array + text: + description: > + The Slack message text. If it is a Slack webhook connector, the + text cannot contain Markdown, images, or other advanced + formatting. If it is a Slack web API connector, it can contain + either plain text or block kit messages. + minLength: 1 type: string - status_code: - type: integer - required: - - message - - status_code - id: - type: string - sourceIndex: - type: string - status: - enum: - - success - - failure - - pending - type: string - updated: - format: date-time - type: string - version: - type: string required: - - id - - destinationIndex - - status - - sourceIndex - - version - - updated - Security_Solution_Detections_API_MigrationFinalizationResult: + - subAction + - subActionParams + title: The postMessage subaction + type: object + Connectors_run_connector_subaction_pushtoservice: + description: >- + The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow + SecOps, Swimlane, and Webhook - Case Management connectors. + title: The pushToService subaction type: object properties: - completed: - type: boolean - destinationIndex: + subAction: + description: The action to test. + enum: + - pushToService type: string - error: + subActionParams: + description: The set of configuration properties for the action. type: object properties: - message: - type: string - status_code: - type: integer - required: - - message - - status_code - id: - type: string - sourceIndex: - type: string - status: + comments: + description: >- + Additional information that is sent to Jira, ServiceNow ITSM, + ServiceNow SecOps, or Swimlane. + items: + type: object + properties: + comment: + description: >- + A comment related to the incident. For example, describe + how to troubleshoot the issue. + type: string + commentId: + description: A unique identifier for the comment. + type: integer + type: array + incident: + description: >- + Information necessary to create or update a Jira, ServiceNow + ITSM, ServiveNow SecOps, or Swimlane incident. + type: object + properties: + alertId: + description: The alert identifier for Swimlane connectors. + type: string + caseId: + description: >- + The case identifier for the incident for Swimlane + connectors. + type: string + caseName: + description: The case name for the incident for Swimlane connectors. + type: string + category: + description: >- + The category of the incident for ServiceNow ITSM and + ServiceNow SecOps connectors. + type: string + correlation_display: + description: >- + A descriptive label of the alert for correlation purposes + for ServiceNow ITSM and ServiceNow SecOps connectors. + type: string + correlation_id: + description: > + The correlation identifier for the security incident for + ServiceNow ITSM and ServiveNow SecOps connectors. Connectors + using the same correlation ID are associated with the same + ServiceNow incident. This value determines whether a new + ServiceNow incident is created or an existing one is + updated. Modifying this value is optional; if not modified, + the rule ID and alert ID are combined as `{{ruleID}}:{{alert + ID}}` to form the correlation ID value in ServiceNow. The + maximum character length for this value is 100 characters. + NOTE: Using the default configuration of `{{ruleID}}:{{alert + ID}}` ensures that ServiceNow creates a separate incident + record for every generated alert that uses a unique alert + ID. If the rule generates multiple alerts that use the same + alert IDs, ServiceNow creates and continually updates a + single incident record for the alert. + type: string + description: + description: >- + The description of the incident for Jira, ServiceNow ITSM, + ServiceNow SecOps, Swimlane, and Webhook - Case Management + connectors. + type: string + dest_ip: + description: > + A list of destination IP addresses related to the security + incident for ServiceNow SecOps connectors. The IPs are added + as observables to the security incident. + oneOf: + - type: string + - items: + type: string + type: array + externalId: + description: > + The Jira, ServiceNow ITSM, or ServiceNow SecOps issue + identifier. If present, the incident is updated. Otherwise, + a new incident is created. + type: string + id: + description: >- + The external case identifier for Webhook - Case Management + connectors. + type: string + impact: + description: The impact of the incident for ServiceNow ITSM connectors. + type: string + issueType: + description: >- + The type of incident for Jira connectors. For example, + 10006. To obtain the list of valid values, set `subAction` + to `issueTypes`. + type: integer + labels: + description: > + The labels for the incident for Jira connectors. NOTE: + Labels cannot contain spaces. + items: + type: string + type: array + malware_hash: + description: >- + A list of malware hashes related to the security incident + for ServiceNow SecOps connectors. The hashes are added as + observables to the security incident. + oneOf: + - type: string + - items: + type: string + type: array + malware_url: + description: >- + A list of malware URLs related to the security incident for + ServiceNow SecOps connectors. The URLs are added as + observables to the security incident. + oneOf: + - type: string + - items: + type: string + type: array + type: string + otherFields: + additionalProperties: true + description: > + Custom field identifiers and their values for Jira + connectors. + maxProperties: 20 + type: object + parent: + description: >- + The ID or key of the parent issue for Jira connectors. + Applies only to `Sub-task` types of issues. + type: string + priority: + description: >- + The priority of the incident in Jira and ServiceNow SecOps + connectors. + type: string + ruleName: + description: The rule name for Swimlane connectors. + type: string + severity: + description: >- + The severity of the incident for ServiceNow ITSM and + Swimlane connectors. + type: string + short_description: + description: > + A short description of the incident for ServiceNow ITSM and + ServiceNow SecOps connectors. It is used for searching the + contents of the knowledge base. + type: string + source_ip: + description: >- + A list of source IP addresses related to the security + incident for ServiceNow SecOps connectors. The IPs are added + as observables to the security incident. + oneOf: + - type: string + - items: + type: string + type: array + status: + description: >- + The status of the incident for Webhook - Case Management + connectors. + type: string + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM and + ServiceNow SecOps connectors. + type: string + summary: + description: A summary of the incident for Jira connectors. + type: string + tags: + description: A list of tags for Webhook - Case Management connectors. + items: + type: string + type: array + title: + description: > + A title for the incident for Jira and Webhook - Case + Management connectors. It is used for searching the contents + of the knowledge base. + type: string + urgency: + description: The urgency of the incident for ServiceNow ITSM connectors. + type: string + required: + - subAction + - subActionParams + Connectors_run_connector_subaction_validchannelid: + description: > + Retrieves information about a valid Slack channel identifier. It is + applicable only when the connector type is `.slack_api`. + properties: + subAction: + description: The action to test. enum: - - success - - failure - - pending - type: string - updated: - format: date-time - type: string - version: + - validChannelId type: string + subActionParams: + type: object + properties: + channelId: + description: The Slack channel identifier. + example: C123ABC456 + type: string + required: + - channelId required: - - id - - completed - - destinationIndex - - status - - sourceIndex - - version - - updated - Security_Solution_Detections_API_MigrationStatus: + - subAction + - subActionParams + title: The validChannelId subaction type: object + Connectors_secrets_properties_bedrock: + description: Defines secrets for connectors when type is `.bedrock`. properties: - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - status: - enum: - - success - - failure - - pending + accessKey: + description: The AWS access key for authentication. type: string - updated: - format: date-time + secret: + description: The AWS secret for authentication. type: string - version: - type: integer required: - - id - - status - - version - - updated - Security_Solution_Detections_API_NewTermsFields: - items: - type: string - maxItems: 3 - minItems: 1 - type: array - Security_Solution_Detections_API_NewTermsRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleResponseFields - Security_Solution_Detections_API_NewTermsRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleDefaultableFields - Security_Solution_Detections_API_NewTermsRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateFields - Security_Solution_Detections_API_NewTermsRuleDefaultableFields: + - accessKey + - secret + title: Connector secrets properties for an Amazon Bedrock connector type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_NewTermsRuleOptionalFields: + Connectors_secrets_properties_cases_webhook: + title: Connector secrets properties for Webhook - Case Management connector type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - Security_Solution_Detections_API_NewTermsRulePatchFields: - allOf: - - type: object - properties: - history_window_start: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_HistoryWindowStart - new_terms_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsFields - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - type: - description: Rule type - enum: - - new_terms - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleDefaultableFields - Security_Solution_Detections_API_NewTermsRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRulePatchFields - Security_Solution_Detections_API_NewTermsRuleRequiredFields: + password: + description: >- + The password for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + user: + description: >- + The username for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + Connectors_secrets_properties_d3security: + description: Defines secrets for connectors when type is `.d3security`. type: object properties: - history_window_start: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_HistoryWindowStart - new_terms_fields: - $ref: '#/components/schemas/Security_Solution_Detections_API_NewTermsFields' - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - type: - description: Rule type - enum: - - new_terms + token: + description: The D3 Security token. type: string required: - - type - - query - - new_terms_fields - - history_window_start - Security_Solution_Detections_API_NewTermsRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_NewTermsRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateFields - Security_Solution_Detections_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Detections_API_NormalizedRuleAction: - additionalProperties: false - type: object + - token + title: Connector secrets properties for a D3 Security connector + Connectors_secrets_properties_email: + description: Defines secrets for connectors when type is `.email`. properties: - alerts_filter: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionAlertsFilter - frequency: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionFrequency - group: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionGroup - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleActionId' - params: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionParams - required: - - id - - params - Security_Solution_Detections_API_NormalizedRuleError: + clientSecret: + description: > + The Microsoft Exchange Client secret for OAuth 2.0 client + credentials authentication. It must be URL-encoded. If `service` is + `exchange_server`, this property is required. + type: string + password: + description: > + The password for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + user: + description: > + The username for HTTP basic authentication. If `hasAuth` is set to + `true`, this property is required. + type: string + title: Connector secrets properties for an email connector type: object + Connectors_secrets_properties_gemini: + description: Defines secrets for connectors when type is `.gemini`. properties: - err_code: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BulkActionsDryRunErrCode - message: + credentialsJSON: + description: >- + The service account credentials JSON file. The service account + should have Vertex AI user IAM role assigned to it. type: string - rules: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDetailsInError - type: array - status_code: - type: integer required: - - message - - status_code - - rules - Security_Solution_Detections_API_OsqueryParams: + - credentialsJSON + title: Connector secrets properties for a Google Gemini connector type: object + Connectors_secrets_properties_genai: + description: Defines secrets for connectors when type is `.gen-ai`. properties: - ecs_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_EcsMapping' - pack_id: - type: string - queries: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_OsqueryQuery' - type: array - query: - type: string - saved_query_id: + apiKey: + description: The OpenAI API key. type: string - timeout: - type: number - Security_Solution_Detections_API_OsqueryQuery: + title: Connector secrets properties for an OpenAI connector + type: object + Connectors_secrets_properties_jira: + description: Defines secrets for connectors when type is `.jira`. type: object properties: - ecs_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_EcsMapping' - id: - description: Query ID - type: string - platform: - type: string - query: - description: Query to run + apiToken: + description: The Jira API authentication token for HTTP basic authentication. type: string - removed: - type: boolean - snapshot: - type: boolean - version: - description: Query version + email: + description: The account email for HTTP Basic authentication. type: string required: - - id - - query - Security_Solution_Detections_API_OsqueryResponseAction: + - apiToken + - email + title: Connector secrets properties for a Jira connector + Connectors_secrets_properties_opsgenie: + description: Defines secrets for connectors when type is `.opsgenie`. type: object properties: - action_type_id: - enum: - - .osquery + apiKey: + description: The Opsgenie API authentication key for HTTP Basic authentication. type: string - params: - $ref: '#/components/schemas/Security_Solution_Detections_API_OsqueryParams' required: - - action_type_id - - params - Security_Solution_Detections_API_PlatformErrorResponse: - type: object + - apiKey + title: Connector secrets properties for an Opsgenie connector + Connectors_secrets_properties_pagerduty: + description: Defines secrets for connectors when type is `.pagerduty`. properties: - error: - type: string - message: + routingKey: + description: > + A 32 character PagerDuty Integration Key for an integration on a + service. type: string - statusCode: - type: integer required: - - statusCode - - error - - message - Security_Solution_Detections_API_ProcessesParams: + - routingKey + title: Connector secrets properties for a PagerDuty connector + type: object + Connectors_secrets_properties_resilient: + description: Defines secrets for connectors when type is `.resilient`. type: object properties: - command: - enum: - - kill-process - - suspend-process + apiKeyId: + description: The authentication key ID for HTTP Basic authentication. type: string - comment: + apiKeySecret: + description: The authentication key secret for HTTP Basic authentication. type: string - config: - type: object - properties: - field: - description: Field to use instead of process.pid - type: string - overwrite: - default: true - description: Whether to overwrite field with process.pid - type: boolean - required: - - field required: - - command - - config - Security_Solution_Detections_API_QueryRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleResponseFields - Security_Solution_Detections_API_QueryRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleDefaultableFields - Security_Solution_Detections_API_QueryRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateFields - Security_Solution_Detections_API_QueryRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - Security_Solution_Detections_API_QueryRuleOptionalFields: - type: object + - apiKeyId + - apiKeySecret + title: Connector secrets properties for IBM Resilient connector + Connectors_secrets_properties_sentinelone: + description: Defines secrets for connectors when type is `.sentinelone`. properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - response_actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ResponseAction - type: array - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - Security_Solution_Detections_API_QueryRulePatchFields: - allOf: - - type: object - properties: - type: - description: Rule type - enum: - - query - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleDefaultableFields - Security_Solution_Detections_API_QueryRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRulePatchFields - Security_Solution_Detections_API_QueryRuleRequiredFields: + token: + description: The A SentinelOne API token. + type: string + required: + - token + title: Connector secrets properties for a SentinelOne connector type: object + Connectors_secrets_properties_servicenow: + description: >- + Defines secrets for connectors when type is `.servicenow`, + `.servicenow-sir`, or `.servicenow-itom`. properties: - type: - description: Rule type - enum: - - query + clientSecret: + description: >- + The client secret assigned to your OAuth application. This property + is required when `isOAuth` is `true`. type: string - required: - - type - Security_Solution_Detections_API_QueryRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - required: - - query - - language - Security_Solution_Detections_API_QueryRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateFields - Security_Solution_Detections_API_RelatedIntegration: - description: > - Related integration is a potential dependency of a rule. It's assumed - that if the user installs - - one of the related integrations of a rule, the rule might start to work - properly because it will - - have source events (generated by this integration) potentially matching - the rule's query. - - - NOTE: Proper work is not guaranteed, because a related integration, if - installed, can be - - configured differently or generate data that is not necessarily relevant - for this rule. - - - Related integration is a combination of a Fleet package and (optionally) - one of the - - package's "integrations" that this package contains. It is represented - by 3 properties: - - - - `package`: name of the package (required, unique id) - - - `version`: version of the package (required, semver-compatible) - - - `integration`: name of the integration of this package (optional, id - within the package) - - - There are Fleet packages like `windows` that contain only one - integration; in this case, - - `integration` should be unspecified. There are also packages like `aws` - and `azure` that contain - - several integrations; in this case, `integration` should be specified. - - - @example - - const x: RelatedIntegration = { - package: 'windows', - version: '1.5.x', - }; - - - @example - - const x: RelatedIntegration = { - package: 'azure', - version: '~1.1.6', - integration: 'activitylogs', - }; + password: + description: >- + The password for HTTP basic authentication. This property is + required when `isOAuth` is `false`. + type: string + privateKey: + description: >- + The RSA private key that you created for use in ServiceNow. This + property is required when `isOAuth` is `true`. + type: string + privateKeyPassword: + description: >- + The password for the RSA private key. This property is required when + `isOAuth` is `true` and you set a password on your private key. + type: string + username: + description: >- + The username for HTTP basic authentication. This property is + required when `isOAuth` is `false`. + type: string + title: >- + Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and + ServiceNow SecOps connectors + type: object + Connectors_secrets_properties_slack_api: + description: Defines secrets for connectors when type is `.slack`. type: object properties: - integration: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - package: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - version: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' + token: + description: Slack bot user OAuth token. + type: string required: - - package - - version - Security_Solution_Detections_API_RelatedIntegrationArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegration - type: array - Security_Solution_Detections_API_RequiredField: - description: > - Describes an Elasticsearch field that is needed for the rule to - function. - - - Almost all types of Security rules check source event documents for a - match to some kind of - - query or filter. If a document has certain field with certain values, - then it's a match and - - the rule will generate an alert. - - - Required field is an event field that must be present in the source - indices of a given rule. - - - @example - - const standardEcsField: RequiredField = { - name: 'event.action', - type: 'keyword', - ecs: true, - }; - - - @example - - const nonEcsField: RequiredField = { - name: 'winlog.event_data.AttributeLDAPDisplayName', - type: 'keyword', - ecs: false, - }; + - token + title: Connector secrets properties for a Web API Slack connector + Connectors_secrets_properties_slack_webhook: + description: Defines secrets for connectors when type is `.slack`. type: object properties: - ecs: - description: Whether the field is an ECS field - type: boolean - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Name of an Elasticsearch field - type: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Type of the Elasticsearch field + webhookUrl: + description: Slack webhook url. + type: string required: - - name - - type - - ecs - Security_Solution_Detections_API_RequiredFieldArray: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_RequiredField' - type: array - Security_Solution_Detections_API_RequiredFieldInput: - description: >- - Input parameters to create a RequiredField. Does not include the `ecs` - field, because `ecs` is calculated on the backend based on the field - name and type. + - webhookUrl + title: Connector secrets properties for a Webhook Slack connector + Connectors_secrets_properties_swimlane: + description: Defines secrets for connectors when type is `.swimlane`. + properties: + apiToken: + description: Swimlane API authentication token. + type: string + title: Connector secrets properties for a Swimlane connector type: object + Connectors_secrets_properties_teams: + description: Defines secrets for connectors when type is `.teams`. properties: - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Name of an Elasticsearch field - type: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: Type of an Elasticsearch field + webhookUrl: + description: > + The URL of the incoming webhook. If you are using the + `xpack.actions.allowedHosts` setting, add the hostname to the + allowed hosts. + type: string required: - - name - - type - Security_Solution_Detections_API_ResponseAction: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_OsqueryResponseAction - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EndpointResponseAction - Security_Solution_Detections_API_ResponseFields: + - webhookUrl + title: Connector secrets properties for a Microsoft Teams connector type: object + Connectors_secrets_properties_tines: + description: Defines secrets for connectors when type is `.tines`. properties: - created_at: - format: date-time - type: string - created_by: - type: string - execution_summary: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionSummary - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleObjectId' - immutable: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleImmutable - required_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldArray - revision: - minimum: 0 - type: integer - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_source: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleSource' - updated_at: - format: date-time + email: + description: The email used to sign in to Tines. type: string - updated_by: + token: + description: The Tines API token. type: string required: - - id - - rule_id - - immutable - - updated_at - - updated_by - - created_at - - created_by - - revision - - related_integrations - - required_fields - Security_Solution_Detections_API_RiskScore: - description: Risk score (0 to 100) - maximum: 100 - minimum: 0 - type: integer - Security_Solution_Detections_API_RiskScoreMapping: - description: >- - Overrides generated alerts' risk_score with a value from the source - event - items: - type: object - properties: - field: - type: string - operator: - enum: - - equals - type: string - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - value: - type: string - required: - - field - - operator - - value - type: array - Security_Solution_Detections_API_RuleAction: + - email + - token + title: Connector secrets properties for a Tines connector type: object + Connectors_secrets_properties_torq: + description: Defines secrets for connectors when type is `.torq`. properties: - action_type_id: - description: The action type used for sending notifications. + token: + description: The secret of the webhook authentication header. type: string - alerts_filter: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionAlertsFilter - frequency: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionFrequency - group: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionGroup - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleActionId' - params: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionParams - uuid: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' required: - - action_type_id - - id - - params - Security_Solution_Detections_API_RuleActionAlertsFilter: - additionalProperties: true - type: object - Security_Solution_Detections_API_RuleActionFrequency: - description: >- - The action frequency defines when the action runs (for example, only on - rule execution or at specific time intervals). + - token + title: Connector secrets properties for a Torq connector type: object + Connectors_secrets_properties_webhook: + description: Defines secrets for connectors when type is `.webhook`. properties: - notifyWhen: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionNotifyWhen - summary: + crt: description: >- - Action summary indicates whether we will send a summary notification - about all the generate alerts or notification per individual alert - type: boolean - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - nullable: true - required: - - summary - - notifyWhen - - throttle - Security_Solution_Detections_API_RuleActionGroup: - description: >- - Optionally groups actions by use cases. Use `default` for alert - notifications. - type: string - Security_Solution_Detections_API_RuleActionId: - description: The connector ID. - type: string - Security_Solution_Detections_API_RuleActionNotifyWhen: - description: >- - The condition for throttling the notification: `onActionGroupChange`, - `onActiveAlert`, or `onThrottleInterval` - enum: - - onActiveAlert - - onThrottleInterval - - onActionGroupChange - type: string - Security_Solution_Detections_API_RuleActionParams: - additionalProperties: true - description: >- - Object containing the allowed connector fields, which varies according - to the connector type. + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT + file. + type: string + key: + description: >- + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-crt-key`, it is a base64 encoded version of the KEY file. + type: string + password: + description: > + The password for HTTP basic authentication or the passphrase for the + SSL certificate files. If `hasAuth` is set to `true` and `authType` + is `webhook-authentication-basic`, this property is required. + type: string + pfx: + description: >- + If `authType` is `webhook-authentication-ssl` and `certType` is + `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + type: string + user: + description: > + The username for HTTP basic authentication. If `hasAuth` is set to + `true` and `authType` is `webhook-authentication-basic`, this + property is required. + type: string + title: Connector secrets properties for a Webhook connector type: object - Security_Solution_Detections_API_RuleActionThrottle: - description: Defines how often rule actions are taken. - oneOf: - - enum: - - no_actions - - rule + Connectors_secrets_properties_xmatters: + description: Defines secrets for connectors when type is `.xmatters`. + properties: + password: + description: > + A user name for HTTP basic authentication. It is applicable only + when `usesBasic` is `true`. type: string - - description: 'Time interval in seconds, minutes, hours, or days.' - example: 1h - pattern: '^[1-9]\d*[smhd]$' + secretsUrl: + description: > + The request URL for the Elastic Alerts trigger in xMatters with the + API key included in the URL. It is applicable only when `usesBasic` + is `false`. type: string - Security_Solution_Detections_API_RuleAuthorArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleCreateProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateProps + user: + description: > + A password for HTTP basic authentication. It is applicable only when + `usesBasic` is `true`. + type: string + title: Connector secrets properties for an xMatters connector + type: object + Connectors_update_connector_request: + description: The properties vary depending on the connector type. + oneOf: + - $ref: '#/components/schemas/Connectors_update_connector_request_bedrock' + - $ref: '#/components/schemas/Connectors_update_connector_request_gemini' - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleCreateProps + #/components/schemas/Connectors_update_connector_request_cases_webhook + - $ref: '#/components/schemas/Connectors_update_connector_request_d3security' + - $ref: '#/components/schemas/Connectors_update_connector_request_email' + - $ref: '#/components/schemas/Connectors_create_connector_request_genai' + - $ref: '#/components/schemas/Connectors_update_connector_request_index' + - $ref: '#/components/schemas/Connectors_update_connector_request_jira' + - $ref: '#/components/schemas/Connectors_update_connector_request_opsgenie' + - $ref: '#/components/schemas/Connectors_update_connector_request_pagerduty' + - $ref: '#/components/schemas/Connectors_update_connector_request_resilient' + - $ref: '#/components/schemas/Connectors_update_connector_request_sentinelone' + - $ref: '#/components/schemas/Connectors_update_connector_request_serverlog' + - $ref: '#/components/schemas/Connectors_update_connector_request_servicenow' - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleCreateProps + #/components/schemas/Connectors_update_connector_request_servicenow_itom + - $ref: '#/components/schemas/Connectors_update_connector_request_slack_api' - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleCreateProps - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleDescription: - minLength: 1 - type: string - Security_Solution_Detections_API_RuleDetailsInError: + #/components/schemas/Connectors_update_connector_request_slack_webhook + - $ref: '#/components/schemas/Connectors_update_connector_request_swimlane' + - $ref: '#/components/schemas/Connectors_update_connector_request_teams' + - $ref: '#/components/schemas/Connectors_update_connector_request_tines' + - $ref: '#/components/schemas/Connectors_update_connector_request_torq' + - $ref: '#/components/schemas/Connectors_update_connector_request_webhook' + - $ref: '#/components/schemas/Connectors_update_connector_request_xmatters' + title: Update connector request body properties + Connectors_update_connector_request_bedrock: + title: Update Amazon Bedrock connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_bedrock' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_bedrock' + required: + - config + - name + Connectors_update_connector_request_cases_webhook: + title: Update Webhook - Case Managment connector request type: object properties: - id: - type: string + config: + $ref: '#/components/schemas/Connectors_config_properties_cases_webhook' name: + description: The display name for the connector. + example: my-connector type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_cases_webhook' required: - - id - Security_Solution_Detections_API_RuleExceptionList: + - config + - name + Connectors_update_connector_request_d3security: + title: Update D3 Security connector request type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: ID of the exception container - list_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - description: List ID of the exception container - namespace_type: - description: Determines the exceptions validity in rule's Kibana space - enum: - - agnostic - - single + config: + $ref: '#/components/schemas/Connectors_config_properties_d3security' + name: + description: The display name for the connector. type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ExceptionListType + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_d3security' required: - - id - - list_id - - type - - namespace_type - Security_Solution_Detections_API_RuleExecutionMetrics: + - config + - name + - secrets + Connectors_update_connector_request_email: + title: Update email connector request type: object properties: - execution_gap_duration_s: - description: Duration in seconds of execution gap - minimum: 0 - type: integer - total_enrichment_duration_ms: - description: >- - Total time spent enriching documents during current rule execution - cycle - minimum: 0 - type: integer - total_indexing_duration_ms: - description: >- - Total time spent indexing documents during current rule execution - cycle - minimum: 0 - type: integer - total_search_duration_ms: - description: >- - Total time spent performing ES searches as measured by Kibana; - includes network latency and time spent serializing/deserializing - request/response - minimum: 0 - type: integer - Security_Solution_Detections_API_RuleExecutionStatus: - description: >- - Custom execution status of Security rules that is different from the - status used in the Alerting Framework. We merge our custom status with - the Framework's status to determine the resulting status of a rule. - - - going to run - @deprecated Replaced by the 'running' status but left - for backwards compatibility with rule execution events already written - to Event Log in the prior versions of Kibana. Don't use when writing - rule status changes. - - - running - Rule execution started but not reached any intermediate or - final status. - - - partial failure - Rule can partially fail for various reasons either - in the middle of an execution (in this case we update its status right - away) or in the end of it. So currently this status can be both - intermediate and final at the same time. A typical reason for a partial - failure: not all the indices that the rule searches over actually exist. - - - failed - Rule failed to execute due to unhandled exception or a reason - defined in the business logic of its executor function. - - - succeeded - Rule executed successfully without any issues. Note: this - status is just an indication of a rule's "health". The rule might or - might not generate any alerts despite of it. - enum: - - going to run - - running - - partial failure - - failed - - succeeded - type: string - Security_Solution_Detections_API_RuleExecutionStatusOrder: - type: integer - Security_Solution_Detections_API_RuleExecutionSummary: + config: + $ref: '#/components/schemas/Connectors_config_properties_email' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_email' + required: + - config + - name + Connectors_update_connector_request_gemini: + title: Update Google Gemini connector request type: object properties: - last_execution: - type: object - properties: - date: - description: Date of the last execution - format: date-time - type: string - message: - type: string - metrics: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionMetrics - status: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionStatus - description: Status of the last execution - status_order: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExecutionStatusOrder - required: - - date - - status - - status_order - - message - - metrics + config: + $ref: '#/components/schemas/Connectors_config_properties_gemini' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_gemini' required: - - last_execution - Security_Solution_Detections_API_RuleFalsePositiveArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleFilterArray: - items: {} - type: array - Security_Solution_Detections_API_RuleInterval: - description: >- - Frequency of rule execution, using a date math range. For example, "1h" - means the rule runs every hour. Defaults to 5m (5 minutes). - type: string - Security_Solution_Detections_API_RuleIntervalFrom: - description: >- - Time from which data is analyzed each time the rule runs, using a date - math range. For example, now-4200s means the rule analyzes data from 70 - minutes before its start time. Defaults to now-6m (analyzes data from 6 - minutes before the start time). - format: date-math - type: string - Security_Solution_Detections_API_RuleIntervalTo: - type: string - Security_Solution_Detections_API_RuleLicense: - description: The rule's license. - type: string - Security_Solution_Detections_API_RuleMetadata: - additionalProperties: true + - config + - name + Connectors_update_connector_request_index: + title: Update index connector request type: object - Security_Solution_Detections_API_RuleName: - minLength: 1 - type: string - Security_Solution_Detections_API_RuleNameOverride: - description: Sets the source field for the alert's signal.rule.name value - type: string - Security_Solution_Detections_API_RuleObjectId: - $ref: '#/components/schemas/Security_Solution_Detections_API_UUID' - Security_Solution_Detections_API_RulePatchProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRulePatchProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRulePatchProps - Security_Solution_Detections_API_RulePreviewLogs: + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_index' + name: + description: The display name for the connector. + type: string + required: + - config + - name + Connectors_update_connector_request_jira: + title: Update Jira connector request type: object properties: - duration: - description: Execution duration in milliseconds - type: integer - errors: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array - startedAt: - $ref: '#/components/schemas/Security_Solution_Detections_API_NonEmptyString' - warnings: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: array + config: + $ref: '#/components/schemas/Connectors_config_properties_jira' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_jira' required: - - errors - - warnings - - duration - Security_Solution_Detections_API_RulePreviewParams: + - config + - name + - secrets + Connectors_update_connector_request_opsgenie: + title: Update Opsgenie connector request type: object properties: - invocationCount: - type: integer - timeframeEnd: - format: date-time + config: + $ref: '#/components/schemas/Connectors_config_properties_opsgenie' + name: + description: The display name for the connector. type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_opsgenie' required: - - invocationCount - - timeframeEnd - Security_Solution_Detections_API_RuleQuery: - type: string - Security_Solution_Detections_API_RuleReferenceArray: - items: - type: string - type: array - Security_Solution_Detections_API_RuleResponse: - anyOf: - - $ref: '#/components/schemas/Security_Solution_Detections_API_EqlRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_QueryRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdRule' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRule - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRule - - $ref: '#/components/schemas/Security_Solution_Detections_API_NewTermsRule' - - $ref: '#/components/schemas/Security_Solution_Detections_API_EsqlRule' - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleSignatureId: - description: 'Could be any string, not necessarily a UUID' - type: string - Security_Solution_Detections_API_RuleSource: - description: >- - Discriminated union that determines whether the rule is internally - sourced (created within the Kibana app) or has an external source, such - as the Elastic Prebuilt rules repo. - discriminator: - propertyName: type - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ExternalRuleSource - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InternalRuleSource - Security_Solution_Detections_API_RuleTagArray: - description: >- - String array containing words and phrases to help categorize, filter, - and search rules. Defaults to an empty array. - items: - type: string - type: array - Security_Solution_Detections_API_RuleUpdateProps: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EqlRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_QueryRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_MachineLearningRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NewTermsRuleUpdateProps - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_EsqlRuleUpdateProps - discriminator: - propertyName: type - Security_Solution_Detections_API_RuleVersion: - description: The rule's version number. - minimum: 1 - type: integer - Security_Solution_Detections_API_SavedObjectResolveAliasPurpose: - enum: - - savedObjectConversion - - savedObjectImport - type: string - Security_Solution_Detections_API_SavedObjectResolveAliasTargetId: - type: string - Security_Solution_Detections_API_SavedObjectResolveOutcome: - enum: - - exactMatch - - aliasMatch - - conflict - type: string - Security_Solution_Detections_API_SavedQueryId: - type: string - Security_Solution_Detections_API_SavedQueryRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleResponseFields - Security_Solution_Detections_API_SavedQueryRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleDefaultableFields - Security_Solution_Detections_API_SavedQueryRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateFields - Security_Solution_Detections_API_SavedQueryRuleDefaultableFields: + - config + - name + - secrets + Connectors_update_connector_request_pagerduty: + title: Update PagerDuty connector request type: object properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_SavedQueryRuleOptionalFields: + config: + $ref: '#/components/schemas/Connectors_config_properties_pagerduty' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_pagerduty' + required: + - config + - name + - secrets + Connectors_update_connector_request_resilient: + title: Update IBM Resilient connector request type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - response_actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ResponseAction - type: array - Security_Solution_Detections_API_SavedQueryRulePatchFields: - allOf: - - type: object - properties: - saved_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryId - type: - description: Rule type - enum: - - saved_query - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleDefaultableFields - Security_Solution_Detections_API_SavedQueryRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRulePatchFields - Security_Solution_Detections_API_SavedQueryRuleRequiredFields: + config: + $ref: '#/components/schemas/Connectors_config_properties_resilient' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_resilient' + required: + - config + - name + - secrets + Connectors_update_connector_request_sentinelone: + title: Update SentinelOne connector request type: object properties: - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - type: - description: Rule type - enum: - - saved_query + config: + $ref: '#/components/schemas/Connectors_config_properties_sentinelone' + name: + description: The display name for the connector. type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_sentinelone' required: - - type - - saved_id - Security_Solution_Detections_API_SavedQueryRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_SavedQueryRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedQueryRuleCreateFields - Security_Solution_Detections_API_SetAlertsStatusByIds: + - config + - name + - secrets + Connectors_update_connector_request_serverlog: + title: Update server log connector request type: object properties: - signal_ids: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - minItems: 1 - type: array - status: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertStatus' + name: + description: The display name for the connector. + type: string required: - - signal_ids - - status - Security_Solution_Detections_API_SetAlertsStatusByQuery: + - name + Connectors_update_connector_request_servicenow: + title: Update ServiceNow ITSM connector or ServiceNow SecOps request type: object properties: - conflicts: - default: abort - enum: - - abort - - proceed + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow' + name: + description: The display name for the connector. type: string - query: - additionalProperties: true - type: object - status: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertStatus' + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - query - - status - Security_Solution_Detections_API_SetAlertTags: + - config + - name + - secrets + Connectors_update_connector_request_servicenow_itom: + title: Create ServiceNow ITOM connector request type: object properties: - tags_to_add: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTags' - tags_to_remove: - $ref: '#/components/schemas/Security_Solution_Detections_API_AlertTags' + config: + $ref: '#/components/schemas/Connectors_config_properties_servicenow_itom' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_servicenow' required: - - tags_to_add - - tags_to_remove - Security_Solution_Detections_API_SetupGuide: - type: string - Security_Solution_Detections_API_Severity: - description: Severity of the rule - enum: - - low - - medium - - high - - critical - type: string - Security_Solution_Detections_API_SeverityMapping: - description: Overrides generated alerts' severity with values from the source event - items: - type: object - properties: - field: - type: string - operator: - enum: - - equals - type: string - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - value: - type: string - required: - - field - - operator - - severity - - value - type: array - Security_Solution_Detections_API_SiemErrorResponse: + - config + - name + - secrets + Connectors_update_connector_request_slack_api: + title: Update Slack connector request type: object properties: - message: + config: + $ref: '#/components/schemas/Connectors_config_properties_slack_api' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_api' + required: + - name + - secrets + Connectors_update_connector_request_slack_webhook: + title: Update Slack connector request + type: object + properties: + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_slack_webhook' + required: + - name + - secrets + Connectors_update_connector_request_swimlane: + title: Update Swimlane connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_swimlane' + name: + description: The display name for the connector. + example: my-connector + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_swimlane' + required: + - config + - name + - secrets + Connectors_update_connector_request_teams: + title: Update Microsoft Teams connector request + type: object + properties: + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_teams' + required: + - name + - secrets + Connectors_update_connector_request_tines: + title: Update Tines connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_tines' + name: + description: The display name for the connector. + type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_tines' + required: + - config + - name + - secrets + Connectors_update_connector_request_torq: + title: Update Torq connector request + type: object + properties: + config: + $ref: '#/components/schemas/Connectors_config_properties_torq' + name: + description: The display name for the connector. type: string - status_code: - type: integer + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_torq' required: - - status_code - - message - Security_Solution_Detections_API_SkippedAlertsIndexMigration: + - config + - name + - secrets + Connectors_update_connector_request_webhook: + title: Update Webhook connector request type: object properties: - index: + config: + $ref: '#/components/schemas/Connectors_config_properties_webhook' + name: + description: The display name for the connector. type: string + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_webhook' required: - - index - Security_Solution_Detections_API_SortOrder: - enum: - - asc - - desc - type: string - Security_Solution_Detections_API_Threat: + - config + - name + - secrets + Connectors_update_connector_request_xmatters: + title: Update xMatters connector request type: object properties: - framework: - description: Relevant attack framework + config: + $ref: '#/components/schemas/Connectors_config_properties_xmatters' + name: + description: The display name for the connector. type: string - tactic: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatTactic' - technique: - description: Array containing information on the attack techniques (optional) - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatTechnique - type: array + secrets: + $ref: '#/components/schemas/Connectors_secrets_properties_xmatters' required: - - framework - - tactic - Security_Solution_Detections_API_ThreatArray: - items: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threat' - type: array - Security_Solution_Detections_API_ThreatFilters: - items: - description: >- - Query and filter context array used to filter documents from the - Elasticsearch index containing the threat values - type: array - Security_Solution_Detections_API_ThreatIndex: - items: - type: string - type: array - Security_Solution_Detections_API_ThreatIndicatorPath: - description: >- - Defines the path to the threat indicator in the indicator documents - (optional) - type: string - Security_Solution_Detections_API_ThreatMapping: - items: - type: object - properties: - entries: - items: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - type: - enum: - - mapping - type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_NonEmptyString - required: - - field - - type - - value - type: array - required: - - entries - minItems: 1 - type: array - Security_Solution_Detections_API_ThreatMatchRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleResponseFields - Security_Solution_Detections_API_ThreatMatchRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields - Security_Solution_Detections_API_ThreatMatchRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateFields - Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields: - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThreatMatchRuleOptionalFields: + - config + - name + - secrets + Data_views_400_response: + title: Bad request type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppression - concurrent_searches: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ConcurrentSearches - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - items_per_search: - $ref: '#/components/schemas/Security_Solution_Detections_API_ItemsPerSearch' - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - threat_filters: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatFilters' - threat_indicator_path: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatIndicatorPath - threat_language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThreatMatchRulePatchFields: - allOf: - - type: object - properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threat_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatIndex - threat_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMapping - threat_query: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatQuery - type: - description: Rule type - enum: - - threat_match - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleDefaultableFields - Security_Solution_Detections_API_ThreatMatchRulePatchProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRulePatchFields - Security_Solution_Detections_API_ThreatMatchRuleRequiredFields: + error: + example: Bad Request + type: string + message: + type: string + statusCode: + example: 400 + type: number + required: + - statusCode + - error + - message + Data_views_404_response: type: object properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threat_index: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatIndex' - threat_mapping: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatMapping' - threat_query: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThreatQuery' - type: - description: Rule type + error: enum: - - threat_match + - Not Found + example: Not Found type: string - required: - - type - - query - - threat_query - - threat_mapping - - threat_index - Security_Solution_Detections_API_ThreatMatchRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_ThreatMatchRuleUpdateProps: - allOf: - - type: object + message: + example: >- + Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] + not found + type: string + statusCode: + enum: + - 404 + example: 404 + type: integer + Data_views_allownoindex: + description: Allows the data view saved object to exist before the data is available. + type: boolean + Data_views_create_data_view_request_object: + title: Create data view request + type: object + properties: + data_view: + description: The data view object. + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldAttrs: + additionalProperties: + $ref: '#/components/schemas/Data_views_fieldattrs' + type: object + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata + type: string name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo + description: The data view name. + type: string + namespaces: + $ref: '#/components/schemas/Data_views_namespaces' + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + type: + $ref: '#/components/schemas/Data_views_type' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta' version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion + type: string required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatMatchRuleCreateFields - Security_Solution_Detections_API_ThreatQuery: - description: Query to run - type: string - Security_Solution_Detections_API_ThreatSubtechnique: - type: object - properties: - id: - description: Subtechnique ID - type: string - name: - description: Subtechnique name - type: string - reference: - description: Subtechnique reference - type: string + - title + override: + default: false + description: >- + Override an existing data view if a data view with the provided + title already exists. + type: boolean required: - - id - - name - - reference - Security_Solution_Detections_API_ThreatTactic: + - data_view + Data_views_data_view_response_object: + title: Data view response properties type: object properties: - id: - description: Tactic ID - type: string - name: - description: Tactic name - type: string - reference: - description: Tactic reference - type: string - required: - - id - - name - - reference - Security_Solution_Detections_API_ThreatTechnique: + data_view: + type: object + properties: + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldAttrs: + additionalProperties: + $ref: '#/components/schemas/Data_views_fieldattrs' + type: object + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object + id: + example: ff959d40-b880-11e8-a6d9-e546fe2bba5f + type: string + name: + description: The data view name. + type: string + namespaces: + $ref: '#/components/schemas/Data_views_namespaces' + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta_response' + version: + example: WzQ2LDJd + type: string + Data_views_fieldattrs: + description: A map of field attributes by field name. type: object properties: - id: - description: Technique ID - type: string - name: - description: Technique name + count: + description: Popularity count for the field. + type: integer + customDescription: + description: Custom description for the field. + maxLength: 300 type: string - reference: - description: Technique reference + customLabel: + description: Custom label for the field. type: string - subtechnique: - description: Array containing more specific information on the attack technique - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatSubtechnique - type: array - required: - - id - - name - - reference - Security_Solution_Detections_API_Threshold: + Data_views_fieldformats: + description: A map of field formats by field name. type: object - properties: - cardinality: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdCardinality - field: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdField' - value: - $ref: '#/components/schemas/Security_Solution_Detections_API_ThresholdValue' - required: - - field - - value - Security_Solution_Detections_API_ThresholdAlertSuppression: + Data_views_namespaces: + description: >- + An array of space identifiers for sharing the data view between multiple + spaces. + items: + default: default + type: string + type: array + Data_views_runtimefieldmap: + description: A map of runtime field definitions by field name. type: object properties: - duration: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertSuppressionDuration + script: + type: object + properties: + source: + description: Script for the runtime field. + type: string + type: + description: Mapping type of the runtime field. + type: string required: - - duration - Security_Solution_Detections_API_ThresholdCardinality: + - script + - type + Data_views_sourcefilters: + description: The array of field names you want to filter out in Discover. items: type: object properties: - field: - type: string value: - minimum: 0 - type: integer + type: string required: - - field - value type: array - Security_Solution_Detections_API_ThresholdField: - description: Field to aggregate on - oneOf: - - type: string - - items: - type: string - type: array - Security_Solution_Detections_API_ThresholdRule: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - version - - tags - - enabled - - risk_score_mapping - - severity_mapping - - interval - - from - - to - - actions - - exceptions_list - - author - - false_positives - - references - - max_signals - - threat - - setup - - related_integrations - - required_fields - - $ref: '#/components/schemas/Security_Solution_Detections_API_ResponseFields' - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleResponseFields - Security_Solution_Detections_API_ThresholdRuleCreateFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleDefaultableFields - Security_Solution_Detections_API_ThresholdRuleCreateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput + Data_views_swap_data_view_request_object: + title: Data view reference swap request + type: object + properties: + delete: + description: Deletes referenced saved object if all references are removed. + type: boolean + forId: + description: Limit the affected saved objects to one or more by identifier. + oneOf: + - type: string + - items: + type: string type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateFields - Security_Solution_Detections_API_ThresholdRuleDefaultableFields: + forType: + description: Limit the affected saved objects by type. + type: string + fromId: + description: The saved object reference to change. + type: string + fromType: + description: > + Specify the type of the saved object reference to alter. The default + value is `index-pattern` for data views. + type: string + toId: + description: New saved object reference value to replace the old value. + type: string + required: + - fromId + - toId + Data_views_timefieldname: + description: 'The timestamp field name, which you use for time-based data views.' + type: string + Data_views_title: + description: >- + Comma-separated list of data streams, indices, and aliases that you want + to search. Supports wildcards (`*`). + type: string + Data_views_type: + description: 'When set to `rollup`, identifies the rollup data views.' + type: string + Data_views_typemeta: + description: >- + When you use rollup indices, contains the field list for the rollup data + view API endpoints. + type: object + properties: + aggs: + description: A map of rollup restrictions by aggregation type and field name. + type: object + params: + description: Properties for retrieving rollup fields. + type: object + required: + - aggs + - params + Data_views_typemeta_response: + description: >- + When you use rollup indices, contains the field list for the rollup data + view API endpoints. + nullable: true type: object properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - Security_Solution_Detections_API_ThresholdRuleOptionalFields: + aggs: + description: A map of rollup restrictions by aggregation type and field name. + type: object + params: + description: Properties for retrieving rollup fields. + type: object + Data_views_update_data_view_request_object: + title: Update data view request type: object properties: - alert_suppression: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdAlertSuppression - data_view_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_DataViewId' - filters: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFilterArray - index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IndexPatternArray - saved_id: - $ref: '#/components/schemas/Security_Solution_Detections_API_SavedQueryId' - Security_Solution_Detections_API_ThresholdRulePatchFields: - allOf: - - type: object - properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threshold: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threshold' - type: - description: Rule type - enum: - - threshold - type: string - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleDefaultableFields - Security_Solution_Detections_API_ThresholdRulePatchProps: - allOf: - - type: object + data_view: + description: > + The data view properties you want to update. Only the specified + properties are updated in the data view. Unspecified fields stay as + they are persisted. + type: object properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata + allowNoIndex: + $ref: '#/components/schemas/Data_views_allownoindex' + fieldFormats: + $ref: '#/components/schemas/Data_views_fieldformats' + fields: + type: object name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRulePatchFields - Security_Solution_Detections_API_ThresholdRuleRequiredFields: + type: string + runtimeFieldMap: + additionalProperties: + $ref: '#/components/schemas/Data_views_runtimefieldmap' + type: object + sourceFilters: + $ref: '#/components/schemas/Data_views_sourcefilters' + timeFieldName: + $ref: '#/components/schemas/Data_views_timefieldname' + title: + $ref: '#/components/schemas/Data_views_title' + type: + $ref: '#/components/schemas/Data_views_type' + typeMeta: + $ref: '#/components/schemas/Data_views_typemeta' + refresh_fields: + default: false + description: Reloads the data view fields after the data view is updated. + type: boolean + required: + - data_view + Fleet_agent: + title: Agent type: object properties: - query: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleQuery' - threshold: - $ref: '#/components/schemas/Security_Solution_Detections_API_Threshold' + access_api_key: + type: string + access_api_key_id: + type: string + active: + type: boolean + components: + items: + $ref: '#/components/schemas/Fleet_agent_component' + type: array + default_api_key: + type: string + default_api_key_id: + type: string + enrolled_at: + type: string + id: + type: string + last_checkin: + type: string + local_metadata: + $ref: '#/components/schemas/Fleet_agent_metadata' + metrics: + type: object + properties: + cpu_avg: + description: >- + Average agent CPU usage during the last 5 minutes, number + between 0-1 + type: number + memory_size_byte_avg: + description: Average agent memory consumption during the last 5 minutes + type: number + policy_id: + type: string + policy_revision: + type: number + status: + $ref: '#/components/schemas/Fleet_agent_status' type: - description: Rule type - enum: - - threshold + $ref: '#/components/schemas/Fleet_agent_type' + unenrolled_at: + type: string + unenrollment_started_at: type: string + user_provided_metadata: + $ref: '#/components/schemas/Fleet_agent_metadata' required: - type - - query - - threshold - Security_Solution_Detections_API_ThresholdRuleResponseFields: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleRequiredFields - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleOptionalFields - - type: object - properties: - language: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_KqlQueryLanguage - required: - - language - Security_Solution_Detections_API_ThresholdRuleUpdateProps: - allOf: - - type: object - properties: - actions: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAction - type: array - alias_purpose: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasPurpose - alias_target_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveAliasTargetId - author: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleAuthorArray - building_block_type: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_BuildingBlockType - description: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleDescription - enabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_IsRuleEnabled - exceptions_list: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleExceptionList - type: array - false_positives: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleFalsePositiveArray - from: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalFrom - id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleObjectId - interval: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleInterval - investigation_fields: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationFields - license: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleLicense - max_signals: - $ref: '#/components/schemas/Security_Solution_Detections_API_MaxSignals' - meta: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleMetadata - name: - $ref: '#/components/schemas/Security_Solution_Detections_API_RuleName' - namespace: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndexNamespace - note: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_InvestigationGuide - outcome: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SavedObjectResolveOutcome - output_index: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_AlertsIndex - references: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleReferenceArray - related_integrations: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RelatedIntegrationArray - required_fields: - items: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RequiredFieldInput - type: array - risk_score: - $ref: '#/components/schemas/Security_Solution_Detections_API_RiskScore' - risk_score_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RiskScoreMapping - rule_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleSignatureId - rule_name_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleNameOverride - setup: - $ref: '#/components/schemas/Security_Solution_Detections_API_SetupGuide' - severity: - $ref: '#/components/schemas/Security_Solution_Detections_API_Severity' - severity_mapping: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_SeverityMapping - tags: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleTagArray - threat: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThreatArray - throttle: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleActionThrottle - timeline_id: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateId - timeline_title: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimelineTemplateTitle - timestamp_override: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverride - timestamp_override_fallback_disabled: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_TimestampOverrideFallbackDisabled - to: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleIntervalTo - version: - $ref: >- - #/components/schemas/Security_Solution_Detections_API_RuleVersion - required: - - name - - description - - risk_score - - severity - - $ref: >- - #/components/schemas/Security_Solution_Detections_API_ThresholdRuleCreateFields - Security_Solution_Detections_API_ThresholdValue: - description: Threshold value - minimum: 1 - type: integer - Security_Solution_Detections_API_ThrottleForBulkActions: - description: >- - The condition for throttling the notification: 'rule', 'no_actions', or - time duration + - active + - enrolled_at + - id + - status + Fleet_agent_action: + oneOf: + - properties: + ack_data: + type: string + data: + type: string + type: + enum: + - UNENROLL + - UPGRADE + - POLICY_REASSIGN + type: string + - properties: + data: + type: object + properties: + log_level: + enum: + - debug + - info + - warning + - error + nullable: true + type: string + type: + type: string + title: Agent action + Fleet_agent_component: + title: Agent component + type: object + properties: + id: + type: string + message: + type: string + status: + $ref: '#/components/schemas/Fleet_agent_component_status' + type: + type: string + units: + items: + $ref: '#/components/schemas/Fleet_agent_component_unit' + type: array + Fleet_agent_component_status: enum: - - rule - - 1h - - 1d - - 7d - type: string - Security_Solution_Detections_API_TiebreakerField: - description: Sets a secondary field for sorting events - type: string - Security_Solution_Detections_API_TimelineTemplateId: - description: Timeline template ID - type: string - Security_Solution_Detections_API_TimelineTemplateTitle: - description: Timeline template title - type: string - Security_Solution_Detections_API_TimestampField: - description: Contains the event timestamp used for sorting a sequence of events - type: string - Security_Solution_Detections_API_TimestampOverride: - description: Sets the time field used to query indices - type: string - Security_Solution_Detections_API_TimestampOverrideFallbackDisabled: - description: Disables the fallback to the event's @timestamp field - type: boolean - Security_Solution_Detections_API_UUID: - description: A universally unique identifier - format: uuid + - starting + - configuring + - healthy + - degraded + - failed + - stopping + - stopped + title: Agent component status type: string - Security_Solution_Detections_API_WarningSchema: + Fleet_agent_component_unit: + title: Agent component unit type: object properties: - actionPath: - type: string - buttonLabel: + id: type: string message: type: string + payload: + type: object + status: + $ref: '#/components/schemas/Fleet_agent_component_status' type: + $ref: '#/components/schemas/Fleet_agent_component_unit_type' + Fleet_agent_component_unit_type: + enum: + - input + - output + title: Agent component unit type + type: string + Fleet_agent_diagnostics: + title: Agent diagnostics + type: object + properties: + actionId: + type: string + createTime: + type: string + filePath: + type: string + id: + type: string + name: type: string + status: + enum: + - READY + - AWAITING_UPLOAD + - DELETED + - IN_PROGRESS required: - - type - - message - - actionPath - Security_Solution_Endpoint_Exceptions_API_EndpointList: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionList - - additionalProperties: false - type: object - Security_Solution_Endpoint_Exceptions_API_EndpointListItem: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItem - Security_Solution_Endpoint_Exceptions_API_ExceptionList: + - id + - name + - createTime + - filePath + - actionId + - status + Fleet_agent_get_by_actions: + items: + items: + type: string + type: array + title: Agents get by action ids + type: array + Fleet_agent_metadata: + title: Agent metadata + type: object + Fleet_agent_policy: + title: Agent Policy type: object properties: - _version: + advanced_settings: + description: >- + Advanced settings stored in the agent policy, e.g. + agent_limits_go_max_procs + nullable: true + type: object + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + agents: + type: number + data_output_id: + nullable: true type: string - created_at: - format: date-time + description: type: string - created_by: + download_source_id: + nullable: true + type: string + fleet_server_host_id: + nullable: true + type: string + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array + id: + type: string + inactivity_timeout: + type: integer + is_protected: + description: >- + Indicates whether the agent policy has tamper protection enabled. + Default false. + type: boolean + keep_monitoring_alive: + description: >- + When set to true, monitoring will be enabled but logs/metrics + collection will be disabled + nullable: true + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string + type: array + monitoring_output_id: + nullable: true type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListDescription - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListId - immutable: - type: boolean - list_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListMeta name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListTags - tie_breaker_id: type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListType - updated_at: - format: date-time + namespace: type: string + overrides: + description: >- + Override settings that are defined in the agent policy. Input + settings cannot be overridden. The override option should be used + only in unusual circumstances and not as a routine procedure. + nullable: true + type: object + package_policies: + description: >- + This field is present only when retrieving a single agent policy, or + when retrieving a list of agent policies with the ?full=true + parameter + items: + $ref: '#/components/schemas/Fleet_package_policy' + type: array + revision: + type: number + supports_agentless: + description: >- + Indicates whether the agent policy supports agentless integrations. + Only allowed in a serverless environment. + type: boolean + unenroll_timeout: + type: integer + unprivileged_agents: + type: number updated_by: type: string - version: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListVersion + updated_on: + format: date-time + type: string required: - id - - list_id - - type + - status - name - - description - - immutable - - namespace_type - - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListDescription: - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - description: 'Human readable string identifier, e.g. `trusted-linux-processes`' - Security_Solution_Endpoint_Exceptions_API_ExceptionListId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItem: + - namespace + Fleet_agent_policy_create_request: + title: Create agent policy request type: object properties: - _version: + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + data_output_id: + nullable: true type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray - created_at: - format: date-time + description: type: string - created_by: + download_source_id: + nullable: true type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time + fleet_server_host_id: + nullable: true type: string + force: + description: Force agent policy creation even if packages are not verified. + type: boolean + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta - name: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags - tie_breaker_id: type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType - updated_at: - format: date-time + inactivity_timeout: + type: integer + is_protected: + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string + type: array + monitoring_output_id: + nullable: true type: string - updated_by: + name: + type: string + namespace: type: string + unenroll_timeout: + type: integer required: - - id - - item_id - - list_id - - type - name - - description - - entries - - namespace_type - - comments - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemComment: + - namespace + Fleet_agent_policy_full: + oneOf: + - type: object + properties: + item: + type: string + - type: object + properties: + item: + $ref: '#/components/schemas/Fleet_full_agent_policy' + title: Agent policy full response + type: object + Fleet_agent_policy_update_request: + title: Update agent policy request type: object properties: - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - created_at: - format: date-time + agent_features: + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + required: + - name + - enabled + type: array + data_output_id: + nullable: true type: string - created_by: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - updated_at: - format: date-time + description: type: string - updated_by: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - required: - - id - - comment - - created_at - - created_by - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemComment - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemDescription: - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntry: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryList - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNested - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchWildcard - discriminator: - propertyName: type - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntry - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - exists + download_source_id: + nullable: true type: string - required: - - type - - field - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryList: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - list: - type: object - properties: - id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ListId - type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ListType - required: - - id - - type - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - list + fleet_server_host_id: + nullable: true type: string - required: - - type - - field - - list - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch: - type: object - properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match + force: + description: Force agent policy creation even if packages are not verified. + type: boolean + inactivity_timeout: + type: integer + is_protected: + type: boolean + monitoring_enabled: + items: + enum: + - metrics + - logs + type: string + type: array + monitoring_output_id: + nullable: true type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString + name: + type: string + namespace: + type: string + unenroll_timeout: + type: integer required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny: + - name + - namespace + Fleet_agent_status: + enum: + - offline + - error + - online + - inactive + - warning + title: Elastic Agent status + type: string + Fleet_agent_type: + enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY + title: Agent type + type: string + Fleet_bulk_install_packages_response: + title: Bulk install packages response type: object properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match_any - type: string - value: + items: items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - minItems: 1 + type: object + properties: + name: + type: string + version: + type: string + type: array + response: + deprecated: true + items: + type: object + properties: + name: + type: string + version: + type: string type: array required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchWildcard: + - items + Fleet_bulk_upgrade_agents: + title: Bulk upgrade agents type: object properties: - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - operator: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - wildcard + agents: + oneOf: + - description: 'KQL query string, leave empty to action all agents' + type: string + - description: list of agent IDs + items: + type: string + type: array + force: + description: 'Force upgrade, skipping validation (should be used with caution)' + type: boolean + rollout_duration_seconds: + description: rolling upgrade window duration in seconds + type: number + skipRateLimitCheck: + description: Skip rate limit check for upgrade + type: boolean + source_uri: + description: alternative upgrade binary download url + type: string + start_time: + description: start time of upgrade in ISO 8601 format + type: string + version: + description: version to upgrade to type: string - value: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString required: - - type - - field - - value - - operator - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNested: + - agents + - version + Fleet_data_stream: + title: Data stream type: object properties: - entries: + dashboard: items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNestedEntryItem - minItems: 1 + type: object + properties: + id: + type: string + title: + type: string type: array - field: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString + dataset: + type: string + index: + type: string + last_activity_ms: + type: number + namespace: + type: string + package: + type: string + package_version: + type: string + size_in_bytes: + type: number + size_in_bytes_formatted: + type: string type: - enum: - - nested type: string - required: - - type - - field - - entries - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryNestedEntryItem: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryExists - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemEntryOperator: - enum: - - excluded - - included - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemHumanId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemMeta: - additionalProperties: true - type: object - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemName: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemTags: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListItemType: - enum: - - simple - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListMeta: - additionalProperties: true + Fleet_download_sources: + title: Download Source type: object - Security_Solution_Endpoint_Exceptions_API_ExceptionListName: - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType: - enum: - - linux - - macos - - windows - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListTags: - items: - type: string - type: array - Security_Solution_Endpoint_Exceptions_API_ExceptionListType: - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Endpoint_Exceptions_API_ExceptionListVersion: - minimum: 1 - type: integer - Security_Solution_Endpoint_Exceptions_API_ExceptionNamespaceType: - description: > - Determines whether the exception container is available in all Kibana - spaces or just the space - - in which it is created, where: - - - - `single`: Only available in the Kibana space in which it is created. - - - `agnostic`: Available in all Kibana spaces. - enum: - - agnostic - - single - type: string - Security_Solution_Endpoint_Exceptions_API_FindEndpointListItemsFilter: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ListId: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Exceptions_API_NonEmptyString - Security_Solution_Endpoint_Exceptions_API_ListType: + properties: + host: + type: string + id: + type: string + is_default: + type: boolean + name: + type: string + proxy_id: + description: >- + The ID of the proxy to use for this download source. See the proxies + API for more information. + nullable: true + type: string + required: + - is_default + - name + - host + Fleet_elasticsearch_asset_type: enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Endpoint_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy + title: Elasticsearch asset type type: string - Security_Solution_Endpoint_Exceptions_API_PlatformErrorResponse: + Fleet_enrollment_api_key: + title: Enrollment API key type: object properties: - error: + active: + type: boolean + api_key: type: string - message: + api_key_id: + type: string + created_at: + type: string + id: + type: string + name: + type: string + policy_id: type: string - statusCode: - type: integer required: - - statusCode - - error - - message - Security_Solution_Endpoint_Exceptions_API_SiemErrorResponse: + - id + - api_key_id + - api_key + - active + - created_at + Fleet_fleet_server_host: + title: Fleet Server Host type: object properties: - message: + host_urls: + items: + type: string + type: array + id: + type: string + is_default: + type: boolean + is_internal: + type: boolean + is_preconfigured: + type: boolean + name: + type: string + proxy_id: type: string - status_code: - type: integer required: - - status_code - - message - Security_Solution_Endpoint_Management_API_ActionLogRequestQuery: - type: object - properties: - end_date: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndDate - page: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Page' - page_size: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PageSize - start_date: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_StartDate - Security_Solution_Endpoint_Management_API_ActionStateSuccessResponse: + - fleet_server_hosts + - id + - is_default + - is_preconfigured + - host_urls + Fleet_fleet_settings_enrollment_response: + title: Fleet settings response type: object properties: - body: + download_source: + $ref: '#/components/schemas/Fleet_download_sources' + fleet_server: type: object properties: - data: - type: object - properties: - canEncrypt: - type: boolean + has_active: + type: boolean + host: + $ref: '#/components/schemas/Fleet_fleet_server_host' + host_proxy: + $ref: '#/components/schemas/Fleet_proxies' + policies: + items: + type: object + properties: + download_source_id: + type: string + fleet_server_host_id: + type: string + has_fleet_server: + type: boolean + id: + type: string + is_default_fleet_server: + type: boolean + is_managed: + type: boolean + name: + type: string + required: + - id + - name + - is_managed + type: array required: - - data + - agent_policies + - has_active required: - - body - Security_Solution_Endpoint_Management_API_ActionStatusSuccessResponse: + - fleet_server + Fleet_fleet_settings_response: + title: Fleet settings response type: object properties: - body: - type: object - properties: - data: - type: object - properties: - agent_id: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentId - pending_actions: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionsSchema - required: - - agent_id - - pending_actions - required: - - data + item: + $ref: '#/components/schemas/Fleet_settings' required: - - body - Security_Solution_Endpoint_Management_API_AgentId: - description: Agent ID - type: string - Security_Solution_Endpoint_Management_API_AgentIds: - minLength: 1 - oneOf: - - items: - minLength: 1 + - item + Fleet_fleet_setup_response: + title: Fleet Setup response + type: object + properties: + isInitialized: + type: boolean + nonFatalErrors: + items: + type: object + properties: + message: + type: string + name: + type: string + required: + - name + - message + type: array + required: + - isInitialized + - nonFatalErrors + Fleet_fleet_status_response: + title: Fleet status response + type: object + properties: + isReady: + type: boolean + missing_optional_features: + items: + enum: + - encrypted_saved_object_encryption_key_required + type: string + type: array + missing_requirements: + items: + enum: + - tls_required + - api_keys + - fleet_admin_user + - fleet_server type: string - maxItems: 50 - minItems: 1 type: array - - minLength: 1 + package_verification_key_id: type: string - Security_Solution_Endpoint_Management_API_AgentTypes: - enum: - - endpoint - - sentinel_one - - crowdstrike - type: string - Security_Solution_Endpoint_Management_API_AlertIds: - description: A list of alerts ids. - items: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NonEmptyString - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_CaseIds: - description: Case IDs to be updated (cannot contain empty strings) - items: - minLength: 1 - type: string - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_Command: - description: The command to be executed (cannot be an empty string) - enum: - - isolate - - unisolate - - kill-process - - suspend-process - - running-processes - - get-file - - execute - - upload - - scan - minLength: 1 - type: string - Security_Solution_Endpoint_Management_API_Commands: - items: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Command' - type: array - Security_Solution_Endpoint_Management_API_Comment: - description: Optional comment - type: string - Security_Solution_Endpoint_Management_API_EndDate: - description: End date - type: string - Security_Solution_Endpoint_Management_API_EndpointIds: - description: List of endpoint IDs (cannot contain empty strings) - items: - minLength: 1 - type: string - minItems: 1 - type: array - Security_Solution_Endpoint_Management_API_ExecuteRouteRequestBody: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object - properties: - parameters: - type: object - properties: - command: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Command - timeout: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Timeout - required: - - command - required: - - parameters - Security_Solution_Endpoint_Management_API_GetEndpointActionListRouteQuery: + required: + - isReady + - missing_requirements + - missing_optional_features + Fleet_full_agent_policy: + title: Full agent policy type: object properties: - agentIds: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentIds - agentTypes: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - commands: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Commands - endDate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndDate - page: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Page' - pageSize: - default: 10 - description: Number of items per page - maximum: 10000 - minimum: 1 - type: integer - startDate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_StartDate - types: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Types' - userIds: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_UserIds - withOutputs: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_WithOutputs - Security_Solution_Endpoint_Management_API_GetFileRouteRequestBody: + agent: + nullable: true + type: string + fleet: + oneOf: + - type: object + properties: + hosts: + items: + type: string + type: array + proxy_headers: {} + proxy_url: + type: string + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + renegotiation: + type: string + verification_mode: + type: string + - type: object + properties: + kibana: + type: object + properties: + hosts: + items: + type: string + type: array + path: + type: string + protocol: + type: string + id: + type: string + inputs: + type: string + output_permissions: + additionalProperties: + type: object + properties: + data: + $ref: >- + #/components/schemas/Fleet_full_agent_policy_output_permissions + output: + type: integer + type: object + outputs: + additionalProperties: + $ref: '#/components/schemas/Fleet_full_agent_policy_output' + type: object + revision: + type: number + secret_references: + items: + type: object + properties: + id: + type: string + type: array + required: + - id + - outputs + - inputs + Fleet_full_agent_policy_input: allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object + - additionalProperties: true + type: object properties: - parameters: + data_stream: type: object properties: - path: + namespace: type: string required: - - path + - namespace + id: + type: string + meta: + additionalProperties: true + type: object + properties: + package: + type: object + properties: + name: + type: string + version: + type: string + required: + - name + - version + name: + type: string + revision: + type: number + streams: + $ref: '#/components/schemas/Fleet_full_agent_policy_input_stream' + type: + type: string + use_output: + type: string required: - - parameters - Security_Solution_Endpoint_Management_API_GetProcessesRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_IsolateRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_KillOrSuspendActionSchema: + - id + - name + - revision + - type + - data_stream + - use_output + title: Full agent policy input + Fleet_full_agent_policy_input_stream: allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object + - additionalProperties: true + type: object properties: - parameters: - oneOf: - - type: object - properties: - pid: - minimum: 1 - type: integer - - type: object - properties: - entity_id: - minLength: 1 - type: string + data_stream: + type: object + properties: + dataset: + type: string + type: + type: string + required: + - dataset + - type + id: + type: string required: - - parameters - Security_Solution_Endpoint_Management_API_ListRequestQuery: + - id + - data_stream + title: Full agent policy input stream + Fleet_full_agent_policy_output: + title: Full agent policy type: object properties: - hostStatuses: + additionalProperties: + type: object + properties: + text: {} + ca_sha256: + nullable: true + type: string + hosts: items: - enum: - - healthy - - offline - - updating - - inactive - - unenrolled type: string type: array - kuery: - nullable: true - type: string - page: - default: 0 - description: Page number - minimum: 0 - type: integer - pageSize: - default: 10 - description: Number of items per page - maximum: 10000 - minimum: 1 - type: integer - sortDirection: - enum: - - asc - - desc - nullable: true - type: string - sortField: - enum: - - enrolled_at - - metadata.host.hostname - - host_status - - metadata.Endpoint.policy.applied.name - - metadata.Endpoint.policy.applied.status - - metadata.host.os.name - - metadata.host.ip - - metadata.agent.version - - last_checkin + proxy_headers: {} + proxy_url: type: string + type: {} required: - - hostStatuses - Security_Solution_Endpoint_Management_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Endpoint_Management_API_NoParametersRequestSchema: + - type + - hosts + - ca_sha256 + Fleet_full_agent_policy_output_permissions: + additionalProperties: + type: object + properties: + data: + type: object + properties: + cluster: + items: + type: string + type: array + indices: + items: + type: object + properties: + names: + items: + type: string + type: array + privileges: + items: + type: string + type: array + type: array + packagePolicyName: + type: string + title: Full agent policy output permissions + Fleet_get_agent_tags_response: + title: Get Agent Tags response + type: object + properties: + items: + items: + type: string + type: array + Fleet_get_agents_response: + title: Get Agent response type: object properties: - body: + items: + items: + $ref: '#/components/schemas/Fleet_agent' + type: array + list: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_agent' + type: array + page: + type: number + perPage: + type: number + statusSummary: type: object properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids + degraded': + type: number + enrolling: + type: number + error: + type: number + inactive: + type: number + offline: + type: number + online: + type: number + unenrolled: + type: number + unenrolling: + type: number + updating: + type: number + total: + type: number required: - - body - Security_Solution_Endpoint_Management_API_Page: - default: 1 - description: Page number - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_PageSize: - default: 10 - description: Number of items per page - maximum: 100 - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_Parameters: - description: Optional parameters object + - items + - total + - page + - perPage + Fleet_get_bulk_assets_response: + deprecated: true + properties: + items: + items: + type: object + properties: + appLink: + type: string + attributes: + type: object + properties: + description: + type: string + title: + type: string + id: + type: string + type: + $ref: '#/components/schemas/Fleet_saved_object_type' + updatedAt: + type: string + type: array + required: + - items + title: Bulk get assets response type: object - Security_Solution_Endpoint_Management_API_PendingActionDataType: - type: integer - Security_Solution_Endpoint_Management_API_PendingActionsSchema: - oneOf: - - type: object - properties: - execute: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - get-file: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - isolate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - kill-process: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - running-processes: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - scan: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - suspend-process: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - unisolate: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - upload: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_PendingActionDataType - - additionalProperties: true - type: object - Security_Solution_Endpoint_Management_API_ProtectionUpdatesNoteResponse: + Fleet_get_categories_response: + title: Get categories response + type: object + properties: + items: + items: + type: object + properties: + count: + type: number + id: + type: string + title: + type: string + required: + - id + - title + - count + type: array + response: + items: + deprecated: true + type: object + properties: + count: + type: number + id: + type: string + title: + type: string + required: + - id + - title + - count + type: array + required: + - items + Fleet_get_packages_response: + title: Get Packages response + type: object + properties: + items: + items: + $ref: '#/components/schemas/Fleet_search_result' + type: array + response: + deprecated: true + items: + $ref: '#/components/schemas/Fleet_search_result' + type: array + required: + - items + Fleet_installation_info: + title: Installation info object type: object properties: - note: + created_at: type: string - Security_Solution_Endpoint_Management_API_ScanRouteRequestBody: - allOf: - - type: object - properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object + experimental_data_stream_features: + type: array properties: - parameters: + data_stream: + type: string + features: type: object properties: - path: - type: string - required: - - path - required: - - parameters - Security_Solution_Endpoint_Management_API_StartDate: - description: Start date - type: string - Security_Solution_Endpoint_Management_API_SuccessResponse: - type: object - properties: {} - Security_Solution_Endpoint_Management_API_Timeout: - description: The maximum timeout value in milliseconds (optional) - minimum: 1 - type: integer - Security_Solution_Endpoint_Management_API_Type: - description: Type of response action - enum: - - automated - - manual - type: string - Security_Solution_Endpoint_Management_API_Types: - description: List of types of response actions - items: - $ref: '#/components/schemas/Security_Solution_Endpoint_Management_API_Type' - maxLength: 2 - minLength: 1 - type: array - Security_Solution_Endpoint_Management_API_UnisolateRouteRequestBody: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_NoParametersRequestSchema - Security_Solution_Endpoint_Management_API_UploadRouteRequestBody: - allOf: - - type: object + doc_value_only_numeric: + nullable: true + type: boolean + doc_value_only_other: + nullable: true + type: boolean + synthetic_source: + nullable: true + type: boolean + tsdb: + nullable: true + type: boolean + install_format_schema_version: + type: string + install_kibana_space_id: + type: string + install_source: + enum: + - registry + - upload + - bundled + type: string + install_status: + enum: + - installed + - installing + - install_failed + type: string + installed_es: + type: object properties: - agent_type: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AgentTypes - alert_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_AlertIds - case_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_CaseIds - comment: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Comment - endpoint_ids: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_EndpointIds - parameters: - $ref: >- - #/components/schemas/Security_Solution_Endpoint_Management_API_Parameters - required: - - endpoint_ids - - type: object + deferred: + type: boolean + id: + type: string + type: + $ref: '#/components/schemas/Fleet_elasticsearch_asset_type' + installed_kibana: + type: object properties: - file: - format: binary + id: type: string - parameters: - type: object - properties: - overwrite: - default: false - type: boolean - required: - - parameters - - file - Security_Solution_Endpoint_Management_API_UserIds: - description: User IDs - oneOf: - - items: - minLength: 1 - type: string - minItems: 1 + type: + $ref: '#/components/schemas/Fleet_kibana_saved_object_type' + latest_executed_state: + description: Latest successfully executed state in package install state machine + type: object + properties: + error: + type: string + name: + enum: + - create_restart_installation + - install_kibana_assets + - install_ilm_policies + - install_ml_model + - install_index_template_pipelines + - remove_legacy_templates + - update_current_write_indices + - install_transforms + - delete_previous_pipelines + - save_archive_entries_from_assets_map + - update_so + type: string + started_at: + type: string + latest_install_failed_attempts: + description: Latest failed install errors + items: + type: object + properties: + created_at: + type: string + error: + type: object + properties: + message: + type: string + name: + type: string + stack: + type: string + target_version: + type: string type: array - - minLength: 1 + name: type: string - Security_Solution_Endpoint_Management_API_WithOutputs: - description: Shows detailed outputs for an action response - oneOf: - - items: - minLength: 1 + namespaces: + items: type: string - minItems: 1 type: array - - minLength: 1 + type: + type: string + updated_at: + type: string + verification_key_id: + nullable: true type: string - Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadErrorItem: - type: object - properties: - index: - type: integer - message: + verification_status: + enum: + - verified + - unverified + - unknown type: string - required: - - message - - index - Security_Solution_Entity_Analytics_API_AssetCriticalityBulkUploadStats: - type: object - properties: - failed: - type: integer - successful: - type: integer - total: - type: integer - required: - - successful - - failed - - total - Security_Solution_Entity_Analytics_API_AssetCriticalityLevel: - description: The criticality level of the asset. - enum: - - low_impact - - medium_impact - - high_impact - - extreme_impact - type: string - Security_Solution_Entity_Analytics_API_AssetCriticalityRecord: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord - - type: object - properties: - '@timestamp': - description: The time the record was created or updated. - example: '2017-07-21T17:32:28Z' - format: date-time - type: string - required: - - '@timestamp' - Security_Solution_Entity_Analytics_API_AssetCriticalityRecordIdParts: - type: object - properties: - id_field: - $ref: '#/components/schemas/Security_Solution_Entity_Analytics_API_IdField' - description: The field representing the ID. - example: host.name - id_value: - description: The ID value of the asset. + version: type: string required: - - id_value - - id_field - Security_Solution_Entity_Analytics_API_CreateAssetCriticalityRecord: - allOf: - - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityRecordIdParts - - type: object - properties: - criticality_level: - $ref: >- - #/components/schemas/Security_Solution_Entity_Analytics_API_AssetCriticalityLevel - required: - - criticality_level - Security_Solution_Entity_Analytics_API_IdField: + - installed_kibana + - installed_es + - name + - version + - install_status + - install_version + - install_started_at + - install_source + - verification_status + - latest_install_failed_attempts + Fleet_kibana_saved_object_type: enum: - - host.name - - user.name + - dashboard + - visualization + - search + - index-pattern + - map + - lens + - ml-module + - security-rule + - csp_rule_template + title: Kibana saved object asset type type: string - Security_Solution_Exceptions_API_CreateExceptionListItemComment: - type: object - properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - comment - Security_Solution_Exceptions_API_CreateExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateExceptionListItemComment - type: array - Security_Solution_Exceptions_API_CreateRuleExceptionListItemComment: - type: object - properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - comment - Security_Solution_Exceptions_API_CreateRuleExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemComment - type: array - Security_Solution_Exceptions_API_CreateRuleExceptionListItemProps: - type: object + Fleet_new_package_policy: + description: '' properties: - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_CreateRuleExceptionListItemCommentArray - default: [] description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time type: string - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta + enabled: + type: boolean + inputs: + items: + type: object + properties: + config: + type: object + enabled: + type: boolean + processors: + items: + type: string + type: array + streams: + items: {} + type: array + type: + type: string + vars: + type: object + required: + - type + - enabled + type: array name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - default: single - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - default: [] - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - default: [] - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType + type: string + namespace: + type: string + output_id: + type: string + overrides: + type: object + package: + type: object + properties: + name: + type: string + requires_root: + type: boolean + title: + type: string + version: + type: string + required: + - name + - version + policy_id: + deprecated: true + type: string + policy_ids: + items: + type: string + type: array required: - - type + - inputs - name - - description - - entries - Security_Solution_Exceptions_API_ExceptionList: + title: New package policy + type: object + Fleet_output_create_request: + discriminator: + mapping: + elasticsearch: '#/components/schemas/Fleet_output_create_request_elasticsearch' + kafka: '#/components/schemas/Fleet_output_create_request_kafka' + logstash: '#/components/schemas/Fleet_output_create_request_logstash' + remote_elasticsearch: >- + #/components/schemas/Fleet_output_create_request_remote_elasticsearch + propertyName: type + oneOf: + - $ref: '#/components/schemas/Fleet_output_create_request_elasticsearch' + - $ref: '#/components/schemas/Fleet_output_create_request_kafka' + - $ref: '#/components/schemas/Fleet_output_create_request_logstash' + - $ref: >- + #/components/schemas/Fleet_output_create_request_remote_elasticsearch + title: Output + Fleet_output_create_request_elasticsearch: + title: elasticsearch type: object properties: - _version: + ca_sha256: type: string - created_at: - format: date-time + ca_trusted_fingerprint: type: string - created_by: + config: + type: object + config_yaml: type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListDescription + hosts: + items: + type: string + type: array id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - immutable: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: type: boolean - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListMeta name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListTags - tie_breaker_id: type: string - type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListType - updated_at: - format: date-time + preset: + enum: + - balanced + - custom + - throughput + - scale + - latency type: string - updated_by: + proxy_id: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - elasticsearch type: string - version: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListVersion required: - - id - - list_id - - type - name - - description - - immutable - - namespace_type - - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Exceptions_API_ExceptionListDescription: - type: string - Security_Solution_Exceptions_API_ExceptionListHumanId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - description: 'Human readable string identifier, e.g. `trusted-linux-processes`' - Security_Solution_Exceptions_API_ExceptionListId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItem: + Fleet_output_create_request_kafka: + title: kafka type: object properties: - _version: + auth_type: type: string - comments: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemCommentArray - created_at: - format: date-time + broker_timeout: + type: number + ca_sha256: type: string - created_by: + ca_trusted_fingerprint: type: string - description: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemDescription - entries: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryArray - expire_time: - format: date-time + client_id: + type: string + compression: + type: string + compression_level: + type: number + config: + type: object + config_yaml: + type: string + connection_type: + enum: + - plaintext + - encryption type: string + headers: + items: + type: object + properties: + key: + type: string + value: + type: string + type: array + hosts: + items: + type: string + type: array id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - meta: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemMeta + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + key: + type: string name: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemName - namespace_type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionNamespaceType - os_types: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray - tags: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemTags - tie_breaker_id: type: string + partition: + type: string + password: + type: string + proxy_id: + type: string + random: + type: object + properties: + group_events: + type: number + required_acks: + type: number + round_robin: + type: object + properties: + group_events: + type: number + sasl: + type: object + properties: + mechanism: + type: string + secrets: + type: object + properties: + password: + type: string + ssl: + type: object + properties: + key: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + verification_mode: + enum: + - none + - full + - certificate + - strict + type: string + timeout: + type: number + topic: + type: string + topics: + deprecated: true + description: Use topic instead. + items: + type: object + properties: + topic: + type: string + when: + deprecated: true + description: >- + Deprecated, kafka output do not support conditionnal topics + anymore. + type: object + properties: + condition: + type: string + type: + type: string + type: array type: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemType - updated_at: - format: date-time + enum: + - kafka type: string - updated_by: + username: + type: string + version: type: string required: - - id - - item_id - - list_id - - type - name - - description - - entries - - namespace_type - - comments - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Exceptions_API_ExceptionListItemComment: + - type + - topics + - auth_type + - hosts + Fleet_output_create_request_logstash: + title: logstash type: object properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - created_at: - format: date-time + ca_sha256: type: string - created_by: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' + ca_trusted_fingerprint: + type: string + config: + type: object + config_yaml: + type: string + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - updated_at: - format: date-time type: string - updated_by: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - required: - - id - - comment - - created_at - - created_by - Security_Solution_Exceptions_API_ExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemComment - type: array - Security_Solution_Exceptions_API_ExceptionListItemDescription: - type: string - Security_Solution_Exceptions_API_ExceptionListItemEntry: - anyOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryList - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryExists - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryNested - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchWildcard - discriminator: - propertyName: type - Security_Solution_Exceptions_API_ExceptionListItemEntryArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntry - type: array - Security_Solution_Exceptions_API_ExceptionListItemEntryExists: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - exists + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: type: string - required: - - type - - field - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryList: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - list: + proxy_id: + type: string + secrets: type: object properties: - id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_ListId' - type: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_ListType' - required: - - id - - type - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - list - type: string - required: - - type - - field - - list - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatch: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator + ssl: + type: object + properties: + key: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string type: enum: - - match + - logstash type: string - value: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' required: + - name + - hosts - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny: + Fleet_output_create_request_remote_elasticsearch: + title: remote_elasticsearch type: object properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator - type: - enum: - - match_any - type: string - value: + hosts: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_NonEmptyString - minItems: 1 + type: string type: array - required: - - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryMatchWildcard: - type: object - properties: - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - operator: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryOperator + id: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + secrets: + type: object + properties: + service_token: + type: string + service_token: + type: string type: enum: - - wildcard + - remote_elasticsearch type: string - value: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' required: - - type - - field - - value - - operator - Security_Solution_Exceptions_API_ExceptionListItemEntryNested: + - name + Fleet_output_update_request: + discriminator: + mapping: + elasticsearch: '#/components/schemas/Fleet_output_update_request_elasticsearch' + kafka: '#/components/schemas/Fleet_output_update_request_kafka' + logstash: '#/components/schemas/Fleet_output_update_request_logstash' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Fleet_output_update_request_elasticsearch' + - $ref: '#/components/schemas/Fleet_output_update_request_kafka' + - $ref: '#/components/schemas/Fleet_output_update_request_logstash' + title: Output + Fleet_output_update_request_elasticsearch: + title: elasticsearch type: object properties: - entries: + ca_sha256: + type: string + ca_trusted_fingerprint: + type: string + config: + type: object + config_yaml: + type: string + hosts: items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryNestedEntryItem - minItems: 1 + type: string type: array - field: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - type: + id: + type: string + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: + type: string + preset: enum: - - nested + - balanced + - custom + - throughput + - scale + - latency type: string - required: - - type - - field - - entries - Security_Solution_Exceptions_API_ExceptionListItemEntryNestedEntryItem: - oneOf: - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatch - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryMatchAny - - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemEntryExists - Security_Solution_Exceptions_API_ExceptionListItemEntryOperator: - enum: - - excluded - - included - type: string - Security_Solution_Exceptions_API_ExceptionListItemHumanId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemMeta: - additionalProperties: true - type: object - Security_Solution_Exceptions_API_ExceptionListItemName: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ExceptionListItemOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Exceptions_API_ExceptionListItemTags: - items: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - type: array - Security_Solution_Exceptions_API_ExceptionListItemType: - enum: - - simple - type: string - Security_Solution_Exceptions_API_ExceptionListMeta: - additionalProperties: true - type: object - Security_Solution_Exceptions_API_ExceptionListName: - type: string - Security_Solution_Exceptions_API_ExceptionListOsType: - enum: - - linux - - macos - - windows - type: string - Security_Solution_Exceptions_API_ExceptionListOsTypeArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListOsType - type: array - Security_Solution_Exceptions_API_ExceptionListsImportBulkError: - type: object - properties: - error: + proxy_id: + type: string + shipper: type: object properties: - message: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: type: string - status_code: - type: integer - required: - - status_code - - message - id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListId - item_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListItemHumanId - list_id: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListHumanId - required: - - error - Security_Solution_Exceptions_API_ExceptionListsImportBulkErrorArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_ExceptionListsImportBulkError - type: array - Security_Solution_Exceptions_API_ExceptionListTags: - items: - type: string - type: array - Security_Solution_Exceptions_API_ExceptionListType: - enum: - - detection - - rule_default - - endpoint - - endpoint_trusted_apps - - endpoint_events - - endpoint_host_isolation_exceptions - - endpoint_blocklists - type: string - Security_Solution_Exceptions_API_ExceptionListVersion: - minimum: 1 - type: integer - Security_Solution_Exceptions_API_ExceptionNamespaceType: - description: > - Determines whether the exception container is available in all Kibana - spaces or just the space - - in which it is created, where: - - - - `single`: Only available in the Kibana space in which it is created. - - - `agnostic`: Available in all Kibana spaces. - enum: - - agnostic - - single - type: string - Security_Solution_Exceptions_API_FindExceptionListItemsFilter: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_FindExceptionListsFilter: - type: string - Security_Solution_Exceptions_API_ListId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - Security_Solution_Exceptions_API_ListType: - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Exceptions_API_PlatformErrorResponse: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: integer - required: - - statusCode - - error - - message - Security_Solution_Exceptions_API_RuleId: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_UUID' - Security_Solution_Exceptions_API_SiemErrorResponse: - type: object - properties: - message: + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - elasticsearch type: string - status_code: - type: integer - required: - - status_code - - message - Security_Solution_Exceptions_API_UpdateExceptionListItemComment: - type: object - properties: - comment: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' - id: - $ref: '#/components/schemas/Security_Solution_Exceptions_API_NonEmptyString' required: - - comment - Security_Solution_Exceptions_API_UpdateExceptionListItemCommentArray: - items: - $ref: >- - #/components/schemas/Security_Solution_Exceptions_API_UpdateExceptionListItemComment - type: array - Security_Solution_Exceptions_API_UUID: - description: A universally unique identifier - format: uuid - type: string - Security_Solution_Lists_API_FindListItemsCursor: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_FindListItemsFilter: - type: string - Security_Solution_Lists_API_FindListsCursor: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_FindListsFilter: - type: string - Security_Solution_Lists_API_List: + - name + - hosts + - type + Fleet_output_update_request_kafka: + title: kafka type: object properties: - _version: + auth_type: type: string - '@timestamp': - format: date-time + broker_timeout: + type: number + ca_sha256: type: string - created_at: - format: date-time + ca_trusted_fingerprint: type: string - created_by: + client_id: type: string - description: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListDescription' - deserializer: + compression: + type: string + compression_level: + type: number + config: + type: object + config_yaml: + type: string + connection_type: + enum: + - plaintext + - encryption type: string + headers: + items: + type: object + properties: + key: + type: string + value: + type: string + type: array + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - immutable: + type: string + is_default: type: boolean - meta: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListMetadata' + is_default_monitoring: + type: boolean + is_internal: + type: boolean + key: + type: string name: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListName' - serializer: type: string - tie_breaker_id: + partition: + type: string + password: + type: string + proxy_id: + type: string + random: + type: object + properties: + group_events: + type: number + required_acks: + type: number + round_robin: + type: object + properties: + group_events: + type: number + sasl: + type: object + properties: + mechanism: + type: string + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + verification_mode: + enum: + - none + - full + - certificate + - strict + type: string + timeout: + type: number + topic: type: string + topics: + deprecated: true + description: Use topic instead. + items: + type: object + properties: + topic: + type: string + when: + deprecated: true + description: >- + Deprecated, kafka output do not support conditionnal topics + anymore. + type: object + properties: + condition: + type: string + type: + type: string + type: array type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - updated_at: - format: date-time + enum: + - kafka type: string - updated_by: + username: type: string version: - minimum: 1 - type: integer + type: string required: - - id - - type - name - - description - - immutable - - version - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Lists_API_ListDescription: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListId: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListItem: + Fleet_output_update_request_logstash: + title: logstash type: object properties: - _version: - type: string - '@timestamp': - format: date-time - type: string - created_at: - format: date-time + ca_sha256: type: string - created_by: + ca_trusted_fingerprint: type: string - deserializer: + config: + type: object + config_yaml: type: string + hosts: + items: + type: string + type: array id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemId' - list_id: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListId' - meta: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemMetadata' - serializer: type: string - tie_breaker_id: + is_default: + type: boolean + is_default_monitoring: + type: boolean + is_internal: + type: boolean + name: type: string - type: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListType' - updated_at: - format: date-time + proxy_id: type: string - updated_by: + shipper: + type: object + properties: + compression_level: + type: number + disk_queue_compression_enabled: + type: boolean + disk_queue_enabled: + type: boolean + disk_queue_encryption_enabled: + type: boolean + disk_queue_max_size: + type: number + disk_queue_path: + type: string + loadbalance: + type: boolean + ssl: + type: object + properties: + certificate: + type: string + certificate_authorities: + items: + type: string + type: array + key: + type: string + type: + enum: + - logstash type: string - value: - $ref: '#/components/schemas/Security_Solution_Lists_API_ListItemValue' required: - - id - - type - - list_id - - value - - tie_breaker_id - - created_at - - created_by - - updated_at - - updated_by - Security_Solution_Lists_API_ListItemId: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListItemMetadata: - additionalProperties: true - type: object - Security_Solution_Lists_API_ListItemPrivileges: + - name + Fleet_package_info: + title: Package information type: object properties: - application: - additionalProperties: - type: boolean + assets: + items: + type: string + type: array + categories: + items: + type: string + type: array + conditions: type: object - cluster: - additionalProperties: - type: boolean + properties: + elasticsearch: + type: object + properties: + subscription: + enum: + - basic + - gold + - platinum + - enterprise + type: string + kibana: + type: object + properties: + versions: + type: string + data_streams: + items: + type: object + properties: + ingeset_pipeline: + type: string + name: + type: string + package: + type: string + release: + type: string + title: + type: string + type: + type: string + vars: + items: + type: object + properties: + default: + type: string + name: + type: string + required: + - name + - default + type: array + required: + - title + - name + - release + - ingeset_pipeline + - type + - package + type: array + description: + type: string + download: + type: string + elasticsearch: type: object - has_all_requested: + properties: + privileges: + type: object + properties: + cluster: + items: + type: string + type: array + format_version: + type: string + icons: + items: + type: string + type: array + internal: type: boolean - index: - additionalProperties: - additionalProperties: - type: boolean + name: + type: string + path: + type: string + readme: + type: string + release: + deprecated: true + description: >- + release label is deprecated, derive from the version instead + (packages follow semver) + enum: + - experimental + - beta + - ga + type: string + screenshots: + items: type: object + properties: + path: + type: string + size: + type: string + src: + type: string + title: + type: string + type: + type: string + required: + - src + - path + type: array + source: type: object - username: + properties: + license: + enum: + - Apache-2.0 + - Elastic-2.0 + type: string + title: + type: string + type: + type: string + version: type: string required: - - username - - has_all_requested - - cluster - - index - - application - Security_Solution_Lists_API_ListItemValue: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListMetadata: - additionalProperties: true - type: object - Security_Solution_Lists_API_ListName: - $ref: '#/components/schemas/Security_Solution_Lists_API_NonEmptyString' - Security_Solution_Lists_API_ListPrivileges: + - name + - title + - version + - description + - type + - categories + - conditions + - assets + - format_version + - download + - path + Fleet_package_policy: + allOf: + - type: object + properties: + id: + type: string + inputs: + oneOf: + - items: {} + type: array + - type: object + revision: + type: number + required: + - id + - revision + - $ref: '#/components/schemas/Fleet_new_package_policy' + title: Package policy + Fleet_package_policy_request: + title: Package Policy Request type: object properties: - application: - additionalProperties: - type: boolean - type: object - cluster: - additionalProperties: - type: boolean - type: object - has_all_requested: + description: + description: Package policy description + example: my description + type: string + force: + description: >- + Force package policy creation even if package is not verified, or if + the agent policy is managed. type: boolean - index: + id: + description: Package policy unique identifier + type: string + inputs: additionalProperties: - additionalProperties: - type: boolean type: object + properties: + enabled: + description: 'enable or disable that input, (default to true)' + type: boolean + streams: + additionalProperties: + type: object + properties: + enabled: + description: 'enable or disable that stream, (default to true)' + type: boolean + vars: + description: >- + Stream level variable (see integration documentation for + more information) + type: object + description: >- + Input streams (see integration documentation to know what + streams are available) + type: object + vars: + description: >- + Input level variable (see integration documentation for more + information) + type: object + description: >- + Package policy inputs (see integration documentation to know what + inputs are available) + example: + nginx-logfile: + enabled: true + streams: + nginx.access: + enabled: true + vars: + ignore_older: 72h + paths: + - /var/log/nginx/access.log* + preserve_original_event: false + tags: + - nginx-access type: object - username: - type: string - required: - - username - - has_all_requested - - cluster - - index - - application - Security_Solution_Lists_API_ListType: - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - type: string - Security_Solution_Lists_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace - minLength: 1 - pattern: ^(?! *$).+$ - type: string - Security_Solution_Lists_API_PlatformErrorResponse: - type: object - properties: - error: + name: + description: Package policy name (should be unique) + example: nginx-123 type: string - message: + namespace: + description: >- + The package policy namespace. Leave blank to inherit the agent + policy's namespace. + example: customnamespace type: string - statusCode: - type: integer - required: - - statusCode - - error - - message - Security_Solution_Lists_API_SiemErrorResponse: - type: object - properties: - message: + overrides: + description: >- + Override settings that are defined in the package policy. The + override option should be used only in unusual circumstances and not + as a routine procedure. + nullable: true + type: object + properties: + inputs: + type: object + package: + type: object + properties: + name: + description: Package name + example: nginx + type: string + version: + description: Package version + example: 1.6.0 + type: string + required: + - name + - version + policy_id: + deprecated: true + description: Agent policy ID where that package policy will be added + example: agent-policy-id type: string - status_code: - type: integer - required: - - status_code - - message - Security_Solution_Osquery_API_ArrayQueries: - items: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ArrayQueriesItem' - type: array - Security_Solution_Osquery_API_ArrayQueriesItem: - type: object - properties: - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PlatformOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_CreateLiveQueryRequestBody: - type: object - properties: - agent_all: - type: boolean - agent_ids: - items: - type: string - type: array - agent_platforms: - items: - type: string - type: array - agent_policy_ids: - items: - type: string - type: array - alert_ids: - items: - type: string - type: array - case_ids: - items: - type: string - type: array - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - event_ids: + policy_ids: + description: Agent policy IDs where that package policy will be added + example: + - agent-policy-id items: type: string type: array - metadata: - nullable: true + vars: + description: >- + Package root level variable (see integration documentation for more + information) type: object - pack_id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackIdOrUndefined' - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ArrayQueries' - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - saved_query_id: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SavedQueryIdOrUndefined - Security_Solution_Osquery_API_CreatePacksRequestBody: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - enabled: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_EnabledOrUndefined - name: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackName' - policy_ids: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PolicyIdsOrUndefined - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueries' - shards: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Shards' - Security_Solution_Osquery_API_CreateSavedQueryRequestBody: + required: + - name + - package + Fleet_package_usage_stats: + title: Package usage stats type: object properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - interval: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Interval' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_DefaultSuccessResponse: - type: object - properties: {} - Security_Solution_Osquery_API_Description: - type: string - Security_Solution_Osquery_API_DescriptionOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Description' - nullable: true - Security_Solution_Osquery_API_ECSMapping: - additionalProperties: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ECSMappingItem' - type: object - Security_Solution_Osquery_API_ECSMappingItem: + agent_policy_count: + type: integer + required: + - agent_policy_count + Fleet_proxies: + title: Fleet Proxy type: object properties: - field: + certificate: type: string - value: - oneOf: - - type: string - - items: - type: string - type: array - Security_Solution_Osquery_API_ECSMappingOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ECSMapping' - nullable: true - Security_Solution_Osquery_API_Enabled: - type: boolean - Security_Solution_Osquery_API_EnabledOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Enabled' - nullable: true - Security_Solution_Osquery_API_FindLiveQueryRequestQuery: - type: object - properties: - kuery: - $ref: '#/components/schemas/Security_Solution_Osquery_API_KueryOrUndefined' - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_FindPacksRequestQuery: - type: object - properties: - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_FindSavedQueryRequestQuery: - type: object - properties: - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_GetLiveQueryResultsRequestQuery: - type: object - properties: - kuery: - $ref: '#/components/schemas/Security_Solution_Osquery_API_KueryOrUndefined' - page: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PageOrUndefined' - pageSize: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PageSizeOrUndefined - sort: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SortOrUndefined' - sortOrder: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SortOrderOrUndefined - Security_Solution_Osquery_API_Id: - type: string - Security_Solution_Osquery_API_Interval: - type: string - Security_Solution_Osquery_API_IntervalOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Interval' - nullable: true - Security_Solution_Osquery_API_KueryOrUndefined: - nullable: true - type: string - Security_Solution_Osquery_API_ObjectQueries: - additionalProperties: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueriesItem' - type: object - Security_Solution_Osquery_API_ObjectQueriesItem: - type: object - properties: - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Id' - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PlatformOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - saved_query_id: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SavedQueryIdOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_PackId: - type: string - Security_Solution_Osquery_API_PackIdOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' - nullable: true - Security_Solution_Osquery_API_PackName: - type: string - Security_Solution_Osquery_API_PageOrUndefined: - nullable: true - type: integer - Security_Solution_Osquery_API_PageSizeOrUndefined: - nullable: true - type: integer - Security_Solution_Osquery_API_Platform: - type: string - Security_Solution_Osquery_API_PlatformOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Platform' - nullable: true - Security_Solution_Osquery_API_PolicyIds: - items: - type: string - type: array - Security_Solution_Osquery_API_PolicyIdsOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PolicyIds' - nullable: true - Security_Solution_Osquery_API_Query: - type: string - Security_Solution_Osquery_API_QueryOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Query' - nullable: true - Security_Solution_Osquery_API_Removed: - type: boolean - Security_Solution_Osquery_API_RemovedOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Removed' - nullable: true - Security_Solution_Osquery_API_SavedQueryId: - type: string - Security_Solution_Osquery_API_SavedQueryIdOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - nullable: true - Security_Solution_Osquery_API_Shards: - additionalProperties: - type: number - type: object - Security_Solution_Osquery_API_Snapshot: - type: boolean - Security_Solution_Osquery_API_SnapshotOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Snapshot' - nullable: true - Security_Solution_Osquery_API_SortOrderOrUndefined: - oneOf: - - nullable: true + certificate_authorities: + type: string + certificate_key: type: string - - enum: - - asc - - desc - Security_Solution_Osquery_API_SortOrUndefined: - nullable: true - type: string - Security_Solution_Osquery_API_UpdatePacksRequestBody: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - enabled: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_EnabledOrUndefined - id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_PackId' - policy_ids: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_PolicyIdsOrUndefined - queries: - $ref: '#/components/schemas/Security_Solution_Osquery_API_ObjectQueries' - shards: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Shards' - Security_Solution_Osquery_API_UpdateSavedQueryRequestBody: - type: object - properties: - description: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - ecs_mapping: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_ECSMappingOrUndefined id: - $ref: '#/components/schemas/Security_Solution_Osquery_API_SavedQueryId' - interval: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_IntervalOrUndefined - platform: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_DescriptionOrUndefined - query: - $ref: '#/components/schemas/Security_Solution_Osquery_API_QueryOrUndefined' - removed: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_RemovedOrUndefined - snapshot: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_SnapshotOrUndefined - version: - $ref: >- - #/components/schemas/Security_Solution_Osquery_API_VersionOrUndefined - Security_Solution_Osquery_API_Version: - type: string - Security_Solution_Osquery_API_VersionOrUndefined: - $ref: '#/components/schemas/Security_Solution_Osquery_API_Version' - nullable: true - Security_Solution_Timeline_API_BareNote: - type: object - properties: - created: - nullable: true - type: number - createdBy: - nullable: true type: string - eventId: - nullable: true + name: type: string - note: - nullable: true + proxy_headers: + type: object + url: type: string - timelineId: - nullable: true + required: + - name + - url + Fleet_saved_object_type: + oneOf: + - enum: + - dashboard + - visualization + - search + - index_pattern + - map + - lens + - security_rule + - csp_rule_template + - ml_module + - tag + - osquery_pack_asset + - osquery_saved_query type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true + - enum: + - index + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy + - ml_model type: string - required: - - timelineId - Security_Solution_Timeline_API_ColumnHeaderResult: + title: Saved Object type + Fleet_search_result: + title: Search result type: object properties: - aggregatable: - type: boolean - category: - type: string - columnHeaderType: - type: string description: type: string - example: - oneOf: - - type: string - - type: number - id: + download: type: string - indexes: - items: - type: string - type: array + icons: + type: string + installationInfo: + $ref: '#/components/schemas/Fleet_installation_info' name: type: string - placeholder: + path: type: string - searchable: - type: boolean - type: + savedObject: + deprecated: true + type: object + status: type: string - Security_Solution_Timeline_API_DataProviderQueryMatch: - type: object - properties: - enabled: - nullable: true - type: boolean - excluded: - nullable: true - type: boolean - id: - nullable: true + title: type: string - kqlQuery: - nullable: true + type: type: string - name: - nullable: true + version: type: string - queryMatch: - $ref: '#/components/schemas/Security_Solution_Timeline_API_QueryMatchResult' - Security_Solution_Timeline_API_DataProviderResult: + required: + - description + - download + - icons + - name + - path + - title + - type + - version + - status + Fleet_settings: + title: Settings type: object properties: - and: + fleet_server_hosts: + deprecated: true items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_DataProviderQueryMatch - nullable: true + type: string type: array - enabled: - nullable: true - type: boolean - excluded: - nullable: true + has_seen_add_data_notice: type: boolean id: - nullable: true type: string - kqlQuery: - nullable: true + prerelease_integrations_enabled: + type: boolean + required: + - fleet_server_hosts + - id + Fleet_upgrade_agent: + title: Upgrade agent + type: object + properties: + force: + description: 'Force upgrade, skipping validation (should be used with caution)' + type: boolean + skipRateLimitCheck: + description: Skip rate limit check for upgrade + type: boolean + source_uri: type: string - name: - nullable: true + version: type: string - queryMatch: - $ref: '#/components/schemas/Security_Solution_Timeline_API_QueryMatchResult' - nullable: true - type: - $ref: '#/components/schemas/Security_Solution_Timeline_API_DataProviderType' - nullable: true - Security_Solution_Timeline_API_DataProviderType: + required: + - version + Fleet_upgrade_agent_diff: + items: + items: + $ref: '#/components/schemas/Fleet_full_agent_policy_input' + type: array + title: Package policy Upgrade dryrun + type: array + Fleet_upgrade_diff: + items: + allOf: + - $ref: '#/components/schemas/Fleet_package_policy' + - allOf: + - $ref: '#/components/schemas/Fleet_new_package_policy' + - type: object + properties: + errors: + items: + type: object + properties: + key: + type: string + message: + type: string + type: array + missingVars: + items: + type: string + type: array + type: object + title: Package policy Upgrade dryrun + type: array + Kibana_HTTP_APIs_core_status_redactedResponse: + additionalProperties: false + description: A minimal representation of Kibana's operational status. + type: object + properties: + status: + additionalProperties: false + type: object + properties: + overall: + additionalProperties: false + type: object + properties: + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + required: + - level + required: + - overall + required: + - status + Kibana_HTTP_APIs_core_status_response: + additionalProperties: false description: >- - The type of data provider to create. Valid values are `default` and - `template`. - enum: - - default - - template - type: string - Security_Solution_Timeline_API_DocumentIds: - oneOf: - - items: - type: string - type: array - - type: string - Security_Solution_Timeline_API_FavoriteTimelineResponse: + Kibana's operational status as well as a detailed breakdown of plugin + statuses indication of various loads (like event loop utilization and + network traffic) at time of request. type: object properties: - code: - nullable: true - type: number - favorite: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResult - type: array - message: - nullable: true - type: string - savedObjectId: + metrics: + additionalProperties: false + description: Metric groups collected by Kibana. + type: object + properties: + collection_interval_in_millis: + description: The interval at which metrics should be collected. + type: number + elasticsearch_client: + additionalProperties: false + description: Current network metrics of Kibana's Elasticsearch client. + type: object + properties: + totalActiveSockets: + description: Count of network sockets currently in use. + type: number + totalIdleSockets: + description: Count of network sockets currently idle. + type: number + totalQueuedRequests: + description: Count of requests not yet assigned to sockets. + type: number + required: + - totalActiveSockets + - totalIdleSockets + - totalQueuedRequests + last_updated: + description: The time metrics were collected. + type: string + required: + - elasticsearch_client + - last_updated + - collection_interval_in_millis + name: + description: Kibana instance name. type: string - templateTimelineId: - nullable: true + status: + additionalProperties: false + type: object + properties: + core: + additionalProperties: false + description: Statuses of core Kibana services. + type: object + properties: + elasticsearch: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: >- + An unstructured set of extra metadata about this + service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + savedObjects: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: >- + An unstructured set of extra metadata about this + service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + required: + - elasticsearch + - savedObjects + overall: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + plugins: + additionalProperties: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: >- + Service status levels as human and machine readable + values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: {} + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + description: A dynamic mapping of plugin ID to plugin status. + type: object + required: + - overall + - core + - plugins + uuid: + description: >- + Unique, generated Kibana instance UUID. This UUID should persist + even if the Kibana process restarts. type: string - templateTimelineVersion: - nullable: true - type: number - timelineType: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' version: - type: string - required: - - savedObjectId - - version - Security_Solution_Timeline_API_FavoriteTimelineResult: - type: object - properties: - favoriteDate: - nullable: true - type: number - fullName: - nullable: true - type: string - userName: - nullable: true - type: string - Security_Solution_Timeline_API_FilterTimelineResult: - type: object - properties: - exists: - type: boolean - match_all: - type: string - meta: + additionalProperties: false type: object properties: - alias: - type: string - controlledBy: - type: string - disabled: - type: boolean - field: - type: string - formattedValue: + build_date: + description: The date and time of this build. type: string - index: + build_flavor: + description: >- + The build flavour determines configuration and behavior of + Kibana. On premise users will almost always run the + "traditional" flavour, while other flavours are reserved for + Elastic-specific use cases. + enum: + - serverless + - traditional type: string - key: + build_hash: + description: >- + A unique hash value representing the git commit of this Kibana + build. type: string - negate: + build_number: + description: >- + A monotonically increasing number, each subsequent build will + have a higher number. + type: number + build_snapshot: + description: Whether this build is a snapshot build. type: boolean - params: - type: string - type: - type: string - value: + number: + description: A semantic version number. type: string - missing: - type: string - query: - type: string - range: + required: + - number + - build_hash + - build_number + - build_snapshot + - build_flavor + - build_date + required: + - name + - uuid + - version + - status + - metrics + Machine_learning_APIs_mlSync200Response: + properties: + datafeedsAdded: + additionalProperties: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' + description: >- + If a saved object for an anomaly detection job is missing a datafeed + identifier, it is added when you run the sync machine learning saved + objects API. + type: object + datafeedsRemoved: + additionalProperties: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseDatafeeds' + description: >- + If a saved object for an anomaly detection job references a datafeed + that no longer exists, it is deleted when you run the sync machine + learning saved objects API. + type: object + savedObjectsCreated: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsCreated + savedObjectsDeleted: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted + title: Successful sync API response + type: object + Machine_learning_APIs_mlSync4xxResponse: + properties: + error: + example: Unauthorized type: string - script: + message: type: string - Security_Solution_Timeline_API_ImportTimelineResult: + statusCode: + example: 401 + type: integer + title: Unsuccessful sync API response type: object + Machine_learning_APIs_mlSyncResponseAnomalyDetectors: + description: >- + The sync machine learning saved objects API response contains this + object when there are anomaly detection jobs affected by the + synchronization. There is an object for each relevant job, which + contains the synchronization status. properties: - errors: - items: - type: object - properties: - error: - type: object - properties: - message: - type: string - status_code: - type: number - id: - type: string - type: array success: - type: boolean - success_count: - type: number - timelines_installed: - type: number - timelines_updated: - type: number - Security_Solution_Timeline_API_ImportTimelines: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SavedTimeline' - - type: object - properties: - eventNotes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - nullable: true - type: array - globalNotes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - nullable: true - type: array - pinnedEventIds: - items: - type: string - nullable: true - type: array - savedObjectId: - nullable: true - type: string - version: - nullable: true - type: string - Security_Solution_Timeline_API_Note: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_BareNote' - - type: object - properties: - noteId: - type: string - version: - type: string - Security_Solution_Timeline_API_PinnedEvent: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for anomaly detection jobs type: object + Machine_learning_APIs_mlSyncResponseDatafeeds: + description: >- + The sync machine learning saved objects API response contains this + object when there are datafeeds affected by the synchronization. There + is an object for each relevant datafeed, which contains the + synchronization status. properties: - created: - nullable: true - type: number - createdBy: - nullable: true - type: string - eventId: - type: string - pinnedEventId: - type: string - timelineId: - type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true - type: string - version: - type: string - required: - - eventId - - pinnedEventId - - timelineId - - version - Security_Solution_Timeline_API_QueryMatchResult: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for datafeeds type: object + Machine_learning_APIs_mlSyncResponseDataFrameAnalytics: + description: >- + The sync machine learning saved objects API response contains this + object when there are data frame analytics jobs affected by the + synchronization. There is an object for each relevant job, which + contains the synchronization status. properties: - displayField: - nullable: true - type: string - displayValue: - nullable: true - type: string - field: - nullable: true - type: string - operator: - nullable: true - type: string - value: - nullable: true - type: string - Security_Solution_Timeline_API_Readable: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for data frame analytics jobs type: object + Machine_learning_APIs_mlSyncResponseSavedObjectsCreated: + description: >- + If saved objects are missing for machine learning jobs or trained + models, they are created when you run the sync machine learning saved + objects API. properties: - _data: - additionalProperties: true - type: object - _encoding: - type: string - _events: - additionalProperties: true - type: object - _eventsCount: - type: number - _maxListeners: - additionalProperties: true + anomaly-detector: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors + description: >- + If saved objects are missing for anomaly detection jobs, they are + created. type: object - _position: - type: number - _read: - additionalProperties: true + data-frame-analytics: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics + description: >- + If saved objects are missing for data frame analytics jobs, they are + created. type: object - _readableState: - additionalProperties: true + trained-model: + additionalProperties: + $ref: >- + #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels + description: 'If saved objects are missing for trained models, they are created.' type: object - readable: - type: boolean - Security_Solution_Timeline_API_RowRendererId: - enum: - - alert - - alerts - - auditd - - auditd_file - - library - - netflow - - plain - - registry - - suricata - - system - - system_dns - - system_endgame_process - - system_file - - system_fim - - system_security_event - - system_socket - - threat_match - - zeek - type: string - Security_Solution_Timeline_API_SavedTimeline: + title: Sync API response for created saved objects type: object + Machine_learning_APIs_mlSyncResponseSavedObjectsDeleted: + description: >- + If saved objects exist for machine learning jobs or trained models that + no longer exist, they are deleted when you run the sync machine learning + saved objects API. properties: - columns: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_ColumnHeaderResult - nullable: true - type: array - created: - nullable: true - type: number - createdBy: - nullable: true - type: string - dataProviders: - items: + anomaly-detector: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_DataProviderResult - nullable: true - type: array - dataViewId: - nullable: true - type: string - dateRange: - nullable: true - type: object - properties: - end: - oneOf: - - type: string - - type: number - start: - oneOf: - - type: string - - type: number - description: - nullable: true - type: string - eqlOptions: - nullable: true + #/components/schemas/Machine_learning_APIs_mlSyncResponseAnomalyDetectors + description: >- + If there are saved objects exist for nonexistent anomaly detection + jobs, they are deleted. type: object - properties: - eventCategoryField: - nullable: true - type: string - query: - nullable: true - type: string - size: - oneOf: - - nullable: true - type: string - - nullable: true - type: number - tiebreakerField: - nullable: true - type: string - timestampField: - nullable: true - type: string - eventType: - nullable: true - type: string - excludedRowRendererIds: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_RowRendererId' - nullable: true - type: array - favorite: - items: + data-frame-analytics: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FavoriteTimelineResult - nullable: true - type: array - filters: - items: + #/components/schemas/Machine_learning_APIs_mlSyncResponseDataFrameAnalytics + description: >- + If there are saved objects exist for nonexistent data frame + analytics jobs, they are deleted. + type: object + trained-model: + additionalProperties: $ref: >- - #/components/schemas/Security_Solution_Timeline_API_FilterTimelineResult - nullable: true - type: array - indexNames: - items: - type: string - nullable: true - type: array - kqlMode: - nullable: true - type: string - kqlQuery: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_SerializedFilterQueryResult - nullable: true - savedQueryId: - nullable: true - type: string - savedSearchId: - nullable: true - type: string - sort: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Sort' - nullable: true - status: - enum: - - active - - draft - - immutable - nullable: true - type: string - templateTimelineId: - nullable: true - type: string - templateTimelineVersion: - nullable: true - type: number - timelineType: - $ref: '#/components/schemas/Security_Solution_Timeline_API_TimelineType' - nullable: true - title: - nullable: true - type: string - updated: - nullable: true - type: number - updatedBy: - nullable: true - type: string - Security_Solution_Timeline_API_SerializedFilterQueryResult: + #/components/schemas/Machine_learning_APIs_mlSyncResponseTrainedModels + description: >- + If there are saved objects exist for nonexistent trained models, + they are deleted. + type: object + title: Sync API response for deleted saved objects type: object + Machine_learning_APIs_mlSyncResponseSuccess: + description: The success or failure of the synchronization. + type: boolean + Machine_learning_APIs_mlSyncResponseTrainedModels: + description: >- + The sync machine learning saved objects API response contains this + object when there are trained models affected by the synchronization. + There is an object for each relevant trained model, which contains the + synchronization status. properties: - filterQuery: - nullable: true - type: object - properties: - kuery: - nullable: true - type: object - properties: - expression: - nullable: true - type: string - kind: - nullable: true - type: string - serializedQuery: - nullable: true - type: string - Security_Solution_Timeline_API_Sort: - oneOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SortObject' - - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_SortObject' - type: array - Security_Solution_Timeline_API_SortFieldTimeline: - description: The field to sort the timelines by. - enum: - - title - - description - - updated - - created - type: string - Security_Solution_Timeline_API_SortObject: + success: + $ref: '#/components/schemas/Machine_learning_APIs_mlSyncResponseSuccess' + title: Sync API response for trained models + type: object + Saved_objects_400_response: + title: Bad request type: object properties: - columnId: - nullable: true - type: string - columnType: - nullable: true + error: + enum: + - Bad Request type: string - sortDirection: - nullable: true + message: type: string - Security_Solution_Timeline_API_TimelineResponse: - allOf: - - $ref: '#/components/schemas/Security_Solution_Timeline_API_SavedTimeline' - - type: object - properties: - eventIdToNoteIds: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Note' - type: array - noteIds: - items: - type: string - type: array - notes: - items: - $ref: '#/components/schemas/Security_Solution_Timeline_API_Note' - type: array - pinnedEventIds: - items: - type: string - type: array - pinnedEventsSaveObject: - items: - $ref: >- - #/components/schemas/Security_Solution_Timeline_API_PinnedEvent - type: array - savedObjectId: - type: string - version: - type: string - required: - - savedObjectId - - version - Security_Solution_Timeline_API_TimelineStatus: - description: >- - The status of the timeline. Valid values are `active`, `draft`, and - `immutable`. - enum: - - active - - draft - - immutable - type: string - Security_Solution_Timeline_API_TimelineType: - description: >- - The type of timeline to create. Valid values are `default` and - `template`. - enum: - - default - - template - type: string + statusCode: + enum: + - 400 + type: integer + required: + - error + - message + - statusCode + Saved_objects_attributes: + description: > + The data that you want to create. WARNING: When you create saved + objects, attributes are not validated, which allows you to pass + arbitrary and ill-formed data into the API that can break Kibana. Make + sure any data that you send to the API is properly formed. + type: object + Saved_objects_initial_namespaces: + description: > + Identifiers for the spaces in which this object is created. If this is + provided, the object is created only in the explicitly defined spaces. + If this is not provided, the object is created in the current space + (default behavior). For shareable object types (registered with + `namespaceType: 'multiple'`), this option can be used to specify one or + more spaces, including the "All spaces" identifier ('*'). For isolated + object types (registered with `namespaceType: 'single'` or + `namespaceType: 'multiple-isolated'`), this option can only be used to + specify a single space, and the "All spaces" identifier ('*') is not + allowed. For global object types (`registered with `namespaceType: + agnostic`), this option cannot be used. + type: array + Saved_objects_references: + description: > + Objects with `name`, `id`, and `type` properties that describe the other + saved objects that this object references. Use `name` in attributes to + refer to the other saved object, but never the `id`, which can update + automatically during migrations or import and export. + type: array SLOs_400_response: title: Bad request type: object @@ -29027,9 +27549,14 @@ components: in: header name: Authorization type: apiKey + basicAuth: + scheme: basic + type: http security: - apiKeyAuth: [] + - basicAuth: [] tags: + - name: alerting - description: > Configure APM agent keys to authorize requests from APM agents to the APM Server. @@ -29039,42 +27566,36 @@ tags: Annotations enable you to easily see how events are impacting the performance of your applications. name: APM annotations + - description: Case APIs enable you to open and track issues. + name: cases - description: Connector APIs enable you to create and manage connectors. name: connectors + - name: Data streams - description: >- Data view APIs enable you to manage data views, formerly known as Kibana index patterns. name: data views + - name: Elastic Agent actions + - name: Elastic Agent binary download sources + - name: Elastic Agent policies + - name: Elastic Agent status + - name: Elastic Agents + - name: Elastic Package Manager (EPM) + - name: Fleet enrollment API keys + - name: Fleet internals + - name: Fleet Kubernetes + - name: Fleet outputs + - name: Fleet package policies + - name: Fleet proxies + - name: Fleet Server hosts + - name: Fleet service tokens + - name: Fleet uninstall tokens - description: Machine learning name: ml - description: >- Manage Kibana saved objects, including dashboards, visualizations, and more. name: saved objects - - description: Manage and interact with Security Assistant resources. - name: Security AI Assistant API - - description: >- - You can create rules that automatically turn events and external alerts - sent to Elastic Security into detection alerts. These alerts are displayed - on the Detections page. - name: Security Solution Detections API - - description: Interact with and manage endpoints running the Elastic Defend integration. - name: Security Solution Endpoint Management API - - description: '' - name: Security Solution Entity Analytics API - - description: >- - Exceptions API allows you to manage detection rule exceptions to prevent a - rule from generating an alert from incoming events even when the rule's - other criteria are met. - name: Security Solution Exceptions API - - description: 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.' - name: Security Solution Lists API - - description: 'Run live queries, manage packs and saved queries.' - name: Security Solution Osquery API - - description: >- - You can create Timelines and Timeline templates via the API, as well as - import new Timelines from an ndjson file. - name: Security Solution Timeline API - description: 'SLO APIs enable you to define, manage and track service-level objectives' name: slo - name: system diff --git a/oas_docs/overlays/alerting.overlays.yaml b/oas_docs/overlays/alerting.overlays.yaml new file mode 100644 index 0000000000000..c4cc25b685783 --- /dev/null +++ b/oas_docs/overlays/alerting.overlays.yaml @@ -0,0 +1,150 @@ +# overlays.yaml +overlay: 1.0.0 +info: + title: Overlays for the alerting rule examples and parameters + version: 0.0.1 +actions: + # Add some alerting API examples + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add examples to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleRequest: + $ref: "../examples/create_es_query_esql_rule_request.yaml" + createEsQueryRuleRequest: + $ref: "../examples/create_es_query_rule_request.yaml" + createEsQueryKqlRuleRequest: + $ref: "../examples/create_es_query_kql_rule_request.yaml" + createIndexThresholdRuleRequest: + $ref: "../examples/create_index_threshold_rule_request.yaml" + createTrackingContainmentRuleRequest: + $ref: "../examples/create_tracking_containment_rule_request.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleResponse: + $ref: "../examples/create_es_query_esql_rule_response.yaml" + createEsQueryRuleResponse: + $ref: "../examples/create_es_query_rule_response.yaml" + createEsQueryKqlRuleResponse: + $ref: "../examples/create_es_query_kql_rule_response.yaml" + createIndexThresholdRuleResponse: + $ref: "../examples/create_index_threshold_rule_response.yaml" + createTrackingContainmentRuleResponse: + $ref: "../examples/create_tracking_containment_rule_response.yaml" + - target: "$.paths['/api/alerting/rule/{id}']['put']" + description: "Add examples to update rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleRequest: + $ref: '../examples/update_rule_request.yaml' + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleResponse: + $ref: '../examples/update_rule_response.yaml' + - target: "$.paths['/api/alerting/rules/_find']['get']" + description: "Add examples to find rules API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + findRulesResponse: + $ref: '../examples/find_rules_response.yaml' + findConditionalActionRulesResponse: + $ref: '../examples/find_rules_response_conditional_action.yaml' + # Fix some optional path parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].parameters[?(@.name=='id')]" + description: Remove optional indicator from path parameter + update: + required: true + # Remove the alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].requestBody.content.*.schema.properties.params" + description: "Remove params type in create rule API" + remove: true + # Add some alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add params to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + anyOf: + # APM anomaly rule (apm.anomaly) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' + # APM error count rule (apm.error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' + # APM transaction duration rule (apm.transaction_duration) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' + # APM transaction error rate rule (apm.transaction_error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' + # Elasticsearch DSL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml' + # Elasticsearch ES|QL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml' + # Elasticsearch KQL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml' + # Index threshold rule () + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml' + # Infra inventory rule (metrics.alert.inventory.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' + # Log threshold rule (logs.alert.document.count) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' + # Infra metric threshold rule (metrics.alert.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' + # SLO burn rate (slo.rules.burnRate) + - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' + # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' + # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' + # TBD + # Anomaly detection alert rule (xpack.ml.anomaly_detection_alert) + # Anomaly detection jobs health rule (xpack.ml.anomaly_detection_jobs_health) + # Tracking containment rule (.geo-containment) + # Infrastructure anomaly rule (metrics.alert.anomaly) + # CCR read exceptions rule (monitoring_ccr_read_exceptions) + # Cluster health rule (monitoring_alert_cluster_health) + # CPU usage rule (monitoring_alert_cpu_usage) + # Custom query rule (siem.queryRule) + # Disk usage rule (monitoring_alert_disk_usage) + # Elasticsearch version mismatch rule (monitoring_alert_elasticsearch_version_mismatch) + # Event correlation rule (siem.eqlRule) + # Indicator match rule (siem.indicatorRule) + # JVM memory usage rule (monitoring_alert_jvm_memory_usage) + # Kibana version mismatch rule ( monitoring_alert_kibana_version_mismatch) + # License expiration rule (monitoring_alert_license_expiration) + # Logstash version mismatch rule (monitoring_alert_logstash_version_mismatch) + # Machine learning rule (siem.mlRule) + # Missing monitoring data rule (monitoring_alert_missing_monitoring_data) + # New terms rule (siem.newTermsRule) + # Nodes changed rule (monitoring_alert_nodes_changed) + # Saved query rule (siem.savedQueryRule) + # Security solution notification (legacy) rule (siem.notifications) + # Shard size rule (monitoring_shard_size) + # Synthetics monitor status rule (xpack.synthetics.alerts.monitorStatus) + # Synthetics uptime duration anomaly rule (xpack.uptime.alerts.durationAnomaly) + # Thread pool search rejections rule (monitoring_alert_thread_pool_search_rejections) + # Thread pool write rejections rule (monitoring_alert_thread_pool_write_rejections) + # Threshold rule (siem.thresholdRule) + # TLS certificate rule (xpack.uptime.alerts.tlsCertificate) + # Transform health (transform_health) + \ No newline at end of file diff --git a/oas_docs/overlays/kibana.overlays.serverless.yaml b/oas_docs/overlays/kibana.overlays.serverless.yaml index 6ed2329c24dca..dc21647813180 100644 --- a/oas_docs/overlays/kibana.overlays.serverless.yaml +++ b/oas_docs/overlays/kibana.overlays.serverless.yaml @@ -15,30 +15,23 @@ actions: variables: kibana_url: default: localhost:5601 - # Remove operation-level security definitions - - target: "$.paths['/api/status']['get'].security" - description: Remove system security definitions - remove: true - # Add a document-level security definition - - target: '$.components.securitySchemes' - description: Add an API key security scheme - update: - apiKeyAuth: - in: header - name: Authorization - type: apiKey - description: You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys). - - target: '$' - description: Add document-level security. - update: - security: - - apiKeyAuth: [] # Mark all operations as beta - - target: '$.paths[*][*]' + - target: "$.paths[*]['get','put','post','delete','options','head','patch','trace']" description: Add x-beta update: x-beta: true # Add some tag descriptions and displayNames + - target: '$.tags[?(@.name=="alerting")]' + description: Change tag description and displayName + update: + description: > + Alerting enables you to define rules, which detect complex conditions within your data. + When a condition is met, the rule tracks it as an alert and runs the actions that are defined in the rule. + Actions typically involve the use of connectors to interact with Kibana services or third party integrations. + externalDocs: + description: Alerting documentation + url: https://www.elastic.co/docs/current/serverless/rules + x-displayName: "Alerting" - target: '$.tags[?(@.name=="connectors")]' description: Change tag description and displayName update: diff --git a/oas_docs/overlays/kibana.overlays.yaml b/oas_docs/overlays/kibana.overlays.yaml index 22162721c6867..926550ca085b7 100644 --- a/oas_docs/overlays/kibana.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.yaml @@ -4,42 +4,6 @@ info: title: Overlays for the Kibana API document version: 0.0.1 actions: - # Clean up server definitions - - target: '$.servers.*' - description: Remove all servers so we can add our own. - remove: true - - target: '$.servers' - description: Add server into the now empty server array. - update: - - url: https://{kibana_url} - variables: - kibana_url: - default: localhost:5601 - # Remove operation-level security definitions - - target: "$.paths['/api/status']['get'].security" - description: Remove system security definitions - remove: true - # Add document-level security definitions - - target: '$.components.securitySchemes' - description: Add an API key security scheme - update: - apiKeyAuth: - in: header - name: Authorization - type: apiKey - description: You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/guide/en/kibana/current/api-keys.html). - - target: '$.components.securitySchemes' - description: Add an basic security scheme - update: - basicAuth: - type: http - scheme: basic - - target: '$' - description: Add document-level security. - update: - security: - - apiKeyAuth: [] - - basicAuth: [] # Add an introduction to spaces - target: '$' description: Add an extra page about spaces @@ -105,10 +69,10 @@ actions: description: Change displayName update: x-displayName: "Saved objects" - # - target: '$.tags[?(@.name=="slo")]' - # description: Change displayName - # update: - # x-displayName: "Service level objectives" + - target: '$.tags[?(@.name=="slo")]' + description: Change displayName + update: + x-displayName: "Service level objectives" - target: '$.tags[?(@.name=="system")]' description: Change displayName update: diff --git a/oas_docs/scripts/merge_ess_oas.js b/oas_docs/scripts/merge_ess_oas.js index a1812670c15f9..f54f7081889f4 100644 --- a/oas_docs/scripts/merge_ess_oas.js +++ b/oas_docs/scripts/merge_ess_oas.js @@ -15,21 +15,18 @@ const { REPO_ROOT } = require('@kbn/repo-info'); sourceGlobs: [ `${REPO_ROOT}/oas_docs/bundle.json`, `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/alerting/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/cases/docs/openapi/bundled.yaml`, `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis.yaml`, `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/fleet/common/openapi/bundled.yaml`, // Observability Solution `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, // Security solution - `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/ess/*.schema.yaml`, ], outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.yaml`, options: { diff --git a/oas_docs/scripts/merge_ess_oas_staging.js b/oas_docs/scripts/merge_ess_oas_staging.js new file mode 100644 index 0000000000000..72b2aae4a4eff --- /dev/null +++ b/oas_docs/scripts/merge_ess_oas_staging.js @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../../src/setup_node_env'); +const { merge } = require('@kbn/openapi-bundler'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +(async () => { + await merge({ + sourceGlobs: [ + `${REPO_ROOT}/oas_docs/bundle.json`, + `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/alerting/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/cases/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis.yaml`, + `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/fleet/common/openapi/bundled.yaml`, + + // Observability Solution + `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, + `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, + + // Security solution + `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/ess/*.schema.yaml`, + ], + outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.staging.yaml`, + options: { + prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.yaml`, + }, + }); +})(); diff --git a/oas_docs/scripts/merge_serverless_oas.js b/oas_docs/scripts/merge_serverless_oas.js index e1b9bf3c7ab17..67ae00522741e 100644 --- a/oas_docs/scripts/merge_serverless_oas.js +++ b/oas_docs/scripts/merge_serverless_oas.js @@ -18,22 +18,17 @@ const { REPO_ROOT } = require('@kbn/repo-info'); `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml`, `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`, + `${REPO_ROOT}/x-pack/plugins/fleet/common/openapi/bundled.yaml`, // Observability Solution `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, // Security solution - `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/serverless/*.schema.yaml`, ], outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.serverless.yaml`, options: { - prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.yaml`, + prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.serverless.yaml`, }, }); })(); diff --git a/oas_docs/scripts/merge_serverless_oas_staging.js b/oas_docs/scripts/merge_serverless_oas_staging.js new file mode 100644 index 0000000000000..ea932fc08f291 --- /dev/null +++ b/oas_docs/scripts/merge_serverless_oas_staging.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +require('../../src/setup_node_env'); +const { merge } = require('@kbn/openapi-bundler'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +(async () => { + await merge({ + sourceGlobs: [ + `${REPO_ROOT}/oas_docs/bundle.serverless.json`, + `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml`, + `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, + `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml`, + `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`, + `${REPO_ROOT}/x-pack/plugins/fleet/common/openapi/bundled.yaml`, + + // Observability Solution + `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, + `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, + + // Security solution + `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/serverless/*.schema.yaml`, + ], + outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.serverless.staging.yaml`, + options: { + prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.serverless.yaml`, + }, + }); +})(); diff --git a/package.json b/package.json index 90f91cf7d98e6..3bcbda6c44346 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "lint:es": "node scripts/eslint", "lint:style": "node scripts/stylelint", "makelogs": "node scripts/makelogs", + "quick-checks": "node scripts/quick_checks", "serverless": "node scripts/kibana --dev --serverless", "serverless-es": "node scripts/kibana --dev --serverless=es", "serverless-oblt": "node scripts/kibana --dev --serverless=oblt", @@ -106,20 +107,21 @@ "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", "@elastic/apm-rum": "^5.16.1", - "@elastic/apm-rum-core": "^5.21.0", + "@elastic/apm-rum-core": "^5.21.1", "@elastic/apm-rum-react": "^2.0.3", - "@elastic/charts": "66.1.0", + "@elastic/charts": "66.1.1", "@elastic/datemath": "5.0.3", - "@elastic/ebt": "1.0.0", + "@elastic/ebt": "^1.1.1", "@elastic/ecs": "^8.11.1", - "@elastic/elasticsearch": "^8.14.0", + "@elastic/elasticsearch": "^8.15.0", "@elastic/ems-client": "8.5.3", - "@elastic/eui": "95.6.0", + "@elastic/eui": "95.7.0", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.20.2", "@elastic/react-search-ui-views": "^1.20.2", + "@elastic/request-converter": "^8.15.3", "@elastic/request-crypto": "2.0.2", "@elastic/search-ui": "^1.20.2", "@elastic/search-ui-app-search-connector": "^1.20.2", @@ -197,6 +199,7 @@ "@kbn/cases-api-integration-test-plugin": "link:x-pack/test/cases_api_integration/common/plugins/cases", "@kbn/cases-components": "link:packages/kbn-cases-components", "@kbn/cases-plugin": "link:x-pack/plugins/cases", + "@kbn/cbor": "link:packages/kbn-cbor", "@kbn/cell-actions": "link:packages/kbn-cell-actions", "@kbn/chart-expressions-common": "link:src/plugins/chart_expressions/common", "@kbn/chart-icons": "link:packages/kbn-chart-icons", @@ -210,6 +213,8 @@ "@kbn/cloud-integration-saml-provider-plugin": "link:x-pack/test/cloud_integration/plugins/saml_provider", "@kbn/cloud-links-plugin": "link:x-pack/plugins/cloud_integrations/cloud_links", "@kbn/cloud-plugin": "link:x-pack/plugins/cloud", + "@kbn/cloud-security-posture": "link:x-pack/packages/kbn-cloud-security-posture", + "@kbn/cloud-security-posture-common": "link:x-pack/packages/kbn-cloud-security-posture-common", "@kbn/cloud-security-posture-plugin": "link:x-pack/plugins/cloud_security_posture", "@kbn/code-editor": "link:packages/shared-ux/code_editor/impl", "@kbn/code-editor-mock": "link:packages/shared-ux/code_editor/mocks", @@ -219,6 +224,8 @@ "@kbn/config-schema": "link:packages/kbn-config-schema", "@kbn/console-plugin": "link:src/plugins/console", "@kbn/content-management-content-editor": "link:packages/content-management/content_editor", + "@kbn/content-management-content-insights-public": "link:packages/content-management/content_insights/content_insights_public", + "@kbn/content-management-content-insights-server": "link:packages/content-management/content_insights/content_insights_server", "@kbn/content-management-examples-plugin": "link:examples/content_management_examples", "@kbn/content-management-favorites-public": "link:packages/content-management/favorites/favorites_public", "@kbn/content-management-favorites-server": "link:packages/content-management/favorites/favorites_server", @@ -456,6 +463,7 @@ "@kbn/enterprise-search-plugin": "link:x-pack/plugins/enterprise_search", "@kbn/entities-data-access-plugin": "link:x-pack/plugins/observability_solution/entities_data_access", "@kbn/entities-schema": "link:x-pack/packages/kbn-entities-schema", + "@kbn/entity-manager-fixture-plugin": "link:x-pack/test/api_integration/apis/entity_manager/fixture_plugin", "@kbn/entityManager-plugin": "link:x-pack/plugins/observability_solution/entity_manager", "@kbn/error-boundary-example-plugin": "link:examples/error_boundary", "@kbn/es-errors": "link:packages/kbn-es-errors", @@ -471,6 +479,7 @@ "@kbn/esql-utils": "link:packages/kbn-esql-utils", "@kbn/esql-validation-autocomplete": "link:packages/kbn-esql-validation-autocomplete", "@kbn/esql-validation-example-plugin": "link:examples/esql_validation_example", + "@kbn/eui-provider-dev-warning": "link:test/plugin_functional/plugins/eui_provider_dev_warning", "@kbn/event-annotation-common": "link:packages/kbn-event-annotation-common", "@kbn/event-annotation-components": "link:packages/kbn-event-annotation-components", "@kbn/event-annotation-listing-plugin": "link:src/plugins/event_annotation_listing", @@ -522,6 +531,8 @@ "@kbn/global-search-providers-plugin": "link:x-pack/plugins/global_search_providers", "@kbn/global-search-test-plugin": "link:x-pack/test/plugin_functional/plugins/global_search_test", "@kbn/graph-plugin": "link:x-pack/plugins/graph", + "@kbn/grid-example-plugin": "link:examples/grid_example", + "@kbn/grid-layout": "link:packages/kbn-grid-layout", "@kbn/grokdebugger-plugin": "link:x-pack/plugins/grokdebugger", "@kbn/grouping": "link:packages/kbn-grouping", "@kbn/guided-onboarding": "link:packages/kbn-guided-onboarding", @@ -529,6 +540,7 @@ "@kbn/guided-onboarding-plugin": "link:src/plugins/guided_onboarding", "@kbn/handlebars": "link:packages/kbn-handlebars", "@kbn/hapi-mocks": "link:packages/kbn-hapi-mocks", + "@kbn/hardening-plugin": "link:test/plugin_functional/plugins/hardening", "@kbn/health-gateway-server": "link:packages/kbn-health-gateway-server", "@kbn/hello-world-plugin": "link:examples/hello_world", "@kbn/home-plugin": "link:src/plugins/home", @@ -556,6 +568,7 @@ "@kbn/interpreter": "link:packages/kbn-interpreter", "@kbn/investigate-app-plugin": "link:x-pack/plugins/observability_solution/investigate_app", "@kbn/investigate-plugin": "link:x-pack/plugins/observability_solution/investigate", + "@kbn/investigation-shared": "link:packages/kbn-investigation-shared", "@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils", "@kbn/ipynb": "link:packages/kbn-ipynb", "@kbn/json-schemas": "link:x-pack/packages/ml/json_schemas", @@ -649,6 +662,7 @@ "@kbn/no-data-page-plugin": "link:src/plugins/no_data_page", "@kbn/notifications-plugin": "link:x-pack/plugins/notifications", "@kbn/object-versioning": "link:packages/kbn-object-versioning", + "@kbn/object-versioning-utils": "link:packages/kbn-object-versioning-utils", "@kbn/observability-ai-assistant-app-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant_app", "@kbn/observability-ai-assistant-management-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant_management", "@kbn/observability-ai-assistant-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant", @@ -661,6 +675,7 @@ "@kbn/observability-onboarding-plugin": "link:x-pack/plugins/observability_solution/observability_onboarding", "@kbn/observability-plugin": "link:x-pack/plugins/observability_solution/observability", "@kbn/observability-shared-plugin": "link:x-pack/plugins/observability_solution/observability_shared", + "@kbn/observability-utils": "link:x-pack/packages/observability/observability_utils", "@kbn/oidc-provider-plugin": "link:x-pack/test/security_api_integration/plugins/oidc_provider", "@kbn/open-telemetry-instrumented-plugin": "link:test/common/plugins/otel_metrics", "@kbn/openapi-common": "link:packages/kbn-openapi-common", @@ -740,13 +755,16 @@ "@kbn/screenshot-mode-plugin": "link:src/plugins/screenshot_mode", "@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example", "@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting", + "@kbn/screenshotting-server": "link:packages/kbn-screenshotting-server", "@kbn/search-api-panels": "link:packages/kbn-search-api-panels", + "@kbn/search-assistant": "link:x-pack/plugins/search_assistant", "@kbn/search-connectors": "link:packages/kbn-search-connectors", "@kbn/search-connectors-plugin": "link:x-pack/plugins/search_connectors", "@kbn/search-errors": "link:packages/kbn-search-errors", "@kbn/search-examples-plugin": "link:examples/search_examples", "@kbn/search-homepage": "link:x-pack/plugins/search_homepage", "@kbn/search-index-documents": "link:packages/kbn-search-index-documents", + "@kbn/search-indices": "link:x-pack/plugins/search_indices", "@kbn/search-inference-endpoints": "link:x-pack/plugins/search_inference_endpoints", "@kbn/search-notebooks": "link:x-pack/plugins/search_notebooks", "@kbn/search-playground": "link:x-pack/plugins/search_playground", @@ -754,12 +772,15 @@ "@kbn/search-types": "link:packages/kbn-search-types", "@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler", "@kbn/security-api-key-management": "link:x-pack/packages/security/api_key_management", + "@kbn/security-authorization-core": "link:x-pack/packages/security/authorization_core", "@kbn/security-form-components": "link:x-pack/packages/security/form_components", "@kbn/security-hardening": "link:packages/kbn-security-hardening", "@kbn/security-plugin": "link:x-pack/plugins/security", "@kbn/security-plugin-types-common": "link:x-pack/packages/security/plugin_types_common", "@kbn/security-plugin-types-public": "link:x-pack/packages/security/plugin_types_public", "@kbn/security-plugin-types-server": "link:x-pack/packages/security/plugin_types_server", + "@kbn/security-role-management-model": "link:x-pack/packages/security/role_management_model", + "@kbn/security-solution-common": "link:x-pack/packages/security-solution/common", "@kbn/security-solution-distribution-bar": "link:x-pack/packages/security-solution/distribution_bar", "@kbn/security-solution-ess": "link:x-pack/plugins/security_solution_ess", "@kbn/security-solution-features": "link:x-pack/packages/security-solution/features", @@ -771,6 +792,7 @@ "@kbn/security-solution-storybook-config": "link:x-pack/packages/security-solution/storybook/config", "@kbn/security-solution-upselling": "link:x-pack/packages/security-solution/upselling", "@kbn/security-test-endpoints-plugin": "link:x-pack/test/security_functional/plugins/test_endpoints", + "@kbn/security-ui-components": "link:x-pack/packages/security/ui_components", "@kbn/securitysolution-autocomplete": "link:packages/kbn-securitysolution-autocomplete", "@kbn/securitysolution-data-table": "link:x-pack/packages/security-solution/data_table", "@kbn/securitysolution-ecs": "link:packages/kbn-securitysolution-ecs", @@ -858,6 +880,7 @@ "@kbn/shared-ux-storybook-config": "link:packages/shared-ux/storybook/config", "@kbn/shared-ux-storybook-mock": "link:packages/shared-ux/storybook/mock", "@kbn/shared-ux-tabbed-modal": "link:packages/shared-ux/modal/tabbed", + "@kbn/shared-ux-table-persist": "link:packages/shared-ux/table_persist", "@kbn/shared-ux-utility": "link:packages/kbn-shared-ux-utility", "@kbn/slo-plugin": "link:x-pack/plugins/observability_solution/slo", "@kbn/slo-schema": "link:x-pack/packages/kbn-slo-schema", @@ -957,10 +980,10 @@ "@langchain/community": "0.2.18", "@langchain/core": "^0.2.18", "@langchain/google-genai": "^0.0.23", - "@langchain/langgraph": "^0.0.31", + "@langchain/langgraph": "0.0.34", "@langchain/openai": "^0.1.3", "@langtrase/trace-attributes": "^3.0.8", - "@launchdarkly/node-server-sdk": "^9.5.0", + "@launchdarkly/node-server-sdk": "^9.5.1", "@loaders.gl/core": "^3.4.7", "@loaders.gl/json": "^3.4.7", "@loaders.gl/shapefile": "^3.4.7", @@ -1008,17 +1031,17 @@ "archiver": "^5.3.1", "async": "^3.2.3", "aws4": "^1.12.0", - "axios": "^1.6.8", + "axios": "^1.7.4", "base64-js": "^1.3.1", "bitmap-sdf": "^1.0.3", "blurhash": "^2.0.1", + "borc": "3.0.0", "brace": "0.11.1", "brok": "^5.0.2", "byte-size": "^8.1.0", "cacheable-lookup": "6", "camelcase-keys": "7.0.2", "canvg": "^3.0.9", - "cbor-x": "^1.3.3", "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.12", "chroma-js": "^2.1.0", @@ -1049,7 +1072,7 @@ "deepmerge": "^4.2.2", "del": "^6.1.0", "diff": "^5.1.0", - "elastic-apm-node": "^4.7.2", + "elastic-apm-node": "^4.7.3", "email-addresses": "^5.0.0", "eventsource-parser": "^1.1.1", "execa": "^5.1.1", @@ -1115,9 +1138,9 @@ "mime": "^2.4.4", "mime-types": "^2.1.27", "minimatch": "^3.1.2", - "moment": "^2.29.4", + "moment": "^2.30.1", "moment-duration-format": "^2.3.2", - "moment-timezone": "^0.5.43", + "moment-timezone": "^0.5.45", "monaco-editor": "^0.44.0", "monaco-yaml": "^5.1.0", "murmurhash": "^2.0.1", @@ -1277,10 +1300,10 @@ "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@istanbuljs/schema": "^0.1.2", - "@jest/console": "^29.6.1", - "@jest/reporters": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@kayahr/text-encoding": "^1.3.0", "@kbn/alerting-api-integration-helpers": "link:x-pack/test/alerting_api_integration/packages/helpers", "@kbn/ambient-common-types": "link:packages/kbn-ambient-common-types", @@ -1297,6 +1320,7 @@ "@kbn/bazel-runner": "link:packages/kbn-bazel-runner", "@kbn/capture-oas-snapshot-cli": "link:packages/kbn-capture-oas-snapshot-cli", "@kbn/check-mappings-update-cli": "link:packages/kbn-check-mappings-update-cli", + "@kbn/check-prod-native-modules-cli": "link:packages/kbn-check-prod-native-modules-cli", "@kbn/ci-stats-core": "link:packages/kbn-ci-stats-core", "@kbn/ci-stats-performance-metrics": "link:packages/kbn-ci-stats-performance-metrics", "@kbn/ci-stats-reporter": "link:packages/kbn-ci-stats-reporter", @@ -1456,6 +1480,7 @@ "@storybook/react": "^6.5.16", "@storybook/testing-react": "^1.3.0", "@storybook/theming": "^6.5.16", + "@testing-library/dom": "^8.19.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^8.0.1", @@ -1575,7 +1600,7 @@ "@types/redux-actions": "^2.6.1", "@types/resolve": "^1.20.1", "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/selenium-webdriver": "^4.1.23", + "@types/selenium-webdriver": "^4.1.25", "@types/semver": "^7.5.8", "@types/set-value": "^2.0.0", "@types/sinon": "^7.0.13", @@ -1610,11 +1635,10 @@ "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "@yarnpkg/lockfile": "^1.1.0", "aggregate-error": "^3.1.0", - "apidoc-markdown": "^7.3.2", "argsplit": "^1.0.5", "autoprefixer": "^10.4.7", - "axe-core": "^4.9.0", - "babel-jest": "^29.6.1", + "axe-core": "^4.10.0", + "babel-jest": "^29.7.0", "babel-loader": "^8.2.5", "babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-istanbul": "^6.1.1", @@ -1627,7 +1651,7 @@ "buildkite-test-collector": "^1.7.0", "callsites": "^3.1.0", "chance": "1.0.18", - "chromedriver": "^126.0.3", + "chromedriver": "^127.0.3", "clean-webpack-plugin": "^3.0.0", "cli-progress": "^3.12.0", "cli-table3": "^0.6.1", @@ -1653,7 +1677,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ban": "^1.6.0", "eslint-plugin-cypress": "^2.15.1", - "eslint-plugin-depend": "^0.9.0", + "eslint-plugin-depend": "^0.10.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-formatjs": "^4.12.2", "eslint-plugin-import": "^2.28.0", @@ -1668,14 +1692,15 @@ "eslint-plugin-react-perf": "^3.3.1", "eslint-traverse": "^1.0.0", "exit-hook": "^2.2.0", - "expect": "^29.6.1", + "expect": "^29.7.0", "expose-loader": "^0.7.5", + "express": "^4.19.2", "faker": "^5.1.0", "fetch-mock": "^7.3.9", "file-loader": "^4.2.0", "find-cypress-specs": "^1.41.4", "form-data": "^4.0.0", - "geckodriver": "^4.4.1", + "geckodriver": "^4.4.3", "gulp-brotli": "^3.0.0", "gulp-postcss": "^9.0.1", "gulp-terser": "^2.1.0", @@ -1686,16 +1711,16 @@ "http2-proxy": "^5.0.53", "http2-wrapper": "^2.2.1", "ignore": "^5.3.0", - "jest": "^29.6.1", + "jest": "^29.7.0", "jest-canvas-mock": "^2.5.2", - "jest-cli": "^29.6.1", - "jest-config": "^29.6.1", - "jest-diff": "^29.6.1", - "jest-environment-jsdom": "^29.6.1", - "jest-matcher-utils": "^29.6.1", - "jest-mock": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-snapshot": "^29.6.1", + "jest-cli": "^29.7.0", + "jest-config": "^29.7.0", + "jest-diff": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", "jest-specific-snapshot": "^8.0.0", "jest-styled-components": "7.0.3", "jsdom": "^20.0.1", @@ -1750,7 +1775,7 @@ "rxjs-marbles": "^7.0.1", "sass-embedded": "^1.77.8", "sass-loader": "^10.5.1", - "selenium-webdriver": "^4.22.0", + "selenium-webdriver": "^4.23.0", "sharp": "0.32.6", "simple-git": "^3.16.0", "sinon": "^7.4.2", @@ -1763,9 +1788,11 @@ "superagent": "^9.0.2", "supertest": "^7.0.0", "svgo": "^2.8.0", + "swagger-jsdoc": "^6.2.8", + "swagger-ui-express": "^5.0.1", "table": "^6.8.1", "tape": "^5.0.1", - "terser": "^5.31.3", + "terser": "^5.31.6", "terser-webpack-plugin": "^4.2.3", "tough-cookie": "^4.1.4", "tree-kill": "^1.2.2", diff --git a/packages/content-management/content_editor/src/components/activity_view.tsx b/packages/content-management/content_editor/src/components/activity_view.tsx deleted file mode 100644 index eb413acb20e36..0000000000000 --- a/packages/content-management/content_editor/src/components/activity_view.tsx +++ /dev/null @@ -1,185 +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 { - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiIconTip, - EuiPanel, - EuiSpacer, - EuiText, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import React from 'react'; -import { - UserAvatarTip, - useUserProfile, - NoUpdaterTip, - NoCreatorTip, - ManagedAvatarTip, -} from '@kbn/content-management-user-profiles'; -import { getUserDisplayName } from '@kbn/user-profile-components'; - -import { Item } from '../types'; - -export interface ActivityViewProps { - item: Pick; -} - -export const ActivityView = ({ item }: ActivityViewProps) => { - const showLastUpdated = Boolean(item.updatedAt && item.updatedAt !== item.createdAt); - - const UnknownUserLabel = ( - - ); - - const ManagedUserLabel = ( - <> - {' '} - - - ); - - return ( - - {' '} - - } - /> - - } - fullWidth - data-test-subj={'activityView'} - > - <> - - - - ) : item.managed ? ( - <>{ManagedUserLabel} - ) : ( - <> - {UnknownUserLabel} - - - ) - } - when={item.createdAt} - data-test-subj={'createdByCard'} - /> - - - {showLastUpdated && ( - - ) : item.managed ? ( - <>{ManagedUserLabel} - ) : ( - <> - {UnknownUserLabel} - - - ) - } - when={item.updatedAt} - data-test-subj={'updatedByCard'} - /> - )} - - - - - ); -}; - -const dateFormatter = new Intl.DateTimeFormat(i18n.getLocale(), { - dateStyle: 'long', - timeStyle: 'short', -}); - -const ActivityCard = ({ - what, - when, - who, - 'data-test-subj': dataTestSubj, -}: { - what: string; - who: React.ReactNode; - when?: string; - 'data-test-subj'?: string; -}) => { - return ( - - - {what} - - - - {who} - - {when && ( - <> - - - - - - )} - - ); -}; - -const UserLabel = ({ uid }: { uid: string }) => { - const userQuery = useUserProfile(uid); - - if (!userQuery.data) return null; - - return ( - <> - {getUserDisplayName(userQuery.data.user)} - - ); -}; diff --git a/packages/content-management/content_editor/src/components/editor_flyout_content.tsx b/packages/content-management/content_editor/src/components/editor_flyout_content.tsx index a347dbb2c4d31..acc5f68d62b02 100644 --- a/packages/content-management/content_editor/src/components/editor_flyout_content.tsx +++ b/packages/content-management/content_editor/src/components/editor_flyout_content.tsx @@ -28,7 +28,6 @@ import type { Item } from '../types'; import { MetadataForm } from './metadata_form'; import { useMetadataForm } from './use_metadata_form'; import type { CustomValidators } from './use_metadata_form'; -import { ActivityView } from './activity_view'; const getI18nTexts = ({ entityName }: { entityName: string }) => ({ saveButtonLabel: i18n.translate('contentManagement.contentEditor.saveButtonLabel', { @@ -56,7 +55,7 @@ export interface Props { }) => Promise; customValidators?: CustomValidators; onCancel: () => void; - showActivityView?: boolean; + appendRows?: React.ReactNode; } const capitalize = (str: string) => `${str.charAt(0).toLocaleUpperCase()}${str.substring(1)}`; @@ -70,7 +69,7 @@ export const ContentEditorFlyoutContent: FC = ({ onSave, onCancel, customValidators, - showActivityView, + appendRows, }) => { const { euiTheme } = useEuiTheme(); const [isSubmitting, setIsSubmitting] = useState(false); @@ -151,7 +150,7 @@ export const ContentEditorFlyoutContent: FC = ({ TagList={TagList} TagSelector={TagSelector} > - {showActivityView && } + {appendRows} diff --git a/packages/content-management/content_editor/src/components/editor_flyout_content_container.tsx b/packages/content-management/content_editor/src/components/editor_flyout_content_container.tsx index 18094bc04f084..49359cd1801f2 100644 --- a/packages/content-management/content_editor/src/components/editor_flyout_content_container.tsx +++ b/packages/content-management/content_editor/src/components/editor_flyout_content_container.tsx @@ -21,7 +21,7 @@ type CommonProps = Pick< | 'onCancel' | 'entityName' | 'customValidators' - | 'showActivityView' + | 'appendRows' >; export type Props = CommonProps; diff --git a/packages/content-management/content_editor/src/components/editor_loader.tsx b/packages/content-management/content_editor/src/components/editor_loader.tsx index b15009f3b4db1..6bfe88fa2c12a 100644 --- a/packages/content-management/content_editor/src/components/editor_loader.tsx +++ b/packages/content-management/content_editor/src/components/editor_loader.tsx @@ -6,32 +6,30 @@ * Side Public License, v 1. */ -import React, { useState, useCallback, useEffect } from 'react'; -import { EuiFlyoutHeader, EuiFlyoutBody, EuiFlyoutFooter } from '@elastic/eui'; +import React from 'react'; +import { EuiFlyoutBody, EuiFlyoutFooter, EuiFlyoutHeader } from '@elastic/eui'; import type { Props } from './editor_flyout_content_container'; -export const ContentEditorLoader: React.FC = (props) => { - const [Editor, setEditor] = useState | null>(null); - - const loadEditor = useCallback(async () => { - const { ContentEditorFlyoutContentContainer } = await import( - './editor_flyout_content_container' - ); - setEditor(() => ContentEditorFlyoutContentContainer); - }, []); +const ContentEditorFlyoutContentContainer = React.lazy(() => + import('./editor_flyout_content_container').then( + ({ ContentEditorFlyoutContentContainer: _ContentEditorFlyoutContentContainer }) => ({ + default: _ContentEditorFlyoutContentContainer, + }) + ) +); - useEffect(() => { - // On mount: load the editor asynchronously - loadEditor(); - }, [loadEditor]); - - return Editor ? ( - - ) : ( - <> - - - - +export const ContentEditorLoader: React.FC = (props) => { + return ( + + + + + + } + > + + ); }; diff --git a/packages/content-management/content_editor/src/components/inspector_flyout_content.test.tsx b/packages/content-management/content_editor/src/components/inspector_flyout_content.test.tsx index c543acedbae5b..e4668d022d00d 100644 --- a/packages/content-management/content_editor/src/components/inspector_flyout_content.test.tsx +++ b/packages/content-management/content_editor/src/components/inspector_flyout_content.test.tsx @@ -262,22 +262,5 @@ describe('', () => { tags: ['id-3', 'id-4'], // New selection }); }); - - test('should render activity view', async () => { - await act(async () => { - testBed = await setup({ showActivityView: true }); - }); - const { find, component } = testBed!; - - expect(find('activityView').exists()).toBe(true); - expect(find('activityView.createdByCard').exists()).toBe(true); - expect(find('activityView.updatedByCard').exists()).toBe(false); - - testBed.setProps({ - item: { ...savedObjectItem, updatedAt: '2021-01-01T00:00:00Z' }, - }); - component.update(); - expect(find('activityView.updatedByCard').exists()).toBe(true); - }); }); }); diff --git a/packages/content-management/content_editor/src/open_content_editor.tsx b/packages/content-management/content_editor/src/open_content_editor.tsx index 89b73991ba5d6..2365aa9641e23 100644 --- a/packages/content-management/content_editor/src/open_content_editor.tsx +++ b/packages/content-management/content_editor/src/open_content_editor.tsx @@ -21,7 +21,7 @@ export type OpenContentEditorParams = Pick< | 'readonlyReason' | 'entityName' | 'customValidators' - | 'showActivityView' + | 'appendRows' >; export function useOpenContentEditor() { diff --git a/packages/content-management/content_editor/tsconfig.json b/packages/content-management/content_editor/tsconfig.json index b4f77e22f1f44..565535ec85b3e 100644 --- a/packages/content-management/content_editor/tsconfig.json +++ b/packages/content-management/content_editor/tsconfig.json @@ -30,7 +30,6 @@ "@kbn/test-jest-helpers", "@kbn/react-kibana-mount", "@kbn/content-management-user-profiles", - "@kbn/user-profile-components" ], "exclude": [ "target/**/*" diff --git a/packages/content-management/content_insights/README.mdx b/packages/content-management/content_insights/README.mdx new file mode 100644 index 0000000000000..a2a3894775a29 --- /dev/null +++ b/packages/content-management/content_insights/README.mdx @@ -0,0 +1,64 @@ +--- +id: sharedUX/ContentInsights +slug: /shared-ux/content-insights +title: Content Insights +description: A set of Content Management services and component to provide insights on the content of Kibana. +tags: ['shared-ux', 'component'] +date: 2024-08-06 +--- + +## Description + +The Content Insights is a set of Content Management services and components to provide insights on the content of Kibana. +Currently, it allows to track the usage of your content and display the stats of it. + +- The service can count the following events: + - `viewed` +- It provides the api for registering the routes to increase the count and to get the stats. +- It provides the client to increase the count and to get the stats. +- It provides a flyout and a component to display the stats as a total count and a weekly chart. +- Internally it uses the usage collection plugin to store and search the data. + +## API + +// server side + +```ts +import { registerContentInsights } from '@kbn/content-management-content-insights-server'; + +if (plugins.usageCollection) { + // Registers routes for tracking and fetching dashboard views + registerContentInsights( + { + usageCollection: plugins.usageCollection, + http: core.http, + getStartServices: () => + core.getStartServices().then(([_, start]) => ({ + usageCollection: start.usageCollection!, + })), + }, + { + domainId: 'dashboard', + // makes sure that only users with read/all access to dashboard app can access the routes + routeTags: ['access:dashboardUsageStats'], + } + ); +} +``` + +// client side + +```ts +import { ContentInsightsClient } from '@kbn/content-management-content-insights-public'; + +const contentInsightsClient = new ContentInsightsClient( + { http: params.coreStart.http }, + { domainId: 'dashboard' } +); + +contentInsightsClient.track(dashboardId, 'viewed'); + +// wrap component in `ContentInsightsProvider` and use the hook to open an insights flyout +const openInsightsFlyout = useOpenInsightsFlyout(); +openInsightsFlyout({ item }); +``` diff --git a/packages/content-management/content_insights/content_insights_public/README.md b/packages/content-management/content_insights/content_insights_public/README.md new file mode 100644 index 0000000000000..719e26238f12a --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/README.md @@ -0,0 +1,3 @@ +# @kbn/content-management-content-insights-public + +Refer to [README](../README.mdx) diff --git a/packages/content-management/content_insights/content_insights_public/index.ts b/packages/content-management/content_insights/content_insights_public/index.ts new file mode 100644 index 0000000000000..e1a0a67ec39bf --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/index.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 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 { + ContentInsightsProvider, + type ContentInsightsServices, + useServices as useContentInsightsServices, +} from './src/services'; + +export { + type ContentInsightsClientPublic, + ContentInsightsClient, + type ContentInsightsEventTypes, +} from './src/client'; + +export { ActivityView, ViewsStats, type ActivityViewProps } from './src/components'; diff --git a/packages/content-management/content_insights/content_insights_public/jest.config.js b/packages/content-management/content_insights/content_insights_public/jest.config.js new file mode 100644 index 0000000000000..b1844b25fcfca --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/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/content-management/content_insights/content_insights_public'], +}; diff --git a/packages/content-management/content_insights/content_insights_public/kibana.jsonc b/packages/content-management/content_insights/content_insights_public/kibana.jsonc new file mode 100644 index 0000000000000..fc4e12374faf9 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-browser", + "id": "@kbn/content-management-content-insights-public", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/content-management/content_insights/content_insights_public/package.json b/packages/content-management/content_insights/content_insights_public/package.json new file mode 100644 index 0000000000000..ca78ba0f1e39d --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/content-management-content-insights-public", + "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/content-management/content_insights/content_insights_public/src/client.ts b/packages/content-management/content_insights/content_insights_public/src/client.ts new file mode 100644 index 0000000000000..8f392ce50536d --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/client.ts @@ -0,0 +1,50 @@ +/* + * 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 { HttpStart } from '@kbn/core-http-browser'; +import type { + ContentInsightsStats, + ContentInsightsStatsResponse, +} from '@kbn/content-management-content-insights-server'; + +export type ContentInsightsEventTypes = 'viewed'; + +/** + * Public interface of the Content Management Insights service. + */ +export interface ContentInsightsClientPublic { + track(id: string, eventType: ContentInsightsEventTypes): void; + getStats(id: string, eventType: ContentInsightsEventTypes): Promise; +} + +/** + * Client for the Content Management Insights service. + */ +export class ContentInsightsClient implements ContentInsightsClientPublic { + constructor( + private readonly deps: { http: HttpStart }, + private readonly config: { domainId: string } + ) {} + + track(id: string, eventType: ContentInsightsEventTypes) { + this.deps.http + .post(`/internal/content_management/insights/${this.config.domainId}/${id}/${eventType}`) + .catch((e) => { + // eslint-disable-next-line no-console + console.warn(`Could not track ${eventType} event for ${id}`, e); + }); + } + + async getStats(id: string, eventType: ContentInsightsEventTypes) { + return this.deps.http + .get( + `/internal/content_management/insights/${this.config.domainId}/${id}/${eventType}/stats` + ) + .then((response) => response.result); + } +} diff --git a/packages/content-management/content_editor/src/components/activity_view.test.tsx b/packages/content-management/content_insights/content_insights_public/src/components/activity_view.test.tsx similarity index 100% rename from packages/content-management/content_editor/src/components/activity_view.test.tsx rename to packages/content-management/content_insights/content_insights_public/src/components/activity_view.test.tsx diff --git a/packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx b/packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx new file mode 100644 index 0000000000000..065a2ed0648a7 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/activity_view.tsx @@ -0,0 +1,152 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React from 'react'; +import { + UserAvatarTip, + useUserProfile, + NoUpdaterTip, + NoCreatorTip, + ManagedAvatarTip, +} from '@kbn/content-management-user-profiles'; +import { getUserDisplayName } from '@kbn/user-profile-components'; + +import { Item } from '../types'; + +export interface ActivityViewProps { + item: Pick, 'createdBy' | 'createdAt' | 'updatedBy' | 'updatedAt' | 'managed'>; +} + +export const ActivityView = ({ item }: ActivityViewProps) => { + const showLastUpdated = Boolean(item.updatedAt && item.updatedAt !== item.createdAt); + + const UnknownUserLabel = ( + + ); + + const ManagedUserLabel = ( + <> + {' '} + + + ); + + return ( + + + + ) : item.managed ? ( + <>{ManagedUserLabel} + ) : ( + <> + {UnknownUserLabel} + + + ) + } + when={item.createdAt} + data-test-subj={'createdByCard'} + /> + + + {showLastUpdated && ( + + ) : item.managed ? ( + <>{ManagedUserLabel} + ) : ( + <> + {UnknownUserLabel} + + + ) + } + when={item.updatedAt} + data-test-subj={'updatedByCard'} + /> + )} + + + ); +}; + +const dateFormatter = new Intl.DateTimeFormat(i18n.getLocale(), { + dateStyle: 'long', + timeStyle: 'short', +}); + +const ActivityCard = ({ + what, + when, + who, + 'data-test-subj': dataTestSubj, +}: { + what: string; + who: React.ReactNode; + when?: string; + 'data-test-subj'?: string; +}) => { + return ( + + + {what} + + + + {who} + + {when && ( + <> + + + + + + )} + + ); +}; + +const UserLabel = ({ uid }: { uid: string }) => { + const userQuery = useUserProfile(uid); + + if (!userQuery.data) return null; + + return ( + <> + {getUserDisplayName(userQuery.data.user)} + + ); +}; diff --git a/packages/content-management/content_insights/content_insights_public/src/components/index.ts b/packages/content-management/content_insights/content_insights_public/src/components/index.ts new file mode 100644 index 0000000000000..b018fca6c843e --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/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 { ActivityView, type ActivityViewProps } from './activity_view'; +export { ViewsStats } from './views_stats'; diff --git a/packages/content-management/content_insights/content_insights_public/src/components/views_stats/index.ts b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/index.ts new file mode 100644 index 0000000000000..01fa00cd44537 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/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 { ViewsStats } from './views_stats'; diff --git a/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_chart.tsx b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_chart.tsx new file mode 100644 index 0000000000000..ff1675744b9a6 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_chart.tsx @@ -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 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 { Chart, Settings, DARK_THEME, LIGHT_THEME, BarSeries, Axis } from '@elastic/charts'; +import { formatDate, useEuiTheme } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; + +const dateFormatter = (d: Date) => formatDate(d, `MM/DD`); + +const seriesName = i18n.translate('contentManagement.contentEditor.viewsStats.viewsLabel', { + defaultMessage: 'Views', +}); + +const weekOfFormatter = (date: Date) => + i18n.translate('contentManagement.contentEditor.viewsStats.weekOfLabel', { + defaultMessage: 'Week of {date}', + values: { date: dateFormatter(date) }, + }); + +export const ViewsChart = ({ data }: { data: Array<[week: number, views: number]> }) => { + const { colorMode } = useEuiTheme(); + + const momentDow = moment().localeData().firstDayOfWeek(); // configured from advanced settings + const isoDow = momentDow === 0 ? 7 : momentDow; + + const momentTz = moment().tz(); // configured from advanced settings + + return ( + + + + + + + + ); +}; diff --git a/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.test.tsx b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.test.tsx new file mode 100644 index 0000000000000..649c34da0f2f7 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.test.tsx @@ -0,0 +1,64 @@ +/* + * 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 { render, within } from '@testing-library/react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; +import { ContentInsightsProvider } from '../../services'; + +import { ViewsStats } from './views_stats'; + +beforeEach(() => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2024-07-15T14:00:00.00Z')); +}); +afterEach(() => jest.clearAllMocks()); +afterAll(() => jest.useRealTimers()); + +const mockStats = jest.fn().mockResolvedValue({ + from: '2024-05-01T00:00:00.000Z', + count: 10, + daily: [ + { + date: '2024-05-01T00:00:00.000Z', + count: 5, + }, + { + date: '2024-06-01T00:00:00.000Z', + count: 5, + }, + ], +}); + +const WrappedViewsStats = () => { + const item = { id: '1' } as any; + const client = { + track: jest.fn(), + getStats: mockStats, + }; + return ( + + + + + + + + ); +}; + +describe('ViewsStats', () => { + test('should render the total views and chart', async () => { + const { getByTestId } = render(); + const totalViews = getByTestId('views-stats-total-views'); + expect(totalViews).toBeInTheDocument(); + await within(totalViews).findByText('Views (last 75 days)'); + await within(totalViews).findByText('10'); + }); +}); diff --git a/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx new file mode 100644 index 0000000000000..15138b55ba9b5 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats.tsx @@ -0,0 +1,125 @@ +/* + * 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 { EuiPanel, EuiStat, EuiSpacer, useEuiTheme, EuiIconTip } from '@elastic/eui'; +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useQuery } from '@tanstack/react-query'; +import { i18n } from '@kbn/i18n'; +import type { ContentInsightsStats } from '@kbn/content-management-content-insights-server'; +import { css } from '@emotion/react'; +import moment from 'moment'; + +import { Item } from '../../types'; +import { ViewsChart } from './views_chart'; +import { useServices } from '../../services'; + +export const ViewsStats = ({ item }: { item: Item }) => { + const contentInsightsClient = useServices()?.contentInsightsClient; + + if (!contentInsightsClient) { + throw new Error('Content insights client is not available'); + } + + const { euiTheme } = useEuiTheme(); + const { data, isLoading } = useQuery( + ['content-insights:viewed', item.id], + async () => + contentInsightsClient.getStats(item.id, 'viewed').then((response) => ({ + totalDays: getTotalDays(response), + totalViews: response.count, + chartData: getChartData(response), + })), + { + staleTime: 0, + retry: false, + } + ); + + return ( + + + + + + } + isLoading={isLoading} + /> + + + + + + ); +}; + +const NoViewsTip = () => ( + + } + /> +); + +export function getTotalDays(stats: ContentInsightsStats) { + return moment.utc().diff(moment.utc(stats.from), 'days'); +} + +export function getChartData(stats: ContentInsightsStats): Array<[week: number, views: number]> { + // prepare a map of views by week starting from the first full week till the current week + const viewsByWeek = new Map(); + + // we use moment to handle weeks because it is configured with the correct first day of the week from advanced settings + // by default it is sunday + const thisWeek = moment().startOf('week'); + const firstFullWeek = moment(stats.from).add(7, 'day').startOf('week'); + + // fill the map with weeks starting from the first full week till the current week + let current = firstFullWeek.clone(); + while (current.isSameOrBefore(thisWeek)) { + viewsByWeek.set(current.toISOString(), 0); + current = current.clone().add(1, 'week'); + } + + // fill the map with views per week + for (let i = 0; i < stats.daily.length; i++) { + const week = moment(stats.daily[i].date).startOf('week').toISOString(); + if (viewsByWeek.has(week)) { + viewsByWeek.set(week, viewsByWeek.get(week)! + stats.daily[i].count); + } + } + + return Array.from(viewsByWeek.entries()) + .sort((a, b) => (a[0] > b[0] ? 1 : -1)) + .map(([date, views]) => [new Date(date).getTime(), views]); +} diff --git a/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats_lib.test.tsx b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats_lib.test.tsx new file mode 100644 index 0000000000000..0ad2b32430561 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/components/views_stats/views_stats_lib.test.tsx @@ -0,0 +1,61 @@ +/* + * 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 moment from 'moment'; +import { getChartData, getTotalDays } from './views_stats'; + +beforeEach(() => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2024-07-15T14:00:00.00Z')); + moment.updateLocale('en', { + week: { + dow: 1, // test with Monday is the first day of the week. + }, + }); +}); +afterEach(() => jest.clearAllMocks()); +afterAll(() => jest.useRealTimers()); + +describe('getTotalDays', () => { + test('should return the total days between the current date and the from date', () => { + const totalDays = getTotalDays({ + from: '2024-07-01T00:00:00.000Z', + daily: [], + count: 0, + }); + expect(totalDays).toBe(14); + }); +}); + +describe('getChartData', () => { + test('should return views bucketed by week', () => { + const data = getChartData({ + from: '2024-05-01T00:00:00.000Z', + daily: [], + count: 0, + }); + expect(data.every(([, count]) => count === 0)).toBe(true); + + // moment is mocked with America/New_York timezone, hence +04:00 offset + expect(data.map((d) => new Date(d[0]).toISOString())).toMatchInlineSnapshot(` + Array [ + "2024-05-06T04:00:00.000Z", + "2024-05-13T04:00:00.000Z", + "2024-05-20T04:00:00.000Z", + "2024-05-27T04:00:00.000Z", + "2024-06-03T04:00:00.000Z", + "2024-06-10T04:00:00.000Z", + "2024-06-17T04:00:00.000Z", + "2024-06-24T04:00:00.000Z", + "2024-07-01T04:00:00.000Z", + "2024-07-08T04:00:00.000Z", + "2024-07-15T04:00:00.000Z", + ] + `); + }); +}); diff --git a/packages/content-management/content_insights/content_insights_public/src/services.tsx b/packages/content-management/content_insights/content_insights_public/src/services.tsx new file mode 100644 index 0000000000000..13d2ade797024 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/services.tsx @@ -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 { FC, PropsWithChildren, useContext } from 'react'; +import React from 'react'; + +import { ContentInsightsClientPublic } from './client'; + +/** + * Abstract external services for this component. + */ +export interface ContentInsightsServices { + contentInsightsClient: ContentInsightsClientPublic; +} + +const ContentInsightsContext = React.createContext(null); + +/** + * Abstract external service Provider. + */ +export const ContentInsightsProvider: FC>> = ({ + children, + ...services +}) => { + if (!services.contentInsightsClient) { + return <>{children}; + } + + return ( + + {children} + + ); +}; + +/* + * React hook for accessing pre-wired services. + */ +export function useServices() { + const context = useContext(ContentInsightsContext); + return context; +} diff --git a/packages/content-management/content_insights/content_insights_public/src/types.ts b/packages/content-management/content_insights/content_insights_public/src/types.ts new file mode 100644 index 0000000000000..75e0ca561c9ae --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/src/types.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. + */ + +import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; + +export type Item = UserContentCommonSchema; diff --git a/packages/content-management/content_insights/content_insights_public/tsconfig.json b/packages/content-management/content_insights/content_insights_public/tsconfig.json new file mode 100644 index 0000000000000..27d479a15d6c9 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_public/tsconfig.json @@ -0,0 +1,32 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@kbn/ambient-ui-types", + "@kbn/ambient-storybook-types", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/content-management-user-profiles", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/user-profile-components", + "@kbn/core-http-browser", + "@kbn/content-management-content-insights-server", + "@kbn/content-management-table-list-view-common", + ] +} diff --git a/packages/content-management/content_insights/content_insights_server/README.md b/packages/content-management/content_insights/content_insights_server/README.md new file mode 100644 index 0000000000000..00f54612cf532 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/README.md @@ -0,0 +1,3 @@ +# @kbn/content-management-content-insights-server + +Refer to [README](../README.mdx) diff --git a/packages/content-management/content_insights/content_insights_server/index.ts b/packages/content-management/content_insights/content_insights_server/index.ts new file mode 100644 index 0000000000000..fe78d0eb181ae --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + registerContentInsights, + type ContentInsightsStatsResponse, + type ContentInsightsStats, +} from './src/register'; diff --git a/packages/content-management/content_insights/content_insights_server/jest.config.js b/packages/content-management/content_insights/content_insights_server/jest.config.js new file mode 100644 index 0000000000000..7761f3fba8000 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/content-management/content_insights/content_insights_server'], +}; diff --git a/packages/content-management/content_insights/content_insights_server/kibana.jsonc b/packages/content-management/content_insights/content_insights_server/kibana.jsonc new file mode 100644 index 0000000000000..386c1a6bf1304 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-server", + "id": "@kbn/content-management-content-insights-server", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/content-management/content_insights/content_insights_server/package.json b/packages/content-management/content_insights/content_insights_server/package.json new file mode 100644 index 0000000000000..ff99762999828 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/content-management-content-insights-server", + "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/content-management/content_insights/content_insights_server/src/register.ts b/packages/content-management/content_insights/content_insights_server/src/register.ts new file mode 100644 index 0000000000000..06283cce089ac --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/src/register.ts @@ -0,0 +1,147 @@ +/* + * 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 { + UsageCollectionSetup, + UsageCollectionStart, +} from '@kbn/usage-collection-plugin/server'; +import type { CoreSetup } from '@kbn/core/server'; +import { schema } from '@kbn/config-schema'; +import moment from 'moment'; + +/** + * Configuration for the usage counter + */ +export interface ContentInsightsConfig { + /** + * e.g. 'dashboard' + * passed as a domainId to usage counter apis + */ + domainId: string; + + /** + * Can control created routes access via access tags + */ + routeTags?: string[]; + + /** + * Retention period in days for usage counter data + */ + retentionPeriodDays?: number; +} + +export interface ContentInsightsDependencies { + usageCollection: UsageCollectionSetup; + http: CoreSetup['http']; + getStartServices: () => Promise<{ + usageCollection: UsageCollectionStart; + }>; +} + +export interface ContentInsightsStatsResponse { + result: ContentInsightsStats; +} + +export interface ContentInsightsStats { + /** + * The date from which the data is counted + */ + from: string; + /** + * Total count of events + */ + count: number; + /** + * Daily counts of events + */ + daily: Array<{ + date: string; + count: number; + }>; +} + +/* + * Registers the content insights routes + */ +export const registerContentInsights = ( + { usageCollection, http, getStartServices }: ContentInsightsDependencies, + config: ContentInsightsConfig +) => { + const retentionPeriodDays = config.retentionPeriodDays ?? 90; + const counter = usageCollection.createUsageCounter(config.domainId, { + retentionPeriodDays, + }); + + const router = http.createRouter(); + const validate = { + params: schema.object({ + id: schema.string(), + eventType: schema.literal('viewed'), + }), + }; + router.post( + { + path: `/internal/content_management/insights/${config.domainId}/{id}/{eventType}`, + validate, + options: { + tags: config.routeTags, + }, + }, + async (context, req, res) => { + const { id, eventType } = req.params; + + counter.incrementCounter({ + counterName: id, + counterType: eventType, + namespace: (await context.core).savedObjects.client.getCurrentNamespace(), + }); + return res.ok(); + } + ); + router.get( + { + path: `/internal/content_management/insights/${config.domainId}/{id}/{eventType}/stats`, + validate, + options: { + tags: config.routeTags, + }, + }, + async (context, req, res) => { + const { id, eventType } = req.params; + const { + usageCollection: { search }, + } = await getStartServices(); + + const startOfDay = moment.utc().startOf('day'); + const from = startOfDay.clone().subtract(retentionPeriodDays, 'days'); + + const result = await search({ + filters: { + domainId: config.domainId, + counterName: id, + counterType: eventType, + namespace: (await context.core).savedObjects.client.getCurrentNamespace(), + from: from.toISOString(), + }, + }); + + const response: ContentInsightsStatsResponse = { + result: { + from: from.toISOString(), + count: result.counters[0]?.count ?? 0, + daily: (result.counters[0]?.records ?? []).map((record) => ({ + date: record.updatedAt, + count: record.count, + })), + }, + }; + + return res.ok({ body: response }); + } + ); +}; diff --git a/packages/content-management/content_insights/content_insights_server/tsconfig.json b/packages/content-management/content_insights/content_insights_server/tsconfig.json new file mode 100644 index 0000000000000..3e2312c0278a2 --- /dev/null +++ b/packages/content-management/content_insights/content_insights_server/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/usage-collection-plugin", + "@kbn/core", + "@kbn/config-schema", + ] +} diff --git a/packages/content-management/favorites/README.mdx b/packages/content-management/favorites/README.mdx index e54f1baef2c98..0c5d5167595a6 100644 --- a/packages/content-management/favorites/README.mdx +++ b/packages/content-management/favorites/README.mdx @@ -28,9 +28,11 @@ import { FavoriteButton, } from '@kbn/content-management-favorites-public'; +const appName = 'my-app'; const favoriteObjectType = 'dashboard'; -const favoritesClient = new FavoritesClient('dashboard', { +const favoritesClient = new FavoritesClient(appName, favoriteObjectType, { http: core.http, + usageCollection: plugins.usageCollection, }); // wrap your content with the favorites context provider diff --git a/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx b/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx index a82933bd0f53e..19e5e28dd99ad 100644 --- a/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx +++ b/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx @@ -12,6 +12,7 @@ import classNames from 'classnames'; import { EuiButtonIcon, euiCanAnimate, EuiThemeComputed } from '@elastic/eui'; import { css } from '@emotion/react'; import { useFavorites, useRemoveFavorite, useAddFavorite } from '../favorites_query'; +import { useFavoritesClient } from '../favorites_context'; export interface FavoriteButtonProps { id: string; @@ -24,6 +25,8 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { const removeFavorite = useRemoveFavorite(); const addFavorite = useAddFavorite(); + const favoritesClient = useFavoritesClient(); + if (!data) return null; const isFavorite = data.favoriteIds.includes(id); @@ -40,6 +43,7 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { aria-label={title} iconType={'starFilled'} onClick={() => { + favoritesClient?.reportRemoveFavoriteClick(); removeFavorite.mutate({ id }); }} className={classNames(className, 'cm-favorite-button', { @@ -59,6 +63,7 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { aria-label={title} iconType={'starEmpty'} onClick={() => { + favoritesClient?.reportAddFavoriteClick(); addFavorite.mutate({ id }); }} className={classNames(className, 'cm-favorite-button', { diff --git a/packages/content-management/favorites/favorites_public/src/favorites_client.ts b/packages/content-management/favorites/favorites_public/src/favorites_client.ts index 58eea3a600de4..c79df94926ed4 100644 --- a/packages/content-management/favorites/favorites_public/src/favorites_client.ts +++ b/packages/content-management/favorites/favorites_public/src/favorites_client.ts @@ -7,6 +7,7 @@ */ import type { HttpStart } from '@kbn/core-http-browser'; +import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import type { GetFavoritesResponse } from '@kbn/content-management-favorites-server'; export interface FavoritesClientPublic { @@ -15,10 +16,16 @@ export interface FavoritesClientPublic { removeFavorite({ id }: { id: string }): Promise; getFavoriteType(): string; + reportAddFavoriteClick(): void; + reportRemoveFavoriteClick(): void; } export class FavoritesClient implements FavoritesClientPublic { - constructor(private favoriteObjectType: string, private deps: { http: HttpStart }) {} + constructor( + private readonly appName: string, + private readonly favoriteObjectType: string, + private readonly deps: { http: HttpStart; usageCollection?: UsageCollectionStart } + ) {} public async getFavorites(): Promise { return this.deps.http.get(`/internal/content_management/favorites/${this.favoriteObjectType}`); @@ -39,4 +46,11 @@ export class FavoritesClient implements FavoritesClientPublic { public getFavoriteType() { return this.favoriteObjectType; } + + public reportAddFavoriteClick() { + this.deps.usageCollection?.reportUiCounter(this.appName, 'click', 'add_favorite'); + } + public reportRemoveFavoriteClick() { + this.deps.usageCollection?.reportUiCounter(this.appName, 'click', 'remove_favorite'); + } } diff --git a/packages/content-management/favorites/favorites_public/tsconfig.json b/packages/content-management/favorites/favorites_public/tsconfig.json index 2e5ef8bc52347..3057c828fc3da 100644 --- a/packages/content-management/favorites/favorites_public/tsconfig.json +++ b/packages/content-management/favorites/favorites_public/tsconfig.json @@ -22,5 +22,6 @@ "@kbn/core-http-browser", "@kbn/content-management-favorites-server", "@kbn/i18n-react", + "@kbn/usage-collection-plugin", ] } diff --git a/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts b/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts index e7d88045860f4..4b283dbef29d7 100644 --- a/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts +++ b/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts @@ -21,13 +21,19 @@ const schemaV1 = schema.object({ favoriteIds: schema.arrayOf(schema.string()), }); +export const favoritesSavedObjectName = 'favorites'; + export const favoritesSavedObjectType: SavedObjectsType = { - name: 'favorites', + name: favoritesSavedObjectName, hidden: true, namespaceType: 'single', mappings: { dynamic: false, - properties: {}, + properties: { + userId: { type: 'keyword' }, + type: { type: 'keyword' }, + favoriteIds: { type: 'keyword' }, + }, }, modelVersions: { 1: { @@ -41,5 +47,22 @@ export const favoritesSavedObjectType: SavedObjectsType = { create: schemaV1, }, }, + 2: { + // the model stays the same, but we added the mappings for the snapshot telemetry needs + changes: [ + { + type: 'mappings_addition', + addedMappings: { + userId: { type: 'keyword' }, + type: { type: 'keyword' }, + favoriteIds: { type: 'keyword' }, + }, + }, + ], + schemas: { + forwardCompatibility: schemaV1.extends({}, { unknowns: 'ignore' }), + create: schemaV1, + }, + }, }, }; diff --git a/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts b/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts new file mode 100644 index 0000000000000..22aab861cc6f0 --- /dev/null +++ b/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts @@ -0,0 +1,129 @@ +/* + * 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 { CoreSetup } from '@kbn/core-lifecycle-server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { estypes } from '@elastic/elasticsearch'; +import { favoritesSavedObjectName } from './favorites_saved_object'; + +interface FavoritesUsage { + [favorite_object_type: string]: { + total: number; + total_users_spaces: number; + avg_per_user_per_space: number; + max_per_user_per_space: number; + }; +} + +export function registerFavoritesUsageCollection({ + core, + usageCollection, +}: { + core: CoreSetup; + usageCollection: UsageCollectionSetup; +}) { + usageCollection.registerCollector( + usageCollection.makeUsageCollector({ + type: 'favorites', + isReady: () => true, + schema: { + DYNAMIC_KEY /* e.g. 'dashboard' */: { + total: { + type: 'long', + _meta: { description: 'Total favorite object count in this deployment' }, + }, + total_users_spaces: { + type: 'long', + _meta: { + description: + 'Total users per space that have favorited an object of this type in this deployment', + }, + }, + avg_per_user_per_space: { + type: 'double', + _meta: { + description: + 'Average favorite objects count of this type per user per space for this deployment, only counts users who have favorited at least one object of this type', + }, + }, + max_per_user_per_space: { + type: 'long', + _meta: { + description: + 'Max favorite objects count of this type per user per space for this deployment', + }, + }, + }, + }, + fetch: async (context) => { + const favoritesIndex = await core + .getStartServices() + .then(([{ savedObjects }]) => savedObjects.getIndexForType(favoritesSavedObjectName)); + + const response = await context.esClient.search< + unknown, + { types: estypes.AggregationsStringTermsAggregate } + >({ + index: favoritesIndex, + size: 0, + _source: false, + filter_path: ['aggregations'], + query: { + bool: { + filter: [ + { + term: { + type: 'favorites', + }, + }, + ], + }, + }, + runtime_mappings: { + number_of_favorites: { + type: 'long', + script: { + source: "emit(doc['favorites.favoriteIds'].length)", + }, + }, + }, + aggs: { + types: { + terms: { + field: 'favorites.type', + }, + aggs: { + stats: { + stats: { + field: 'number_of_favorites', + }, + }, + }, + }, + }, + }); + + const favoritesUsage: FavoritesUsage = {}; + + const typesBuckets = (response.aggregations?.types?.buckets ?? + []) as estypes.AggregationsStringTermsBucket[]; + + typesBuckets.forEach((bucket) => { + favoritesUsage[bucket.key] = { + total: bucket.stats.sum, + total_users_spaces: bucket.stats.count, + avg_per_user_per_space: bucket.stats.avg, + max_per_user_per_space: bucket.stats.max, + }; + }); + + return favoritesUsage; + }, + }) + ); +} diff --git a/packages/content-management/favorites/favorites_server/src/index.ts b/packages/content-management/favorites/favorites_server/src/index.ts index 729d4537717c9..c639bd53361d0 100644 --- a/packages/content-management/favorites/favorites_server/src/index.ts +++ b/packages/content-management/favorites/favorites_server/src/index.ts @@ -7,8 +7,10 @@ */ import type { CoreSetup, Logger } from '@kbn/core/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { registerFavoritesRoutes } from './favorites_routes'; import { favoritesSavedObjectType } from './favorites_saved_object'; +import { registerFavoritesUsageCollection } from './favorites_usage_collection'; export type { GetFavoritesResponse } from './favorites_routes'; @@ -18,8 +20,21 @@ export type { GetFavoritesResponse } from './favorites_routes'; * * @param logger * @param core + * @param usageCollection */ -export function registerFavorites({ logger, core }: { core: CoreSetup; logger: Logger }) { +export function registerFavorites({ + logger, + core, + usageCollection, +}: { + core: CoreSetup; + logger: Logger; + usageCollection?: UsageCollectionSetup; +}) { core.savedObjects.registerType(favoritesSavedObjectType); registerFavoritesRoutes({ core, logger }); + + if (usageCollection) { + registerFavoritesUsageCollection({ core, usageCollection }); + } } diff --git a/packages/content-management/favorites/favorites_server/tsconfig.json b/packages/content-management/favorites/favorites_server/tsconfig.json index fd4fbfb554cf6..5a9ae392c875b 100644 --- a/packages/content-management/favorites/favorites_server/tsconfig.json +++ b/packages/content-management/favorites/favorites_server/tsconfig.json @@ -17,5 +17,7 @@ "@kbn/core", "@kbn/config-schema", "@kbn/core-saved-objects-api-server", + "@kbn/core-lifecycle-server", + "@kbn/usage-collection-plugin", ] } diff --git a/packages/content-management/table_list_view_table/src/components/content_editor_activity_row.tsx b/packages/content-management/table_list_view_table/src/components/content_editor_activity_row.tsx new file mode 100644 index 0000000000000..79a10d42f41e2 --- /dev/null +++ b/packages/content-management/table_list_view_table/src/components/content_editor_activity_row.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 { EuiFormRow, EuiIconTip, EuiSpacer } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { FC } from 'react'; +import type { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; +import { ActivityView, ViewsStats } from '@kbn/content-management-content-insights-public'; + +/** + * This component is used as an extension for the ContentEditor to render the ActivityView and ViewsStats inside the flyout without depending on them directly + */ +export const ContentEditorActivityRow: FC<{ item: UserContentCommonSchema }> = ({ item }) => { + return ( + + {' '} + + } + /> + + } + > + <> + + + + + + ); +}; diff --git a/packages/content-management/table_list_view_table/src/services.tsx b/packages/content-management/table_list_view_table/src/services.tsx index ebdbaf31b4f0e..b452bf916a525 100644 --- a/packages/content-management/table_list_view_table/src/services.tsx +++ b/packages/content-management/table_list_view_table/src/services.tsx @@ -14,6 +14,10 @@ import { ContentEditorKibanaProvider, type SavedObjectsReference, } from '@kbn/content-management-content-editor'; +import { + ContentInsightsClientPublic, + ContentInsightsProvider, +} from '@kbn/content-management-content-insights-public'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { MountPoint, OverlayRef } from '@kbn/core-mount-utils-browser'; @@ -174,6 +178,11 @@ export interface TableListViewKibanaDependencies { * The favorites client to enable the favorites feature. */ favorites?: FavoritesClientPublic; + + /** + * Content insights client to enable content insights features. + */ + contentInsightsClient?: ContentInsightsClientPublic; } /** @@ -240,37 +249,42 @@ export const TableListViewKibanaProvider: FC< - { - notifications.toasts.addDanger({ title: toMountPoint(title, startServices), text }); - }} - > - - application.getUrlForApp('management', { - path: `/kibana/settings?query=savedObjects:listingLimit`, - }) - } + + { notifications.toasts.addDanger({ title: toMountPoint(title, startServices), text }); }} - searchQueryParser={searchQueryParser} - DateFormatterComp={(props) => } - currentAppId$={application.currentAppId$} - navigateToUrl={application.navigateToUrl} - isTaggingEnabled={() => Boolean(savedObjectsTagging)} - isFavoritesEnabled={() => Boolean(services.favorites)} - getTagList={getTagList} - TagList={TagList} - itemHasTags={itemHasTags} - getTagIdsFromReferences={getTagIdsFromReferences} - getTagManagementUrl={() => core.http.basePath.prepend(TAG_MANAGEMENT_APP_URL)} > - {children} - - + + application.getUrlForApp('management', { + path: `/kibana/settings?query=savedObjects:listingLimit`, + }) + } + notifyError={(title, text) => { + notifications.toasts.addDanger({ + title: toMountPoint(title, startServices), + text, + }); + }} + searchQueryParser={searchQueryParser} + DateFormatterComp={(props) => } + currentAppId$={application.currentAppId$} + navigateToUrl={application.navigateToUrl} + isTaggingEnabled={() => Boolean(savedObjectsTagging)} + isFavoritesEnabled={() => Boolean(services.favorites)} + getTagList={getTagList} + TagList={TagList} + itemHasTags={itemHasTags} + getTagIdsFromReferences={getTagIdsFromReferences} + getTagManagementUrl={() => core.http.basePath.prepend(TAG_MANAGEMENT_APP_URL)} + > + {children} + + + diff --git a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx index e56322099d5ff..f7ad968d78965 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx @@ -1052,7 +1052,7 @@ describe('TableListView', () => { }); describe('search', () => { - const updatedAt = new Date('2023-07-15').toISOString(); + const updatedAt = moment('2023-07-15').toISOString(); const hits: UserContentCommonSchema[] = [ { @@ -1146,7 +1146,7 @@ describe('TableListView', () => { { id: 'item-from-search', type: 'dashboard', - updatedAt: new Date('2023-07-01').toISOString(), + updatedAt: moment('2023-07-01').toISOString(), attributes: { title: 'Item from search', }, diff --git a/packages/content-management/table_list_view_table/src/table_list_view_table.tsx b/packages/content-management/table_list_view_table/src/table_list_view_table.tsx index 82894d7d8b6ef..c15462f88b585 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view_table.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view_table.tsx @@ -38,6 +38,10 @@ import type { } from '@kbn/content-management-content-editor'; import type { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; import type { RecentlyAccessed } from '@kbn/recently-accessed'; +import { + ContentInsightsProvider, + useContentInsightsServices, +} from '@kbn/content-management-content-insights-public'; import { Table, @@ -54,12 +58,10 @@ import { useTags } from './use_tags'; import { useInRouterContext, useUrlState } from './use_url_state'; import { RowActions, TableItemsRowActions } from './types'; import { sortByRecentlyAccessed } from './components/table_sort_select'; +import { ContentEditorActivityRow } from './components/content_editor_activity_row'; interface ContentEditorConfig - extends Pick< - OpenContentEditorParams, - 'isReadonly' | 'onSave' | 'customValidators' | 'showActivityView' - > { + extends Pick { enabled?: boolean; } @@ -371,6 +373,7 @@ function TableListViewTableComp({ } = useServices(); const openContentEditor = useOpenContentEditor(); + const contentInsightsServices = useContentInsightsServices(); const isInRouterContext = useInRouterContext(); @@ -567,6 +570,12 @@ function TableListViewTableComp({ close(); }), + appendRows: contentInsightsServices && ( + // have to "REWRAP" in the provider here because it will be rendered in a different context + + + + ), }); }, [ @@ -576,6 +585,7 @@ function TableListViewTableComp({ contentEditor, tableItemsRowActions, fetchItems, + contentInsightsServices, ] ); @@ -713,7 +723,7 @@ function TableListViewTableComp({ name: i18n.translate('contentManagement.tableList.listing.table.actionTitle', { defaultMessage: 'Actions', }), - width: `${32 * actions.length}px`, + width: `72px`, actions, }); } diff --git a/packages/content-management/table_list_view_table/tsconfig.json b/packages/content-management/table_list_view_table/tsconfig.json index 7bd513f12f99e..a5530ee717e49 100644 --- a/packages/content-management/table_list_view_table/tsconfig.json +++ b/packages/content-management/table_list_view_table/tsconfig.json @@ -36,6 +36,7 @@ "@kbn/react-kibana-mount", "@kbn/content-management-user-profiles", "@kbn/recently-accessed", + "@kbn/content-management-content-insights-public", "@kbn/content-management-favorites-public" ], "exclude": [ diff --git a/packages/core/application/core-application-browser-internal/integration_tests/application_service.test.tsx b/packages/core/application/core-application-browser-internal/integration_tests/application_service.test.tsx index d04157efb6476..fda23142288ca 100644 --- a/packages/core/application/core-application-browser-internal/integration_tests/application_service.test.tsx +++ b/packages/core/application/core-application-browser-internal/integration_tests/application_service.test.tsx @@ -159,7 +159,7 @@ describe('ApplicationService', () => { await act(async () => { await navigateToApp('app1'); - update(); + await update(); }); expect(currentAppIds).toEqual(['app1']); @@ -195,15 +195,15 @@ describe('ApplicationService', () => { await act(async () => { await navigateToApp('app1'); - update(); + await update(); }); await act(async () => { await navigateToApp('app2', { path: '/nested' }); - update(); + await update(); }); await act(async () => { await navigateToApp('app2', { path: '/another-path' }); - update(); + await update(); }); expect(locations).toEqual(['/', '/app/app1', '/app/app2/nested', '/app/app2/another-path']); @@ -625,9 +625,14 @@ describe('ApplicationService', () => { title: 'App1', mount: async ({ setHeaderActionMenu }: AppMountParameters) => { setHeaderActionMenu(mounter1); - promise.then(() => { - setHeaderActionMenu(mounter2); - }); + promise + .then(() => { + setHeaderActionMenu(mounter2); + }) + .catch((error) => { + // eslint-disable-next-line no-console + console.error('Error:', error); + }); return () => undefined; }, }); @@ -663,9 +668,14 @@ describe('ApplicationService', () => { title: 'App1', mount: async ({ setHeaderActionMenu }: AppMountParameters) => { setHeaderActionMenu(mounter1); - promise.then(() => { - setHeaderActionMenu(undefined); - }); + promise + .then(() => { + setHeaderActionMenu(undefined); + }) + .catch((error) => { + // eslint-disable-next-line no-console + console.error('Error:', error); + }); return () => undefined; }, }); diff --git a/packages/core/application/core-application-browser-internal/src/application_service.test.ts b/packages/core/application/core-application-browser-internal/src/application_service.test.ts index 073ce6099830e..89b34876e50c9 100644 --- a/packages/core/application/core-application-browser-internal/src/application_service.test.ts +++ b/packages/core/application/core-application-browser-internal/src/application_service.test.ts @@ -98,7 +98,9 @@ describe('#setup()', () => { await service.start(startDeps); expect(() => register(Symbol(), createApp({ id: 'app1' })) - ).toThrowErrorMatchingInlineSnapshot(`"Applications cannot be registered after \\"setup\\""`); + ).toThrowErrorMatchingInlineSnapshot( + `"Applications cannot be registered after \\"setup\\" (attempted to register \\"app1\\")"` + ); }); it('allows to register an AppUpdater for the application', async () => { diff --git a/packages/core/application/core-application-browser-internal/src/application_service.tsx b/packages/core/application/core-application-browser-internal/src/application_service.tsx index b30f4ce650730..0b1f0f3ec6431 100644 --- a/packages/core/application/core-application-browser-internal/src/application_service.tsx +++ b/packages/core/application/core-application-browser-internal/src/application_service.tsx @@ -182,7 +182,9 @@ export class ApplicationService { const validateApp = (app: App) => { if (this.registrationClosed) { - throw new Error(`Applications cannot be registered after "setup"`); + throw new Error( + `Applications cannot be registered after "setup" (attempted to register "${app.id}")` + ); } else if (!applicationIdRegexp.test(app.id)) { throw new Error( `Invalid application id: it can only be composed of alphanum chars, '-' and '_'` diff --git a/packages/core/apps/core-apps-server-internal/src/core_app.ts b/packages/core/apps/core-apps-server-internal/src/core_app.ts index e9676c792292a..5ee8fe4938a44 100644 --- a/packages/core/apps/core-apps-server-internal/src/core_app.ts +++ b/packages/core/apps/core-apps-server-internal/src/core_app.ts @@ -29,13 +29,13 @@ import type { import type { InternalStaticAssets } from '@kbn/core-http-server-internal'; import { combineLatest, - concatMap, firstValueFrom, map, type Observable, ReplaySubject, shareReplay, Subject, + switchMap, takeUntil, timer, } from 'rxjs'; @@ -238,7 +238,7 @@ export class CoreAppsService { // Poll for updates combineLatest([savedObjectsClient$, timer(0, 10_000)]) .pipe( - concatMap(async ([soClient]) => { + switchMap(async ([soClient]) => { try { const persistedOverrides = await soClient.get>( DYNAMIC_CONFIG_OVERRIDES_SO_TYPE, @@ -300,7 +300,10 @@ export class CoreAppsService { await soClient.create(DYNAMIC_CONFIG_OVERRIDES_SO_TYPE, newGlobalOverrides, { id: DYNAMIC_CONFIG_OVERRIDES_SO_ID, overwrite: true, + refresh: false, }); + // set it again in memory in case the timer polling the SO for updates has overridden it during this update. + this.configService.setDynamicConfigOverrides(req.body); } catch (err) { if (err instanceof ValidationError) { return res.badRequest({ body: err }); diff --git a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx index 5f9a17713861c..0b7f0e8afd958 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx @@ -180,14 +180,24 @@ export class ChromeService { if (isDev) { setEuiDevProviderWarning((providerError) => { const errorObject = new Error(providerError.toString()); - // show a stack trace in the console + // 1. show a stack trace in the console // eslint-disable-next-line no-console console.error(errorObject); + // 2. store error in sessionStorage so it can be detected in testing + const storedError = { + message: providerError.toString(), + stack: errorObject.stack ?? 'undefined', + pageHref: window.location.href, + pageTitle: document.title, + }; + sessionStorage.setItem('dev.euiProviderWarning', JSON.stringify(storedError)); + + // 3. error toast / popup notifications.toasts.addDanger({ title: '`EuiProvider` is missing', text: mountReactNode( -

+

), + 'data-test-subj': 'core-chrome-euiDevProviderWarning-toast', toastLifeTimeMs: 60 * 60 * 1000, // keep message visible for up to an hour }); }); diff --git a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx index fb1043d239523..ac80702ab99ec 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx @@ -144,6 +144,7 @@ function buildRootCrumb({ color="text" iconType="gear" data-test-subj="manageDeploymentBtn" + size="s" > {i18n.translate('core.ui.primaryNav.cloud.breadCrumbDropdown.manageDeploymentLabel', { defaultMessage: 'Manage this deployment', @@ -157,6 +158,7 @@ function buildRootCrumb({ color="text" iconType="spaces" data-test-subj="viewDeploymentsBtn" + size="s" > {cloudLinks.deployments.title} @@ -164,9 +166,9 @@ function buildRootCrumb({ ), popoverProps: { - panelPaddingSize: 'm', + panelPaddingSize: 's', zIndex: 6000, - panelStyle: { width: 260 }, + panelStyle: { maxWidth: 240 }, panelProps: { 'data-test-subj': 'deploymentLinksPanel', }, diff --git a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/project_navigation_service.ts b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/project_navigation_service.ts index 0a1292be9b3f1..0c40edfc26292 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/project_navigation_service.ts +++ b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/project_navigation_service.ts @@ -20,6 +20,7 @@ import type { } from '@kbn/core-chrome-browser'; import type { InternalHttpStart } from '@kbn/core-http-browser-internal'; import { + Subject, BehaviorSubject, combineLatest, map, @@ -32,6 +33,7 @@ import { of, type Observable, type Subscription, + timer, } from 'rxjs'; import { type Location, createLocation } from 'history'; import deepEqual from 'react-fast-compare'; @@ -326,20 +328,50 @@ export class ProjectNavigationService { } const { sideNavComponent, homePage = '' } = definition; - const homePageLink = this.navLinksService?.get(homePage); if (sideNavComponent) { this.setSideNavComponent(sideNavComponent); } - if (homePageLink) { - this.setProjectHome(homePageLink.href); - } + this.waitForLink(homePage, (navLink: ChromeNavLink) => { + this.setProjectHome(navLink.href); + }); this.initNavigation(nextId, definition.navigationTree$); }); } + /** + * This method waits for the chrome nav link to be available and then calls the callback. + * This is necessary to avoid race conditions when we register the solution navigation + * before the deep links are available (plugins can register them later). + * + * @param linkId The chrome nav link id + * @param cb The callback to call when the link is found + * @returns + */ + private waitForLink(linkId: string, cb: (chromeNavLink: ChromeNavLink) => undefined): void { + if (!this.navLinksService) return; + + let navLink: ChromeNavLink | undefined = this.navLinksService.get(linkId); + if (navLink) { + cb(navLink); + return; + } + + const stop$ = new Subject(); + const tenSeconds = timer(10000); + + this.deepLinksMap$.pipe(takeUntil(tenSeconds), takeUntil(stop$)).subscribe((navLinks) => { + navLink = navLinks[linkId]; + + if (navLink) { + cb(navLink); + stop$.next(); + } + }); + } + private setProjectHome(homeHref: string) { this.projectHome$.next(homeHref); } diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/collapsible_nav.scss b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/collapsible_nav.scss index a121ac4c02b25..1086e30ebec0e 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/collapsible_nav.scss +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/collapsible_nav.scss @@ -7,9 +7,9 @@ $screenHeightBreakpoint: $euiSize * 15; } .kbnCollapsibleNav__recentsListGroup { - @include euiYScroll; max-height: $euiSize * 10; margin-right: -$euiSizeS; + @include euiYScroll; } .kbnCollapsibleNav__solutions { diff --git a/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts b/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts index 80ba357009530..0dfc9d2ea05e2 100644 --- a/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts +++ b/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts @@ -9,6 +9,7 @@ import type { PropertyName as EsPropertyName, MappingProperty as EsMappingProperty, + MappingPropertyBase as EsMappingPropertyBase, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; /** @@ -64,19 +65,20 @@ export interface SavedObjectsMappingProperties { * * @public */ -export type SavedObjectsFieldMapping = EsMappingProperty & { - /** - * The dynamic property of the mapping, either `false` or `'strict'`. If - * unspecified `dynamic: 'strict'` will be inherited from the top-level - * index mappings. - * - * Note: To limit the number of mapping fields Saved Object types should - * *never* use `dynamic: true`. - */ - dynamic?: false | 'strict'; - /** - * Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type - * to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`. - */ - properties?: Record; -}; +export type SavedObjectsFieldMapping = EsMappingProperty & + EsMappingPropertyBase & { + /** + * The dynamic property of the mapping, either `false` or `'strict'`. If + * unspecified `dynamic: 'strict'` will be inherited from the top-level + * index mappings. + * + * Note: To limit the number of mapping fields Saved Object types should + * *never* use `dynamic: true`. + */ + dynamic?: false | 'strict'; + /** + * Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type + * to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`. + */ + properties?: Record; + }; diff --git a/packages/deeplinks/observability/locators/dataset_quality.ts b/packages/deeplinks/observability/locators/dataset_quality.ts index e30648e3f129c..9e04e10e9933e 100644 --- a/packages/deeplinks/observability/locators/dataset_quality.ts +++ b/packages/deeplinks/observability/locators/dataset_quality.ts @@ -23,14 +23,6 @@ type TimeRangeConfig = { refresh: RefreshInterval; }; -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type DatasetConfig = { - rawName: string; - type: string; - name: string; - namespace: string; -}; - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type Filters = { timeRange: TimeRangeConfig; @@ -38,7 +30,4 @@ type Filters = { export interface DataQualityLocatorParams extends SerializableRecord { filters?: Filters; - flyout?: { - dataset: DatasetConfig; - }; } diff --git a/packages/deeplinks/observability/locators/dataset_quality_details.ts b/packages/deeplinks/observability/locators/dataset_quality_details.ts new file mode 100644 index 0000000000000..6f51bbbfe7ce3 --- /dev/null +++ b/packages/deeplinks/observability/locators/dataset_quality_details.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 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 { SerializableRecord } from '@kbn/utility-types'; + +export const DATA_QUALITY_DETAILS_LOCATOR_ID = 'DATA_QUALITY_DETAILS_LOCATOR'; + +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type RefreshInterval = { + pause: boolean; + value: number; +}; + +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type TimeRangeConfig = { + from: string; + to: string; + refresh: RefreshInterval; +}; + +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type DegradedFieldsTable = { + page?: number; + rowsPerPage?: number; + sort?: { + field: string; + direction: 'asc' | 'desc'; + }; +}; + +export interface DataQualityDetailsLocatorParams extends SerializableRecord { + dataStream: string; + timeRange?: TimeRangeConfig; + breakdownField?: string; + degradedFields?: { + table?: DegradedFieldsTable; + }; +} diff --git a/packages/deeplinks/observability/locators/index.ts b/packages/deeplinks/observability/locators/index.ts index 67e79ecb577ea..48902c8f37cf4 100644 --- a/packages/deeplinks/observability/locators/index.ts +++ b/packages/deeplinks/observability/locators/index.ts @@ -7,6 +7,7 @@ */ export * from './dataset_quality'; +export * from './dataset_quality_details'; export * from './logs_explorer'; export * from './observability_logs_explorer'; export * from './observability_onboarding'; diff --git a/packages/kbn-alerting-types/index.ts b/packages/kbn-alerting-types/index.ts index dcf9cfe297ccb..da0603f60b3e7 100644 --- a/packages/kbn-alerting-types/index.ts +++ b/packages/kbn-alerting-types/index.ts @@ -17,4 +17,5 @@ export * from './r_rule_types'; export * from './rule_notify_when_type'; export * from './rule_type_types'; export * from './rule_types'; +export * from './rule_flapping'; export * from './search_strategy_types'; diff --git a/packages/kbn-alerting-types/rule_flapping.ts b/packages/kbn-alerting-types/rule_flapping.ts new file mode 100644 index 0000000000000..27f4edb3c693b --- /dev/null +++ b/packages/kbn-alerting-types/rule_flapping.ts @@ -0,0 +1,12 @@ +/* + * 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 const MIN_LOOK_BACK_WINDOW = 2; +export const MAX_LOOK_BACK_WINDOW = 20; +export const MIN_STATUS_CHANGE_THRESHOLD = 2; +export const MAX_STATUS_CHANGE_THRESHOLD = 20; diff --git a/packages/kbn-alerting-types/rule_types.ts b/packages/kbn-alerting-types/rule_types.ts index cb72d3bfd4c5e..a844914778c35 100644 --- a/packages/kbn-alerting-types/rule_types.ts +++ b/packages/kbn-alerting-types/rule_types.ts @@ -102,6 +102,7 @@ export enum RuleExecutionStatusWarningReasons { MAX_EXECUTABLE_ACTIONS = 'maxExecutableActions', MAX_ALERTS = 'maxAlerts', MAX_QUEUED_ACTIONS = 'maxQueuedActions', + EXECUTION = 'ruleExecution', } export type RuleExecutionStatuses = (typeof RuleExecutionStatusValues)[number]; @@ -238,6 +239,10 @@ export interface Rule { running?: boolean | null; viewInAppRelativeUrl?: string; alertDelay?: AlertDelay | null; + flapping?: { + lookBackWindow: number; + statusChangeThreshold: number; + }; } export type SanitizedRule = Omit< diff --git a/packages/kbn-alerts-grouping/index.ts b/packages/kbn-alerts-grouping/index.ts index e9e2476dde7a7..f124e57596191 100644 --- a/packages/kbn-alerts-grouping/index.ts +++ b/packages/kbn-alerts-grouping/index.ts @@ -7,5 +7,9 @@ */ export { AlertsGrouping } from './src/components/alerts_grouping'; -export { type AlertsGroupingProps } from './src/types'; +export { + type AlertsGroupingProps, + type BaseAlertsGroupAggregations, + type AlertsGroupAggregationBucket, +} from './src/types'; export { useAlertsGroupingState } from './src/contexts/alerts_grouping_context'; diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx index 87517def778cd..47e2d5c1b4082 100644 --- a/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx @@ -158,7 +158,7 @@ describe('AlertsGrouping', () => { }, { range: { - '@timestamp': { + 'kibana.alert.time_range': { gte: mockDate.from, lte: mockDate.to, }, diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx index f17d794668371..17a4d35f73e8a 100644 --- a/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx @@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n'; import { useAlertsDataView } from '@kbn/alerts-ui-shared/src/common/hooks/use_alerts_data_view'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { AlertsGroupingLevel, AlertsGroupingLevelProps } from './alerts_grouping_level'; -import { AlertsGroupingProps } from '../types'; +import type { AlertsGroupingProps, BaseAlertsGroupAggregations } from '../types'; import { AlertsGroupingContextProvider, useAlertsGroupingState, @@ -40,7 +40,10 @@ const NextLevel = ({ parentGroupingFilter, groupingFilters, getLevel, -}: Pick & { +}: Pick< + AlertsGroupingLevelProps, + 'children' | 'parentGroupingFilter' +> & { level: number; selectedGroups: string[]; groupingFilters: Filter[]; @@ -56,7 +59,9 @@ const NextLevel = ({ return children(nextGroupingFilters)!; }; -const AlertsGroupingInternal = (props: AlertsGroupingProps) => { +const AlertsGroupingInternal = ( + props: AlertsGroupingProps +) => { const { groupingId, services, @@ -194,7 +199,7 @@ const AlertsGroupingInternal = (props: AlertsGroupingProps) => { }; return ( - {...props} getGrouping={getGrouping} groupingLevel={level} @@ -230,6 +235,8 @@ const AlertsGroupingInternal = (props: AlertsGroupingProps) => { return getLevel(0, selectedGroups[0]); }; +const typedMemo: (c: T) => T = memo; + /** * A coordinator component to show multiple alert tables grouped by one or more fields * @@ -243,7 +250,7 @@ const AlertsGroupingInternal = (props: AlertsGroupingProps) => { * * * return ( - * * featureIds={[...]} * globalQuery={{ query: ..., language: 'kql' }} * globalFilters={...} @@ -274,11 +281,25 @@ const AlertsGroupingInternal = (props: AlertsGroupingProps) => { * * ); * ``` + * + * To define your aggregations result type, extend the `BaseAlertsGroupAggregations` type: + * + * ```ts + * import { BaseAlertsGroupAggregations } from '@kbn/alerts-grouping'; + * + * interface YourAggregationsType extends BaseAlertsGroupAggregations { + * // Your custom aggregations here + * } + * ``` + * + * Check {@link useGetAlertsGroupAggregationsQuery} for more info on alerts aggregations. */ -export const AlertsGrouping = memo((props: AlertsGroupingProps) => { - return ( - - - - ); -}); +export const AlertsGrouping = typedMemo( + (props: AlertsGroupingProps) => { + return ( + + + + ); + } +); diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx index e4511e8dea774..c0ebf0e6fa234 100644 --- a/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx @@ -14,14 +14,16 @@ import { type GroupingAggregation } from '@kbn/grouping'; import { isNoneGroup } from '@kbn/grouping'; import type { DynamicGroupingProps } from '@kbn/grouping/src'; import { parseGroupingQuery } from '@kbn/grouping/src'; +import { ALERT_TIME_RANGE } from '@kbn/rule-data-utils'; import { useGetAlertsGroupAggregationsQuery, UseGetAlertsGroupAggregationsQueryProps, } from '@kbn/alerts-ui-shared'; -import { AlertsGroupingProps } from '../types'; +import { AlertsGroupingProps, BaseAlertsGroupAggregations } from '../types'; -export interface AlertsGroupingLevelProps = {}> - extends AlertsGroupingProps { +export interface AlertsGroupingLevelProps< + T extends BaseAlertsGroupAggregations = BaseAlertsGroupAggregations +> extends AlertsGroupingProps { getGrouping: ( props: Omit, 'groupSelector' | 'pagination'> ) => ReactElement; @@ -40,8 +42,9 @@ const DEFAULT_FILTERS: Filter[] = []; /** * Renders an alerts grouping level */ -export const AlertsGroupingLevel = memo( - = {}>({ +const typedMemo: (c: T) => T = memo; +export const AlertsGroupingLevel = typedMemo( + ({ featureIds, defaultFilters = DEFAULT_FILTERS, from, @@ -92,7 +95,7 @@ export const AlertsGroupingLevel = memo( ...filters, { range: { - '@timestamp': { + [ALERT_TIME_RANGE]: { gte: from, lte: to, }, diff --git a/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx b/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx index cc5e06e652cd4..2d1315e3ece6d 100644 --- a/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx +++ b/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx @@ -54,7 +54,6 @@ export const useAlertsGroupingState = (groupingId: string) => { setGroupingState((prevState) => ({ ...prevState, [groupingId]: { - // @ts-expect-error options might not be defined options: [], // @ts-expect-error activeGroups might not be defined activeGroups: initialActiveGroups, diff --git a/packages/kbn-alerts-grouping/src/types.ts b/packages/kbn-alerts-grouping/src/types.ts index 8d226bb74e71f..24239364bb6c2 100644 --- a/packages/kbn-alerts-grouping/src/types.ts +++ b/packages/kbn-alerts-grouping/src/types.ts @@ -22,14 +22,16 @@ import { ReactElement } from 'react'; export interface GroupModel { activeGroups: string[]; - options: Array<{ key: string; label: string }>; + options?: Array<{ key: string; label: string }>; } export interface AlertsGroupingState { [groupingId: string]: GroupModel; } -export interface AlertsGroupingProps = {}> { +export interface AlertsGroupingProps< + T extends BaseAlertsGroupAggregations = BaseAlertsGroupAggregations +> { /** * The leaf component that will be rendered in the grouping panels */ @@ -96,3 +98,26 @@ export interface AlertsGroupingProps = {}> { http: HttpSetup; }; } + +export interface AlertsGroupAggregationBucket { + key: string; + doc_count: number; + isNullGroup?: boolean; + unitsCount?: { + value: number; + }; +} + +export interface BaseAlertsGroupAggregations { + groupByFields: { + doc_count_error_upper_bound: number; + sum_other_doc_count: number; + buckets: AlertsGroupAggregationBucket[]; + }; + groupsCount: { + value: number; + }; + unitsCount: { + value: number; + }; +} diff --git a/packages/kbn-alerts-ui-shared/src/add_message_variables/add_message_variables.scss b/packages/kbn-alerts-ui-shared/src/add_message_variables/add_message_variables.scss index 521d0f399b19b..d53223bd6ad0d 100644 --- a/packages/kbn-alerts-ui-shared/src/add_message_variables/add_message_variables.scss +++ b/packages/kbn-alerts-ui-shared/src/add_message_variables/add_message_variables.scss @@ -1,5 +1,6 @@ .messageVariablesPanel { - @include euiYScrollWithShadows; max-height: $euiSize * 20; max-width: $euiSize * 20; + + @include euiYScrollWithShadows; } \ No newline at end of file diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/create_rule.test.ts b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/create_rule.test.ts index 8735a9bebca73..e1947f6d8890e 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/create_rule.test.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/create_rule.test.ts @@ -62,6 +62,10 @@ describe('createRule', () => { alert_delay: { active: 10, }, + flapping: { + look_back_window: 10, + status_change_threshold: 10, + }, }; const ruleToCreate: CreateRuleBody = { @@ -109,10 +113,18 @@ describe('createRule', () => { alertDelay: { active: 10, }, + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, + }, }; http.post.mockResolvedValueOnce(resolvedValue); const result = await createRule({ http, rule: ruleToCreate as CreateRuleBody }); + expect(http.post).toHaveBeenCalledWith('/api/alerting/rule', { + body: '{"params":{"aggType":"count","termSize":5,"thresholdComparator":">","timeWindowSize":5,"timeWindowUnit":"m","groupBy":"all","threshold":[1000],"index":[".kibana"],"timeField":"alert.executionStatus.lastExecutionDate"},"consumer":"alerts","schedule":{"interval":"1m"},"tags":[],"name":"test","enabled":true,"throttle":null,"notifyWhen":"onActionGroupChange","rule_type_id":".index-threshold","actions":[{"group":"threshold met","id":"83d4d860-9316-11eb-a145-93ab369a4461","params":{"level":"info","message":"Rule \'{{rule.name}}\' is active for group \'{{context.group}}\':\\n\\n- Value: {{context.value}}\\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\\n- Timestamp: {{context.date}}"},"frequency":{"notify_when":"onActionGroupChange","throttle":null,"summary":false}},{"id":".test-system-action","params":{}}],"alert_delay":{"active":10},"flapping":{"look_back_window":10,"status_change_threshold":10}}', + }); + expect(result).toEqual({ actions: [ { @@ -169,6 +181,10 @@ describe('createRule', () => { alertDelay: { active: 10, }, + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, + }, }); }); }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.test.ts b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.test.ts index 8b41e38d14ec1..7c5c80efa3ee2 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.test.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.test.ts @@ -55,6 +55,10 @@ const ruleToCreate: CreateRuleBody = { alertDelay: { active: 10, }, + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, + }, }; describe('transformCreateRuleBody', () => { @@ -96,8 +100,11 @@ describe('transformCreateRuleBody', () => { }, { id: '.test-system-action', params: {} }, ], - alert_delay: { active: 10 }, + flapping: { + look_back_window: 10, + status_change_threshold: 10, + }, }); }); }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.ts b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.ts index 9baae0267d22f..dd8d5483ef0d7 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/transform_create_rule_body.ts @@ -8,11 +8,26 @@ import { RewriteResponseCase } from '@kbn/actions-types'; import { CreateRuleBody } from './types'; +import { Rule } from '../../types'; + +const transformCreateRuleFlapping = (flapping: Rule['flapping']) => { + if (!flapping) { + return flapping; + } + + return { + flapping: { + look_back_window: flapping.lookBackWindow, + status_change_threshold: flapping.statusChangeThreshold, + }, + }; +}; export const transformCreateRuleBody: RewriteResponseCase = ({ ruleTypeId, actions = [], alertDelay, + flapping, ...res }): any => ({ ...res, @@ -44,4 +59,5 @@ export const transformCreateRuleBody: RewriteResponseCase = ({ }; }), ...(alertDelay ? { alert_delay: alertDelay } : {}), + ...(flapping !== undefined ? transformCreateRuleFlapping(flapping) : {}), }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/types.ts b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/types.ts index e40059d5e6860..1527744ced38c 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/types.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/create_rule/types.ts @@ -20,4 +20,5 @@ export interface CreateRuleBody throttle?: Rule['throttle']; notifyWhen?: Rule['notifyWhen']; alertDelay?: Rule['alertDelay']; + flapping?: Rule['flapping']; } diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.test.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.test.ts index c30807884a646..d5efc7b8fd19f 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.test.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.test.ts @@ -52,6 +52,10 @@ const ruleToUpdate: UpdateRuleBody = { alertDelay: { active: 10, }, + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, + }, }; describe('transformUpdateRuleBody', () => { @@ -98,6 +102,10 @@ describe('transformUpdateRuleBody', () => { }, tags: [], throttle: null, + flapping: { + look_back_window: 10, + status_change_threshold: 10, + }, }); }); }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.ts index 959cf5c7cdd3c..45c34833fad9b 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/transform_update_rule_body.ts @@ -8,10 +8,25 @@ import { RewriteResponseCase } from '@kbn/actions-types'; import { UpdateRuleBody } from './types'; +import { Rule } from '../../types'; + +const transformUpdateRuleFlapping = (flapping: Rule['flapping']) => { + if (!flapping) { + return flapping; + } + + return { + flapping: { + look_back_window: flapping.lookBackWindow, + status_change_threshold: flapping.statusChangeThreshold, + }, + }; +}; export const transformUpdateRuleBody: RewriteResponseCase = ({ actions = [], alertDelay, + flapping, ...res }): any => ({ ...res, @@ -41,4 +56,5 @@ export const transformUpdateRuleBody: RewriteResponseCase = ({ }; }), ...(alertDelay ? { alert_delay: alertDelay } : {}), + ...(flapping !== undefined ? transformUpdateRuleFlapping(flapping) : {}), }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/types.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/types.ts index dac91fa2076f6..7a466ac0b6d86 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/types.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/types.ts @@ -17,4 +17,5 @@ export interface UpdateRuleBody throttle?: Rule['throttle']; notifyWhen?: Rule['notifyWhen']; alertDelay?: Rule['alertDelay']; + flapping?: Rule['flapping']; } diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts index 7cb64b51427e0..9668e60a79417 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts @@ -7,28 +7,74 @@ */ import { httpServiceMock } from '@kbn/core/public/mocks'; -import { Rule } from '../../types'; import { updateRule, UpdateRuleBody } from '.'; const http = httpServiceMock.createStartContract(); describe('updateRule', () => { test('should call rule update API', async () => { - const ruleToUpdate = { + const updatedRule = { + params: { + aggType: 'count', + termSize: 5, + thresholdComparator: '>', + timeWindowSize: 5, + timeWindowUnit: 'm', + groupBy: 'all', + threshold: [1000], + index: ['.kibana'], + timeField: 'alert.executionStatus.lastExecutionDate', + }, consumer: 'alerts', + schedule: { interval: '1m' }, + tags: [], name: 'test', - tags: ['foo'], + rule_type_id: '.index-threshold', + actions: [ + { + group: 'threshold met', + id: '1', + params: { + level: 'info', + message: 'alert ', + }, + connector_type_id: '.server-log', + frequency: { + notify_when: 'onActionGroupChange', + throttle: null, + summary: false, + }, + }, + { + id: '.test-system-action', + params: {}, + connector_type_id: '.system-action', + }, + ], + scheduled_task_id: '1', + execution_status: { status: 'pending', last_execution_date: '2021-04-01T21:33:13.250Z' }, + create_at: '2021-04-01T21:33:13.247Z', + updated_at: '2021-04-01T21:33:13.247Z', + create_by: 'user', + updated_by: 'user', + alert_delay: { + active: 10, + }, + flapping: { + look_back_window: 10, + status_change_threshold: 10, + }, + }; + + const updateRuleBody = { + name: 'test-update', + tags: ['foo', 'bar'], schedule: { - interval: '1m', + interval: '5m', }, params: {}, - createdAt: new Date('1970-01-01T00:00:00.000Z'), - updatedAt: new Date('1970-01-01T00:00:00.000Z'), - apiKey: null, - apiKeyOwner: null, - revision: 0, alertDelay: { - active: 10, + active: 50, }, actions: [ { @@ -43,37 +89,29 @@ describe('updateRule', () => { summary: false, }, }, - { - id: '.test-system-action', - params: {}, - actionTypeId: '.system-action', - }, ], - }; - - const resolvedValue: Rule = { - ...ruleToUpdate, - id: '12/3', - enabled: true, - ruleTypeId: 'test', - createdBy: null, - updatedBy: null, - muteAll: false, - mutedInstanceIds: [], - executionStatus: { - status: 'unknown', - lastExecutionDate: new Date('2020-08-20T19:23:38Z'), + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, }, - revision: 1, }; http.put.mockResolvedValueOnce({ - ...resolvedValue, + ...updatedRule, + name: 'test-update', + tags: ['foo', 'bar'], + schedule: { + interval: '5m', + }, + params: {}, + alert_delay: { + active: 50, + }, actions: [ { group: 'default', id: '2', - connector_type_id: 'test', + action_type_dd: 'test', params: {}, use_alert_data_for_template: false, frequency: { @@ -82,41 +120,57 @@ describe('updateRule', () => { summary: false, }, }, - { - id: '.test-system-action', - params: {}, - connector_type_id: '.system-action', - }, ], + flapping: { + look_back_window: 10, + status_change_threshold: 10, + }, }); - const result = await updateRule({ http, id: '12/3', rule: ruleToUpdate as UpdateRuleBody }); + const result = await updateRule({ http, id: '12/3', rule: updateRuleBody as UpdateRuleBody }); expect(result).toEqual({ - ...resolvedValue, actions: [ { - group: 'default', - id: '2', - actionTypeId: 'test', - params: {}, - useAlertDataForTemplate: false, frequency: { notifyWhen: 'onActionGroupChange', - throttle: null, summary: false, + throttle: null, }, - }, - { - id: '.test-system-action', + group: 'default', + id: '2', params: {}, - actionTypeId: '.system-action', + useAlertDataForTemplate: false, }, ], + alertDelay: { + active: 50, + }, + consumer: 'alerts', + create_at: '2021-04-01T21:33:13.247Z', + create_by: 'user', + executionStatus: { + lastExecutionDate: '2021-04-01T21:33:13.250Z', + status: 'pending', + }, + flapping: { + lookBackWindow: 10, + statusChangeThreshold: 10, + }, + name: 'test-update', + params: {}, + ruleTypeId: '.index-threshold', + schedule: { + interval: '5m', + }, + scheduledTaskId: '1', + tags: ['foo', 'bar'], + updatedAt: '2021-04-01T21:33:13.247Z', + updatedBy: 'user', }); expect(http.put).toHaveBeenCalledWith('/api/alerting/rule/12%2F3', { - body: '{"name":"test","tags":["foo"],"schedule":{"interval":"1m"},"params":{},"actions":[{"group":"default","id":"2","params":{},"frequency":{"notify_when":"onActionGroupChange","throttle":null,"summary":false},"use_alert_data_for_template":false},{"id":".test-system-action","params":{}}],"alert_delay":{"active":10}}', + body: '{"name":"test-update","tags":["foo","bar"],"schedule":{"interval":"5m"},"params":{},"actions":[{"group":"default","id":"2","params":{},"frequency":{"notify_when":"onActionGroupChange","throttle":null,"summary":false},"use_alert_data_for_template":false}],"alert_delay":{"active":50},"flapping":{"look_back_window":10,"status_change_threshold":10}}', }); }); }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts index 841778eaa52ee..97e5ed6bef480 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts @@ -21,6 +21,7 @@ export const UPDATE_FIELDS: Array = [ 'schedule', 'params', 'alertDelay', + 'flapping', ]; export const UPDATE_FIELDS_WITH_ACTIONS: Array = [ @@ -30,6 +31,7 @@ export const UPDATE_FIELDS_WITH_ACTIONS: Array = [ 'params', 'alertDelay', 'actions', + 'flapping', ]; export async function updateRule({ diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts index eab5b9ac510fa..e9e24b7a20d5e 100644 --- a/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts @@ -45,6 +45,8 @@ export interface UseGetAlertsGroupAggregationsQueryProps { * * The provided `aggregations` are applied within `groupByFields`. Here the `groupByField` runtime * field can be used to perform grouping-based aggregations. + * `groupByField` buckets computed over a field with a null/absent value are marked with the + * `isNullGroup` flag set to true and their key is set to the `--` string. * * Applies alerting RBAC through featureIds. */ diff --git a/packages/kbn-alerts-ui-shared/src/common/transformations/transform_rule.ts b/packages/kbn-alerts-ui-shared/src/common/transformations/transform_rule.ts index 46717052d70b2..5081ef0314e4d 100644 --- a/packages/kbn-alerts-ui-shared/src/common/transformations/transform_rule.ts +++ b/packages/kbn-alerts-ui-shared/src/common/transformations/transform_rule.ts @@ -33,6 +33,19 @@ const transformLastRun: RewriteRequestCase = ({ ...rest, }); +const transformFlapping = (flapping: AsApiContract) => { + if (!flapping) { + return flapping; + } + + return { + flapping: { + lookBackWindow: flapping.look_back_window, + statusChangeThreshold: flapping.status_change_threshold, + }, + }; +}; + export const transformRule: RewriteRequestCase = ({ rule_type_id: ruleTypeId, created_by: createdBy, @@ -53,6 +66,7 @@ export const transformRule: RewriteRequestCase = ({ last_run: lastRun, next_run: nextRun, alert_delay: alertDelay, + flapping, ...rest }: any) => ({ ruleTypeId, @@ -76,6 +90,7 @@ export const transformRule: RewriteRequestCase = ({ ...(nextRun ? { nextRun } : {}), ...(apiKeyCreatedByUser !== undefined ? { apiKeyCreatedByUser } : {}), ...(alertDelay ? { alertDelay } : {}), + ...(flapping !== undefined ? transformFlapping(flapping) : {}), ...rest, }); diff --git a/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_inputs.tsx b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_inputs.tsx new file mode 100644 index 0000000000000..6b3086df3f952 --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_inputs.tsx @@ -0,0 +1,110 @@ +/* + * 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 } from 'react'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { + MIN_LOOK_BACK_WINDOW, + MAX_LOOK_BACK_WINDOW, + MIN_STATUS_CHANGE_THRESHOLD, + MAX_STATUS_CHANGE_THRESHOLD, +} from '@kbn/alerting-types'; +import { i18n } from '@kbn/i18n'; +import { RuleSettingsRangeInput } from './rule_settings_range_input'; + +const lookBackWindowLabel = i18n.translate( + 'alertsUIShared.ruleSettingsFlappingInputsProps.lookBackWindowLabel', + { + defaultMessage: 'Rule run look back window', + } +); + +const lookBackWindowHelp = i18n.translate( + 'alertsUIShared.ruleSettingsFlappingInputsProps.lookBackWindowHelp', + { + defaultMessage: 'The minimum number of runs in which the threshold must be met.', + } +); + +const statusChangeThresholdLabel = i18n.translate( + 'alertsUIShared.ruleSettingsFlappingInputsProps.statusChangeThresholdLabel', + { + defaultMessage: 'Alert status change threshold', + } +); + +const statusChangeThresholdHelp = i18n.translate( + 'alertsUIShared.ruleSettingsFlappingInputsProps.statusChangeThresholdHelp', + { + defaultMessage: + 'The minimum number of times an alert must switch states in the look back window.', + } +); + +export interface RuleSettingsFlappingInputsProps { + lookBackWindow: number; + statusChangeThreshold: number; + isDisabled?: boolean; + onLookBackWindowChange: (value: number) => void; + onStatusChangeThresholdChange: (value: number) => void; +} + +export const RuleSettingsFlappingInputs = (props: RuleSettingsFlappingInputsProps) => { + const { + lookBackWindow, + statusChangeThreshold, + isDisabled = false, + onLookBackWindowChange, + onStatusChangeThresholdChange, + } = props; + + const internalOnLookBackWindowChange = useCallback( + (e) => { + onLookBackWindowChange(parseInt(e.currentTarget.value, 10)); + }, + [onLookBackWindowChange] + ); + + const internalOnStatusChangeThresholdChange = useCallback( + (e) => { + onStatusChangeThresholdChange(parseInt(e.currentTarget.value, 10)); + }, + [onStatusChangeThresholdChange] + ); + + return ( + + + + + + + + + ); +}; diff --git a/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_message.tsx b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_message.tsx new file mode 100644 index 0000000000000..7752ef7ba5e86 --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_message.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 { EuiText } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React from 'react'; + +const getLookBackWindowLabelRuleRuns = (amount: number) => { + return i18n.translate('alertsUIShared.ruleSettingsFlappingMessage.lookBackWindowLabelRuleRuns', { + defaultMessage: '{amount, number} rule {amount, plural, one {run} other {runs}}', + values: { amount }, + }); +}; + +const getStatusChangeThresholdRuleRuns = (amount: number) => { + return i18n.translate('alertsUIShared.ruleSettingsFlappingMessage.statusChangeThresholdTimes', { + defaultMessage: '{amount, number} {amount, plural, one {time} other {times}}', + values: { amount }, + }); +}; + +export const flappingOffMessage = i18n.translate( + 'alertsUIShared.ruleSettingsFlappingMessage.flappingOffMessage', + { + defaultMessage: + 'Alert flapping detection is off. Alerts will be generated based on the rule interval, which might result in higher alert volumes.', + } +); + +export interface RuleSettingsFlappingMessageProps { + lookBackWindow: number; + statusChangeThreshold: number; +} + +export const RuleSettingsFlappingMessage = (props: RuleSettingsFlappingMessageProps) => { + const { lookBackWindow, statusChangeThreshold } = props; + + return ( + + {getLookBackWindowLabelRuleRuns(lookBackWindow)}, + statusChangeThreshold: {getStatusChangeThresholdRuleRuns(statusChangeThreshold)}, + }} + /> + + ); +}; diff --git a/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_range_input.tsx b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_range_input.tsx new file mode 100644 index 0000000000000..2103a7c2adbd4 --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_range_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 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, { memo } from 'react'; +import { EuiFormRow, EuiFormRowProps, EuiIconTip, EuiRange, EuiRangeProps } from '@elastic/eui'; + +export interface RuleSettingsRangeInputProps { + label: EuiFormRowProps['label']; + labelPopoverText?: string; + min: number; + max: number; + value: number; + fullWidth?: EuiRangeProps['fullWidth']; + disabled?: EuiRangeProps['disabled']; + onChange?: EuiRangeProps['onChange']; +} + +export const RuleSettingsRangeInput = memo((props: RuleSettingsRangeInputProps) => { + const { label, labelPopoverText, min, max, value, fullWidth, disabled, onChange, ...rest } = + props; + + const renderLabel = () => { + return ( +
+ {label} +   + {labelPopoverText && ( + + )} +
+ ); + }; + + return ( + + + + ); +}); diff --git a/packages/kbn-apm-synthtrace-client/src/lib/infra/host.ts b/packages/kbn-apm-synthtrace-client/src/lib/infra/host.ts index a5ca11ad20203..c9956dc8a666e 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/infra/host.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/infra/host.ts @@ -8,6 +8,7 @@ /* eslint-disable max-classes-per-file */ import { Entity, Fields } from '../entity'; import { Serializable } from '../serializable'; +import { k8sNode } from './k8s_node'; import { pod } from './pod'; interface HostDocument extends Fields { @@ -20,17 +21,20 @@ interface HostDocument extends Fields { 'host.ip'?: string; 'host.os.name'?: string; 'host.os.version'?: string; + 'host.os.platform'?: string; 'cloud.provider'?: string; } class Host extends Entity { - cpu() { + cpu({ cpuTotalValue }: { cpuTotalValue?: number } = {}) { return new HostMetrics({ ...this.fields, - 'system.cpu.total.norm.pct': 0.094, + 'system.cpu.total.norm.pct': cpuTotalValue ?? 0.98, 'system.cpu.user.pct': 0.805, 'system.cpu.system.pct': 0.704, 'system.cpu.cores': 16, + 'process.cpu.pct': 0.1, + 'system.cpu.nice.pct': 0.1, 'metricset.period': 10000, 'metricset.name': 'cpu', }); @@ -45,6 +49,7 @@ class Host extends Entity { 'system.memory.total': 68719476736, 'system.memory.used.bytes': 39964708864, 'system.memory.used.pct': 0.582, + 'process.memory.pct': 0.1, 'metricset.period': 10000, 'metricset.name': 'memory', }); @@ -72,6 +77,22 @@ class Host extends Entity { }); } + core() { + return new HostMetrics({ + ...this.fields, + 'system.core.total.pct': 0.98, + 'system.core.user.pct': 0.805, + 'system.core.nice.pct': 0.704, + 'system.core.idle.pct': 0.1, + 'system.core.iowait.pct': 0.1, + 'system.core.irq.pct': 0.1, + 'system.core.softirq.pct': 0.1, + 'system.core.steal.pct': 0.1, + 'metricset.period': 10000, + 'metricset.name': 'core', + }); + } + filesystem() { return new HostMetrics({ ...this.fields, @@ -96,6 +117,10 @@ class Host extends Entity { pod(uid: string) { return pod(uid, this.fields['host.hostname']); } + + node(podUid: string) { + return k8sNode(this.fields['host.hostname'], podUid); + } } export interface HostMetricsDocument extends HostDocument { @@ -120,6 +145,17 @@ export interface HostMetricsDocument extends HostDocument { 'system.load'?: { 1: number; cores: number }; 'host.network.ingress.bytes'?: number; 'host.network.egress.bytes'?: number; + 'process.cpu.pct'?: number; + 'process.memory.pct'?: number; + 'system.core.total.pct'?: number; + 'system.core.user.pct'?: number; + 'system.core.nice.pct'?: number; + 'system.core.idle.pct'?: number; + 'system.core.iowait.pct'?: number; + 'system.core.irq.pct'?: number; + 'system.core.softirq.pct'?: number; + 'system.core.steal.pct'?: number; + 'system.cpu.nice.pct'?: number; } class HostMetrics extends Serializable {} @@ -132,6 +168,7 @@ export function host(name: string): Host { 'host.name': name, 'host.ip': '10.128.0.2', 'host.os.name': 'Linux', + 'host.os.platform': 'ubuntu', 'host.os.version': '4.19.76-linuxkit', 'cloud.provider': 'gcp', }); diff --git a/packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts b/packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts index c325635e27098..b8b0600fc1838 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/infra/index.ts @@ -11,13 +11,15 @@ import { host, HostMetricsDocument } from './host'; import { k8sContainer, K8sContainerMetricsDocument } from './k8s_container'; import { pod, PodMetricsDocument } from './pod'; import { awsRds, AWSRdsMetricsDocument } from './aws/rds'; +import { k8sNode, K8sNodeMetricsDocument } from './k8s_node'; export type InfraDocument = | HostMetricsDocument | PodMetricsDocument | DockerContainerMetricsDocument | K8sContainerMetricsDocument - | AWSRdsMetricsDocument; + | AWSRdsMetricsDocument + | K8sNodeMetricsDocument; export const infra = { host, @@ -25,4 +27,5 @@ export const infra = { dockerContainer, k8sContainer, awsRds, + k8sNode, }; diff --git a/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_container.ts b/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_container.ts index 6aa813913c118..7135581f6129c 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_container.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_container.ts @@ -18,11 +18,13 @@ interface K8sContainerDocument extends Fields { 'container.name'?: string; 'container.image.name'?: string; 'container.runtime'?: string; - 'host.name'?: string; + 'host.name': string; + 'host.hostname': string; 'cloud.provider'?: string; 'cloud.instance.id'?: string; 'cloud.image.id'?: string; 'event.dataset'?: string; + 'agent.id': string; } export class K8sContainer extends Entity { @@ -31,6 +33,7 @@ export class K8sContainer extends Entity { ...this.fields, 'kubernetes.container.cpu.usage.limit.pct': 46, 'kubernetes.container.memory.usage.limit.pct': 30, + 'kubernetes.pod.cpu.usage.limit.pct': 46, }); } } @@ -38,6 +41,7 @@ export class K8sContainer extends Entity { export interface K8sContainerMetricsDocument extends K8sContainerDocument { 'kubernetes.container.cpu.usage.limit.pct': number; 'kubernetes.container.memory.usage.limit.pct': number; + 'kubernetes.pod.cpu.usage.limit.pct': number; } class K8sContainerMetrics extends Serializable {} @@ -51,6 +55,8 @@ export function k8sContainer(id: string, uid: string, nodeName: string): K8sCont 'container.runtime': 'containerd', 'container.image.name': 'image-1', 'host.name': 'host-1', + 'host.hostname': 'host-1', + 'agent.id': 'synthtrace', 'cloud.instance.id': 'instance-1', 'cloud.image.id': 'image-1', 'cloud.provider': 'aws', diff --git a/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_node.ts b/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_node.ts new file mode 100644 index 0000000000000..8b596a6591669 --- /dev/null +++ b/packages/kbn-apm-synthtrace-client/src/lib/infra/k8s_node.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ +/* eslint-disable max-classes-per-file */ +import { Entity, Fields } from '../entity'; +import { Serializable } from '../serializable'; + +interface K8sNodeDocument extends Fields { + 'kubernetes.node.name': string; + 'kubernetes.pod.uid'?: string; + 'agent.id': string; + 'host.hostname': string; + 'host.name': string; + 'metricset.name'?: string; + 'event.dataset'?: string; +} + +export class K8sNode extends Entity { + metrics() { + return new K8sNodeMetrics({ + ...this.fields, + 'kubernetes.node.cpu.allocatable.cores': 0.53, + 'kubernetes.node.cpu.usage.nanocores': 0.32, + 'kubernetes.node.memory.allocatable.bytes': 0.46, + 'kubernetes.node.memory.usage.bytes': 0.86, + 'kubernetes.node.fs.capacity.bytes': 100, + 'kubernetes.node.fs.used.bytes': 100, + 'kubernetes.node.pod.allocatable.total': 10, + }); + } +} + +export interface K8sNodeMetricsDocument extends K8sNodeDocument { + 'kubernetes.node.cpu.allocatable.cores': number; + 'kubernetes.node.cpu.usage.nanocores': number; + 'kubernetes.node.memory.allocatable.bytes': number; + 'kubernetes.node.memory.usage.bytes': number; + 'kubernetes.node.fs.capacity.bytes': number; + 'kubernetes.node.fs.used.bytes': number; + 'kubernetes.node.pod.allocatable.total': number; +} + +class K8sNodeMetrics extends Serializable {} + +export function k8sNode(name: string, podUid: string) { + return new K8sNode({ + 'kubernetes.node.name': name, + 'kubernetes.pod.uid': podUid, + 'agent.id': 'synthtrace', + 'host.hostname': name, + 'host.name': name, + 'event.dataset': 'kubernetes.node', + }); +} diff --git a/packages/kbn-apm-synthtrace-client/src/lib/infra/pod.ts b/packages/kbn-apm-synthtrace-client/src/lib/infra/pod.ts index 35ebe94ba6ee1..b885fd1aeb606 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/infra/pod.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/infra/pod.ts @@ -12,6 +12,9 @@ import { Serializable } from '../serializable'; import { k8sContainer } from './k8s_container'; interface PodDocument extends Fields { + 'agent.id': string; + 'host.hostname': string; + 'host.name': string; 'kubernetes.pod.uid': string; 'kubernetes.node.name': string; 'metricset.name'?: string; @@ -40,5 +43,8 @@ export function pod(uid: string, nodeName: string) { return new Pod({ 'kubernetes.pod.uid': uid, 'kubernetes.node.name': nodeName, + 'agent.id': 'synthtrace', + 'host.hostname': nodeName, + 'host.name': nodeName, }); } diff --git a/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts b/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts index 18c3f32afaaef..a649189de47a5 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { randomInt } from 'crypto'; import { Fields } from '../entity'; import { Serializable } from '../serializable'; @@ -55,6 +56,13 @@ export type LogDocument = Fields & 'error.exception.stacktrace'?: string; 'error.log.stacktrace'?: string; 'log.custom': Record; + 'host.geo.location': number[]; + 'host.ip': string; + 'network.bytes': number; + 'tls.established': boolean; + 'event.duration': number; + 'event.start': Date; + 'event.end': Date; }>; class Log extends Serializable { @@ -100,6 +108,21 @@ class Log extends Serializable { this.fields.message = message; return this; } + + setGeoLocation(geoCoordinates: number[]) { + this.fields['host.geo.location'] = geoCoordinates; + return this; + } + + setHostIp(hostIp: string) { + this.fields['host.ip'] = hostIp; + return this; + } + + timestamp(time: number) { + super.timestamp(time); + return this; + } } function create(logsOptions: LogsOptions = defaultLogsOptions): Log { @@ -109,6 +132,8 @@ function create(logsOptions: LogsOptions = defaultLogsOptions): Log { 'data_stream.namespace': 'default', 'data_stream.type': 'logs', 'host.name': 'synth-host', + 'network.bytes': randomInt(500, 10000), + 'tls.established': Math.random() < 0.5, }, logsOptions ).dataset('synth'); diff --git a/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_es_client.ts b/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_es_client.ts index 6c42d7051a9b0..dcd5e6da2d261 100644 --- a/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_es_client.ts +++ b/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_es_client.ts @@ -22,7 +22,14 @@ export class InfraSynthtraceEsClient extends SynthtraceEsClient { ...options, pipeline: infraPipeline(), }); - this.dataStreams = ['metrics-*', 'logs-*']; + this.dataStreams = [ + 'metrics-system*', + 'metrics-kubernetes*', + 'metrics-docker*', + 'metrics-aws*', + 'metricbeat-*', + 'logs-*', + ]; } } @@ -60,7 +67,10 @@ function getRoutingTransform() { document._index = 'metrics-system.filesystem-default'; } else if (metricset === 'diskio') { document._index = 'metrics-system.diskio-default'; + } else if (metricset === 'core') { + document._index = 'metrics-system.core-default'; } else if ('container.id' in document) { + document._index = 'metrics-docker.container-default'; document._index = 'metrics-kubernetes.container-default'; } else if ('kubernetes.pod.uid' in document) { document._index = 'metrics-kubernetes.pod-default'; diff --git a/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts b/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts index b39efada2abff..5c6e02aaedc3a 100644 --- a/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts +++ b/packages/kbn-apm-synthtrace/src/lib/infra/infra_synthtrace_kibana_client.ts @@ -70,4 +70,27 @@ export class InfraSynthtraceKibanaClient { this.logger.info(`Installed System package ${packageVersion}`); } + + async uninstallSystemPackage(packageVersion: string) { + this.logger.debug(`Uninstalling System package ${packageVersion}`); + + const url = join(this.target, `/api/fleet/epm/packages/system/${packageVersion}`); + const response = await pRetry(() => { + return fetch(url, { + method: 'DELETE', + headers: kibanaHeaders(), + body: '{"force":true}', + }); + }); + + const responseJson = await response.json(); + + if (!responseJson.items) { + throw new Error( + `Failed to uninstall System package version ${packageVersion}, received HTTP ${response.status} and message: ${responseJson.message} for url ${url}` + ); + } + + this.logger.info(`System package ${packageVersion} uninstalled`); + } } diff --git a/packages/kbn-apm-synthtrace/src/scenarios/degraded_logs.ts b/packages/kbn-apm-synthtrace/src/scenarios/degraded_logs.ts index 20323c8c2be91..f33e43e0e11ec 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/degraded_logs.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/degraded_logs.ts @@ -9,11 +9,27 @@ import { LogDocument, log, generateShortId, generateLongId } from '@kbn/apm-synt import { Scenario } from '../cli/scenario'; import { IndexTemplateName } from '../lib/logs/custom_logsdb_index_templates'; import { withClient } from '../lib/utils/with_client'; +import { + getServiceName, + getCluster, + getCloudRegion, + getCloudProvider, +} from './helpers/logs_mock_data'; import { parseLogsScenarioOpts } from './helpers/logs_scenario_opts_parser'; const MORE_THAN_1024_CHARS = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?'; +// Logs Data logic +const MESSAGE_LOG_LEVELS = [ + { message: 'A simple log', level: 'info' }, + { + message: 'Another log message', + level: 'debug', + }, + { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, +]; + const scenario: Scenario = async (runOptions) => { const { isLogsDb } = parseLogsScenarioOpts(runOptions.scenarioOpts); return { @@ -23,100 +39,89 @@ const scenario: Scenario = async (runOptions) => { generate: ({ range, clients: { logsEsClient } }) => { const { logger } = runOptions; - // Logs Data logic - const MESSAGE_LOG_LEVELS = [ - { message: 'A simple log', level: 'info' }, - { - message: 'Another log message', - level: 'debug', - }, - { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, - ]; - const CLOUD_PROVIDERS = ['gcp', 'aws', 'azure']; - const CLOUD_REGION = ['eu-central-1', 'us-east-1', 'area-51']; + const constructLogsCommonData = () => { + const index = Math.floor(Math.random() * 3); + const serviceName = getServiceName(index); + const logMessage = MESSAGE_LOG_LEVELS[index]; + const { clusterId, clusterName } = getCluster(index); + const cloudRegion = getCloudRegion(index); - const CLUSTER = [ - { clusterId: generateShortId(), clusterName: 'synth-cluster-1' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-2' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-3' }, - ]; + const commonLongEntryFields: LogDocument = { + 'trace.id': generateShortId(), + 'agent.name': 'synth-agent', + 'orchestrator.cluster.name': clusterName, + 'orchestrator.cluster.id': clusterId, + 'orchestrator.resource.id': generateShortId(), + 'cloud.provider': getCloudProvider(), + 'cloud.region': cloudRegion, + 'cloud.availability_zone': `${cloudRegion}a`, + 'cloud.project.id': generateShortId(), + 'cloud.instance.id': generateShortId(), + 'log.file.path': `/logs/${generateLongId()}/error.txt`, + }; - const SERVICE_NAMES = Array(3) - .fill(null) - .map((_, idx) => `synth-service-${idx}`); + return { + index, + serviceName, + logMessage, + cloudRegion, + commonLongEntryFields, + }; + }; const datasetSynth1Logs = (timestamp: number) => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level, message }, + commonLongEntryFields, + } = constructLogsCommonData(); + return log .create({ isLogsDb }) .dataset('synth.1') - .message(MESSAGE_LOG_LEVELS[index].message as string) - .logLevel(MESSAGE_LOG_LEVELS[index].level) - .service(SERVICE_NAMES[index]) - .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'synth-agent', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, - }) + .message(message) + .logLevel(level) + .service(serviceName) + .defaults(commonLongEntryFields) .timestamp(timestamp); }; const datasetSynth2Logs = (i: number, timestamp: number) => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level, message }, + commonLongEntryFields, + } = constructLogsCommonData(); const isMalformed = i % 60 === 0; return log .create({ isLogsDb }) .dataset('synth.2') - .message(MESSAGE_LOG_LEVELS[index].message as string) - .logLevel(isMalformed ? MORE_THAN_1024_CHARS : MESSAGE_LOG_LEVELS[index].level) // "ignore_above": 1024 in mapping - .service(SERVICE_NAMES[index]) - .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'synth-agent', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, - }) + .message(message) + .logLevel(isMalformed ? MORE_THAN_1024_CHARS : level) // "ignore_above": 1024 in mapping + .service(serviceName) + .defaults(commonLongEntryFields) .timestamp(timestamp); }; const datasetSynth3Logs = (i: number, timestamp: number) => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level, message }, + cloudRegion, + commonLongEntryFields, + } = constructLogsCommonData(); const isMalformed = i % 10 === 0; return log .create({ isLogsDb }) .dataset('synth.3') - .message(MESSAGE_LOG_LEVELS[index].message as string) - .logLevel(isMalformed ? MORE_THAN_1024_CHARS : MESSAGE_LOG_LEVELS[index].level) // "ignore_above": 1024 in mapping - .service(SERVICE_NAMES[index]) + .message(message) + .logLevel(isMalformed ? MORE_THAN_1024_CHARS : level) // "ignore_above": 1024 in mapping + .service(serviceName) .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'synth-agent', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], + ...commonLongEntryFields, 'cloud.availability_zone': isMalformed ? MORE_THAN_1024_CHARS // "ignore_above": 1024 in mapping - : `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, + : `${cloudRegion}a`, }) .timestamp(timestamp); }; diff --git a/packages/kbn-apm-synthtrace/src/scenarios/helpers/logs_mock_data.ts b/packages/kbn-apm-synthtrace/src/scenarios/helpers/logs_mock_data.ts new file mode 100644 index 0000000000000..052ccce76499f --- /dev/null +++ b/packages/kbn-apm-synthtrace/src/scenarios/helpers/logs_mock_data.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 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 { generateShortId } from '@kbn/apm-synthtrace-client'; +import { faker } from '@faker-js/faker'; +import { randomInt } from 'crypto'; +import moment from 'moment'; + +const { + internet: { ipv4, userAgent, httpMethod, httpStatusCode }, + word: { noun, verb }, +} = faker; + +// Utility function to get a random element from an array +const getAtIndexOrRandom = (values: T[], index?: number) => + values[index ?? randomInt(values.length)]; + +// Arrays for data +const LOG_LEVELS: string[] = ['FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE']; + +const JAVA_LOG_MESSAGES = [ + '[main] com.example1.core.ApplicationCore - Critical failure: NullPointerException encountered during startup', + '[main] com.example.service.UserService - User registration completed for userId: 12345', + '[main] com.example3.util.JsonParser - Parsing JSON response from external API', + '[main] com.example4.security.AuthManager - Unauthorized access attempt detected for userId: 67890', + '[main] com.example5.dao.UserDao - Database query failed: java.sql.SQLException: Timeout expired', +]; + +const IP_ADDRESSES = [ + '223.72.43.22', + '20.24.184.101', + '178.173.228.103', + '147.161.184.179', + '34.136.92.88', +]; + +const GEO_COORDINATES = [ + [116.3861, 39.9143], + [103.8554, 1.3036], + [139.7425, 35.6164], + [2.4075, 48.8323], + [-95.8517, 41.2591], +]; + +const CLOUD_PROVIDERS = ['gcp', 'aws', 'azure']; +const CLOUD_REGION = ['eu-central-1', 'us-east-1', 'area-51']; + +const CLUSTER = [ + { clusterId: generateShortId(), clusterName: 'synth-cluster-1', namespace: 'default' }, + { clusterId: generateShortId(), clusterName: 'synth-cluster-2', namespace: 'production' }, + { clusterId: generateShortId(), clusterName: 'synth-cluster-3', namespace: 'kube' }, +]; + +const SERVICE_NAMES = Array(3) + .fill(null) + .map((_, idx) => `synth-service-${idx}`); + +// Functions to get random elements +export const getCluster = (index?: number) => getAtIndexOrRandom(CLUSTER, index); +export const getIpAddress = (index?: number) => getAtIndexOrRandom(IP_ADDRESSES, index); +export const getGeoCoordinate = (index?: number) => getAtIndexOrRandom(GEO_COORDINATES, index); +export const getCloudProvider = (index?: number) => getAtIndexOrRandom(CLOUD_PROVIDERS, index); +export const getCloudRegion = (index?: number) => getAtIndexOrRandom(CLOUD_REGION, index); +export const getServiceName = (index?: number) => getAtIndexOrRandom(SERVICE_NAMES, index); +export const getJavaLog = () => + `${moment().format('YYYY-MM-DD HH:mm:ss,SSS')} ${getAtIndexOrRandom( + LOG_LEVELS + )} ${getAtIndexOrRandom(JAVA_LOG_MESSAGES)}`; + +export const getWebLog = () => { + const path = `/api/${noun()}/${verb()}`; + const bytes = randomInt(100, 4000); + + return `${ipv4()} - - [${moment().toISOString()}] "${httpMethod()} ${path} HTTP/1.1" ${httpStatusCode()} ${bytes} "-" "${userAgent()}"`; +}; diff --git a/packages/kbn-apm-synthtrace/src/scenarios/infra_hosts_with_apm_hosts.ts b/packages/kbn-apm-synthtrace/src/scenarios/infra_hosts_with_apm_hosts.ts index cbb4ad1b7cf6c..7d77f4bded599 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/infra_hosts_with_apm_hosts.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/infra_hosts_with_apm_hosts.ts @@ -6,29 +6,30 @@ * Side Public License, v 1. */ import { InfraDocument, apm, Instance, infra, ApmFields } from '@kbn/apm-synthtrace-client'; +import { random, times } from 'lodash'; import { Scenario } from '../cli/scenario'; import { withClient } from '../lib/utils/with_client'; import { getSynthtraceEnvironment } from '../lib/utils/get_synthtrace_environment'; const ENVIRONMENT = getSynthtraceEnvironment(__filename); -const scenario: Scenario = async (runOptions) => { +const scenario: Scenario = async ({ + logger, + scenarioOpts = { numInstances: 10 }, +}) => { return { generate: ({ range, clients: { infraEsClient, apmEsClient } }) => { - const { numServices = 3, numHosts = 10 } = runOptions.scenarioOpts || {}; - const { logger } = runOptions; + const { numInstances } = scenarioOpts; + const transactionName = 'GET /host/{id}'; - // Infra hosts Data logic - - const HOSTS = Array(numHosts) - .fill(0) - .map((_, idx) => infra.host(`my-host-${idx}`)); + // Only half of the hosts will have system metrics + const hostList = times(numInstances / 2).map((index) => infra.host(`host-${index}`)); const hosts = range .interval('30s') .rate(1) .generator((timestamp) => - HOSTS.flatMap((host) => [ + hostList.flatMap((host) => [ host.cpu().timestamp(timestamp), host.memory().timestamp(timestamp), host.network().timestamp(timestamp), @@ -39,28 +40,46 @@ const scenario: Scenario = async (runOptions) => { ); // APM Simple Trace + const instances = times(numInstances).map((index) => { + return apm + .service({ + name: `synth-node-${index % 3}`, + environment: ENVIRONMENT, + agentName: 'node-js', + }) + .instance(`host-${index}`); + }); - const instances = [...Array(numServices).keys()].map((index) => - apm - .service({ name: `synth-node-${index}`, environment: ENVIRONMENT, agentName: 'nodejs' }) - .instance('instance') - ); const instanceSpans = (instance: Instance) => { + const hasHighDuration = Math.random() > 0.5; + const throughput = random(1, 10); + + const traces = range.ratePerMinute(throughput).generator((timestamp) => { + const parentDuration = hasHighDuration ? random(1000, 5000) : random(100, 1000); + return instance + .transaction({ transactionName }) + .timestamp(timestamp) + .duration(parentDuration) + .success(); + }); + + const cpuPct = random(0, 1); + const memoryFree = random(0, 1000); const metricsets = range .interval('30s') .rate(1) .generator((timestamp) => instance .appMetrics({ - 'system.memory.actual.free': 800, + 'system.memory.actual.free': memoryFree, 'system.memory.total': 1000, - 'system.cpu.total.norm.pct': 0.6, + 'system.cpu.total.norm.pct': cpuPct, 'system.process.cpu.total.norm.pct': 0.7, }) .timestamp(timestamp) ); - return [metricsets]; + return [traces, metricsets]; }; return [ diff --git a/packages/kbn-apm-synthtrace/src/scenarios/logs_and_metrics.ts b/packages/kbn-apm-synthtrace/src/scenarios/logs_and_metrics.ts index 15085d087096e..42552b86b77e4 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/logs_and_metrics.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/logs_and_metrics.ts @@ -18,9 +18,17 @@ import { withClient } from '../lib/utils/with_client'; import { getSynthtraceEnvironment } from '../lib/utils/get_synthtrace_environment'; import { parseLogsScenarioOpts } from './helpers/logs_scenario_opts_parser'; import { IndexTemplateName } from '../lib/logs/custom_logsdb_index_templates'; +import { getCluster, getCloudRegion, getCloudProvider } from './helpers/logs_mock_data'; const ENVIRONMENT = getSynthtraceEnvironment(__filename); +// Logs Data logic +const MESSAGE_LOG_LEVELS = [ + { message: 'A simple log', level: 'info' }, + { message: 'Yet another debug log', level: 'debug' }, + { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, +]; + const scenario: Scenario = async (runOptions) => { const { isLogsDb } = parseLogsScenarioOpts(runOptions.scenarioOpts); @@ -32,21 +40,6 @@ const scenario: Scenario = async (runOptions) => { const { numServices = 3 } = runOptions.scenarioOpts || {}; const { logger } = runOptions; - // Logs Data logic - const MESSAGE_LOG_LEVELS = [ - { message: 'A simple log', level: 'info' }, - { message: 'Yet another debug log', level: 'debug' }, - { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, - ]; - const CLOUD_PROVIDERS = ['gcp', 'aws', 'azure']; - const CLOUD_REGION = ['eu-central-1', 'us-east-1', 'area-51']; - - const CLUSTER = [ - { clusterId: generateShortId(), clusterName: 'synth-cluster-1' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-2' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-3' }, - ]; - const SERVICE_NAMES = Array(3) .fill(null) .map((_, idx) => `synth-service-${idx}`); @@ -59,6 +52,8 @@ const scenario: Scenario = async (runOptions) => { .fill(0) .map(() => { const index = Math.floor(Math.random() * 3); + const { clusterId, clusterName } = getCluster(index); + const cloudRegion = getCloudRegion(index); return log .create({ isLogsDb }) .message(MESSAGE_LOG_LEVELS[index].message) @@ -67,12 +62,12 @@ const scenario: Scenario = async (runOptions) => { .defaults({ 'trace.id': generateShortId(), 'agent.name': 'synth-agent', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, + 'orchestrator.cluster.name': clusterName, + 'orchestrator.cluster.id': clusterId, 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, + 'cloud.provider': getCloudProvider(), + 'cloud.region': cloudRegion, + 'cloud.availability_zone': `${cloudRegion}a`, 'cloud.project.id': generateShortId(), 'cloud.instance.id': generateShortId(), 'log.file.path': `/logs/${generateLongId()}/error.txt`, diff --git a/packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts b/packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts index d496079ebd556..a7f89216d0ee4 100644 --- a/packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts +++ b/packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts @@ -6,17 +6,65 @@ * Side Public License, v 1. */ import { LogDocument, log, generateShortId, generateLongId } from '@kbn/apm-synthtrace-client'; +import moment from 'moment'; import { Scenario } from '../cli/scenario'; import { IndexTemplateName } from '../lib/logs/custom_logsdb_index_templates'; import { withClient } from '../lib/utils/with_client'; +import { + getServiceName, + getGeoCoordinate, + getIpAddress, + getCluster, + getCloudProvider, + getCloudRegion, +} from './helpers/logs_mock_data'; import { parseLogsScenarioOpts } from './helpers/logs_scenario_opts_parser'; +// Logs Data logic +const MESSAGE_LOG_LEVELS = [ + { message: 'A simple log with something random in the middle', level: 'info' }, + { message: 'Yet another debug log', level: 'debug' }, + { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, +]; + const MORE_THAN_1024_CHARS = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?'; const scenario: Scenario = async (runOptions) => { const { isLogsDb } = parseLogsScenarioOpts(runOptions.scenarioOpts); + const constructLogsCommonData = () => { + const index = Math.floor(Math.random() * 3); + const serviceName = getServiceName(index); + const logMessage = MESSAGE_LOG_LEVELS[index]; + const { clusterId, clusterName, namespace } = getCluster(index); + const cloudRegion = getCloudRegion(index); + + const commonLongEntryFields: LogDocument = { + 'trace.id': generateShortId(), + 'agent.name': 'nodejs', + 'orchestrator.cluster.name': clusterName, + 'orchestrator.cluster.id': clusterId, + 'orchestrator.namespace': namespace, + 'container.name': `${serviceName}-${generateShortId()}`, + 'orchestrator.resource.id': generateShortId(), + 'cloud.provider': getCloudProvider(), + 'cloud.region': cloudRegion, + 'cloud.availability_zone': `${cloudRegion}a`, + 'cloud.project.id': generateShortId(), + 'cloud.instance.id': generateShortId(), + 'log.file.path': `/logs/${generateLongId()}/error.txt`, + }; + + return { + index, + serviceName, + logMessage, + cloudRegion, + commonLongEntryFields, + }; + }; + return { bootstrap: async ({ logsEsClient }) => { if (isLogsDb) await logsEsClient.createIndexTemplate(IndexTemplateName.LogsDb); @@ -24,25 +72,6 @@ const scenario: Scenario = async (runOptions) => { generate: ({ range, clients: { logsEsClient } }) => { const { logger } = runOptions; - // Logs Data logic - const MESSAGE_LOG_LEVELS = [ - { message: 'A simple log with something random in the middle', level: 'info' }, - { message: 'Yet another debug log', level: 'debug' }, - { message: 'Error with certificate: "ca_trusted_fingerprint"', level: 'error' }, - ]; - const CLOUD_PROVIDERS = ['gcp', 'aws', 'azure']; - const CLOUD_REGION = ['eu-central-1', 'us-east-1', 'area-51']; - - const CLUSTER = [ - { clusterId: generateShortId(), clusterName: 'synth-cluster-1', namespace: 'default' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-2', namespace: 'production' }, - { clusterId: generateShortId(), clusterName: 'synth-cluster-3', namespace: 'kube' }, - ]; - - const SERVICE_NAMES = Array(3) - .fill(null) - .map((_, idx) => `synth-service-${idx}`); - const logs = range .interval('1m') .rate(1) @@ -50,30 +79,20 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); - const { message, level } = MESSAGE_LOG_LEVELS[index]; - const serviceName = SERVICE_NAMES[index]; + const { + serviceName, + logMessage: { level, message }, + commonLongEntryFields, + } = constructLogsCommonData(); return log .create({ isLogsDb }) .message(message.replace('', generateShortId())) .logLevel(level) .service(serviceName) - .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, - }) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) + .defaults(commonLongEntryFields) .timestamp(timestamp); }); }); @@ -85,25 +104,20 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { message }, + commonLongEntryFields, + } = constructLogsCommonData(); + return log .create({ isLogsDb }) - .service(SERVICE_NAMES[index]) + .service(serviceName) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) .defaults({ - 'trace.id': generateShortId(), - 'error.message': MESSAGE_LOG_LEVELS[index].message, - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, + ...commonLongEntryFields, + 'error.message': message, }) .timestamp(timestamp); }); @@ -116,27 +130,22 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level, message }, + commonLongEntryFields, + } = constructLogsCommonData(); + return log .create({ isLogsDb }) - .logLevel(MESSAGE_LOG_LEVELS[index].level) - .service(SERVICE_NAMES[index]) + .logLevel(level) + .service(serviceName) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) .defaults({ - 'trace.id': generateShortId(), - 'error.message': MESSAGE_LOG_LEVELS[index].message, + ...commonLongEntryFields, + 'error.message': message, 'error.exception.stacktrace': 'Error message in error.exception.stacktrace', - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, }) .timestamp(timestamp); }); @@ -149,27 +158,26 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level, message }, + commonLongEntryFields, + } = constructLogsCommonData(); + + const eventDate = moment().toDate(); + return log .create({ isLogsDb }) - .logLevel(MESSAGE_LOG_LEVELS[index].level) - .service(SERVICE_NAMES[index]) + .logLevel(level) + .service(serviceName) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) .defaults({ - 'trace.id': generateShortId(), - 'event.original': MESSAGE_LOG_LEVELS[index].message, + ...commonLongEntryFields, + 'event.original': message, 'error.log.stacktrace': 'Error message in error.log.stacktrace', - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, + 'event.start': eventDate, + 'event.end': moment(eventDate).add(1, 'm').toDate(), }) .timestamp(timestamp); }); @@ -182,25 +190,20 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { level }, + commonLongEntryFields, + } = constructLogsCommonData(); + return log .create({ isLogsDb }) - .logLevel(MESSAGE_LOG_LEVELS[index].level) - .service(SERVICE_NAMES[index]) + .logLevel(level) + .service(serviceName) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.resource.id': generateShortId(), - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], - 'cloud.availability_zone': `${CLOUD_REGION[index]}a`, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, + ...commonLongEntryFields, 'error.stack_trace': 'Error message in error.stack_trace', }) .timestamp(timestamp); @@ -214,26 +217,24 @@ const scenario: Scenario = async (runOptions) => { return Array(3) .fill(0) .map(() => { - const index = Math.floor(Math.random() * 3); + const { + serviceName, + logMessage: { message }, + cloudRegion, + commonLongEntryFields, + } = constructLogsCommonData(); + return log .create({ isLogsDb }) - .message(MESSAGE_LOG_LEVELS[index].message) + .message(message) .logLevel(MORE_THAN_1024_CHARS) - .service(SERVICE_NAMES[index]) + .setGeoLocation(getGeoCoordinate()) + .setHostIp(getIpAddress()) + .service(serviceName) .defaults({ - 'trace.id': generateShortId(), - 'agent.name': 'nodejs', - 'orchestrator.cluster.name': CLUSTER[index].clusterName, - 'orchestrator.cluster.id': CLUSTER[index].clusterId, - 'orchestrator.namespace': CLUSTER[index].namespace, - 'container.name': `${SERVICE_NAMES[index]}-${generateShortId()}`, - 'orchestrator.resource.id': generateShortId(), - 'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)], - 'cloud.region': CLOUD_REGION[index], + ...commonLongEntryFields, + 'cloud.region': cloudRegion, 'cloud.availability_zone': MORE_THAN_1024_CHARS, - 'cloud.project.id': generateShortId(), - 'cloud.instance.id': generateShortId(), - 'log.file.path': `/logs/${generateLongId()}/error.txt`, }) .timestamp(timestamp); }); diff --git a/packages/kbn-apm-synthtrace/src/scenarios/unstructured_logs.ts b/packages/kbn-apm-synthtrace/src/scenarios/unstructured_logs.ts new file mode 100644 index 0000000000000..fe9eee2ae1f32 --- /dev/null +++ b/packages/kbn-apm-synthtrace/src/scenarios/unstructured_logs.ts @@ -0,0 +1,47 @@ +/* + * 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 { LogDocument, log } from '@kbn/apm-synthtrace-client'; +import { Scenario } from '../cli/scenario'; +import { IndexTemplateName } from '../lib/logs/custom_logsdb_index_templates'; +import { withClient } from '../lib/utils/with_client'; +import { parseLogsScenarioOpts } from './helpers/logs_scenario_opts_parser'; +import { getJavaLog, getWebLog } from './helpers/logs_mock_data'; + +const scenario: Scenario = async (runOptions) => { + const { isLogsDb } = parseLogsScenarioOpts(runOptions.scenarioOpts); + return { + bootstrap: async ({ logsEsClient }) => { + if (isLogsDb) await logsEsClient.createIndexTemplate(IndexTemplateName.LogsDb); + }, + generate: ({ range, clients: { logsEsClient } }) => { + const { logger } = runOptions; + + const datasetJavaLogs = (timestamp: number) => + log.create({ isLogsDb }).dataset('java').message(getJavaLog()).timestamp(timestamp); + + const datasetWebLogs = (timestamp: number) => + log.create({ isLogsDb }).dataset('web').message(getWebLog()).timestamp(timestamp); + + const logs = range + .interval('1m') + .rate(1) + .generator((timestamp) => { + return Array(200) + .fill(0) + .flatMap((_, index) => [datasetJavaLogs(timestamp), datasetWebLogs(timestamp)]); + }); + + return withClient( + logsEsClient, + logger.perf('generating_logs', () => logs) + ); + }, + }; +}; + +export default scenario; diff --git a/packages/kbn-babel-transform/fast_async_transformer.js b/packages/kbn-babel-transform/fast_async_transformer.js index fad1a1762ba4d..a9793e9faa0d9 100644 --- a/packages/kbn-babel-transform/fast_async_transformer.js +++ b/packages/kbn-babel-transform/fast_async_transformer.js @@ -39,6 +39,8 @@ async function withFastAsyncTransform(config, block) { try { await block(transform); success = true; + } catch (e) { + console.error('Error during transformation', e); } finally { try { await pool.destroy(); diff --git a/packages/kbn-cbor/README.md b/packages/kbn-cbor/README.md new file mode 100644 index 0000000000000..3f28f45253e80 --- /dev/null +++ b/packages/kbn-cbor/README.md @@ -0,0 +1,3 @@ +# @kbn/cbor + +Simple wrapper around borc to expose CBOR encode and decode methods with reasonable performance and no native modules \ No newline at end of file diff --git a/packages/kbn-cbor/index.test.ts b/packages/kbn-cbor/index.test.ts new file mode 100644 index 0000000000000..706fd691e4731 --- /dev/null +++ b/packages/kbn-cbor/index.test.ts @@ -0,0 +1,40 @@ +/* + * 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 { encode, decode } from '.'; + +describe('KbnCbor', () => { + it('should correctly encode and decode data', () => { + const data = { hello: 'world', count: 123, isValid: true }; + + // encoding + const encoded = encode(data); + expect(encoded).toBeInstanceOf(Buffer); + expect(encoded.length).toBeGreaterThan(0); + + // decoding + const decoded = decode(encoded); + expect(decoded).toEqual(data); + }); + + it('should encode data to Buffer', () => { + const data = { foo: 'bar' }; + + const encoded = encode(data); + expect(Buffer.isBuffer(encoded)).toBe(true); + }); + + it('should decode Buffer to original data', () => { + const data = { foo: 'bar', num: 42, arr: [1, 2, 3] }; + + const encoded = encode(data); + const decoded = decode(encoded); + + expect(decoded).toEqual(data); + }); +}); diff --git a/packages/kbn-cbor/index.ts b/packages/kbn-cbor/index.ts new file mode 100644 index 0000000000000..6b55b931e7852 --- /dev/null +++ b/packages/kbn-cbor/index.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 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. + */ + +// NOTE: This can possibly be replaced with node-cbor using encode, and decodeFirstSync if we do need +// to change into something better maintained but for now we are going to stick with borc as it is +// a little faster +import { encode as encodeJS, decode as decodeJS } from 'borc'; + +export class KbnCbor { + static encode(data: unknown) { + return encodeJS(data); + } + + static decode(uint8: any) { + return decodeJS(uint8); + } +} + +export const encode = KbnCbor.encode; +export const decode = KbnCbor.decode; diff --git a/packages/kbn-cbor/jest.config.js b/packages/kbn-cbor/jest.config.js new file mode 100644 index 0000000000000..e804d351d8d9d --- /dev/null +++ b/packages/kbn-cbor/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-cbor'], +}; diff --git a/packages/kbn-cbor/kibana.jsonc b/packages/kbn-cbor/kibana.jsonc new file mode 100644 index 0000000000000..91ecbb2d27def --- /dev/null +++ b/packages/kbn-cbor/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/cbor", + "owner": "@elastic/kibana-operations" +} diff --git a/packages/kbn-cbor/package.json b/packages/kbn-cbor/package.json new file mode 100644 index 0000000000000..20d13f0f907fa --- /dev/null +++ b/packages/kbn-cbor/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/cbor", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "main": "./index.ts" +} diff --git a/packages/kbn-cbor/tsconfig.json b/packages/kbn-cbor/tsconfig.json new file mode 100644 index 0000000000000..f4b12f8b2de2b --- /dev/null +++ b/packages/kbn-cbor/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + "../../typings/borc.d.ts" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index 211777a5274a5..0447ba6a226dd 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -436,7 +436,11 @@ "updated_by", "version" ], - "favorites": [], + "favorites": [ + "favoriteIds", + "type", + "userId" + ], "file": [ "FileKind", "Meta", @@ -460,6 +464,36 @@ "token", "valid_until" ], + "fleet-agent-policies": [ + "advanced_settings", + "agent_features", + "agent_features.enabled", + "agent_features.name", + "data_output_id", + "description", + "download_source_id", + "fleet_server_host_id", + "global_data_tags", + "inactivity_timeout", + "is_default", + "is_default_fleet_server", + "is_managed", + "is_preconfigured", + "is_protected", + "keep_monitoring_alive", + "monitoring_enabled", + "monitoring_output_id", + "name", + "namespace", + "overrides", + "revision", + "schema_version", + "status", + "supports_agentless", + "unenroll_timeout", + "updated_at", + "updated_by" + ], "fleet-fleet-server-host": [ "host_urls", "is_default", @@ -469,6 +503,32 @@ "proxy_id" ], "fleet-message-signing-keys": [], + "fleet-package-policies": [ + "created_at", + "created_by", + "description", + "elasticsearch", + "enabled", + "inputs", + "is_managed", + "name", + "namespace", + "output_id", + "overrides", + "package", + "package.name", + "package.requires_root", + "package.title", + "package.version", + "policy_id", + "policy_ids", + "revision", + "secret_references", + "secret_references.id", + "updated_at", + "updated_by", + "vars" + ], "fleet-preconfiguration-deletion-record": [ "id" ], @@ -488,6 +548,7 @@ ], "fleet-space-settings": [], "fleet-uninstall-tokens": [ + "namespaces", "policy_id", "token_plain" ], @@ -651,7 +712,9 @@ "has_seen_add_data_notice", "output_secret_storage_requirements_met", "prerelease_integrations_enabled", - "secret_storage_requirements_met" + "secret_storage_requirements_met", + "use_space_awareness_migration_started_at", + "use_space_awareness_migration_status" ], "inventory-view": [], "kql-telemetry": [], diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index e6e1fef63ee85..bda2270001bd9 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -1484,7 +1484,17 @@ }, "favorites": { "dynamic": false, - "properties": {} + "properties": { + "favoriteIds": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "userId": { + "type": "keyword" + } + } }, "file": { "dynamic": false, @@ -1553,6 +1563,99 @@ } } }, + "fleet-agent-policies": { + "properties": { + "advanced_settings": { + "index": false, + "type": "flattened" + }, + "agent_features": { + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "type": "keyword" + } + } + }, + "data_output_id": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "download_source_id": { + "type": "keyword" + }, + "fleet_server_host_id": { + "type": "keyword" + }, + "global_data_tags": { + "index": false, + "type": "flattened" + }, + "inactivity_timeout": { + "type": "integer" + }, + "is_default": { + "type": "boolean" + }, + "is_default_fleet_server": { + "type": "boolean" + }, + "is_managed": { + "type": "boolean" + }, + "is_preconfigured": { + "type": "keyword" + }, + "is_protected": { + "type": "boolean" + }, + "keep_monitoring_alive": { + "type": "boolean" + }, + "monitoring_enabled": { + "index": false, + "type": "keyword" + }, + "monitoring_output_id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "namespace": { + "type": "keyword" + }, + "overrides": { + "index": false, + "type": "flattened" + }, + "revision": { + "type": "integer" + }, + "schema_version": { + "type": "version" + }, + "status": { + "type": "keyword" + }, + "supports_agentless": { + "type": "boolean" + }, + "unenroll_timeout": { + "type": "integer" + }, + "updated_at": { + "type": "date" + }, + "updated_by": { + "type": "keyword" + } + } + }, "fleet-fleet-server-host": { "properties": { "host_urls": { @@ -1581,6 +1684,87 @@ "dynamic": false, "properties": {} }, + "fleet-package-policies": { + "properties": { + "created_at": { + "type": "date" + }, + "created_by": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "elasticsearch": { + "dynamic": false, + "properties": {} + }, + "enabled": { + "type": "boolean" + }, + "inputs": { + "dynamic": false, + "properties": {} + }, + "is_managed": { + "type": "boolean" + }, + "name": { + "type": "keyword" + }, + "namespace": { + "type": "keyword" + }, + "output_id": { + "type": "keyword" + }, + "overrides": { + "index": false, + "type": "flattened" + }, + "package": { + "properties": { + "name": { + "type": "keyword" + }, + "requires_root": { + "type": "boolean" + }, + "title": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + }, + "policy_id": { + "type": "keyword" + }, + "policy_ids": { + "type": "keyword" + }, + "revision": { + "type": "integer" + }, + "secret_references": { + "properties": { + "id": { + "type": "keyword" + } + } + }, + "updated_at": { + "type": "date" + }, + "updated_by": { + "type": "keyword" + }, + "vars": { + "type": "flattened" + } + } + }, "fleet-preconfiguration-deletion-record": { "properties": { "id": { @@ -1638,6 +1822,9 @@ "fleet-uninstall-tokens": { "dynamic": false, "properties": { + "namespaces": { + "type": "keyword" + }, "policy_id": { "type": "keyword" }, @@ -2168,6 +2355,14 @@ }, "secret_storage_requirements_met": { "type": "boolean" + }, + "use_space_awareness_migration_started_at": { + "index": false, + "type": "date" + }, + "use_space_awareness_migration_status": { + "index": false, + "type": "keyword" } } }, diff --git a/packages/kbn-check-prod-native-modules-cli/README.md b/packages/kbn-check-prod-native-modules-cli/README.md new file mode 100644 index 0000000000000..4a5749a699ffa --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/README.md @@ -0,0 +1,3 @@ +# @kbn/check-prod-native-modules-cli + +Simple and straightforward CLI for searching for native modules installed as prod dependencies or as a result of any prod dependency. \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.test.ts b/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.test.ts new file mode 100644 index 0000000000000..ff795bf5a0b2d --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.test.ts @@ -0,0 +1,243 @@ +/* + * 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 { promises as fs, existsSync } from 'fs'; +import { ToolingLog } from '@kbn/tooling-log'; +import { findProductionDependencies, readYarnLock } from '@kbn/yarn-lock-validator'; +import { + checkProdNativeModules, + checkDependencies, + isNativeModule, +} from './check_prod_native_modules'; + +jest.mock('fs', () => ({ + promises: { + readdir: jest.fn(), + }, + existsSync: jest.fn(), +})); + +jest.mock('@kbn/repo-info', () => ({ + REPO_ROOT: '/mocked/repo/root', +})); + +jest.mock('@kbn/tooling-log', () => ({ + ToolingLog: jest.fn().mockImplementation(() => ({ + info: jest.fn(), + error: jest.fn(), + success: jest.fn(), + })), +})); + +jest.mock('@kbn/yarn-lock-validator', () => ({ + findProductionDependencies: jest.fn(), + readYarnLock: jest.fn(), +})); + +jest.mock( + // eslint-disable-next-line @kbn/imports/no_unresolvable_imports + '/test/node_modules/test-package/package.json', + () => ({ + name: 'test-package', + version: '1.0.0', + }), + { virtual: true } +); + +jest.mock( + // eslint-disable-next-line @kbn/imports/no_unresolvable_imports + '/test/node_modules/@scope/package/package.json', + () => ({ + name: '@scope/package', + version: '1.0.0', + }), + { virtual: true } +); + +describe('Check Prod Native Modules', () => { + let mockLog: jest.Mocked; + + beforeEach(() => { + jest.clearAllMocks(); + mockLog = new ToolingLog() as jest.Mocked; + }); + + describe('isNativeModule', () => { + it('should return true if binding.gyp is found', async () => { + (fs.readdir as jest.Mock).mockResolvedValueOnce([ + { name: 'binding.gyp', isDirectory: () => false }, + ]); + + const result = await isNativeModule('/test/path', mockLog); + expect(result).toBe(true); + }); + + it('should return true if .node file is found', async () => { + (fs.readdir as jest.Mock).mockResolvedValueOnce([ + { name: 'test.node', isDirectory: () => false }, + ]); + + const result = await isNativeModule('/test/path', mockLog); + expect(result).toBe(true); + }); + + it('should return false if no native module indicators are found', async () => { + (fs.readdir as jest.Mock).mockResolvedValueOnce([ + { name: 'regular.js', isDirectory: () => false }, + ]); + + const result = await isNativeModule('/test/path', mockLog); + expect(result).toBe(false); + }); + + it('should log an error if there is an issue reading the directory', async () => { + (fs.readdir as jest.Mock).mockRejectedValueOnce(new Error('Read error')); + + await isNativeModule('/test/path', mockLog); + expect(mockLog.error).toHaveBeenCalledWith('Error when reading /test/path: Read error'); + }); + }); + + describe('checkDependencies', () => { + it('should identify native modules in production dependencies', async () => { + const mockProductionDependencies = new Map([['test-package@1.0.0', true]]); + const mockProdNativeModulesFound: Array<{ name: string; version: string; path: string }> = []; + + (fs.readdir as jest.Mock).mockResolvedValueOnce([ + { name: 'test-package', isDirectory: () => true }, + ]); + (fs.readdir as jest.Mock) + .mockResolvedValueOnce([{ name: 'binding.gyp', isDirectory: () => false }]) + .mockResolvedValueOnce([]); + (existsSync as jest.Mock).mockReturnValue(true); + jest + // eslint-disable-next-line @typescript-eslint/no-var-requires + .spyOn(require('./check_prod_native_modules'), 'isNativeModule') + .mockResolvedValueOnce(true); + + await checkDependencies( + '/test/node_modules', + mockProductionDependencies, + mockProdNativeModulesFound, + mockLog + ); + + expect(mockProdNativeModulesFound).toEqual([ + { name: 'test-package', version: '1.0.0', path: '/test/node_modules/test-package' }, + ]); + }); + + it('should handle scoped packages', async () => { + const mockProductionDependencies = new Map([['@scope/package@1.0.0', true]]); + const mockProdNativeModulesFound: Array<{ name: string; version: string; path: string }> = []; + + (fs.readdir as jest.Mock) + .mockResolvedValueOnce([{ name: '@scope', isDirectory: () => true }]) + .mockResolvedValueOnce([{ name: 'package', isDirectory: () => true }]); + (fs.readdir as jest.Mock) + .mockResolvedValueOnce([{ name: 'binding.gyp', isDirectory: () => false }]) + .mockResolvedValueOnce([]); + (existsSync as jest.Mock).mockReturnValue(true); + (existsSync as jest.Mock).mockReturnValue(true); + jest + // eslint-disable-next-line @typescript-eslint/no-var-requires + .spyOn(require('./check_prod_native_modules'), 'isNativeModule') + .mockResolvedValueOnce(true); + + await checkDependencies( + '/test/node_modules', + mockProductionDependencies, + mockProdNativeModulesFound, + mockLog + ); + + expect(mockProdNativeModulesFound).toEqual([ + { name: '@scope/package', version: '1.0.0', path: '/test/node_modules/@scope/package' }, + ]); + }); + }); + + describe('checkProdNativeModules', () => { + it('should return false when no native modules are found', async () => { + (existsSync as jest.Mock).mockReturnValue(true); + (findProductionDependencies as jest.Mock).mockReturnValue(new Map()); + (readYarnLock as jest.Mock).mockResolvedValueOnce({}); + (fs.readdir as jest.Mock).mockResolvedValue([]); + jest + // eslint-disable-next-line @typescript-eslint/no-var-requires + .spyOn(require('./check_prod_native_modules'), 'checkDependencies') + .mockResolvedValue(undefined); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(false); + expect(mockLog.success).toHaveBeenCalledWith( + 'No production native modules installed were found' + ); + }); + + it('should return true and log errors when native modules are found', async () => { + (existsSync as jest.Mock).mockReturnValueOnce(true).mockReturnValueOnce(true); + (findProductionDependencies as jest.Mock).mockReturnValue( + new Map([['native-module@1.0.0', { name: 'native-module', version: '1.0.0' }]]) + ); + (readYarnLock as jest.Mock).mockResolvedValueOnce({}); + + // Mock loadPackageJson to return a mock package JSON object + jest + // eslint-disable-next-line @typescript-eslint/no-var-requires + .spyOn(require('./helpers'), 'loadPackageJson') + .mockImplementation((packageJsonPath: any) => { + return { + name: 'native-module', + version: '1.0.0', + }; + }); + + (fs.readdir as jest.Mock) + .mockResolvedValueOnce([{ name: 'native-module', isDirectory: () => true }]) + // .mockResolvedValueOnce([{ name: 'package.json', isDirectory: () => false }]) + .mockResolvedValueOnce([{ name: 'binding.gyp', isDirectory: () => false }]); + jest + // eslint-disable-next-line @typescript-eslint/no-var-requires + .spyOn(require('./check_prod_native_modules'), 'checkDependencies') + .mockImplementationOnce((_, __, prodNativeModulesFound: any) => { + prodNativeModulesFound.push({ + name: 'native-module', + version: '1.0.0', + path: '/path/to/native-module', + }); + }); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(true); + expect(mockLog.error).toHaveBeenNthCalledWith( + 1, + 'Production native module detected: node_modules/native-module' + ); + expect(mockLog.error).toHaveBeenNthCalledWith( + 2, + 'Production native modules were detected and logged above' + ); + }); + + it('should throw an error if root node_modules folder is not found', async () => { + (existsSync as jest.Mock).mockReturnValue(false); + (findProductionDependencies as jest.Mock).mockReturnValue(new Map()); + (readYarnLock as jest.Mock).mockResolvedValueOnce({}); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(true); + expect(mockLog.error).toHaveBeenCalledWith( + 'No root node_modules folder was found in the project. Impossible to continue' + ); + }); + }); +}); diff --git a/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.ts b/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.ts new file mode 100644 index 0000000000000..df188401abdd6 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/check_prod_native_modules.ts @@ -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 * as path from 'path'; +import { promises as fs, existsSync } from 'fs'; +import { REPO_ROOT } from '@kbn/repo-info'; +import type { ToolingLog } from '@kbn/tooling-log'; +import { findProductionDependencies, readYarnLock } from '@kbn/yarn-lock-validator'; +import { loadPackageJson } from './helpers'; + +// Checks if a given path contains a native module or not recursively +async function isNativeModule(modulePath: string, log: ToolingLog): Promise { + const stack: string[] = [modulePath]; + + while (stack.length > 0) { + const currentPath = stack.pop() as string; + + // Skip processing if the current directory is a node_modules folder + if (path.basename(currentPath) === 'node_modules') { + continue; + } + + try { + const entries = await fs.readdir(currentPath, { withFileTypes: true }); + + for (const entry of entries) { + const entryPath = path.join(currentPath, entry.name); + + if (entry.isDirectory()) { + stack.push(entryPath); + } else if (entry.name === 'binding.gyp' || entry.name.endsWith('.node')) { + return true; + } + } + } catch (err) { + log.error(`Error when reading ${currentPath}: ${err.message}`); + } + } + return false; +} + +// Searches through node_modules and for each module which is a prod dep (or a direct result of one) checks recursively for native modules +async function checkDependencies( + rootNodeModulesDir: string, + productionDependencies: Map, + prodNativeModulesFound: Array<{ name: string; version: string; path: string }>, + log: ToolingLog +) { + const stack: string[] = [rootNodeModulesDir]; + + while (stack.length > 0) { + const currentDir = stack.pop() as string; + + try { + const entries = await fs.readdir(currentDir, { withFileTypes: true }); + + for (const entry of entries) { + if (!entry.isDirectory()) continue; + + const entryPath = path.join(currentDir, entry.name); + if (entry.name.startsWith('@')) { + // Handle scoped packages (e.g., @scope/package) + stack.push(entryPath); + continue; + } + + const packageJsonPath = path.join(entryPath, 'package.json'); + if (existsSync(packageJsonPath)) { + const packageJson = loadPackageJson(packageJsonPath); + const dependencyKey = `${packageJson.name}@${packageJson.version}`; + + if (productionDependencies.has(dependencyKey)) { + const isNative = await isNativeModule(entryPath, log); + if (isNative) { + prodNativeModulesFound.push({ + name: packageJson.name, + version: packageJson.version, + path: entryPath, + }); + } + } + } + + // Adds nested node_modules to the stack to check for further dependencies + const nestedNodeModulesPath = path.join(entryPath, 'node_modules'); + if (existsSync(nestedNodeModulesPath)) { + stack.push(nestedNodeModulesPath); + } + } + } catch (err) { + throw new Error(`Error processing directory ${currentDir}: ${err.message}`); + } + } +} + +// Checks if there are native modules in the production dependencies +async function checkProdNativeModules(log: ToolingLog) { + log.info('Checking for native modules on production dependencies...'); + const rootNodeModulesDir = path.join(REPO_ROOT, 'node_modules'); + const prodNativeModulesFound: Array<{ name: string; version: string; path: string }> = []; + + try { + // Gets all production dependencies based on package.json and then searches across transient dependencies using lock file + const rawProductionDependencies = findProductionDependencies(log, await readYarnLock()); + + // Converts rawProductionDependencies into a simple Map of production dependencies + const productionDependencies: Map = new Map(); + rawProductionDependencies.forEach((depInfo, depKey) => { + productionDependencies.set(`${depInfo.name}@${depInfo.version}`, true); + }); + + // Fail if no root node_modules folder + if (!existsSync(rootNodeModulesDir)) { + throw new Error( + 'No root node_modules folder was found in the project. Impossible to continue' + ); + } + + // Goes into the node_modules folder and for each node_module which is a production dependency (or a result of one) checks recursively if there are native modules + await checkDependencies( + rootNodeModulesDir, + productionDependencies, + prodNativeModulesFound, + log + ); + + // In that case no prod native modules were found + if (!prodNativeModulesFound.length) { + log.success('No production native modules installed were found'); + return false; + } + + // Logs every detected native module at once + prodNativeModulesFound.forEach((dep) => { + log.error(`Production native module detected: ${path.relative(REPO_ROOT, dep.path)}`); + }); + + throw new Error('Production native modules were detected and logged above'); + } catch (err) { + log.error(err.message); + return true; + } +} + +export { checkProdNativeModules, checkDependencies, isNativeModule }; diff --git a/packages/kbn-check-prod-native-modules-cli/helpers.ts b/packages/kbn-check-prod-native-modules-cli/helpers.ts new file mode 100644 index 0000000000000..6efccaac6ad68 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/helpers.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 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. + */ + +// helper function to load package.json +function loadPackageJson(packageJsonPath: string) { + return require(packageJsonPath); +} + +export { loadPackageJson }; diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-a/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-a/package.json new file mode 100644 index 0000000000000..785a76c07d76f --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-a/package.json @@ -0,0 +1,4 @@ +{ + "name": "package-a", + "version": "1.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-b/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-b/package.json new file mode 100644 index 0000000000000..62a888ea46a01 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/node_modules/package-b/package.json @@ -0,0 +1,4 @@ +{ + "name": "package-b", + "version": "2.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/package.json new file mode 100644 index 0000000000000..17cf802f22889 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/package.json @@ -0,0 +1,8 @@ +{ + "name": "no-native-modules-project", + "version": "1.0.0", + "dependencies": { + "package-a": "^1.0.0", + "package-b": "^2.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/yarn.lock b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/yarn.lock new file mode 100644 index 0000000000000..e44b1d1767019 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_native_modules/yarn.lock @@ -0,0 +1,11 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +package-a@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-a/-/package-a-1.0.0.tgz" + integrity sha1-example123 + +package-b@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-b/-/package-b-2.0.0.tgz" + integrity sha1-example456 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/package.json new file mode 100644 index 0000000000000..b8478fdabc03c --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/package.json @@ -0,0 +1,8 @@ +{ + "name": "no-node-modules-project", + "version": "1.0.0", + "dependencies": { + "package-a": "^1.0.0", + "package-b": "^2.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/yarn.lock b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/yarn.lock new file mode 100644 index 0000000000000..e44b1d1767019 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/no_node_modules/yarn.lock @@ -0,0 +1,11 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +package-a@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-a/-/package-a-1.0.0.tgz" + integrity sha1-example123 + +package-b@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-b/-/package-b-2.0.0.tgz" + integrity sha1-example456 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/binding.gyp b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/binding.gyp new file mode 100644 index 0000000000000..4d850b6b74fdf --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/binding.gyp @@ -0,0 +1,8 @@ +{ + "targets": [ + { + "target_name": "native_module", + "sources": [ "" ] + } + ] +} diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/package.json new file mode 100644 index 0000000000000..2d11f7b6c542e --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/native-module/package.json @@ -0,0 +1,5 @@ +{ + "name": "native-module", + "version": "1.0.0", + "gypfile": true +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/package-b/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/package-b/package.json new file mode 100644 index 0000000000000..62a888ea46a01 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/node_modules/package-b/package.json @@ -0,0 +1,4 @@ +{ + "name": "package-b", + "version": "2.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/package.json new file mode 100644 index 0000000000000..bf04488f0b8f6 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/package.json @@ -0,0 +1,10 @@ +{ + "name": "with-native-modules-project", + "version": "1.0.0", + "devDependencies": { + "native-module": "^1.0.0" + }, + "dependencies": { + "package-b": "^2.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/yarn.lock b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/yarn.lock new file mode 100644 index 0000000000000..2dcb949a3fe54 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_dev_native_modules/yarn.lock @@ -0,0 +1,11 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +native-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/native-module/-/native-module-1.0.0.tgz" + integrity sha1-example789 + +package-b@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-b/-/package-b-2.0.0.tgz" + integrity sha1-example456 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/binding.gyp b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/binding.gyp new file mode 100644 index 0000000000000..4d850b6b74fdf --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/binding.gyp @@ -0,0 +1,8 @@ +{ + "targets": [ + { + "target_name": "native_module", + "sources": [ "" ] + } + ] +} diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/package.json new file mode 100644 index 0000000000000..2d11f7b6c542e --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module/package.json @@ -0,0 +1,5 @@ +{ + "name": "native-module", + "version": "1.0.0", + "gypfile": true +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/a.node b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/a.node new file mode 100644 index 0000000000000..573541ac9702d --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/a.node @@ -0,0 +1 @@ +0 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/package.json new file mode 100644 index 0000000000000..49afa2f226630 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/native-module2/package.json @@ -0,0 +1,4 @@ +{ + "name": "native-module2", + "version": "1.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/package-b/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/package-b/package.json new file mode 100644 index 0000000000000..62a888ea46a01 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/node_modules/package-b/package.json @@ -0,0 +1,4 @@ +{ + "name": "package-b", + "version": "2.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/package.json new file mode 100644 index 0000000000000..1f3541823693f --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/package.json @@ -0,0 +1,9 @@ +{ + "name": "with-native-modules-project", + "version": "1.0.0", + "dependencies": { + "native-module": "^1.0.0", + "native-module2": "^1.0.0", + "package-b": "^2.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/yarn.lock b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/yarn.lock new file mode 100644 index 0000000000000..96e286d5b03cf --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_native_modules/yarn.lock @@ -0,0 +1,16 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +native-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/native-module/-/native-module-1.0.0.tgz" + integrity sha1-example789 + +native-module2@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/native-module/-/native-module2-1.0.0.tgz" + integrity sha1-example789 + +package-b@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-b/-/package-b-2.0.0.tgz" + integrity sha1-example456 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/binding.gyp b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/binding.gyp new file mode 100644 index 0000000000000..4d850b6b74fdf --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/binding.gyp @@ -0,0 +1,8 @@ +{ + "targets": [ + { + "target_name": "native_module", + "sources": [ "" ] + } + ] +} diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/package.json new file mode 100644 index 0000000000000..2d11f7b6c542e --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/native-module/package.json @@ -0,0 +1,5 @@ +{ + "name": "native-module", + "version": "1.0.0", + "gypfile": true +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-a/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-a/package.json new file mode 100644 index 0000000000000..127ebe036ed37 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-a/package.json @@ -0,0 +1,7 @@ +{ + "name": "packaga-a", + "version": "1.0.0", + "dependencies": { + "native-module": "^1.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-b/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-b/package.json new file mode 100644 index 0000000000000..62a888ea46a01 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/node_modules/package-b/package.json @@ -0,0 +1,4 @@ +{ + "name": "package-b", + "version": "2.0.0" +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/package.json b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/package.json new file mode 100644 index 0000000000000..22f67d7fdce96 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/package.json @@ -0,0 +1,8 @@ +{ + "name": "with-native-modules-project", + "version": "1.0.0", + "dependencies": { + "package-a": "^1.0.0", + "package-b": "^2.0.0" + } +} \ No newline at end of file diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/yarn.lock b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/yarn.lock new file mode 100644 index 0000000000000..61adb1a8b22b3 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/with_transient_native_modules/yarn.lock @@ -0,0 +1,18 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +native-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/native-module/-/native-module-1.0.0.tgz" + integrity sha1-example789 + +package-a@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-a/-/package-a-1.0.0.tgz" + integrity sha1-example789 + dependencies: + native-module "^1.0.0" + +package-b@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-b/-/package-b-2.0.0.tgz" + integrity sha1-example456 diff --git a/packages/kbn-check-prod-native-modules-cli/integration_tests/run_check_prod_native_modules.cli.test.ts b/packages/kbn-check-prod-native-modules-cli/integration_tests/run_check_prod_native_modules.cli.test.ts new file mode 100644 index 0000000000000..1df0501a544fe --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/integration_tests/run_check_prod_native_modules.cli.test.ts @@ -0,0 +1,151 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import path from 'path'; +import fs from 'fs'; +import { ToolingLog } from '@kbn/tooling-log'; +import { checkProdNativeModules } from '../check_prod_native_modules'; + +describe('checkProdNativeModules', () => { + let mockLog: jest.Mocked; + const fixturesDir = path.join(__dirname, '__fixtures__'); + + beforeEach(() => { + mockLog = { + info: jest.fn(), + success: jest.fn(), + error: jest.fn(), + } as unknown as jest.Mocked; + + jest.clearAllMocks(); + }); + + it('should return false when no native modules are found', async () => { + // Use a fixture without native modules + const noNativeModulesDir = path.join(fixturesDir, 'no_native_modules'); + const noNativeModulesPkgJsonPath = path.join(noNativeModulesDir, 'package.json'); + jest.spyOn(process, 'cwd').mockReturnValue(noNativeModulesDir); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'REPO_ROOT', noNativeModulesDir); + + const noNativeModulesPkgJson = JSON.parse(fs.readFileSync(noNativeModulesPkgJsonPath, 'utf8')); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'kibanaPackageJson', noNativeModulesPkgJson); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(false); + expect(mockLog.success).toHaveBeenCalledWith( + 'No production native modules installed were found' + ); + }); + + it('should return true and log errors when native modules are found', async () => { + // Use a fixture with native modules + const withNativeModulesDir = path.join(fixturesDir, 'with_native_modules'); + const withNativeModulesPkgJsonPath = path.join(withNativeModulesDir, 'package.json'); + jest.spyOn(process, 'cwd').mockReturnValue(withNativeModulesDir); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'REPO_ROOT', withNativeModulesDir); + + const withNativeModulesPkgJson = JSON.parse( + fs.readFileSync(withNativeModulesPkgJsonPath, 'utf8') + ); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'kibanaPackageJson', withNativeModulesPkgJson); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(true); + expect(mockLog.error).toHaveBeenCalledWith( + expect.stringContaining('Production native module detected:') + ); + expect(mockLog.error).toHaveBeenCalledWith( + 'Production native modules were detected and logged above' + ); + }); + + it('should throw an error when root node_modules folder is not found', async () => { + // Use a fixture without node_modules + const noNodeModulesDir = path.join(fixturesDir, 'no_node_modules'); + const noNodeModulesPkgJsonPath = path.join(noNodeModulesDir, 'package.json'); + jest.spyOn(process, 'cwd').mockReturnValue(noNodeModulesDir); + + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'REPO_ROOT', noNodeModulesDir); + + const noNodeModulesPkgJson = JSON.parse(fs.readFileSync(noNodeModulesPkgJsonPath, 'utf8')); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'kibanaPackageJson', noNodeModulesPkgJson); + + expect(await checkProdNativeModules(mockLog)).toBe(true); + expect(mockLog.error).toHaveBeenCalledWith( + 'No root node_modules folder was found in the project. Impossible to continue' + ); + }); + + it('should return false when no prod native modules are found', async () => { + // Use a fixture without native modules + const withDevNativeModulesDir = path.join(fixturesDir, 'with_dev_native_modules'); + const withDevNativeModulesPkgJsonPath = path.join(withDevNativeModulesDir, 'package.json'); + jest.spyOn(process, 'cwd').mockReturnValue(withDevNativeModulesDir); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'REPO_ROOT', withDevNativeModulesDir); + + const withDevNativeModulesPkgJson = JSON.parse( + fs.readFileSync(withDevNativeModulesPkgJsonPath, 'utf8') + ); + + jest.replaceProperty( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('@kbn/repo-info'), + 'kibanaPackageJson', + withDevNativeModulesPkgJson + ); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(false); + expect(mockLog.success).toHaveBeenCalledWith( + 'No production native modules installed were found' + ); + }); + + it('should return true and log errors when prod transient native modules are found', async () => { + // Use a fixture with native modules + const withTransientNativeModulesDir = path.join(fixturesDir, 'with_transient_native_modules'); + const withTransientNativeModulesPkgJsonPath = path.join( + withTransientNativeModulesDir, + 'package.json' + ); + jest.spyOn(process, 'cwd').mockReturnValue(withTransientNativeModulesDir); + // eslint-disable-next-line @typescript-eslint/no-var-requires + jest.replaceProperty(require('@kbn/repo-info'), 'REPO_ROOT', withTransientNativeModulesDir); + + const withTransientNativeModulesPkgJson = JSON.parse( + fs.readFileSync(withTransientNativeModulesPkgJsonPath, 'utf8') + ); + + jest.replaceProperty( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('@kbn/repo-info'), + 'kibanaPackageJson', + withTransientNativeModulesPkgJson + ); + + const result = await checkProdNativeModules(mockLog); + + expect(result).toBe(true); + expect(mockLog.error).toHaveBeenCalledWith( + expect.stringContaining('Production native module detected:') + ); + expect(mockLog.error).toHaveBeenCalledWith( + 'Production native modules were detected and logged above' + ); + }); +}); diff --git a/packages/kbn-check-prod-native-modules-cli/jest.config.js b/packages/kbn-check-prod-native-modules-cli/jest.config.js new file mode 100644 index 0000000000000..3a0fc2e1c98d5 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-check-prod-native-modules-cli'], +}; diff --git a/packages/kbn-check-prod-native-modules-cli/jest.integration.config.js b/packages/kbn-check-prod-native-modules-cli/jest.integration.config.js new file mode 100644 index 0000000000000..17aa3994d5763 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/jest.integration.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_integration_node', + rootDir: '../..', + roots: ['/packages/kbn-check-prod-native-modules-cli'], +}; diff --git a/packages/kbn-check-prod-native-modules-cli/kibana.jsonc b/packages/kbn-check-prod-native-modules-cli/kibana.jsonc new file mode 100644 index 0000000000000..6daa5ddb876ff --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-server", + "id": "@kbn/check-prod-native-modules-cli", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-check-prod-native-modules-cli/package.json b/packages/kbn-check-prod-native-modules-cli/package.json new file mode 100644 index 0000000000000..68af62072eba6 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/check-prod-native-modules-cli", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "main": "./run_check_prod_native_modules_cli" +} diff --git a/packages/kbn-check-prod-native-modules-cli/run_check_prod_native_modules_cli.ts b/packages/kbn-check-prod-native-modules-cli/run_check_prod_native_modules_cli.ts new file mode 100644 index 0000000000000..7850dc09f06c8 --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/run_check_prod_native_modules_cli.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { run } from '@kbn/dev-cli-runner'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { checkProdNativeModules } from './check_prod_native_modules'; + +run( + async ({ log }) => { + const foundProdNativeModules = await checkProdNativeModules(log); + if (foundProdNativeModules) { + throw createFailError( + 'Failed: check all previous errors before continuing. Chat with the Kibana Operations Team if you do need help.' + ); + } + }, + { + usage: `node scripts/check_prod_native_modules`, + description: + 'Check if there are production dependencies that contains or installs dependencies that contain native modules and errors out on those cases', + } +); diff --git a/packages/kbn-check-prod-native-modules-cli/tsconfig.json b/packages/kbn-check-prod-native-modules-cli/tsconfig.json new file mode 100644 index 0000000000000..1ced58536098e --- /dev/null +++ b/packages/kbn-check-prod-native-modules-cli/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/repo-info", + "@kbn/tooling-log", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/yarn-lock-validator", + ] +} 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 index 290c549684f90..a9249d703d747 100644 --- 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 @@ -15,22 +15,26 @@ import { Container } from './components/container/container'; import { ColorMapping } from './config'; import { uiReducer } from './state/ui'; +export interface ColorMappingInputCategoricalData { + type: 'categories'; + /** an ORDERED array of categories rendered in the visualization */ + categories: Array; +} + +export interface ColorMappingInputContinuousData { + type: 'ranges'; + min: number; + max: number; + bins: number; +} + /** * 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; - }; + | ColorMappingInputCategoricalData + | ColorMappingInputContinuousData; /** * The props of the CategoricalColorMapping component 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 index 8867b07572308..77aec76e68a4e 100644 --- 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 @@ -74,7 +74,7 @@ export function getColorFactory( }) : []; - // find all categories that doesn't match with an assignment + // find all categories that don't match with an assignment const notAssignedCategories = data.type === 'categories' ? data.categories.filter((category) => { 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 index a157c7927747c..7bfc22691bb72 100644 --- 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 @@ -41,7 +41,7 @@ export function rangeMatch(rule: ColorMapping.RuleRange, value: number) { } // TODO: move in some data/table related package -export const SPECIAL_TOKENS_STRING_CONVERTION = new Map([ +export const SPECIAL_TOKENS_STRING_CONVERSION = new Map([ [ '__other__', i18n.translate('coloring.colorMapping.terms.otherBucketLabel', { @@ -55,3 +55,9 @@ export const SPECIAL_TOKENS_STRING_CONVERTION = new Map([ }), ], ]); + +/** + * Returns special string for sake of color mapping/syncing + */ +export const getSpecialString = (value: string) => + SPECIAL_TOKENS_STRING_CONVERSION.get(value) ?? value; 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 index 89c4375d4bc10..7e9e6869849c6 100644 --- 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 @@ -121,7 +121,7 @@ export function Assignment({ css={ !disableDelete ? css` - color: ${euiThemeVars.euiTextSubduedColor}; + color: ${euiThemeVars.euiTextColor}; transition: ${euiThemeVars.euiAnimSpeedFast} ease-in-out; transition-property: color; &:hover, 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 index bfef7a270e1a0..c10b3c0194cf7 100644 --- 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 @@ -73,6 +73,7 @@ export const Match: React.FC<{ return ( 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 index f576daa2096cc..ebce7b9749830 100644 --- 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 @@ -7,14 +7,7 @@ */ import React, { useState } from 'react'; -import { - EuiButtonEmpty, - EuiPopoverTitle, - EuiTab, - EuiTabs, - EuiTitle, - EuiHorizontalRule, -} from '@elastic/eui'; +import { EuiButtonEmpty, EuiPopoverTitle, EuiTab, EuiTabs, EuiHorizontalRule } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ColorMapping } from '../../config'; import { getPalette } from '../../palettes'; @@ -56,22 +49,14 @@ export function ColorPicker({ > setTab('palette')} isSelected={tab === 'palette'}> - - - {i18n.translate('coloring.colorMapping.colorPicker.paletteTabLabel', { - defaultMessage: 'Colors', - })} - - + {i18n.translate('coloring.colorMapping.colorPicker.paletteTabLabel', { + defaultMessage: 'Colors', + })} setTab('custom')} isSelected={tab === 'custom'}> - - - {i18n.translate('coloring.colorMapping.colorPicker.customTabLabel', { - defaultMessage: 'Custom', - })} - - + {i18n.translate('coloring.colorMapping.colorPicker.customTabLabel', { + defaultMessage: 'Custom', + })} 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 index 34ffbefeca30f..9b466810b069c 100644 --- 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 @@ -124,15 +124,14 @@ export const ColorSwatch = ({ css={css` &::after { content: ''; - width: 0; - height: 0; - border-left: 3px solid transparent; - border-right: 3px solid transparent; - border-top: 4px solid ${colorIsDark ? 'white' : 'black'}; - margin: 0; - bottom: 2px; + background-color: ${colorIsDark ? 'white' : 'black'}; + // custom arrowDown svg + mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3IiBoZWlnaHQ9IjQiIHZpZXdCb3g9IjAgMCA3IDQiPgogIDxwYXRoIGQ9Ik0uMTQ2LjE0N2EuNS41IDAgMCAxIC43MDggMEwzLjUgMi43OTQgNi4xNDYuMTQ3YS41LjUgMCAxIDEgLjcwOC43MDhsLTMgM2EuNS41IDAgMCAxLS43MDggMGwtMy0zYS41LjUgMCAwIDEgMC0uNzA4WiIvPgo8L3N2Zz4K'); + height: 4px; + width: 7px; + bottom: 6px; + right: 4px; position: absolute; - right: 2px; } `} /> diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/palette_colors.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/palette_colors.tsx index 77a8273654b89..48473fc191f25 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/palette_colors.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/palette_colors.tsx @@ -12,8 +12,9 @@ import { EuiFlexItem, EuiHorizontalRule, EuiIcon, - EuiText, + EuiTitle, EuiToolTip, + EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ColorMapping } from '../../config'; @@ -50,13 +51,14 @@ export function PaletteColors({ <> - - + +
{i18n.translate('coloring.colorMapping.colorPicker.paletteColorsLabel', { defaultMessage: 'Palette colors', })} - - +
+ + - - + +
{i18n.translate('coloring.colorMapping.colorPicker.themeAwareColorsLabel', { defaultMessage: 'Neutral colors', })} - - - - - + + + +
+ + @@ -214,7 +214,6 @@ export function AssignmentsConfig({ , @@ -228,13 +227,14 @@ export function AssignmentsConfig({ {assignments.length > 0 && } -
- {assignments.length > 0 && ( + + {assignments.length > 0 && ( +
{i18n.translate( 'coloring.colorMapping.container.clearAllAssignmentsButtonLabel', @@ -322,8 +325,8 @@ export function AssignmentsConfig({ )} - )} -
+
+ )} ); } diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/container.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/container.tsx index e3de3c0a24261..e8466e428ee88 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/container.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/container.tsx @@ -81,6 +81,7 @@ export function Container({ > >( ({ target: { value: targetValue } }) => { - setLocalValue(targetValue); + setLocalValue(+targetValue); dispatch({ type: 'updateValue', payload: { index, value: targetValue, accessor, dataBounds, palettes }, @@ -138,7 +146,7 @@ export function ColorRangeItem({ ); const onUpdateColor = useCallback( - (color) => { + (color: string) => { dispatch({ type: 'updateColor', payload: { index, color, dataBounds, palettes } }); }, [dispatch, index, dataBounds, palettes] diff --git a/packages/kbn-coloring/src/shared_components/coloring/palette_picker.tsx b/packages/kbn-coloring/src/shared_components/coloring/palette_picker.tsx index 5cb2466d48421..ca7116142bfde 100644 --- a/packages/kbn-coloring/src/shared_components/coloring/palette_picker.tsx +++ b/packages/kbn-coloring/src/shared_components/coloring/palette_picker.tsx @@ -77,9 +77,9 @@ export function PalettePicker({ }) { const palettesToShow: EuiColorPalettePickerPaletteProps[] = palettes .getAll() - .filter(({ internal, canDynamicColoring }) => - showDynamicColorOnly ? canDynamicColoring : !internal - ) + .filter(({ internal, canDynamicColoring }) => { + return showDynamicColorOnly ? canDynamicColoring && !internal : !internal; + }) .map(({ id, title, getCategoricalColors }) => { const colors = getCategoricalColors( activePalette?.params?.steps || DEFAULT_COLOR_STEPS, diff --git a/packages/kbn-config-schema/index.ts b/packages/kbn-config-schema/index.ts index e0adf545f454f..32fd90cf4713c 100644 --- a/packages/kbn-config-schema/index.ts +++ b/packages/kbn-config-schema/index.ts @@ -146,6 +146,23 @@ function recordOf( return new RecordOfType(keyType, valueType, options); } +function oneOf( + types: [ + Type, + Type, + Type, + Type, + Type, + Type, + Type, + Type, + Type, + Type, + Type, + Type + ], + options?: UnionTypeOptions +): Type; function oneOf( types: [ Type, diff --git a/packages/kbn-config/src/__fixtures__/unsplittable_3.yml b/packages/kbn-config/src/__fixtures__/unsplittable_3.yml new file mode 100644 index 0000000000000..8e206af4b0228 --- /dev/null +++ b/packages/kbn-config/src/__fixtures__/unsplittable_3.yml @@ -0,0 +1,7 @@ + +'[foo.bar]': "foobar" +list: + - id: "id1" + '[a.b]': ['foo', 'bar'] + test.this.out: ['foo', 'bar'] + diff --git a/packages/kbn-config/src/raw/read_config.test.ts b/packages/kbn-config/src/raw/read_config.test.ts index 4a3754def8ae7..b7beb85d47147 100644 --- a/packages/kbn-config/src/raw/read_config.test.ts +++ b/packages/kbn-config/src/raw/read_config.test.ts @@ -131,6 +131,33 @@ test('supports unsplittable key syntax on nested list', () => { `); }); +test('supports unsplittable key syntax on nested list with splittable subkeys', () => { + const config = getConfigFromFiles([fixtureFile('/unsplittable_3.yml')]); + + expect(config).toMatchInlineSnapshot(` + Object { + "foo.bar": "foobar", + "list": Array [ + Object { + "a.b": Array [ + "foo", + "bar", + ], + "id": "id1", + "test": Object { + "this": Object { + "out": Array [ + "foo", + "bar", + ], + }, + }, + }, + ], + } + `); +}); + test('supports var:default syntax', () => { process.env.KBN_ENV_VAR1 = 'val1'; diff --git a/packages/kbn-config/src/raw/read_config.ts b/packages/kbn-config/src/raw/read_config.ts index 1126ac1bc3f81..8836c16664e5e 100644 --- a/packages/kbn-config/src/raw/read_config.ts +++ b/packages/kbn-config/src/raw/read_config.ts @@ -59,7 +59,9 @@ function processEntryValue(value: any) { delete value[subKey]; set(value, [unsplitKey], processEntryValue(subVal)); } else { - set(value, subKey, processEntryValue(subVal)); + const subKeySplits = splitKey(subKey); + if (subKeySplits.length > 1) delete value[subKey]; + set(value, subKeySplits, processEntryValue(subVal)); } } } else if (typeof value === 'string') { diff --git a/packages/kbn-content-management-utils/kibana.jsonc b/packages/kbn-content-management-utils/kibana.jsonc index 06779896a47c4..0b0fa95451cd2 100644 --- a/packages/kbn-content-management-utils/kibana.jsonc +++ b/packages/kbn-content-management-utils/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/content-management-utils", "owner": "@elastic/kibana-data-discovery" } diff --git a/packages/kbn-dev-cli-runner/src/run.ts b/packages/kbn-dev-cli-runner/src/run.ts index d84c7b9a4edf2..8440bd9ea6b57 100644 --- a/packages/kbn-dev-cli-runner/src/run.ts +++ b/packages/kbn-dev-cli-runner/src/run.ts @@ -31,18 +31,24 @@ export interface RunOptions { description?: string; log?: { defaultLevel?: LogLevel; + context?: string; }; flags?: FlagOptions; } export async function run(fn: RunFn, options: RunOptions = {}): Promise { const flags = getFlags(process.argv.slice(2), options.flags, options.log?.defaultLevel); - const log = new ToolingLog({ - level: pickLevelFromFlags(flags, { - default: options.log?.defaultLevel, - }), - writeTo: process.stdout, - }); + const log = new ToolingLog( + { + level: pickLevelFromFlags(flags, { + default: options.log?.defaultLevel, + }), + writeTo: process.stdout, + }, + { + context: options.log?.context, + } + ); const metrics = new Metrics(log); const helpText = getHelp({ diff --git a/packages/kbn-discover-utils/index.ts b/packages/kbn-discover-utils/index.ts index 656d3e1cf0fec..d494955d8d644 100644 --- a/packages/kbn-discover-utils/index.ts +++ b/packages/kbn-discover-utils/index.ts @@ -50,6 +50,7 @@ export { getLogLevelCoalescedValueLabel, LogLevelCoalescedValue, LogLevelBadge, + getFieldValue, } from './src'; export type { LogsContextService } from './src'; diff --git a/packages/kbn-discover-utils/src/utils/get_field_value.test.ts b/packages/kbn-discover-utils/src/utils/get_field_value.test.ts new file mode 100644 index 0000000000000..fcdc151f54947 --- /dev/null +++ b/packages/kbn-discover-utils/src/utils/get_field_value.test.ts @@ -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 { DataTableRecord } from '../types'; +import { getFieldValue } from './get_field_value'; + +const dataTableRecord: DataTableRecord = { + id: '1', + raw: {}, + flattened: { + 'field1.value': 'value1', + 'field2.value': ['value2'], + }, +}; + +describe('getFieldValue', () => { + it('should return the value of field correctly', () => { + expect(getFieldValue(dataTableRecord, 'field1.value')).toBe('value1'); + }); + + it('should return the first value of field correctly if field has a value of Array type', () => { + expect(getFieldValue(dataTableRecord, 'field2.value')).toBe('value2'); + }); + + it('should return undefined when field is not available', () => { + expect(getFieldValue(dataTableRecord, 'field3.value')).toBeUndefined(); + }); +}); diff --git a/packages/kbn-discover-utils/src/utils/get_field_value.ts b/packages/kbn-discover-utils/src/utils/get_field_value.ts new file mode 100644 index 0000000000000..043b5f2458a7a --- /dev/null +++ b/packages/kbn-discover-utils/src/utils/get_field_value.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 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 { DataTableRecord } from '../types'; + +export const getFieldValue = (record: DataTableRecord, field: string) => { + const value = record.flattened[field]; + return Array.isArray(value) ? value[0] : value; +}; diff --git a/packages/kbn-discover-utils/src/utils/index.ts b/packages/kbn-discover-utils/src/utils/index.ts index fd368beda5d7c..6c719f74dfa7a 100644 --- a/packages/kbn-discover-utils/src/utils/index.ts +++ b/packages/kbn-discover-utils/src/utils/index.ts @@ -15,5 +15,6 @@ export * from './get_log_document_overview'; export * from './get_message_field_with_fallbacks'; export * from './get_should_show_field_handler'; export * from './nested_fields'; +export * from './get_field_value'; export * from './calc_field_counts'; export { isLegacyTableEnabled } from './is_legacy_table_enabled'; diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index dec15cf568e98..99c72660f0b27 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -506,6 +506,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`, queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`, queryESQL: `${ELASTICSEARCH_DOCS}esql.html`, + queryESQLExamples: `${ELASTICSEARCH_DOCS}esql-examples.html`, }, search: { sessions: `${KIBANA_DOCS}search-sessions.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index b92c59a624880..5e1f4abd92906 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -377,6 +377,7 @@ export interface DocLinks { readonly percolate: string; readonly queryDsl: string; readonly queryESQL: string; + readonly queryESQLExamples: string; }; readonly date: { readonly dateMath: string; diff --git a/packages/kbn-dom-drag-drop/index.ts b/packages/kbn-dom-drag-drop/index.ts index f188b6c6659ad..f9e4f3f4f5bb9 100644 --- a/packages/kbn-dom-drag-drop/index.ts +++ b/packages/kbn-dom-drag-drop/index.ts @@ -14,6 +14,7 @@ export { type DraggingIdentifier, type DragDropAction, type DropOverlayWrapperProps, + type DroppableProps, Draggable, Droppable, useDragDropContext, diff --git a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts index 485a10fddb038..63ff39e467aef 100644 --- a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts +++ b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts @@ -37,7 +37,7 @@ export type ScriptedPhraseFilter = Filter & { meta: PhraseFilterMeta; query: { script: { - script: estypes.InlineScript; + script: estypes.Script; }; }; }; @@ -134,7 +134,7 @@ export const getPhraseScript = (field: DataViewFieldBase, value: PhraseFilterVal params: { value: convertedValue, }, - } as estypes.InlineScript, + } as estypes.Script, }; }; diff --git a/packages/kbn-es-query/src/filters/build_filters/range_filter.ts b/packages/kbn-es-query/src/filters/build_filters/range_filter.ts index f80fce31cb8ae..46a36b5c49994 100644 --- a/packages/kbn-es-query/src/filters/build_filters/range_filter.ts +++ b/packages/kbn-es-query/src/filters/build_filters/range_filter.ts @@ -65,7 +65,7 @@ export type ScriptedRangeFilter = Filter & { meta: RangeFilterMeta; query: { script: { - script: estypes.InlineScript; + script: estypes.Script; }; }; }; @@ -189,7 +189,7 @@ export const buildRangeFilter = ( * @internal */ export const getRangeScript = (field: DataViewFieldBase, params: RangeFilterParams) => { - const knownParams: estypes.InlineScript['params'] = mapValues( + const knownParams: estypes.Script['params'] = mapValues( pickBy(params, (val, key) => key in operators), (value) => (field.type === 'number' && typeof value === 'string' ? parseFloat(value) : value) ); diff --git a/packages/kbn-es/src/cluster.ts b/packages/kbn-es/src/cluster.ts index 65e232a9bbd48..6644e6828f41b 100644 --- a/packages/kbn-es/src/cluster.ts +++ b/packages/kbn-es/src/cluster.ts @@ -18,6 +18,7 @@ import { promisify } from 'util'; import { CA_CERT_PATH, ES_NOPASSWORD_P12_PATH, extract } from '@kbn/dev-utils'; import { ToolingLog } from '@kbn/tooling-log'; import treeKill from 'tree-kill'; +import { MOCK_IDP_REALM_NAME, ensureSAMLRoleMapping } from '@kbn/mock-idp-utils'; import { downloadSnapshot, installSnapshot, installSource, installArchive } from './install'; import { ES_BIN, ES_PLUGIN_BIN, ES_KEYSTORE_BIN } from './paths'; import { @@ -312,7 +313,7 @@ export class Cluster { */ private exec(installPath: string, opts: EsClusterExecOptions) { const { - skipNativeRealmSetup = false, + skipSecuritySetup = false, reportTime = () => {}, startTime, skipReadyCheck, @@ -437,8 +438,8 @@ export class Cluster { }); } - // once the cluster is ready setup the native realm - if (!skipNativeRealmSetup) { + // once the cluster is ready setup the realm + if (!skipSecuritySetup) { const nativeRealm = new NativeRealm({ log: this.log, elasticPassword: options.password, @@ -446,8 +447,12 @@ export class Cluster { }); await nativeRealm.setPasswords(options); - } + const samlRealmConfigPrefix = `authc.realms.saml.${MOCK_IDP_REALM_NAME}.`; + if (args.some((arg) => arg.includes(samlRealmConfigPrefix))) { + await ensureSAMLRoleMapping(client); + } + } this.log.success('kbn/es setup complete'); }); diff --git a/packages/kbn-es/src/cluster_exec_options.ts b/packages/kbn-es/src/cluster_exec_options.ts index 362af62c57954..2cbefe06095e1 100644 --- a/packages/kbn-es/src/cluster_exec_options.ts +++ b/packages/kbn-es/src/cluster_exec_options.ts @@ -7,7 +7,7 @@ */ export interface EsClusterExecOptions { - skipNativeRealmSetup?: boolean; + skipSecuritySetup?: boolean; reportTime?: (...args: any[]) => void; startTime?: number; esArgs?: string[] | string; diff --git a/packages/kbn-es/src/install/install_archive.ts b/packages/kbn-es/src/install/install_archive.ts index 2bfef3ab7abef..c9f3ab3cc274c 100644 --- a/packages/kbn-es/src/install/install_archive.ts +++ b/packages/kbn-es/src/install/install_archive.ts @@ -18,7 +18,7 @@ import { ToolingLog } from '@kbn/tooling-log'; import { BASE_PATH, ES_CONFIG, ES_KEYSTORE_BIN } from '../paths'; import { Artifact } from '../artifact'; import { parseSettings, SettingsFilter } from '../settings'; -import { log as defaultLog } from '../utils/log'; +import { log as defaultLog, isFile, copyFileSync } from '../utils'; import { InstallArchiveOptions } from './types'; const isHttpUrl = (str: string) => { @@ -41,6 +41,7 @@ export async function installArchive(archive: string, options?: InstallArchiveOp log = defaultLog, esArgs = [], disableEsTmpDir = process.env.FTR_DISABLE_ES_TMPDIR?.toLowerCase() === 'true', + resources, } = options || {}; let dest = archive; @@ -84,6 +85,23 @@ export async function installArchive(archive: string, options?: InstallArchiveOp ...parseSettings(esArgs, { filter: SettingsFilter.SecureOnly }), ]); + // copy resources to ES config directory + if (resources) { + resources.forEach((resource) => { + if (!isFile(resource)) { + throw new Error( + `Invalid resource: '${resource}'.\nOnly valid files can be copied to ES config directory` + ); + } + + const filename = path.basename(resource); + const destPath = path.resolve(installPath, 'config', filename); + + copyFileSync(resource, destPath); + log.info('moved %s in config to %s', resource, destPath); + }); + } + return { installPath, disableEsTmpDir }; } diff --git a/packages/kbn-es/src/install/install_snapshot.ts b/packages/kbn-es/src/install/install_snapshot.ts index e4a7fbd678f78..49f5d26df4ad6 100644 --- a/packages/kbn-es/src/install/install_snapshot.ts +++ b/packages/kbn-es/src/install/install_snapshot.ts @@ -51,6 +51,7 @@ export async function installSnapshot({ log = defaultLog, esArgs, useCached = false, + resources, }: InstallSnapshotOptions) { const { downloadPath } = await downloadSnapshot({ license, @@ -68,5 +69,6 @@ export async function installSnapshot({ installPath, log, esArgs, + resources, }); } diff --git a/packages/kbn-es/src/install/install_source.ts b/packages/kbn-es/src/install/install_source.ts index b3fca2b2ac046..6bec4a5d764d9 100644 --- a/packages/kbn-es/src/install/install_source.ts +++ b/packages/kbn-es/src/install/install_source.ts @@ -33,6 +33,7 @@ export async function installSource({ installPath = path.resolve(basePath, 'source'), log = defaultLog, esArgs, + resources, }: InstallSourceOptions) { log.info('source path: %s', chalk.bold(sourcePath)); log.info('install path: %s', chalk.bold(installPath)); @@ -59,6 +60,7 @@ export async function installSource({ installPath, log, esArgs, + resources, }); } diff --git a/packages/kbn-es/src/install/types.ts b/packages/kbn-es/src/install/types.ts index 6217f5b93c7f6..6db62b28eae70 100644 --- a/packages/kbn-es/src/install/types.ts +++ b/packages/kbn-es/src/install/types.ts @@ -17,6 +17,7 @@ export interface InstallSourceOptions { installPath?: string; log?: ToolingLog; esArgs?: string[]; + resources?: string[]; } export interface DownloadSnapshotOptions { @@ -26,6 +27,7 @@ export interface DownloadSnapshotOptions { installPath?: string; log?: ToolingLog; useCached?: boolean; + resources?: string[]; } export interface InstallSnapshotOptions extends DownloadSnapshotOptions { @@ -42,4 +44,5 @@ export interface InstallArchiveOptions { esArgs?: string[]; /** Disable creating a temp directory, allowing ES to write to OS's /tmp directory */ disableEsTmpDir?: boolean; + resources?: string[]; } diff --git a/packages/kbn-es/src/integration_tests/cluster.test.ts b/packages/kbn-es/src/integration_tests/cluster.test.ts index 0ef9803539fdd..d63b81c9a771e 100644 --- a/packages/kbn-es/src/integration_tests/cluster.test.ts +++ b/packages/kbn-es/src/integration_tests/cluster.test.ts @@ -311,6 +311,7 @@ describe('#installArchive()', () => { esArgs: ['foo=true'], log, disableEsTmpDir: true, + resources: ['path/to/resource'], }; const cluster = new Cluster({ log }); await cluster.installArchive('bar', options); diff --git a/packages/kbn-es/src/utils/extract_config_files.ts b/packages/kbn-es/src/utils/extract_config_files.ts index 908005887dbc0..52e382a64fe8b 100644 --- a/packages/kbn-es/src/utils/extract_config_files.ts +++ b/packages/kbn-es/src/utils/extract_config_files.ts @@ -43,11 +43,11 @@ export function extractConfigFiles( return localConfig; } -function isFile(dest = '') { +export function isFile(dest = '') { return fs.existsSync(dest) && fs.statSync(dest).isFile(); } -function copyFileSync(src: string, dest: string) { +export function copyFileSync(src: string, dest: string) { const destPath = path.dirname(dest); if (!fs.existsSync(destPath)) { diff --git a/packages/kbn-es/src/utils/index.ts b/packages/kbn-es/src/utils/index.ts index 04e94d109f58f..f3457fc958b53 100644 --- a/packages/kbn-es/src/utils/index.ts +++ b/packages/kbn-es/src/utils/index.ts @@ -10,7 +10,7 @@ export { cache } from './cache'; export { log } from './log'; export { parseEsLog } from './parse_es_log'; export { findMostRecentlyChanged } from './find_most_recently_changed'; -export { extractConfigFiles } from './extract_config_files'; +export { extractConfigFiles, isFile, copyFileSync } from './extract_config_files'; // @ts-expect-error not typed yet export { NativeRealm, SYSTEM_INDICES_SUPERUSER } from './native_realm'; export { buildSnapshot } from './build_snapshot'; diff --git a/packages/kbn-es/src/utils/read_roles_from_resource.ts b/packages/kbn-es/src/utils/read_roles_from_resource.ts index c52e38308f54c..5ef7b9094b52c 100644 --- a/packages/kbn-es/src/utils/read_roles_from_resource.ts +++ b/packages/kbn-es/src/utils/read_roles_from_resource.ts @@ -7,7 +7,7 @@ */ import fs from 'fs'; import { extname } from 'path'; -import { load as loadYaml } from 'js-yaml'; +import { safeLoad as loadYaml } from 'js-yaml'; export const readRolesFromResource = (resourcePath: string) => { if (!fs.existsSync(resourcePath) || extname(resourcePath) !== '.yml') { diff --git a/packages/kbn-eslint-config/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js index 028309aa05774..de3bb8e313ccc 100644 --- a/packages/kbn-eslint-config/.eslintrc.js +++ b/packages/kbn-eslint-config/.eslintrc.js @@ -115,6 +115,12 @@ module.exports = { disallowedMessage: `import from @kbn/i18n-react instead`, exclude: [/packages[\/\\]kbn-i18n-react[\/\\]/], }, + { + from: 'zod', + to: '@kbn/zod', + disallowedMessage: `import from @kbn/zod instead`, + exclude: [/packages[\/\\]kbn-zod[\/\\]/], + }, { from: 'styled-components', to: false, @@ -308,6 +314,7 @@ module.exports = { '@kbn/eslint/no_constructor_args_in_property_initializers': 'error', '@kbn/eslint/no_this_in_property_initializers': 'error', '@kbn/eslint/no_unsafe_console': 'error', + '@kbn/eslint/no_unsafe_js_yaml': 'error', '@kbn/imports/no_unresolvable_imports': 'error', '@kbn/imports/uniform_imports': 'error', '@kbn/imports/no_unused_imports': 'error', diff --git a/packages/kbn-eslint-plugin-eslint/index.js b/packages/kbn-eslint-plugin-eslint/index.js index 3d161ec33dda1..f54879b9e697e 100644 --- a/packages/kbn-eslint-plugin-eslint/index.js +++ b/packages/kbn-eslint-plugin-eslint/index.js @@ -18,5 +18,6 @@ module.exports = { no_constructor_args_in_property_initializers: require('./rules/no_constructor_args_in_property_initializers'), no_this_in_property_initializers: require('./rules/no_this_in_property_initializers'), no_unsafe_console: require('./rules/no_unsafe_console'), + no_unsafe_js_yaml: require('./rules/no_unsafe_js_yaml'), }, }; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.js b/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.js new file mode 100644 index 0000000000000..fcbb04a79fded --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.js @@ -0,0 +1,90 @@ +/* + * 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 = { + meta: { + fixable: 'code', + schema: [], + }, + create(context) { + const sourceCode = context.getSourceCode(); + const jsYamlIdentifiers = new Set(); + const isUnsafeMethod = (node) => node.name === 'load' || node.name === 'dump'; + + return { + ImportDeclaration(node) { + if (node.source.value === 'js-yaml') { + node.specifiers.forEach((specifier) => { + jsYamlIdentifiers.add(specifier.local.name); + + if (specifier.imported && isUnsafeMethod(specifier.imported)) { + context.report({ + node: specifier, + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + fix(fixer) { + const replacement = + specifier.imported.name === 'load' + ? fixer.replaceText(specifier.imported, 'safeLoad') + : fixer.replaceText(specifier.imported, 'safeDump'); + return replacement; + }, + }); + } + }); + } + }, + CallExpression(node) { + const callee = node.callee; + + if (isUnsafeMethod(callee)) { + const scope = sourceCode.getScope(node); + const variable = scope.variables.find((v) => v.name === callee.name); + + if (variable && variable.defs.length) { + const [def] = variable.defs; + + if (def?.parent?.source?.value === 'js-yaml') { + context.report({ + node: callee, + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + fix(fixer) { + const replacement = + callee.name === 'load' + ? fixer.replaceText(callee, 'safeLoad') + : fixer.replaceText(callee, 'safeDump'); + return replacement; + }, + }); + } + } + } + + if ( + callee.type === 'MemberExpression' && + isUnsafeMethod(callee.property) && + jsYamlIdentifiers.has(callee.object.name) + ) { + context.report({ + node: callee.property, + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + fix(fixer) { + const replacement = + callee.property.name === 'load' + ? fixer.replaceText(callee.property, 'safeLoad') + : fixer.replaceText(callee.property, 'safeDump'); + return replacement; + }, + }); + } + }, + }; + }, +}; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.test.js b/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.test.js new file mode 100644 index 0000000000000..d59c8e3e47e5f --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_unsafe_js_yaml.test.js @@ -0,0 +1,104 @@ +/* + * 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. + */ + +const { RuleTester } = require('eslint'); +const rule = require('./no_unsafe_js_yaml'); + +const ruleTester = new RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + }, +}); + +ruleTester.run('no_unsafe_js_yaml', rule, { + valid: [ + "import { safeLoad } from 'js-yaml'; const data = safeLoad(yamlString);", + "import { safeDump } from 'js-yaml'; const yaml = safeDump(data);", + "import * as yaml from 'js-yaml'; const data = yaml.safeLoad(yamlString);", + "import yaml from 'js-yaml'; yaml.safeLoad('yamlString');", + ], + invalid: [ + { + code: "import { load } from 'js-yaml'; const data = load(yamlString);", + errors: [ + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + line: 1, + column: 10, + endLine: 1, + endColumn: 14, + }, + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + line: 1, + column: 46, + endLine: 1, + endColumn: 50, + }, + ], + output: "import { safeLoad } from 'js-yaml'; const data = safeLoad(yamlString);", + }, + { + code: "import { dump } from 'js-yaml'; const yaml = dump(data);", + errors: [ + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + line: 1, + column: 10, + endLine: 1, + endColumn: 14, + }, + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + line: 1, + column: 46, + endLine: 1, + endColumn: 50, + }, + ], + output: "import { safeDump } from 'js-yaml'; const yaml = safeDump(data);", + }, + { + code: "import * as yaml from 'js-yaml'; const data = yaml.load(yamlString);", + errors: [ + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + }, + ], + output: "import * as yaml from 'js-yaml'; const data = yaml.safeLoad(yamlString);", + }, + { + code: "import yaml from 'js-yaml'; yaml.load('someYAMLContent')", + errors: [ + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + }, + ], + output: "import yaml from 'js-yaml'; yaml.safeLoad('someYAMLContent')", + }, + { + code: "import yaml, { safeDump } from 'js-yaml'; safeDump(data); yaml.load('someYAMLContent');", + errors: [ + { + message: + 'Use `safeLoad` instead of `load` and `safeDump` instead of `dump` from `js-yaml`.', + }, + ], + output: + "import yaml, { safeDump } from 'js-yaml'; safeDump(data); yaml.safeLoad('someYAMLContent');", + }, + ], +}); diff --git a/packages/kbn-esql-ast/src/__tests__/ast_parser.columns.test.ts b/packages/kbn-esql-ast/src/__tests__/ast_parser.columns.test.ts new file mode 100644 index 0000000000000..0a6dbe1f772a2 --- /dev/null +++ b/packages/kbn-esql-ast/src/__tests__/ast_parser.columns.test.ts @@ -0,0 +1,92 @@ +/* + * 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 { getAstAndSyntaxErrors as parse } from '../ast_parser'; + +describe('Column Identifier Expressions', () => { + it('can parse un-quoted identifiers', () => { + const text = 'ROW a, b.c'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + args: [ + { + type: 'column', + parts: ['a'], + }, + { + type: 'column', + parts: ['b', 'c'], + }, + ], + }, + ]); + }); + + it('can parse quoted identifiers', () => { + const text = 'ROW `a`, `b`.c, `d`.`👍`.`123``123`'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + args: [ + { + type: 'column', + parts: ['a'], + }, + { + type: 'column', + parts: ['b', 'c'], + }, + { + type: 'column', + parts: ['d', '👍', '123`123'], + }, + ], + }, + ]); + }); + + it('can mix quoted and un-quoted identifiers', () => { + const text = 'ROW part1.part2.`part``3️⃣`'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + args: [ + { + type: 'column', + parts: ['part1', 'part2', 'part`3️⃣'], + }, + ], + }, + ]); + }); + + it('in KEEP command', () => { + const text = 'FROM a | KEEP a.b'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + {}, + { + type: 'command', + args: [ + { + type: 'column', + parts: ['a', 'b'], + }, + ], + }, + ]); + }); +}); diff --git a/packages/kbn-esql-ast/src/__tests__/ast_parser.literal.test.ts b/packages/kbn-esql-ast/src/__tests__/ast_parser.literal.test.ts index 1f941c49f0fbe..cc03bd3db0a9d 100644 --- a/packages/kbn-esql-ast/src/__tests__/ast_parser.literal.test.ts +++ b/packages/kbn-esql-ast/src/__tests__/ast_parser.literal.test.ts @@ -22,4 +22,28 @@ describe('literal expression', () => { value: 1, }); }); + + it('decimals vs integers', () => { + const text = 'ROW a(1.0, 1)'; + const { ast } = parse(text); + + expect(ast[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'function', + args: [ + { + type: 'literal', + literalType: 'decimal', + }, + { + type: 'literal', + literalType: 'integer', + }, + ], + }, + ], + }); + }); }); diff --git a/packages/kbn-esql-ast/src/__tests__/ast_parser.rename.test.ts b/packages/kbn-esql-ast/src/__tests__/ast_parser.rename.test.ts new file mode 100644 index 0000000000000..0ad62b59b9cb8 --- /dev/null +++ b/packages/kbn-esql-ast/src/__tests__/ast_parser.rename.test.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 { getAstAndSyntaxErrors as parse } from '../ast_parser'; + +describe('RENAME', () => { + /** + * Enable this test once RENAME commands are fixed: + * https://github.com/elastic/kibana/discussions/182393#discussioncomment-10313313 + */ + it.skip('example from documentation', () => { + const text = ` +FROM kibana_sample_data_logs +| RENAME total_visits as \`Unique Visits (Total)\`, +`; + const { ast } = parse(text); + + // eslint-disable-next-line no-console + console.log(JSON.stringify(ast, null, 2)); + }); +}); diff --git a/packages/kbn-esql-ast/src/__tests__/ast_parser.source.test.ts b/packages/kbn-esql-ast/src/__tests__/ast_parser.source.test.ts new file mode 100644 index 0000000000000..8d01e655e6fff --- /dev/null +++ b/packages/kbn-esql-ast/src/__tests__/ast_parser.source.test.ts @@ -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 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 { getAstAndSyntaxErrors as parse } from '../ast_parser'; + +describe('source nodes', () => { + it('cluster vs quoted source', () => { + const text = 'FROM cluster:index, "cluster:index"'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'cluster:index', + cluster: 'cluster', + index: 'index', + }, + { + type: 'source', + name: 'cluster:index', + cluster: '', + index: 'cluster:index', + }, + ], + }, + ]); + }); + + it('date-math syntax', () => { + const text = 'FROM '; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: '', + cluster: '', + index: '', + }, + ], + }, + ]); + }); + + describe('unquoted', () => { + it('basic', () => { + const text = 'FROM a'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a', + cluster: '', + index: 'a', + }, + ], + }, + ]); + }); + + it('with slash', () => { + const text = 'FROM a/b'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a/b', + cluster: '', + index: 'a/b', + }, + ], + }, + ]); + }); + + it('dot and star', () => { + const text = 'FROM a.b-*'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a.b-*', + cluster: '', + index: 'a.b-*', + }, + ], + }, + ]); + }); + }); + + describe('double quoted', () => { + it('basic', () => { + const text = 'FROM "a"'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a', + cluster: '', + index: 'a', + }, + ], + }, + ]); + }); + + it('allows escaped chars', () => { + const text = 'FROM "a \\" \\r \\n \\t \\\\ b"'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: expect.any(String), + cluster: '', + index: 'a " \r \n \t \\ b', + }, + ], + }, + ]); + }); + }); + + describe('triple-double quoted', () => { + it('basic', () => { + const text = 'FROM """a"""'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a', + cluster: '', + index: 'a', + }, + ], + }, + ]); + }); + + it('with double quote in the middle', () => { + const text = 'FROM """a"b"""'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a"b', + cluster: '', + index: 'a"b', + }, + ], + }, + ]); + }); + + it('allows special chars', () => { + const text = 'FROM """a:\\/b"""'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a:\\/b', + cluster: '', + index: 'a:\\/b', + }, + ], + }, + ]); + }); + + it('allows emojis', () => { + const text = 'FROM """a👍b"""'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'a👍b', + cluster: '', + index: 'a👍b', + }, + ], + }, + ]); + }); + }); + + describe('cluster string', () => { + it('basic', () => { + const text = 'FROM cluster:a'; + const { ast } = parse(text); + + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'cluster:a', + cluster: 'cluster', + index: 'a', + }, + ], + }, + ]); + }); + }); +}); diff --git a/packages/kbn-esql-ast/src/ast/constants.ts b/packages/kbn-esql-ast/src/ast/constants.ts new file mode 100644 index 0000000000000..ee78109f7fc94 --- /dev/null +++ b/packages/kbn-esql-ast/src/ast/constants.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. + */ + +/** + * The group name of a binary expression. Groups are ordered by precedence. + */ +export enum BinaryExpressionGroup { + unknown = 0, + additive = 10, + multiplicative = 20, + assignment = 30, + comparison = 40, + regex = 50, +} diff --git a/packages/kbn-esql-ast/src/ast/helpers.ts b/packages/kbn-esql-ast/src/ast/helpers.ts new file mode 100644 index 0000000000000..a7961a9ed01b9 --- /dev/null +++ b/packages/kbn-esql-ast/src/ast/helpers.ts @@ -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 { ESQLAstNode, ESQLBinaryExpression, ESQLFunction } from '../types'; +import { BinaryExpressionGroup } from './constants'; + +export const isFunctionExpression = (node: unknown): node is ESQLFunction => + !!node && typeof node === 'object' && !Array.isArray(node) && (node as any).type === 'function'; + +/** + * Returns true if the given node is a binary expression, i.e. an operator + * surrounded by two operands: + * + * ``` + * 1 + 1 + * column LIKE "foo" + * foo = "bar" + * ``` + * + * @param node Any ES|QL AST node. + */ +export const isBinaryExpression = (node: unknown): node is ESQLBinaryExpression => + isFunctionExpression(node) && node.subtype === 'binary-expression'; + +/** + * Returns the group of a binary expression: + * + * - `additive`: `+`, `-` + * - `multiplicative`: `*`, `/`, `%` + * - `assignment`: `=` + * - `comparison`: `==`, `=~`, `!=`, `<`, `<=`, `>`, `>=` + * - `regex`: `like`, `not_like`, `rlike`, `not_rlike` + * @param node Any ES|QL AST node. + * @returns Binary expression group or undefined if the node is not a binary expression. + */ +export const binaryExpressionGroup = (node: ESQLAstNode): BinaryExpressionGroup => { + if (isBinaryExpression(node)) { + switch (node.name) { + case '+': + case '-': + return BinaryExpressionGroup.additive; + case '*': + case '/': + case '%': + return BinaryExpressionGroup.multiplicative; + case '=': + return BinaryExpressionGroup.assignment; + case '==': + case '=~': + case '!=': + case '<': + case '<=': + case '>': + case '>=': + return BinaryExpressionGroup.comparison; + case 'like': + case 'not_like': + case 'rlike': + case 'not_rlike': + return BinaryExpressionGroup.regex; + } + } + return BinaryExpressionGroup.unknown; +}; diff --git a/packages/kbn-esql-ast/src/ast_helpers.ts b/packages/kbn-esql-ast/src/ast_helpers.ts index 6ebb3fb9c4490..e338d2eacd4a4 100644 --- a/packages/kbn-esql-ast/src/ast_helpers.ts +++ b/packages/kbn-esql-ast/src/ast_helpers.ts @@ -11,12 +11,15 @@ */ import { type Token, type ParserRuleContext, type TerminalNode } from 'antlr4'; -import type { - ArithmeticUnaryContext, - DecimalValueContext, - InlineCastContext, - IntegerValueContext, - QualifiedIntegerLiteralContext, +import { + IndexPatternContext, + QualifiedNameContext, + type ArithmeticUnaryContext, + type DecimalValueContext, + type InlineCastContext, + type IntegerValueContext, + type QualifiedIntegerLiteralContext, + QualifiedNamePatternContext, } from './antlr/esql_parser'; import { getPosition } from './ast_position_utils'; import { DOUBLE_TICKS_REGEX, SINGLE_BACKTICK, TICKS_REGEX } from './constants'; @@ -39,6 +42,7 @@ import type { FunctionSubtype, ESQLNumericLiteral, } from './types'; +import { parseIdentifier } from './parser/helpers'; export function nonNullable(v: T): v is NonNullable { return v != null; @@ -303,6 +307,34 @@ function sanitizeSourceString(ctx: ParserRuleContext) { return contextText; } +const unquoteIndexString = (indexString: string): string => { + const isStringQuoted = indexString[0] === '"'; + + if (!isStringQuoted) { + return indexString; + } + + // If wrapped by triple double quotes, simply remove them. + if (indexString.startsWith(`"""`) && indexString.endsWith(`"""`)) { + return indexString.slice(3, -3); + } + + // If wrapped by double quote, remove them and unescape the string. + if (indexString[indexString.length - 1] === '"') { + indexString = indexString.slice(1, -1); + indexString = indexString + .replace(/\\"/g, '"') + .replace(/\\r/g, '\r') + .replace(/\\n/g, '\n') + .replace(/\\t/g, '\t') + .replace(/\\\\/g, '\\'); + return indexString; + } + + // This should never happen, but if it does, return the original string. + return indexString; +}; + export function sanitizeIdentifierString(ctx: ParserRuleContext) { const result = getUnquotedText(ctx)?.getText() || @@ -349,8 +381,27 @@ export function createSource( type: 'index' | 'policy' = 'index' ): ESQLSource { const text = sanitizeSourceString(ctx); + + let cluster: string = ''; + let index: string = ''; + + if (ctx instanceof IndexPatternContext) { + const clusterString = ctx.clusterString(); + const indexString = ctx.indexString(); + + if (clusterString) { + cluster = clusterString.getText(); + } + if (indexString) { + index = indexString.getText(); + index = unquoteIndexString(index); + } + } + return { type: 'source', + cluster, + index, name: text, sourceType: type, text, @@ -360,10 +411,13 @@ export function createSource( } export function createColumnStar(ctx: TerminalNode): ESQLColumn { + const text = ctx.getText(); + return { type: 'column', - name: ctx.getText(), - text: ctx.getText(), + name: text, + parts: [text], + text, location: getPosition(ctx.symbol), incomplete: ctx.getText() === '', quoted: false, @@ -371,11 +425,22 @@ export function createColumnStar(ctx: TerminalNode): ESQLColumn { } export function createColumn(ctx: ParserRuleContext): ESQLColumn { + const parts: string[] = []; + if (ctx instanceof QualifiedNamePatternContext) { + parts.push( + ...ctx.identifierPattern_list().map((identifier) => parseIdentifier(identifier.getText())) + ); + } else if (ctx instanceof QualifiedNameContext) { + parts.push(...ctx.identifier_list().map((identifier) => parseIdentifier(identifier.getText()))); + } else { + parts.push(sanitizeIdentifierString(ctx)); + } const text = sanitizeIdentifierString(ctx); const hasQuotes = Boolean(getQuotedText(ctx) || isQuoted(ctx.getText())); return { type: 'column' as const, name: text, + parts, text: ctx.getText(), location: getPosition(ctx.start, ctx.stop), incomplete: Boolean(ctx.exception || text === ''), diff --git a/packages/kbn-esql-ast/src/parser/helpers.ts b/packages/kbn-esql-ast/src/parser/helpers.ts new file mode 100644 index 0000000000000..9aea72a3a2073 --- /dev/null +++ b/packages/kbn-esql-ast/src/parser/helpers.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. + */ + +export const isQuotedIdentifier = (text: string): boolean => { + const firstChar = text[0]; + const lastChar = text[text.length - 1]; + + return firstChar === '`' && lastChar === '`'; +}; + +export const parseIdentifier = (text: string): string => { + const isQuoted = isQuotedIdentifier(text); + + if (!isQuoted) { + return text; + } + + return text.slice(1, -1).replace(/``/g, '`'); +}; + +export const regexUnquotedIdentifierPattern = /^([a-z\*_\@]{1})[a-z0-9_\*]*$/i; + +export const formatIdentifier = (text: string): string => { + if (regexUnquotedIdentifierPattern.test(text)) { + return text; + } + + return `\`${text.replace(/`/g, '``')}\``; +}; + +export const formatIdentifierParts = (parts: string[]): string => + parts.map(formatIdentifier).join('.'); diff --git a/packages/kbn-esql-ast/src/pretty_print/README.md b/packages/kbn-esql-ast/src/pretty_print/README.md new file mode 100644 index 0000000000000..48066697a5a7e --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/README.md @@ -0,0 +1,23 @@ +# Pretty-printing + +*Pretty-printing* is the process of converting an ES|QL AST into a +human-readable string. This is useful for debugging or for displaying +the AST to the user. + +This module provides a number of pretty-printing options. + + +## `BasicPrettyPrinter` + +The `BasicPrettyPrinter` class provides the most basic pretty-printing—it +prints a query to a single line. Or it can print a query with each command on +a separate line, with the ability to customize the indentation before the pipe +character. + +It can also print a single command to a single line; or an expression to a +single line. + +- `BasicPrettyPrinter.print()` — prints query to a single line. +- `BasicPrettyPrinter.multiline()` — prints a query to multiple lines. +- `BasicPrettyPrinter.command()` — prints a command to a single line. +- `BasicPrettyPrinter.expression()` — prints an expression to a single line. diff --git a/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts b/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts new file mode 100644 index 0000000000000..d6509a1e1601b --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts @@ -0,0 +1,487 @@ +/* + * 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 { getAstAndSyntaxErrors } from '../../ast_parser'; +import { ESQLFunction } from '../../types'; +import { Walker } from '../../walker'; +import { BasicPrettyPrinter, BasicPrettyPrinterMultilineOptions } from '../basic_pretty_printer'; + +const reprint = (src: string) => { + const { ast } = getAstAndSyntaxErrors(src); + const text = BasicPrettyPrinter.print(ast); + + // console.log(JSON.stringify(ast, null, 2)); + + return { text }; +}; + +describe('single line query', () => { + describe('commands', () => { + describe('FROM', () => { + test('FROM command with a single source', () => { + const { text } = reprint('FROM index1'); + + expect(text).toBe('FROM index1'); + }); + + test('FROM command with multiple indices', () => { + const { text } = reprint('from index1, index2, index3'); + + expect(text).toBe('FROM index1, index2, index3'); + }); + + test('FROM command with METADATA', () => { + const { text } = reprint('FROM index1, index2 METADATA field1, field2'); + + expect(text).toBe('FROM index1, index2 METADATA field1, field2'); + }); + }); + + describe('SORT', () => { + test('order expression with no modifier', () => { + const { text } = reprint('FROM a | SORT b'); + + expect(text).toBe('FROM a | SORT b'); + }); + + /** @todo Enable once order expressions are supported. */ + test.skip('order expression with ASC modifier', () => { + const { text } = reprint('FROM a | SORT b ASC'); + + expect(text).toBe('FROM a | SORT b ASC'); + }); + + /** @todo Enable once order expressions are supported. */ + test.skip('order expression with ASC and NULLS FIRST modifier', () => { + const { text } = reprint('FROM a | SORT b ASC NULLS FIRST'); + + expect(text).toBe('FROM a | SORT b ASC NULLS FIRST'); + }); + }); + + describe('EXPLAIN', () => { + /** @todo Enable once query expressions are supported. */ + test.skip('a nested query', () => { + const { text } = reprint('EXPLAIN [ FROM 1 ]'); + + expect(text).toBe('EXPLAIN [ FROM 1 ]'); + }); + }); + + describe('SHOW', () => { + /** @todo Enable once show command args are parsed as columns. */ + test.skip('info page', () => { + const { text } = reprint('SHOW info'); + + expect(text).toBe('SHOW info'); + }); + }); + + describe('META', () => { + /** @todo Enable once show command args are parsed as columns. */ + test.skip('functions page', () => { + const { text } = reprint('META functions'); + + expect(text).toBe('META functions'); + }); + }); + + describe('STATS', () => { + test('with aggregates assignment', () => { + const { text } = reprint('FROM a | STATS var = agg(123, fn(true))'); + + expect(text).toBe('FROM a | STATS var = AGG(123, FN(TRUE))'); + }); + + test('with BY clause', () => { + const { text } = reprint('FROM a | STATS a(1), b(2) by asdf'); + + expect(text).toBe('FROM a | STATS A(1), B(2) BY asdf'); + }); + }); + }); + + describe('expressions', () => { + describe('source expressions', () => { + test('simple source expression', () => { + const { text } = reprint('from source'); + + expect(text).toBe('FROM source'); + }); + + test('sources with dots', () => { + const { text } = reprint('FROM a.b.c'); + + expect(text).toBe('FROM a.b.c'); + }); + + test('sources with slashes', () => { + const { text } = reprint('FROM a/b/c'); + + expect(text).toBe('FROM a/b/c'); + }); + + test('cluster source', () => { + const { text } = reprint('FROM cluster:index'); + + expect(text).toBe('FROM cluster:index'); + }); + + test('quoted source', () => { + const { text } = reprint('FROM "quoted"'); + + expect(text).toBe('FROM quoted'); + }); + + test('triple-quoted source', () => { + const { text } = reprint('FROM """quoted"""'); + + expect(text).toBe('FROM quoted'); + }); + }); + + describe('column expressions', () => { + test('simple columns expressions', () => { + const { text } = reprint('FROM a METADATA column1, _column2'); + + expect(text).toBe('FROM a METADATA column1, _column2'); + }); + + // Un-skip when columns are parsed correctly: https://github.com/elastic/kibana/issues/189913 + test.skip('nested fields', () => { + const { text } = reprint('FROM a | KEEP a.b'); + + expect(text).toBe('FROM a | KEEP a.b'); + }); + + // Un-skip when columns are parsed correctly: https://github.com/elastic/kibana/issues/189913 + test.skip('quoted nested fields', () => { + const { text } = reprint('FROM index | KEEP `a`.`b`, c.`d`'); + + expect(text).toBe('FROM index | KEEP a.b, c.d'); + }); + + // Un-skip when identifier names are escaped correctly. + test.skip('special character in identifier', () => { + const { text } = reprint('FROM a | KEEP `a 👉 b`, a.`✅`'); + + expect(text).toBe('FROM a | KEEP `a 👉 b`, a.`✅`'); + }); + }); + + describe('"function" expressions', () => { + describe('function call expression', () => { + test('no argument function', () => { + const { text } = reprint('ROW fn()'); + + expect(text).toBe('ROW FN()'); + }); + + test('functions with arguments', () => { + const { text } = reprint('ROW gg(1), wp(1, 2, 3)'); + + expect(text).toBe('ROW GG(1), WP(1, 2, 3)'); + }); + + test('functions with star argument', () => { + const { text } = reprint('ROW f(*)'); + + expect(text).toBe('ROW F(*)'); + }); + }); + + describe('unary expression', () => { + test('NOT expression', () => { + const { text } = reprint('ROW NOT a'); + + expect(text).toBe('ROW NOT a'); + }); + }); + + describe('postfix unary expression', () => { + test('IS NOT NULL expression', () => { + const { text } = reprint('ROW a IS NOT NULL'); + + expect(text).toBe('ROW a IS NOT NULL'); + }); + }); + + describe('binary expression', () => { + test('arithmetic expression', () => { + const { text } = reprint('ROW 1 + 2'); + + expect(text).toBe('ROW 1 + 2'); + }); + + test('assignment expression', () => { + const { text } = reprint('FROM a | STATS a != 1'); + + expect(text).toBe('FROM a | STATS a != 1'); + }); + + test('regex expression - 1', () => { + const { text } = reprint('FROM a | WHERE a NOT RLIKE "a"'); + + expect(text).toBe('FROM a | WHERE a NOT RLIKE "a"'); + }); + + test('regex expression - 2', () => { + const { text } = reprint('FROM a | WHERE a LIKE "b"'); + + expect(text).toBe('FROM a | WHERE a LIKE "b"'); + }); + + test('inserts brackets where necessary due precedence', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * 3'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * 3'); + }); + + test('inserts brackets where necessary due precedence - 2', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * (3 - 4)'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * (3 - 4)'); + }); + + test('inserts brackets where necessary due precedence - 3', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * (3 - 4) / (5 + 6 + 7)'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * (3 - 4) / (5 + 6 + 7)'); + }); + + test('inserts brackets where necessary due precedence - 4', () => { + const { text } = reprint('FROM a | WHERE (1 + (1 + 2)) * ((3 - 4) / (5 + 6 + 7))'); + + expect(text).toBe('FROM a | WHERE (1 + 1 + 2) * (3 - 4) / (5 + 6 + 7)'); + }); + + test('inserts brackets where necessary due precedence - 5', () => { + const { text } = reprint('FROM a | WHERE (1 + (1 + 2)) * (((3 - 4) / (5 + 6 + 7)) + 1)'); + + expect(text).toBe('FROM a | WHERE (1 + 1 + 2) * ((3 - 4) / (5 + 6 + 7) + 1)'); + }); + }); + }); + + describe('literals expressions', () => { + test('null', () => { + const { text } = reprint('ROW null'); + + expect(text).toBe('ROW NULL'); + }); + + test('boolean', () => { + expect(reprint('ROW true').text).toBe('ROW TRUE'); + expect(reprint('ROW false').text).toBe('ROW FALSE'); + }); + + describe('numeric literal', () => { + test('integer', () => { + const { text } = reprint('ROW 1'); + + expect(text).toBe('ROW 1'); + }); + + test('decimal', () => { + const { text } = reprint('ROW 1.2'); + + expect(text).toBe('ROW 1.2'); + }); + + test('rounded decimal', () => { + const { text } = reprint('ROW 1.0'); + + expect(text).toBe('ROW 1.0'); + }); + + test('string', () => { + const { text } = reprint('ROW "abc"'); + + expect(text).toBe('ROW "abc"'); + }); + + test('string w/ special chars', () => { + const { text } = reprint('ROW "as \\" 👍"'); + + expect(text).toBe('ROW "as \\" 👍"'); + }); + }); + + describe('params', () => { + test('unnamed', () => { + const { text } = reprint('ROW ?'); + + expect(text).toBe('ROW ?'); + }); + + test('named', () => { + const { text } = reprint('ROW ?kappa'); + + expect(text).toBe('ROW ?kappa'); + }); + + test('positional', () => { + const { text } = reprint('ROW ?42'); + + expect(text).toBe('ROW ?42'); + }); + }); + }); + + describe('list literal expressions', () => { + describe('integer list', () => { + test('one element list', () => { + expect(reprint('ROW [1]').text).toBe('ROW [1]'); + }); + + test('multiple elements', () => { + expect(reprint('ROW [1, 2]').text).toBe('ROW [1, 2]'); + expect(reprint('ROW [1, 2, -1]').text).toBe('ROW [1, 2, -1]'); + }); + }); + + describe('boolean list', () => { + test('one element list', () => { + expect(reprint('ROW [true]').text).toBe('ROW [TRUE]'); + }); + + test('multiple elements', () => { + expect(reprint('ROW [TRUE, false]').text).toBe('ROW [TRUE, FALSE]'); + expect(reprint('ROW [false, FALSE, false]').text).toBe('ROW [FALSE, FALSE, FALSE]'); + }); + }); + + describe('string list', () => { + test('one element list', () => { + expect(reprint('ROW ["a"]').text).toBe('ROW ["a"]'); + }); + + test('multiple elements', () => { + expect(reprint('ROW ["a", "b"]').text).toBe('ROW ["a", "b"]'); + expect(reprint('ROW ["foo", "42", "boden"]').text).toBe('ROW ["foo", "42", "boden"]'); + }); + }); + }); + + describe('cast expressions', () => { + test('various', () => { + expect(reprint('ROW a::string').text).toBe('ROW a::string'); + expect(reprint('ROW 123::string').text).toBe('ROW 123::string'); + expect(reprint('ROW "asdf"::number').text).toBe('ROW "asdf"::number'); + }); + + test('wraps into rackets complex cast expressions', () => { + expect(reprint('ROW (1 + 2)::string').text).toBe('ROW (1 + 2)::string'); + }); + + test('does not wrap function call', () => { + expect(reprint('ROW fn()::string').text).toBe('ROW FN()::string'); + }); + }); + + describe('time interval expression', () => { + test('days', () => { + const { text } = reprint('ROW 1 d'); + + expect(text).toBe('ROW 1d'); + }); + + test('years', () => { + const { text } = reprint('ROW 42y'); + + expect(text).toBe('ROW 42y'); + }); + }); + }); +}); + +describe('multiline query', () => { + const multiline = (src: string, opts?: BasicPrettyPrinterMultilineOptions) => { + const { ast } = getAstAndSyntaxErrors(src); + const text = BasicPrettyPrinter.multiline(ast, opts); + + // console.log(JSON.stringify(ast, null, 2)); + + return { text }; + }; + + test('can print the query on multiple lines', () => { + const { text } = multiline('FROM index1 | SORT asdf | WHERE a == 1 | LIMIT 123'); + + expect(text).toBe(`FROM index1 + | SORT asdf + | WHERE a == 1 + | LIMIT 123`); + }); + + test('can customize tabbing before pipe', () => { + const query = 'FROM index1 | SORT asdf | WHERE a == 1 | LIMIT 123'; + const text1 = multiline(query, { pipeTab: '' }).text; + const text2 = multiline(query, { pipeTab: '\t' }).text; + + expect(text1).toBe(`FROM index1 +| SORT asdf +| WHERE a == 1 +| LIMIT 123`); + + expect(text2).toBe(`FROM index1 +\t| SORT asdf +\t| WHERE a == 1 +\t| LIMIT 123`); + }); + + test('large query', () => { + const query = `FROM employees, kibana_sample_data_flights, kibana_sample_data_logs, kibana_sample_data_ecommerce +| EVAL hired = DATE_FORMAT("YYYY-MM-DD", hired, "Europe/Amsterdam") +| STATS avg_salary = AVG(salary) BY hired, languages, department, dream_salary > 100000 +| EVAL avg_salary = ROUND(avg_salary) +| SORT hired, languages +| LIMIT 100`; + const text1 = multiline(query, { pipeTab: '' }).text; + + expect(text1).toBe(query); + }); +}); + +describe('single line command', () => { + test('can print an individual command', () => { + const query = `FROM employees, kibana_sample_data_flights, kibana_sample_data_logs, kibana_sample_data_ecommerce + | EVAL hired = DATE_FORMAT("YYYY-MM-DD", hired, "Europe/Amsterdam") + | STATS avg_salary = AVG(salary) BY hired, languages, department, dream_salary > 100000 + | EVAL avg_salary = ROUND(avg_salary) + | SORT hired, languages + | LIMIT 100`; + const { ast: commands } = getAstAndSyntaxErrors(query); + const line1 = BasicPrettyPrinter.command(commands[0]); + const line2 = BasicPrettyPrinter.command(commands[1]); + const line3 = BasicPrettyPrinter.command(commands[2]); + + expect(line1).toBe( + 'FROM employees, kibana_sample_data_flights, kibana_sample_data_logs, kibana_sample_data_ecommerce' + ); + expect(line2).toBe('EVAL hired = DATE_FORMAT("YYYY-MM-DD", hired, "Europe/Amsterdam")'); + expect(line3).toBe( + 'STATS avg_salary = AVG(salary) BY hired, languages, department, dream_salary > 100000' + ); + }); +}); + +describe('single line expression', () => { + test('can print a single expression', () => { + const query = `FROM a | STATS a != 1, avg(1, 2, 3)`; + const { ast } = getAstAndSyntaxErrors(query); + const comparison = Walker.match(ast, { type: 'function', name: '!=' })! as ESQLFunction; + const func = Walker.match(ast, { type: 'function', name: 'avg' })! as ESQLFunction; + + const text1 = BasicPrettyPrinter.expression(comparison); + const text2 = BasicPrettyPrinter.expression(func); + + expect(text1).toBe('a != 1'); + expect(text2).toBe('AVG(1, 2, 3)'); + }); +}); diff --git a/packages/kbn-esql-ast/src/pretty_print/__tests__/fixtures.ts b/packages/kbn-esql-ast/src/pretty_print/__tests__/fixtures.ts new file mode 100644 index 0000000000000..f50bd546fde6c --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/__tests__/fixtures.ts @@ -0,0 +1,66 @@ +/* + * 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 const query1 = ` +from kibana_sample_data_logs +| EVAL timestamp=DATE_TRUNC(3 hour, @timestamp), status = CASE( to_integer(response.keyword) >= 200 and to_integer(response.keyword) < 400, "HTTP 2xx and 3xx", to_integer(response.keyword) >= 400 and to_integer(response.keyword) < 500, "HTTP 4xx", "HTTP 5xx") +| stats results = count(*) by \`Over time\` = BUCKET(timestamp, 50, ?t_start, ?t_end), status +`; + +export const query2 = ` +from kibana_sample_data_logs +| sort @timestamp +| eval t = now() +| eval key = case(timestamp < t - 1 hour and timestamp > t - 2 hour, "Last hour", "Other") +| stats sum = sum(bytes), count = count_distinct(clientip) by key, extension.keyword +| eval sum_last_hour = case(key == "Last hour", sum), sum_rest = case(key == "Other", sum), count_last_hour = case(key == "Last hour", count), count_rest = case(key == "Other", count) +| stats sum_last_hour = max(sum_last_hour), sum_rest = max(sum_rest), count_last_hour = max(count_last_hour), count_rest = max(count_rest) by key, extension.keyword +| eval total_bytes = to_double(coalesce(sum_last_hour, 0::long) + coalesce(sum_rest, 0::long)) +| eval total_visits = to_double(coalesce(count_last_hour, 0::long) + coalesce(count_rest, 0::long)) +| eval bytes_transform = round(total_bytes / 1000000.0, 1) +| eval bytes_transform_last_hour = round(sum_last_hour / 1000.0, 2) +| keep count_last_hour, total_visits, bytes_transform, bytes_transform_last_hour, extension.keyword +| stats count_last_hour = sum(count_last_hour), total_visits = sum(total_visits), bytes_transform = sum(bytes_transform), bytes_transform_last_hour = sum(bytes_transform_last_hour) by extension.keyword +| rename total_visits as \`Unique Visits (Total)\`, count_last_hour as \`Unique Visits (Last hour)\`, bytes_transform as \`Bytes(Total - MB)\`, bytes_transform_last_hour as \`Bytes(Last hour - KB)\`, extension.keyword as \`Type\` +`; + +export const query3 = ` +from kibana_sample_data_logs +| keep bytes, clientip, url.keyword, response.keyword +| EVAL type = CASE(to_integer(response.keyword) >= 400 and to_integer(response.keyword) < 500, "4xx", to_integer(response.keyword) >= 500, "5xx", "Other") +| stats Visits = count(), Unique = count_distinct(clientip), p95 = percentile(bytes, 95), median = median(bytes) by type, url.keyword +| eval count_4xx = case(type == "4xx", Visits), count_5xx = case(type == "5xx", Visits), count_rest = case(type == "Other", Visits) +| stats count_4xx = sum(count_4xx), count_5xx = sum(count_5xx), count_rest = sum(count_rest), Unique = sum(Unique),\`95th percentile of bytes\` = max(p95), \`Median of bytes\` = max(median) BY url.keyword +| eval count_4xx = COALESCE(count_4xx, 0::LONG), count_5xx = COALESCE(count_5xx, 0::LONG), count_rest = COALESCE(count_rest, 0::LONG) +| eval total_records = TO_DOUBLE(count_4xx + count_5xx + count_rest) +| eval percentage_4xx = count_4xx / total_records, percentage_5xx = count_5xx / total_records +| eval percentage_4xx = round(100 * percentage_4xx, 2) +| eval percentage_5xx = round(100 * percentage_5xx, 2) +| drop count_4xx, count_rest, total_records +| RENAME percentage_4xx as \`HTTP 4xx\`, percentage_5xx as \`HTTP 5xx\` +`; + +export const query4 = ` +from kibana_sample_data_logs, kibana_sample_data_flights, kibana_sample_data_ecommerce, + index1, my-data-2024-*, my-data-2025-01-*, xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx, yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy + METADATA _index, _id, _type, _score + +| sort @timestamp +| eval t = now() +| eval key = case(timestamp < t - 1 hour and timestamp > t - 2 hour, "Last hour", "Other") +| stats sum = sum(bytes), count = count_distinct(clientip) by key, extension.keyword +| eval sum_last_hour = case(key == "Last hour", sum), sum_rest = case(key == "Other", sum), count_last_hour = case(key == "Last hour", count), count_rest = case(key == "Other", count) +| stats sum_last_hour = max(sum_last_hour), sum_rest = max(sum_rest), count_last_hour = max(count_last_hour), count_rest = max(count_rest) by key, extension.keyword +| eval total_bytes = to_double(coalesce(sum_last_hour, 0::long) + coalesce(sum_rest, 0::long)) +| eval total_visits = to_double(coalesce(count_last_hour, 0::long) + coalesce(count_rest, 0::long)) +| eval bytes_transform = round(total_bytes / 1000000.0, 1) +| eval bytes_transform_last_hour = round(sum_last_hour / 1000.0, 2) +| keep count_last_hour, total_visits, bytes_transform, bytes_transform_last_hour, extension.keyword +| stats count_last_hour = sum(count_last_hour), total_visits = sum(total_visits), bytes_transform = sum(bytes_transform), bytes_transform_last_hour = sum(bytes_transform_last_hour) by extension.keyword +| rename total_visits as \`Unique Visits (Total)\`, count_last_hour as \`Unique Visits (Last hour)\`, bytes_transform as \`Bytes(Total - MB)\`, bytes_transform_last_hour as \`Bytes(Last hour - KB)\`, extension.keyword as \`Type\` +`; diff --git a/packages/kbn-esql-ast/src/pretty_print/__tests__/wrapping_pretty_printer.test.ts b/packages/kbn-esql-ast/src/pretty_print/__tests__/wrapping_pretty_printer.test.ts new file mode 100644 index 0000000000000..4cbebb5d66b67 --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/__tests__/wrapping_pretty_printer.test.ts @@ -0,0 +1,566 @@ +/* + * 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 { getAstAndSyntaxErrors } from '../../ast_parser'; +import { WrappingPrettyPrinter, WrappingPrettyPrinterOptions } from '../wrapping_pretty_printer'; + +const reprint = (src: string, opts?: WrappingPrettyPrinterOptions) => { + const { ast } = getAstAndSyntaxErrors(src); + const text = WrappingPrettyPrinter.print(ast, opts); + + // console.log(JSON.stringify(ast, null, 2)); + + return { text }; +}; + +describe('casing', () => { + test('can chose command name casing', () => { + const query = 'FROM index | WHERE a == 123'; + const text1 = reprint(query, { lowercase: true }).text; + const text2 = reprint(query, { lowercaseCommands: true }).text; + const text3 = reprint(query, { lowercaseCommands: false }).text; + + expect(text1).toBe('from index | where a == 123'); + expect(text2).toBe('from index | where a == 123'); + expect(text3).toBe('FROM index | WHERE a == 123'); + }); + + test('can chose command option name casing', () => { + const text1 = reprint('FROM a METADATA b', { lowercaseOptions: true }).text; + const text2 = reprint('FROM a METADATA b', { lowercaseOptions: false }).text; + + expect(text1).toBe('FROM a metadata b'); + expect(text2).toBe('FROM a METADATA b'); + }); + + test('can chose function name casing', () => { + const query = 'FROM index | STATS FN1(), FN2(), FN3()'; + const text1 = reprint(query, { lowercase: true }).text; + const text2 = reprint(query, { lowercaseFunctions: true }).text; + const text3 = reprint(query, { lowercaseFunctions: false }).text; + + expect(text1).toBe('from index | stats fn1(), fn2(), fn3()'); + expect(text2).toBe('FROM index | STATS fn1(), fn2(), fn3()'); + expect(text3).toBe('FROM index | STATS FN1(), FN2(), FN3()'); + }); + + test('can choose keyword casing', () => { + const query = 'FROM index | RENAME a AS b'; + const text1 = reprint(query, { lowercase: true }).text; + const text2 = reprint(query, { lowercaseKeywords: true }).text; + const text3 = reprint(query, { lowercaseKeywords: false }).text; + + expect(text1).toBe('from index | rename a as b'); + expect(text2).toBe('FROM index | RENAME a as b'); + expect(text3).toBe('FROM index | RENAME a AS b'); + }); + + test('can chose keyword casing (function nodes)', () => { + const query = 'FROM index | WHERE a LIKE "b"'; + const text1 = reprint(query, { lowercase: true }).text; + const text2 = reprint(query, { lowercaseKeywords: true }).text; + const text3 = reprint(query, { lowercaseKeywords: false }).text; + + expect(text1).toBe('from index | where a like "b"'); + expect(text2).toBe('FROM index | WHERE a like "b"'); + expect(text3).toBe('FROM index | WHERE a LIKE "b"'); + }); +}); + +describe('short query', () => { + test('can format a simple query to one line', () => { + const query = 'FROM index | WHERE a == 123'; + const text = reprint(query).text; + + expect(text).toBe('FROM index | WHERE a == 123'); + }); + + test('one line query respects indentation option', () => { + const query = 'FROM index | WHERE a == 123'; + const text = reprint(query, { indent: ' ' }).text; + + expect(text).toBe(' FROM index | WHERE a == 123'); + }); + + test('can force small query onto multiple lines', () => { + const query = 'FROM index | WHERE a == 123'; + const text = reprint(query, { multiline: true }).text; + + expect('\n' + text).toBe(` +FROM index + | WHERE a == 123`); + }); + + test('with initial indentation', () => { + const query = 'FROM index | WHERE a == 123'; + const text = reprint(query, { multiline: true, indent: '>' }).text; + + expect('\n' + text).toBe(` +>FROM index +> | WHERE a == 123`); + }); +}); + +describe('long query', () => { + describe('command arguments', () => { + test('wraps source list', () => { + const query = + 'FROM index, another_index, yet_another_index, on-more-index, last_index, very_last_index, ok_this_is_the_last_index'; + const text = reprint(query, { indent: '- ' }).text; + + expect('\n' + text).toBe(` +- FROM index, another_index, yet_another_index, on-more-index, last_index, +- very_last_index, ok_this_is_the_last_index`); + }); + + test('wraps source list, leaves one item on last line', () => { + const query = + 'FROM index, another_index, yet_another_index, on-more-index, last_index, very_last_index'; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index, another_index, yet_another_index, on-more-index, last_index, + very_last_index`); + }); + + test('for a single very long source, prints a standalone line', () => { + const query = + 'FROM index_another_index_yet_another_index_on-more-index_last_index_very_last_index'; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM + index_another_index_yet_another_index_on-more-index_last_index_very_last_index`); + }); + + test('keeps sources in a list, as long as at least two fit per line', () => { + const query = ` +FROM xxxxxxxxxx, yyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, aaaa, + bbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccc, gggggggggggggggg +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM xxxxxxxxxx, yyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, aaaa, + bbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccc, gggggggggggggggg`); + }); + + test('keeps sources in a list, even if the last item consumes more than a line', () => { + const query = ` +FROM xxxxxxxxxx, yyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, aaaa, + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM xxxxxxxxxx, yyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, aaaa, + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb`); + }); + + test('breaks sources per-line, if list layout results into alone source per line', () => { + const query = ` +FROM xxxxxxxxxx, yyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, // <------------ this one + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccc, ggggggggg +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM + xxxxxxxxxx, + yyyyyyyyyyy, + zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz, + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, + ccccccc, + ggggggggg`); + }); + + test('breaks sources per-line, whe there is one large source', () => { + const query = ` +FROM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, // <------------ this one + yyyyyyyyyyy, ccccccc, ggggggggg + `; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, + yyyyyyyyyyy, + ccccccc, + ggggggggg`); + }); + }); + + describe('command option', () => { + test('prints short query on a single line', () => { + const query = 'FROM index METADATA _id'; + const text = reprint(query).text; + + expect(text).toBe(`FROM index METADATA _id`); + }); + + test('breaks METADATA option to new line, when query reaches wrapping threshold', () => { + const query = ` +FROM index1, index2, index2, index3, index4, index5, index6 METADATA _id, _source`; + const text = reprint(query, { pipeTab: ' ' }).text; + + expect('\n' + text).toBe(` +FROM index1, index2, index2, index3, index4, index5, index6 + METADATA _id, _source`); + }); + + test('indents METADATA option differently than the LIMIT pipe', () => { + const query = ` +FROM index1, index2, index2, index3, index4, index5, index6 METADATA _id, _source | LIMIT 10`; + const text = reprint(query, { pipeTab: ' ' }).text; + + expect('\n' + text).toBe(` +FROM index1, index2, index2, index3, index4, index5, index6 + METADATA _id, _source + | LIMIT 10`); + }); + + test('indents METADATA option differently than main FROM arguments', () => { + const query = ` +FROM index1, index2, index2, index3, index4, index5, index6, index7, index8, index9, index10, index11, index12, index13, index14, index15, index16, index17 METADATA _id, _source`; + const text = reprint(query, { pipeTab: ' ' }).text; + + expect('\n' + text).toBe(` +FROM index1, index2, index2, index3, index4, index5, index6, index7, index8, + index9, index10, index11, index12, index13, index14, index15, index16, + index17 + METADATA _id, _source`); + }); + + test('indents METADATA option differently than main FROM arguments when broken per line', () => { + const query = ` +FROM index_index_index_index_index_index_index_index_index_index_index_index_1, index_index_index_index_index_index_index_index_index_index_index_index_2, index_index_index_index_index_index_index_index_index_index_index_index_3 METADATA _id, _source`; + const text = reprint(query, { pipeTab: ' ' }).text; + + expect('\n' + text).toBe(` +FROM + index_index_index_index_index_index_index_index_index_index_index_index_1, + index_index_index_index_index_index_index_index_index_index_index_index_2, + index_index_index_index_index_index_index_index_index_index_index_index_3 + METADATA _id, _source`); + }); + + test('indents METADATA option different than the source list', () => { + const query = + 'FROM index, another_index, another_index, a_very_very_long_index_a_very_very_long_index_a_very_very_long_index, another_index, another_index METADATA _id, _source'; + const text = reprint(query, { indent: '👉 ' }).text; + + expect('\n' + text).toBe(` +👉 FROM +👉 index, +👉 another_index, +👉 another_index, +👉 a_very_very_long_index_a_very_very_long_index_a_very_very_long_index, +👉 another_index, +👉 another_index +👉 METADATA _id, _source`); + }); + + test('can break multiple options', () => { + const query = + 'from a | enrich policy ON match_field_which_is_very_long WITH new_name1 = field1, new_name2 = field2'; + const text = reprint(query, { indent: '👉 ' }).text; + + expect('\n' + text).toBe(` +👉 FROM a +👉 | ENRICH policy +👉 ON match_field_which_is_very_long +👉 WITH new_name1 = field1, new_name2 = field2`); + }); + + test('can break multiple options and wrap option arguments', () => { + const query = + 'from a | enrich policy ON match_field WITH new_name1 = field1, new_name2 = field2, new_name3 = field3, new_name4 = field4, new_name5 = field5, new_name6 = field6, new_name7 = field7, new_name8 = field8, new_name9 = field9, new_name10 = field10'; + const text = reprint(query, { indent: '👉 ' }).text; + + expect('\n' + text).toBe(` +👉 FROM a +👉 | ENRICH policy +👉 ON match_field +👉 WITH new_name1 = field1, new_name2 = field2, new_name3 = field3, +👉 new_name4 = field4, new_name5 = field5, new_name6 = field6, +👉 new_name7 = field7, new_name8 = field8, new_name9 = field9, +👉 new_name10 = field10`); + }); + }); + + describe('function call arguments', () => { + test('renders a one line list, if there is enough space', () => { + const query = ` +FROM index +| STATS avg(height), sum(weight), min(age), max(age), count(*) +| LIMIT 10 +`; + const text = reprint(query, { indent: '- ' }).text; + + expect('\n' + text).toBe(` +- FROM index +- | STATS AVG(height), SUM(weight), MIN(age), MAX(age), COUNT(*) +- | LIMIT 10`); + }); + + test('wraps function list', () => { + const query = ` +FROM index +| STATS avg(height), sum(weight), min(age), max(age), count(*), super_function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) +| LIMIT 10 +`; + const text = reprint(query, { indent: '- ' }).text; + + expect('\n' + text).toBe(` +- FROM index +- | STATS AVG(height), SUM(weight), MIN(age), MAX(age), COUNT(*), +- SUPER_FUNCTION(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) +- | LIMIT 10`); + }); + + test('wraps function arguments', () => { + const query = ` +FROM index +| STATS avg(height), + super_function(some_column, another_column == "this is string", 1234567890.999991), + sum(weight) +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + AVG(height), + SUPER_FUNCTION(some_column, another_column == "this is string", + 1234567890.999991), + SUM(weight) + | LIMIT 10`); + }); + + test('break by line function arguments, when wrapping is not enough', () => { + const query = ` +FROM index +| STATS avg(height), + super_function("xxxx-xxxx-xxxxxxxxxxxx-xxxx-xxxxxxxx", "yyyy-yyyy-yyyyyyyyyyyy-yyyy-yyyyyyyyyyyy", "zzzz-zzzz-zzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz"), + sum(weight) +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + AVG(height), + SUPER_FUNCTION( + "xxxx-xxxx-xxxxxxxxxxxx-xxxx-xxxxxxxx", + "yyyy-yyyy-yyyyyyyyyyyy-yyyy-yyyyyyyyyyyy", + "zzzz-zzzz-zzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz"), + SUM(weight) + | LIMIT 10`); + }); + + test('break by line last function arguments, when wrapping is not enough', () => { + const query = ` +FROM index +| STATS avg(height), + super_function("xxxx-xxxx-xxxxxxxxxxxx-xxxx-xxxxxxxx", "yyyy-yyyy-yyyyyyyyyyyy-yyyy-yyyyyyyyyyyy", "zzzz-zzzz-zzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz"), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + AVG(height), + SUPER_FUNCTION( + "xxxx-xxxx-xxxxxxxxxxxx-xxxx-xxxxxxxx", + "yyyy-yyyy-yyyyyyyyyyyy-yyyy-yyyyyyyyyyyy", + "zzzz-zzzz-zzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz") + | LIMIT 10`); + }); + + test('break by line when wrapping would results in lines with a single item', () => { + const query = ` +FROM index +| STATS avg(height), + super_function("xxxx-xxxx-xxxxxxxxxxxxx-xxxxx-xxxxxxxx", + 1234567890 + 1234567890, + "zzzz-zzzz-zzzzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz"), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + AVG(height), + SUPER_FUNCTION( + "xxxx-xxxx-xxxxxxxxxxxxx-xxxxx-xxxxxxxx", + 1234567890 + 1234567890, + "zzzz-zzzz-zzzzzzzzzzzzzzzzz-zzzz-zzzzzzzzzzzzzz") + | LIMIT 10`); + }); + + test('break by line when wrapping would results in lines with a single item - 2', () => { + const query = ` +FROM index +| STATS avg(height), + super_function(func1(123 + 123123 - 12333.33 / FALSE), func2("abrakadabra what?"), func3(), func4()), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + AVG(height), + SUPER_FUNCTION( + FUNC1(123 + 123123 - 12333.33 / FALSE), + FUNC2("abrakadabra what?"), + FUNC3(), + FUNC4()) + | LIMIT 10`); + }); + + test('can vertically flatten adjacent binary expressions of the same precedence', () => { + const query = ` +FROM index +| STATS super_function_name(0.123123123123123 + 888811112.232323123123 + 123123123123.123123123 + 23232323.23232323123 - 123 + 999)), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + SUPER_FUNCTION_NAME( + 0.123123123123123 + + 888811112.2323232 + + 123123123123.12312 + + 23232323.232323233 - + 123 + + 999)`); + }); + }); + + describe('binary expressions', () => { + test('can break a standalone binary expression (+) to two lines', () => { + const query = ` +FROM index +| STATS super_function_name("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + SUPER_FUNCTION_NAME( + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") + | LIMIT 10`); + }); + + describe('vertical flattening', () => { + test('binary expressions of different precedence are not flattened', () => { + const query = ` +FROM index +| STATS super_function_name(0.123123123123123 + 888811112.232323123123 * 123123123123.123123123 + 23232323.23232323123 - 123 + 999)), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + SUPER_FUNCTION_NAME( + 0.123123123123123 + + 888811112.2323232 * 123123123123.12312 + + 23232323.232323233 - + 123 + + 999)`); + }); + + test('binary expressions vertical flattening child function function argument wrapping', () => { + const query = ` +FROM index +| STATS super_function_name(11111111111111.111 + 11111111111111.111 * 11111111111111.111 + another_function_goes_here("this will get wrapped", "at this word", "and one more long string") - 111 + 111)), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + SUPER_FUNCTION_NAME( + 11111111111111.111 + + 11111111111111.111 * 11111111111111.111 + + ANOTHER_FUNCTION_GOES_HERE("this will get wrapped", "at this word", + "and one more long string") - + 111 + + 111)`); + }); + + test('two binary expression lists of different precedence group', () => { + const query = ` +FROM index +| STATS super_function_name(11111111111111.111 + 3333333333333.3333 * 3333333333333.3333 * 3333333333333.3333 * 3333333333333.3333 + 11111111111111.111 + 11111111111111.111)), +| LIMIT 10 +`; + const text = reprint(query).text; + + expect('\n' + text).toBe(` +FROM index + | STATS + SUPER_FUNCTION_NAME( + 11111111111111.111 + + 3333333333333.3335 * + 3333333333333.3335 * + 3333333333333.3335 * + 3333333333333.3335 + + 11111111111111.111 + + 11111111111111.111)`); + }); + }); + }); + + describe('inline cast expression', () => { + test('wraps complex expression into brackets where necessary', () => { + const query = ` +ROW (asdf + asdf)::string, 1.2::string, "1234"::integer, (12321342134 + 2341234123432 + 23423423423 + 234234234 + 234234323423 + 3343423424234234)::integer, + function_name(123456789 + 123456789 + 123456789 + 123456789 + 123456789 + 123456789 + 123456789, "bbbbbbbbbbbbbb", "aaaaaaaaaaa")::boolean +`; + const text = reprint(query, { indent: '- ' }).text; + + expect('\n' + text).toBe(` +- ROW +- (asdf + asdf)::string, +- 1.2::string, +- "1234"::integer, +- (12321342134 + +- 2341234123432 + +- 23423423423 + +- 234234234 + +- 234234323423 + +- 3343423424234234)::integer, +- FUNCTION_NAME( +- 123456789 + +- 123456789 + +- 123456789 + +- 123456789 + +- 123456789 + +- 123456789 + +- 123456789, +- "bbbbbbbbbbbbbb", +- "aaaaaaaaaaa")::boolean`); + }); + }); +}); diff --git a/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts b/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts new file mode 100644 index 0000000000000..b6adf29a75cc9 --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.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 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 { binaryExpressionGroup } from '../ast/helpers'; +import { ESQLAstCommand } from '../types'; +import { ESQLAstExpressionNode, ESQLAstQueryNode, Visitor } from '../visitor'; +import { LeafPrinter } from './leaf_printer'; + +/** + * @todo + * + * 1. Add support for binary expression wrapping into brackets, due to operator + * precedence. + */ + +export interface BasicPrettyPrinterOptions { + /** + * Whether to break the query into multiple lines on each pipe. Defaults to + * `false`. + */ + multiline?: boolean; + + /** + * Tabbing string inserted before a pipe, when `multiline` is `true`. Defaults + * to two spaces. + */ + pipeTab?: string; + + /** + * The default lowercase setting to use for all options. Defaults to `false`. + */ + lowercase?: boolean; + + /** + * Whether to lowercase command names. Defaults to `false`. + */ + lowercaseCommands?: boolean; + + /** + * Whether to lowercase command options. Defaults to `false`. + */ + lowercaseOptions?: boolean; + + /** + * Whether to lowercase function names. Defaults to `false`. + */ + lowercaseFunctions?: boolean; + + /** + * Whether to lowercase keywords. Defaults to `false`. + */ + lowercaseKeywords?: boolean; +} + +export type BasicPrettyPrinterMultilineOptions = Omit; + +export class BasicPrettyPrinter { + /** + * @param query ES|QL query AST to print. + * @returns A single-line string representation of the query. + */ + public static readonly print = ( + query: ESQLAstQueryNode, + opts?: BasicPrettyPrinterOptions + ): string => { + const printer = new BasicPrettyPrinter(opts); + return printer.print(query); + }; + + /** + * Print a query with each command on a separate line. It is also possible to + * specify a tabbing option for the pipe character. + * + * @param query ES|QL query AST to print. + * @param opts Options for pretty-printing. + * @returns A multi-line string representation of the query. + */ + public static readonly multiline = ( + query: ESQLAstQueryNode, + opts?: BasicPrettyPrinterMultilineOptions + ): string => { + const printer = new BasicPrettyPrinter({ ...opts, multiline: true }); + return printer.print(query); + }; + + /** + * @param command ES|QL command AST node to print. + * @returns Prints a single-line string representation of the command. + */ + public static readonly command = ( + command: ESQLAstCommand, + opts?: BasicPrettyPrinterOptions + ): string => { + const printer = new BasicPrettyPrinter(opts); + return printer.printCommand(command); + }; + + /** + * @param expression ES|QL expression AST node to print. + * @returns Prints a single-line string representation of the expression. + */ + public static readonly expression = ( + expression: ESQLAstExpressionNode, + opts?: BasicPrettyPrinterOptions + ): string => { + const printer = new BasicPrettyPrinter(opts); + return printer.printExpression(expression); + }; + + protected readonly opts: Required; + + constructor(opts: BasicPrettyPrinterOptions = {}) { + this.opts = { + pipeTab: opts.pipeTab ?? ' ', + multiline: opts.multiline ?? false, + lowercase: opts.lowercase ?? false, + lowercaseCommands: opts.lowercaseCommands ?? opts.lowercase ?? false, + lowercaseOptions: opts.lowercaseOptions ?? opts.lowercase ?? false, + lowercaseFunctions: opts.lowercaseFunctions ?? opts.lowercase ?? false, + lowercaseKeywords: opts.lowercaseKeywords ?? opts.lowercase ?? false, + }; + } + + protected keyword(word: string) { + return this.opts.lowercaseKeywords ?? this.opts.lowercase + ? word.toLowerCase() + : word.toUpperCase(); + } + + protected readonly visitor = new Visitor() + .on('visitExpression', (ctx) => { + return ''; + }) + + .on('visitSourceExpression', (ctx) => LeafPrinter.source(ctx.node)) + .on('visitColumnExpression', (ctx) => LeafPrinter.column(ctx.node)) + .on('visitLiteralExpression', (ctx) => LeafPrinter.literal(ctx.node)) + .on('visitTimeIntervalLiteralExpression', (ctx) => LeafPrinter.timeInterval(ctx.node)) + + .on('visitInlineCastExpression', (ctx) => { + const value = ctx.value(); + const wrapInBrackets = + value.type !== 'literal' && + value.type !== 'column' && + !(value.type === 'function' && value.subtype === 'variadic-call'); + + let valueFormatted = ctx.visitValue(); + + if (wrapInBrackets) { + valueFormatted = `(${valueFormatted})`; + } + + return `${valueFormatted}::${ctx.node.castType}`; + }) + + .on('visitListLiteralExpression', (ctx) => { + let elements = ''; + + for (const arg of ctx.visitElements()) { + elements += (elements ? ', ' : '') + arg; + } + + return `[${elements}]`; + }) + + .on('visitFunctionCallExpression', (ctx) => { + const opts = this.opts; + const node = ctx.node; + + let operator = ctx.operator(); + + switch (node.subtype) { + case 'unary-expression': { + operator = this.keyword(operator); + + return `${operator} ${ctx.visitArgument(0, undefined)}`; + } + case 'postfix-unary-expression': { + operator = this.keyword(operator); + + return `${ctx.visitArgument(0)} ${operator}`; + } + case 'binary-expression': { + operator = this.keyword(operator); + + const group = binaryExpressionGroup(ctx.node); + const [left, right] = ctx.arguments(); + const groupLeft = binaryExpressionGroup(left); + const groupRight = binaryExpressionGroup(right); + + let leftFormatted = ctx.visitArgument(0); + let rightFormatted = ctx.visitArgument(1); + + if (groupLeft && groupLeft < group) { + leftFormatted = `(${leftFormatted})`; + } + + if (groupRight && groupRight < group) { + rightFormatted = `(${rightFormatted})`; + } + + const formatted = `${leftFormatted} ${operator} ${rightFormatted}`; + + return formatted; + } + default: { + if (opts.lowercaseFunctions) { + operator = operator.toLowerCase(); + } + + let args = ''; + + for (const arg of ctx.visitArguments()) { + args += (args ? ', ' : '') + arg; + } + + return `${operator}(${args})`; + } + } + }) + + .on('visitRenameExpression', (ctx) => { + return `${ctx.visitArgument(0)} ${this.keyword('AS')} ${ctx.visitArgument(1)}`; + }) + + .on('visitCommandOption', (ctx) => { + const opts = this.opts; + const option = opts.lowercaseOptions ? ctx.node.name : ctx.node.name.toUpperCase(); + + let args = ''; + + for (const arg of ctx.visitArguments()) { + args += (args ? ', ' : '') + arg; + } + + const argsFormatted = args ? ` ${args}` : ''; + const optionFormatted = `${option}${argsFormatted}`; + + return optionFormatted; + }) + + .on('visitCommand', (ctx) => { + const opts = this.opts; + const cmd = opts.lowercaseCommands ? ctx.node.name : ctx.node.name.toUpperCase(); + + let args = ''; + let options = ''; + + for (const source of ctx.visitArguments()) { + args += (args ? ', ' : '') + source; + } + + for (const option of ctx.visitOptions()) { + options += (options ? ' ' : '') + option; + } + + const argsFormatted = args ? ` ${args}` : ''; + const optionsFormatted = options ? ` ${options}` : ''; + const cmdFormatted = `${cmd}${argsFormatted}${optionsFormatted}`; + + return cmdFormatted; + }) + + .on('visitQuery', (ctx) => { + const opts = this.opts; + const cmdSeparator = opts.multiline ? `\n${opts.pipeTab ?? ' '}| ` : ' | '; + let text = ''; + + for (const cmd of ctx.visitCommands()) { + if (text) text += cmdSeparator; + text += cmd; + } + + return text; + }); + + public print(query: ESQLAstQueryNode) { + return this.visitor.visitQuery(query); + } + + public printCommand(command: ESQLAstCommand) { + return this.visitor.visitCommand(command); + } + + public printExpression(expression: ESQLAstExpressionNode) { + return this.visitor.visitExpression(expression); + } +} diff --git a/packages/kbn-esql-ast/src/pretty_print/leaf_printer.ts b/packages/kbn-esql-ast/src/pretty_print/leaf_printer.ts new file mode 100644 index 0000000000000..b7bd13be8e8b8 --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/leaf_printer.ts @@ -0,0 +1,93 @@ +/* + * 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 { ESQLColumn, ESQLLiteral, ESQLSource, ESQLTimeInterval } from '../types'; + +const regexUnquotedIdPattern = /^([a-z\*_\@]{1})[a-z0-9_\*]*$/i; + +/** + * Printer for leaf AST nodes. The printing output of these nodes should + * typically not depend on word wrapping settings, should always return an + * atomic short string. + */ +export const LeafPrinter = { + source: (node: ESQLSource) => node.name, + + /** + * @todo: Add support for: (1) escaped characters, (2) nested fields. + * + * See: https://github.com/elastic/kibana/issues/189913 + */ + column: (node: ESQLColumn) => { + // In the future "column" nodes will have a "parts" field that will be used + // specify the parts of the column name. + const parts: string[] = [node.text]; + + let formatted = ''; + + for (const part of parts) { + if (formatted.length > 0) { + formatted += '.'; + } + if (regexUnquotedIdPattern.test(part)) { + formatted += part; + } else { + // Escape backticks "`" with double backticks "``". + const escaped = part.replace(/`/g, '``'); + formatted += '`' + escaped + '`'; + } + } + + return formatted; + }, + + literal: (node: ESQLLiteral) => { + switch (node.literalType) { + case 'null': { + return 'NULL'; + } + case 'boolean': { + return String(node.value).toUpperCase() === 'TRUE' ? 'TRUE' : 'FALSE'; + } + case 'param': { + switch (node.paramType) { + case 'named': + case 'positional': + return '?' + node.value; + default: + return '?'; + } + } + case 'string': { + return String(node.value); + } + case 'decimal': { + const isRounded = node.value % 1 === 0; + + if (isRounded) { + return String(node.value) + '.0'; + } else { + return String(node.value); + } + } + default: { + return String(node.value); + } + } + }, + + timeInterval: (node: ESQLTimeInterval) => { + const { quantity, unit } = node; + + if (unit.length === 1) { + return `${quantity}${unit}`; + } else { + return `${quantity} ${unit}`; + } + }, +}; diff --git a/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.test.ts b/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.test.ts deleted file mode 100644 index 2112eeabe483b..0000000000000 --- a/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.test.ts +++ /dev/null @@ -1,352 +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 { getAstAndSyntaxErrors } from '../ast_parser'; -import { prettyPrintOneLine } from './pretty_print_one_line'; - -const reprint = (src: string) => { - const { ast } = getAstAndSyntaxErrors(src); - const text = prettyPrintOneLine(ast); - - // console.log(JSON.stringify(ast, null, 2)); - - return { text }; -}; - -describe('commands', () => { - describe('FROM', () => { - test('FROM command with a single source', () => { - const { text } = reprint('FROM index1'); - - expect(text).toBe('FROM index1'); - }); - - test('FROM command with multiple indices', () => { - const { text } = reprint('from index1, index2, index3'); - - expect(text).toBe('FROM index1, index2, index3'); - }); - - test('FROM command with METADATA', () => { - const { text } = reprint('FROM index1, index2 METADATA field1, field2'); - - expect(text).toBe('FROM index1, index2 METADATA field1, field2'); - }); - }); - - describe('SORT', () => { - test('order expression with no modifier', () => { - const { text } = reprint('FROM a | SORT b'); - - expect(text).toBe('FROM a | SORT b'); - }); - - /** @todo Enable once order expressions are supported. */ - test.skip('order expression with ASC modifier', () => { - const { text } = reprint('FROM a | SORT b ASC'); - - expect(text).toBe('FROM a | SORT b ASC'); - }); - - /** @todo Enable once order expressions are supported. */ - test.skip('order expression with ASC and NULLS FIRST modifier', () => { - const { text } = reprint('FROM a | SORT b ASC NULLS FIRST'); - - expect(text).toBe('FROM a | SORT b ASC NULLS FIRST'); - }); - }); - - describe('EXPLAIN', () => { - /** @todo Enable once query expressions are supported. */ - test.skip('a nested query', () => { - const { text } = reprint('EXPLAIN [ FROM 1 ]'); - - expect(text).toBe('EXPLAIN [ FROM 1 ]'); - }); - }); - - describe('SHOW', () => { - /** @todo Enable once show command args are parsed as columns. */ - test.skip('info page', () => { - const { text } = reprint('SHOW info'); - - expect(text).toBe('SHOW info'); - }); - }); - - describe('META', () => { - /** @todo Enable once show command args are parsed as columns. */ - test.skip('functions page', () => { - const { text } = reprint('META functions'); - - expect(text).toBe('META functions'); - }); - }); - - describe('STATS', () => { - test('with aggregates assignment', () => { - const { text } = reprint('FROM a | STATS var = agg(123, fn(true))'); - - expect(text).toBe('FROM a | STATS var = AGG(123, FN(TRUE))'); - }); - - test('with BY clause', () => { - const { text } = reprint('FROM a | STATS a(1), b(2) by asdf'); - - expect(text).toBe('FROM a | STATS A(1), B(2) BY asdf'); - }); - }); -}); - -describe('expressions', () => { - describe('source expressions', () => { - test('simple source expression', () => { - const { text } = reprint('from source'); - - expect(text).toBe('FROM source'); - }); - - test('sources with dots', () => { - const { text } = reprint('FROM a.b.c'); - - expect(text).toBe('FROM a.b.c'); - }); - - test('sources with slashes', () => { - const { text } = reprint('FROM a/b/c'); - - expect(text).toBe('FROM a/b/c'); - }); - - test('cluster source', () => { - const { text } = reprint('FROM cluster:index'); - - expect(text).toBe('FROM cluster:index'); - }); - - test('quoted source', () => { - const { text } = reprint('FROM "quoted"'); - - expect(text).toBe('FROM quoted'); - }); - - test('triple-quoted source', () => { - const { text } = reprint('FROM """quoted"""'); - - expect(text).toBe('FROM quoted'); - }); - }); - - describe('column expressions', () => { - test('simple columns expressions', () => { - const { text } = reprint('FROM a METADATA column1, _column2'); - - expect(text).toBe('FROM a METADATA column1, _column2'); - }); - - test('nested fields', () => { - const { text } = reprint('FROM a | KEEP a.b'); - - expect(text).toBe('FROM a | KEEP a.b'); - }); - - // Un-skip when "IdentifierPattern" is parsed correctly. - test.skip('quoted nested fields', () => { - const { text } = reprint('FROM index | KEEP `a`.`b`, c.`d`'); - - expect(text).toBe('FROM index | KEEP a.b, c.d'); - }); - - // Un-skip when identifier names are escaped correctly. - test.skip('special character in identifier', () => { - const { text } = reprint('FROM a | KEEP `a 👉 b`, a.`✅`'); - - expect(text).toBe('FROM a | KEEP `a 👉 b`, a.`✅`'); - }); - }); - - describe('"function" expressions', () => { - describe('function call expression', () => { - test('no argument function', () => { - const { text } = reprint('ROW fn()'); - - expect(text).toBe('ROW FN()'); - }); - - test('functions with arguments', () => { - const { text } = reprint('ROW gg(1), wp(1, 2, 3)'); - - expect(text).toBe('ROW GG(1), WP(1, 2, 3)'); - }); - - test('functions with star argument', () => { - const { text } = reprint('ROW f(*)'); - - expect(text).toBe('ROW F(*)'); - }); - }); - - describe('unary expression', () => { - test('NOT expression', () => { - const { text } = reprint('ROW NOT a'); - - expect(text).toBe('ROW NOT a'); - }); - }); - - describe('postfix unary expression', () => { - test('IS NOT NULL expression', () => { - const { text } = reprint('ROW a IS NOT NULL'); - - expect(text).toBe('ROW a IS NOT NULL'); - }); - }); - - describe('binary expression expression', () => { - test('arithmetic expression', () => { - const { text } = reprint('ROW 1 + 2'); - - expect(text).toBe('ROW 1 + 2'); - }); - - test('assignment expression', () => { - const { text } = reprint('FROM a | STATS a != 1'); - - expect(text).toBe('FROM a | STATS a != 1'); - }); - - test('regex expression - 1', () => { - const { text } = reprint('FROM a | WHERE a NOT RLIKE "a"'); - - expect(text).toBe('FROM a | WHERE a NOT RLIKE "a"'); - }); - - test('regex expression - 2', () => { - const { text } = reprint('FROM a | WHERE a LIKE "b"'); - - expect(text).toBe('FROM a | WHERE a LIKE "b"'); - }); - }); - }); - - describe('literals expressions', () => { - describe('numeric literal', () => { - test('null', () => { - const { text } = reprint('ROW null'); - - expect(text).toBe('ROW NULL'); - }); - - test('boolean', () => { - expect(reprint('ROW true').text).toBe('ROW TRUE'); - expect(reprint('ROW false').text).toBe('ROW FALSE'); - }); - - test('integer', () => { - const { text } = reprint('ROW 1'); - - expect(text).toBe('ROW 1'); - }); - - test('decimal', () => { - const { text } = reprint('ROW 1.2'); - - expect(text).toBe('ROW 1.2'); - }); - - test('string', () => { - const { text } = reprint('ROW "abc"'); - - expect(text).toBe('ROW "abc"'); - }); - - test('string w/ special chars', () => { - const { text } = reprint('ROW "as \\" 👍"'); - - expect(text).toBe('ROW "as \\" 👍"'); - }); - - describe('params', () => { - test('unnamed', () => { - const { text } = reprint('ROW ?'); - - expect(text).toBe('ROW ?'); - }); - - test('named', () => { - const { text } = reprint('ROW ?kappa'); - - expect(text).toBe('ROW ?kappa'); - }); - - test('positional', () => { - const { text } = reprint('ROW ?42'); - - expect(text).toBe('ROW ?42'); - }); - }); - }); - }); - - describe('list literal expressions', () => { - describe('integer list', () => { - test('one element list', () => { - expect(reprint('ROW [1]').text).toBe('ROW [1]'); - }); - - test('multiple elements', () => { - expect(reprint('ROW [1, 2]').text).toBe('ROW [1, 2]'); - expect(reprint('ROW [1, 2, -1]').text).toBe('ROW [1, 2, -1]'); - }); - }); - - describe('boolean list', () => { - test('one element list', () => { - expect(reprint('ROW [true]').text).toBe('ROW [TRUE]'); - }); - - test('multiple elements', () => { - expect(reprint('ROW [TRUE, false]').text).toBe('ROW [TRUE, FALSE]'); - expect(reprint('ROW [false, FALSE, false]').text).toBe('ROW [FALSE, FALSE, FALSE]'); - }); - }); - - describe('string list', () => { - test('one element list', () => { - expect(reprint('ROW ["a"]').text).toBe('ROW ["a"]'); - }); - - test('multiple elements', () => { - expect(reprint('ROW ["a", "b"]').text).toBe('ROW ["a", "b"]'); - expect(reprint('ROW ["foo", "42", "boden"]').text).toBe('ROW ["foo", "42", "boden"]'); - }); - }); - }); - - describe('cast expressions', () => { - test('various', () => { - expect(reprint('ROW a::string').text).toBe('ROW a::string'); - expect(reprint('ROW 123::string').text).toBe('ROW 123::string'); - expect(reprint('ROW "asdf"::number').text).toBe('ROW "asdf"::number'); - }); - }); - - describe('time interval expression', () => { - test('days', () => { - const { text } = reprint('ROW 1 d'); - - expect(text).toBe('ROW 1d'); - }); - - test('years', () => { - const { text } = reprint('ROW 42y'); - - expect(text).toBe('ROW 42y'); - }); - }); -}); diff --git a/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.ts b/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.ts deleted file mode 100644 index 94f4afd1acd11..0000000000000 --- a/packages/kbn-esql-ast/src/pretty_print/pretty_print_one_line.ts +++ /dev/null @@ -1,148 +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 { ESQLAstQueryNode, Visitor } from '../visitor'; - -export const prettyPrintOneLine = (query: ESQLAstQueryNode) => { - const visitor = new Visitor() - .on('visitSourceExpression', (ctx) => { - return ctx.node.name; - }) - .on('visitColumnExpression', (ctx) => { - /** - * @todo: Add support for: (1) escaped characters, (2) nested fields. - */ - return ctx.node.name; - }) - .on('visitFunctionCallExpression', (ctx) => { - const node = ctx.node; - let operator = node.name.toUpperCase(); - - switch (node.subtype) { - case 'unary-expression': { - return `${operator} ${ctx.visitArgument(0)}`; - } - case 'postfix-unary-expression': { - return `${ctx.visitArgument(0)} ${operator}`; - } - case 'binary-expression': { - /** @todo Make `operator` printable. */ - switch (operator) { - case 'NOT_LIKE': { - operator = 'NOT LIKE'; - break; - } - case 'NOT_RLIKE': { - operator = 'NOT RLIKE'; - break; - } - } - return `${ctx.visitArgument(0)} ${operator} ${ctx.visitArgument(1)}`; - } - default: { - let args = ''; - - for (const arg of ctx.visitArguments()) { - args += (args ? ', ' : '') + arg; - } - - return `${operator}(${args})`; - } - } - }) - .on('visitLiteralExpression', (ctx) => { - const node = ctx.node; - - switch (node.literalType) { - case 'null': { - return 'NULL'; - } - case 'boolean': { - return String(node.value).toUpperCase() === 'TRUE' ? 'TRUE' : 'FALSE'; - } - case 'param': { - switch (node.paramType) { - case 'named': - case 'positional': - return '?' + node.value; - default: - return '?'; - } - } - case 'string': { - return node.value; - } - default: { - return String(ctx.node.value); - } - } - }) - .on('visitListLiteralExpression', (ctx) => { - let elements = ''; - - for (const arg of ctx.visitElements()) { - elements += (elements ? ', ' : '') + arg; - } - - return `[${elements}]`; - }) - .on('visitTimeIntervalLiteralExpression', (ctx) => { - /** @todo Rename to `fmt`. */ - return ctx.format(); - }) - .on('visitInlineCastExpression', (ctx) => { - /** @todo Add `.fmt()` helper. */ - return `${ctx.visitValue()}::${ctx.node.castType}`; - }) - .on('visitExpression', (ctx) => { - return ctx.node.text ?? ''; - }) - .on('visitCommandOption', (ctx) => { - const option = ctx.node.name.toUpperCase(); - let args = ''; - - for (const arg of ctx.visitArguments()) { - args += (args ? ', ' : '') + arg; - } - - const argsFormatted = args ? ` ${args}` : ''; - const optionFormatted = `${option}${argsFormatted}`; - - return optionFormatted; - }) - .on('visitCommand', (ctx) => { - const cmd = ctx.node.name.toUpperCase(); - let args = ''; - let options = ''; - - for (const source of ctx.visitArguments()) { - args += (args ? ', ' : '') + source; - } - - for (const option of ctx.visitOptions()) { - options += (options ? ' ' : '') + option; - } - - const argsFormatted = args ? ` ${args}` : ''; - const optionsFormatted = options ? ` ${options}` : ''; - const cmdFormatted = `${cmd}${argsFormatted}${optionsFormatted}`; - - return cmdFormatted; - }) - .on('visitQuery', (ctx) => { - let text = ''; - - for (const cmd of ctx.visitCommands()) { - text += (text ? ' | ' : '') + cmd; - } - - return text; - }); - - return visitor.visitQuery(query); -}; diff --git a/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts b/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts new file mode 100644 index 0000000000000..d4c2fe5cc20eb --- /dev/null +++ b/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts @@ -0,0 +1,479 @@ +/* + * 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 { BinaryExpressionGroup } from '../ast/constants'; +import { binaryExpressionGroup, isBinaryExpression } from '../ast/helpers'; +import { + CommandOptionVisitorContext, + CommandVisitorContext, + ESQLAstQueryNode, + ExpressionVisitorContext, + FunctionCallExpressionVisitorContext, + Visitor, +} from '../visitor'; +import { singleItems } from '../visitor/utils'; +import { BasicPrettyPrinter, BasicPrettyPrinterOptions } from './basic_pretty_printer'; +import { LeafPrinter } from './leaf_printer'; + +/** + * @todo + * + * 1. Implement list literal pretty printing. + */ + +interface Input { + indent: string; + remaining: number; + + /** + * Passed between adjacent binary expressions to flatten them into a single + * vertical list. + * + * For example, a list like this: + * + * ``` + * 1 + 2 + 3 + 4 + * ``` + * + * Is flatted into a single list: + * + * ``` + * 1 + + * 2 + + * 3 + + * 4 + * ``` + */ + flattenBinExpOfType?: BinaryExpressionGroup; +} + +interface Output { + txt: string; + lines?: number; +} + +export interface WrappingPrettyPrinterOptions extends BasicPrettyPrinterOptions { + /** + * Initial indentation string inserted before the whole query. Defaults to an + * empty string. + */ + indent?: string; + + /** + * Tabbing string inserted before new level of nesting. Defaults to two spaces. + */ + tab?: string; + + /** + * Tabbing string inserted before a pipe, when `multiline` is `true`. + */ + pipeTab?: string; + + /** + * Tabbing string inserted before command arguments, when they are broken into + * multiple lines. Defaults to four spaces. + */ + commandTab?: string; + + /** + * Whether to force multiline formatting. Defaults to `false`. If set to + * `false`, it will try to fit the query into a single line. + */ + multiline?: boolean; + + /** + * Expected width of the output. Defaults to 80 characters. Text will be + * wrapped to fit this width. + */ + wrap?: number; +} + +export class WrappingPrettyPrinter { + public static readonly print = ( + query: ESQLAstQueryNode, + opts?: WrappingPrettyPrinterOptions + ): string => { + const printer = new WrappingPrettyPrinter(opts); + return printer.print(query); + }; + + protected readonly opts: Required; + + constructor(opts: WrappingPrettyPrinterOptions = {}) { + this.opts = { + indent: opts.indent ?? '', + tab: opts.tab ?? ' ', + pipeTab: opts.pipeTab ?? ' ', + commandTab: opts.commandTab ?? ' ', + multiline: opts.multiline ?? false, + wrap: opts.wrap ?? 80, + lowercase: opts.lowercase ?? false, + lowercaseCommands: opts.lowercaseCommands ?? opts.lowercase ?? false, + lowercaseOptions: opts.lowercaseOptions ?? opts.lowercase ?? false, + lowercaseFunctions: opts.lowercaseFunctions ?? opts.lowercase ?? false, + lowercaseKeywords: opts.lowercaseKeywords ?? opts.lowercase ?? false, + }; + } + + protected keyword(word: string) { + return this.opts.lowercaseKeywords ?? this.opts.lowercase + ? word.toLowerCase() + : word.toUpperCase(); + } + + private visitBinaryExpression( + ctx: ExpressionVisitorContext, + operator: string, + inp: Input + ): Output { + const node = ctx.node; + const group = binaryExpressionGroup(node); + const [left, right] = ctx.arguments(); + const groupLeft = binaryExpressionGroup(left); + const groupRight = binaryExpressionGroup(right); + const continueVerticalFlattening = group && inp.flattenBinExpOfType === group; + + if (continueVerticalFlattening) { + const parent = ctx.parent?.node; + const isLeftChild = isBinaryExpression(parent) && parent.args[0] === node; + const leftInput: Input = { + indent: inp.indent, + remaining: inp.remaining, + flattenBinExpOfType: group, + }; + const rightInput: Input = { + indent: inp.indent + this.opts.tab, + remaining: inp.remaining - this.opts.tab.length, + flattenBinExpOfType: group, + }; + const leftOut = ctx.visitArgument(0, leftInput); + const rightOut = ctx.visitArgument(1, rightInput); + const rightTab = isLeftChild ? this.opts.tab : ''; + const txt = `${leftOut.txt} ${operator}\n${inp.indent}${rightTab}${rightOut.txt}`; + + return { txt }; + } + + let txt: string = ''; + let leftFormatted = BasicPrettyPrinter.expression(left, this.opts); + let rightFormatted = BasicPrettyPrinter.expression(right, this.opts); + + if (groupLeft && groupLeft < group) { + leftFormatted = `(${leftFormatted})`; + } + + if (groupRight && groupRight < group) { + rightFormatted = `(${rightFormatted})`; + } + + const length = leftFormatted.length + rightFormatted.length + operator.length + 2; + const fitsOnOneLine = length <= inp.remaining; + + if (fitsOnOneLine) { + txt = `${leftFormatted} ${operator} ${rightFormatted}`; + } else { + const flattenVertically = group === groupLeft || group === groupRight; + const flattenBinExpOfType = flattenVertically ? group : undefined; + const leftInput: Input = { + indent: inp.indent, + remaining: inp.remaining, + flattenBinExpOfType, + }; + const rightInput: Input = { + indent: inp.indent + this.opts.tab, + remaining: inp.remaining - this.opts.tab.length, + flattenBinExpOfType, + }; + const leftOut = ctx.visitArgument(0, leftInput); + const rightOut = ctx.visitArgument(1, rightInput); + + txt = `${leftOut.txt} ${operator}\n${inp.indent}${this.opts.tab}${rightOut.txt}`; + } + + return { txt }; + } + + private printArguments( + ctx: CommandVisitorContext | CommandOptionVisitorContext | FunctionCallExpressionVisitorContext, + inp: Input + ) { + let txt = ''; + let lines = 1; + let largestArg = 0; + let argsPerLine = 0; + let minArgsPerLine = 1e6; + let maxArgsPerLine = 0; + let remainingCurrentLine = inp.remaining; + let oneArgumentPerLine = false; + + ARGS: for (const arg of singleItems(ctx.arguments())) { + if (arg.type === 'option') { + continue; + } + + const formattedArg = BasicPrettyPrinter.expression(arg, this.opts); + const formattedArgLength = formattedArg.length; + const needsWrap = remainingCurrentLine < formattedArgLength; + if (formattedArgLength > largestArg) { + largestArg = formattedArgLength; + } + let separator = txt ? ',' : ''; + let fragment = ''; + + if (needsWrap) { + separator += + '\n' + + inp.indent + + this.opts.tab + + (ctx instanceof CommandVisitorContext ? this.opts.commandTab : ''); + fragment = separator + formattedArg; + lines++; + if (argsPerLine > maxArgsPerLine) { + maxArgsPerLine = argsPerLine; + } + if (argsPerLine < minArgsPerLine) { + minArgsPerLine = argsPerLine; + if (minArgsPerLine < 2) { + oneArgumentPerLine = true; + break ARGS; + } + } + remainingCurrentLine = + inp.remaining - formattedArgLength - this.opts.tab.length - this.opts.commandTab.length; + argsPerLine = 1; + } else { + argsPerLine++; + fragment = separator + (separator ? ' ' : '') + formattedArg; + remainingCurrentLine -= fragment.length; + } + txt += fragment; + } + + let indent = inp.indent + this.opts.tab; + + if (ctx instanceof CommandVisitorContext) { + const isFirstCommand = (ctx.parent?.node as ESQLAstQueryNode)?.[0] === ctx.node; + if (!isFirstCommand) { + indent += this.opts.commandTab; + } + } + + if (oneArgumentPerLine) { + lines = 1; + txt = ctx instanceof CommandVisitorContext ? indent : '\n' + indent; + let i = 0; + for (const arg of ctx.visitArguments({ + indent, + remaining: this.opts.wrap - indent.length, + })) { + const isFirstArg = i === 0; + const separator = isFirstArg ? '' : ',\n' + indent; + txt += separator + arg.txt; + lines++; + i++; + } + } + + return { txt, lines, indent, oneArgumentPerLine }; + } + + protected readonly visitor = new Visitor() + .on('visitExpression', (ctx, inp: Input): Output => { + const txt = ctx.node.text ?? ''; + return { txt }; + }) + + .on( + 'visitSourceExpression', + (ctx, inp: Input): Output => ({ txt: LeafPrinter.source(ctx.node) }) + ) + + .on( + 'visitColumnExpression', + (ctx, inp: Input): Output => ({ txt: LeafPrinter.column(ctx.node) }) + ) + + .on( + 'visitLiteralExpression', + (ctx, inp: Input): Output => ({ txt: LeafPrinter.literal(ctx.node) }) + ) + + .on( + 'visitTimeIntervalLiteralExpression', + (ctx, inp: Input): Output => ({ txt: LeafPrinter.timeInterval(ctx.node) }) + ) + + .on('visitInlineCastExpression', (ctx, inp: Input): Output => { + const value = ctx.value(); + const wrapInBrackets = + value.type !== 'literal' && + value.type !== 'column' && + !(value.type === 'function' && value.subtype === 'variadic-call'); + const castType = ctx.node.castType; + + let valueFormatted = ctx.visitValue({ + indent: inp.indent, + remaining: inp.remaining - castType.length - 2, + }).txt; + + if (wrapInBrackets) { + valueFormatted = `(${valueFormatted})`; + } + + const txt = `${valueFormatted}::${ctx.node.castType}`; + + return { txt }; + }) + + .on('visitRenameExpression', (ctx, inp: Input): Output => { + const operator = this.keyword('AS'); + + return this.visitBinaryExpression(ctx, operator, inp); + }) + + .on('visitListLiteralExpression', (ctx, inp: Input): Output => { + let elements = ''; + + for (const out of ctx.visitElements()) { + elements += (elements ? ', ' : '') + out.txt; + } + + const txt = `[${elements}]`; + return { txt }; + }) + + .on('visitFunctionCallExpression', (ctx, inp: Input): Output => { + const node = ctx.node; + let operator = ctx.operator(); + let txt: string = ''; + + if (this.opts.lowercaseFunctions ?? this.opts.lowercase) { + operator = operator.toLowerCase(); + } + + switch (node.subtype) { + case 'unary-expression': { + txt = `${operator} ${ctx.visitArgument(0, inp).txt}`; + break; + } + case 'postfix-unary-expression': { + txt = `${ctx.visitArgument(0, inp).txt} ${operator}`; + break; + } + case 'binary-expression': { + return this.visitBinaryExpression(ctx, operator, inp); + } + default: { + const args = this.printArguments(ctx, { + indent: inp.indent, + remaining: inp.remaining - operator.length - 1, + }); + + txt = `${operator}(${args.txt})`; + } + } + + return { txt }; + }) + + .on('visitCommandOption', (ctx, inp: Input): Output => { + const option = this.opts.lowercaseOptions ? ctx.node.name : ctx.node.name.toUpperCase(); + const args = this.printArguments(ctx, { + indent: inp.indent, + remaining: inp.remaining - option.length - 1, + }); + const argsFormatted = args.txt ? ` ${args.txt}` : ''; + const txt = `${option}${argsFormatted}`; + + return { txt, lines: args.lines }; + }) + + .on('visitCommand', (ctx, inp: Input): Output => { + const opts = this.opts; + const cmd = opts.lowercaseCommands ? ctx.node.name : ctx.node.name.toUpperCase(); + const args = this.printArguments(ctx, { + indent: inp.indent, + remaining: inp.remaining - cmd.length - 1, + }); + const optionIndent = args.indent + opts.pipeTab; + const optionsTxt: string[] = []; + + let options = ''; + let optionsLines = 0; + let breakOptions = false; + + for (const out of ctx.visitOptions({ + indent: optionIndent, + remaining: opts.wrap - optionIndent.length, + })) { + optionsLines += out.lines ?? 1; + optionsTxt.push(out.txt); + options += (options ? ' ' : '') + out.txt; + } + + breakOptions = + breakOptions || + args.lines > 1 || + optionsLines > 1 || + options.length > opts.wrap - inp.remaining - cmd.length - 1 - args.txt.length; + + if (breakOptions) { + options = optionsTxt.join('\n' + optionIndent); + } + + const argsWithWhitespace = args.txt + ? `${args.oneArgumentPerLine ? '\n' : ' '}${args.txt}` + : ''; + const optionsWithWhitespace = options + ? `${breakOptions ? '\n' + optionIndent : ' '}${options}` + : ''; + const txt = `${cmd}${argsWithWhitespace}${optionsWithWhitespace}`; + + return { txt, lines: args.lines /* add options lines count */ }; + }) + + .on('visitQuery', (ctx) => { + const opts = this.opts; + const indent = opts.indent ?? ''; + const commandCount = ctx.node.length; + let multiline = opts.multiline ?? commandCount > 3; + + if (!multiline) { + const oneLine = indent + BasicPrettyPrinter.print(ctx.node, opts); + if (oneLine.length <= opts.wrap) { + return oneLine; + } else { + multiline = true; + } + } + + let text = indent; + const cmdSeparator = multiline ? `\n${indent}${opts.pipeTab ?? ' '}| ` : ' | '; + let i = 0; + let prevOut: Output | undefined; + + for (const out of ctx.visitCommands({ indent, remaining: opts.wrap - indent.length })) { + const isSecondCommand = i === 1; + if (isSecondCommand) { + const firstCommandIsMultiline = prevOut?.lines && prevOut.lines > 1; + if (firstCommandIsMultiline) text += '\n' + indent; + } + const isFirstCommand = i === 0; + if (!isFirstCommand) text += cmdSeparator; + text += out.txt; + i++; + prevOut = out; + } + + return text; + }); + + public print(query: ESQLAstQueryNode) { + return this.visitor.visitQuery(query); + } +} diff --git a/packages/kbn-esql-ast/src/types.ts b/packages/kbn-esql-ast/src/types.ts index 12496835ea12b..e9c0db1d216d3 100644 --- a/packages/kbn-esql-ast/src/types.ts +++ b/packages/kbn-esql-ast/src/types.ts @@ -72,6 +72,14 @@ export interface ESQLCommandOption extends ESQLAstBaseItem { args: ESQLAstItem[]; } +/** + * Right now rename expressions ("clauses") are parsed as options in the + * RENAME command. + */ +export interface ESQLAstRenameExpression extends ESQLCommandOption { + name: 'as'; +} + export interface ESQLCommandMode extends ESQLAstBaseItem { type: 'mode'; } @@ -167,10 +175,45 @@ export interface ESQLTimeInterval extends ESQLAstBaseItem { export interface ESQLSource extends ESQLAstBaseItem { type: 'source'; sourceType: 'index' | 'policy'; + + /** + * Represents the cluster part of the source identifier. Empty string if not + * present. + * + * ``` + * FROM [:] + * ``` + */ + cluster?: string; + + /** + * Represents the index part of the source identifier. Unescaped and unquoted. + * + * ``` + * FROM [:] + * ``` + */ + index?: string; } export interface ESQLColumn extends ESQLAstBaseItem { type: 'column'; + + /** + * An identifier can be composed of multiple parts, e.g: part1.part2.`part``3️⃣`. + * This property contains the parsed unquoted parts of the identifier. + * For example: `['part1', 'part2', 'part`3️⃣']`. + */ + parts: string[]; + + /** + * @deprecated + * + * An identifier can be composed of multiple parts, e.g: part1.part2.`part3️⃣` + * + * Each part can be quoted or not quoted independently. A single `quoted` + * property is not enough to represent the identifier. Use `parts` instead. + */ quoted: boolean; } diff --git a/packages/kbn-esql-ast/src/visitor/__tests__/scenarios.test.ts b/packages/kbn-esql-ast/src/visitor/__tests__/scenarios.test.ts index ce338e8bd72ba..d0e597ea553de 100644 --- a/packages/kbn-esql-ast/src/visitor/__tests__/scenarios.test.ts +++ b/packages/kbn-esql-ast/src/visitor/__tests__/scenarios.test.ts @@ -65,12 +65,12 @@ test('can remove a specific WHERE command', () => { const print = () => new Visitor() + .on('visitExpression', (ctx) => '') .on('visitColumnExpression', (ctx) => ctx.node.name) .on( 'visitFunctionCallExpression', (ctx) => `${ctx.node.name}(${[...ctx.visitArguments()].join(', ')})` ) - .on('visitExpression', (ctx) => '') .on('visitCommand', (ctx) => { if (ctx.node.name === 'where') { const args = [...ctx.visitArguments()].join(', '); @@ -84,12 +84,12 @@ test('can remove a specific WHERE command', () => { const removeFilter = (field: string) => { query.ast = new Visitor() + .on('visitExpression', (ctx) => ctx.node) .on('visitColumnExpression', (ctx) => (ctx.node.name === field ? null : ctx.node)) .on('visitFunctionCallExpression', (ctx) => { const args = [...ctx.visitArguments()]; return args.some((arg) => arg === null) ? null : ctx.node; }) - .on('visitExpression', (ctx) => ctx.node) .on('visitCommand', (ctx) => { if (ctx.node.name === 'where') { ctx.node.args = [...ctx.visitArguments()].filter(Boolean); @@ -116,6 +116,9 @@ test('can remove a specific WHERE command', () => { export const prettyPrint = (ast: ESQLAstQueryNode) => new Visitor() + .on('visitExpression', (ctx) => { + return ''; + }) .on('visitSourceExpression', (ctx) => { return ctx.node.name; }) @@ -141,9 +144,6 @@ export const prettyPrint = (ast: ESQLAstQueryNode) => .on('visitInlineCastExpression', (ctx) => { return ''; }) - .on('visitExpression', (ctx) => { - return ''; - }) .on('visitCommandOption', (ctx) => { let args = ''; for (const arg of ctx.visitArguments()) { diff --git a/packages/kbn-esql-ast/src/visitor/contexts.ts b/packages/kbn-esql-ast/src/visitor/contexts.ts index a9e690b6067d2..376825f88577f 100644 --- a/packages/kbn-esql-ast/src/visitor/contexts.ts +++ b/packages/kbn-esql-ast/src/visitor/contexts.ts @@ -16,6 +16,7 @@ import type { ESQLAstCommand, ESQLAstItem, ESQLAstNodeWithArgs, + ESQLAstRenameExpression, ESQLColumn, ESQLCommandOption, ESQLDecimalLiteral, @@ -24,6 +25,7 @@ import type { ESQLIntegerLiteral, ESQLList, ESQLLiteral, + ESQLSingleAstItem, ESQLSource, ESQLTimeInterval, } from '../types'; @@ -35,7 +37,9 @@ import type { ExpressionVisitorOutput, UndefinedToVoid, VisitorAstNode, + VisitorInput, VisitorMethods, + VisitorOutput, } from './types'; import { Builder } from '../builder'; @@ -66,8 +70,8 @@ export class VisitorContext< ) {} public *visitArguments( - input: ExpressionVisitorInput - ): Iterable> { + input: VisitorInput + ): Iterable> { this.ctx.assertMethodExists('visitExpression'); const node = this.node; @@ -77,14 +81,33 @@ export class VisitorContext< } for (const arg of singleItems(node.args)) { + if (arg.type === 'option' && arg.name !== 'as') { + continue; + } yield this.visitExpression(arg, input as any); } } + public arguments(): ESQLAstExpressionNode[] { + const node = this.node; + + if (!isNodeWithArgs(node)) { + throw new Error('Node does not have arguments'); + } + + const args: ESQLAstExpressionNode[] = []; + + for (const arg of singleItems(node.args)) { + args.push(arg); + } + + return args; + } + public visitArgument( index: number, - input: ExpressionVisitorInput - ): ExpressionVisitorOutput { + input: VisitorInput + ): VisitorOutput { this.ctx.assertMethodExists('visitExpression'); const node = this.node; @@ -106,8 +129,8 @@ export class VisitorContext< public visitExpression( expressionNode: ESQLAstExpressionNode, - input: ExpressionVisitorInput - ): ExpressionVisitorOutput { + input: VisitorInput + ): VisitorOutput { return this.ctx.visitExpression(this, expressionNode, input); } @@ -154,6 +177,8 @@ export class CommandVisitorContext< continue; } if (arg.type === 'option') { + // We treat "AS" options as rename expressions, not as command options. + if (arg.name === 'as') continue; yield arg; } } @@ -172,7 +197,7 @@ export class CommandVisitorContext< } } - public *arguments(option: '' | string = ''): Iterable { + public *args(option: '' | string = ''): Iterable { option = option.toLowerCase(); if (!option) { @@ -183,6 +208,9 @@ export class CommandVisitorContext< } if (arg.type !== 'option') { yield arg; + } else if (arg.name === 'as') { + // We treat "AS" options as rename expressions, not as command options. + yield arg; } } } @@ -196,20 +224,21 @@ export class CommandVisitorContext< } } - public *visitArguments( - input: ExpressionVisitorInput, + public *visitArgs( + input: + | VisitorInput + | (() => VisitorInput), option: '' | string = '' ): Iterable> { this.ctx.assertMethodExists('visitExpression'); - const node = this.node; - - if (!isNodeWithArgs(node)) { - throw new Error('Node does not have arguments'); - } - - for (const arg of singleItems(this.arguments(option))) { - yield this.visitExpression(arg, input as any); + for (const arg of singleItems(this.args(option))) { + yield this.visitExpression( + arg, + typeof input === 'function' + ? (input as () => VisitorInput)() + : (input as VisitorInput) + ); } } @@ -441,7 +470,25 @@ export class SourceExpressionVisitorContext< export class FunctionCallExpressionVisitorContext< Methods extends VisitorMethods = VisitorMethods, Data extends SharedData = SharedData -> extends VisitorContext {} +> extends VisitorContext { + /** + * @returns Returns a printable uppercase function name or operator. + */ + public operator(): string { + const operator = this.node.name; + + switch (operator) { + case 'note_like': { + return 'NOT LIKE'; + } + case 'not_rlike': { + return 'NOT RLIKE'; + } + } + + return operator.toUpperCase(); + } +} export class LiteralExpressionVisitorContext< Methods extends VisitorMethods = VisitorMethods, @@ -468,23 +515,30 @@ export class ListLiteralExpressionVisitorContext< export class TimeIntervalLiteralExpressionVisitorContext< Methods extends VisitorMethods = VisitorMethods, Data extends SharedData = SharedData -> extends ExpressionVisitorContext { - format(): string { - const node = this.node; - - return `${node.quantity}${node.unit}`; - } -} +> extends ExpressionVisitorContext {} export class InlineCastExpressionVisitorContext< Methods extends VisitorMethods = VisitorMethods, Data extends SharedData = SharedData > extends ExpressionVisitorContext { - public visitValue(input: ExpressionVisitorInput): ExpressionVisitorOutput { + public value(): ESQLSingleAstItem { this.ctx.assertMethodExists('visitExpression'); const value = firstItem([this.node.value])!; - return this.visitExpression(value, input as any); + return value; + } + + public visitValue( + input: VisitorInput + ): VisitorOutput { + this.ctx.assertMethodExists('visitExpression'); + + return this.visitExpression(this.value(), input as any); } } + +export class RenameExpressionVisitorContext< + Methods extends VisitorMethods = VisitorMethods, + Data extends SharedData = SharedData +> extends VisitorContext {} diff --git a/packages/kbn-esql-ast/src/visitor/global_visitor_context.ts b/packages/kbn-esql-ast/src/visitor/global_visitor_context.ts index d05a4ce326eb7..e1ca7f6677d24 100644 --- a/packages/kbn-esql-ast/src/visitor/global_visitor_context.ts +++ b/packages/kbn-esql-ast/src/visitor/global_visitor_context.ts @@ -9,6 +9,7 @@ import * as contexts from './contexts'; import type { ESQLAstCommand, + ESQLAstRenameExpression, ESQLColumn, ESQLFunction, ESQLInlineCast, @@ -398,6 +399,18 @@ export class GlobalVisitorContext< if (!this.methods.visitInlineCastExpression) break; return this.visitInlineCastExpression(parent, expressionNode, input as any); } + case 'option': { + switch (expressionNode.name) { + case 'as': { + if (!this.methods.visitRenameExpression) break; + return this.visitRenameExpression( + parent, + expressionNode as ESQLAstRenameExpression, + input as any + ); + } + } + } } return this.visitExpressionGeneric(parent, expressionNode, input as any); } @@ -464,4 +477,13 @@ export class GlobalVisitorContext< const context = new contexts.InlineCastExpressionVisitorContext(this, node, parent); return this.visitWithSpecificContext('visitInlineCastExpression', context, input); } + + public visitRenameExpression( + parent: contexts.VisitorContext | null, + node: ESQLAstRenameExpression, + input: types.VisitorInput + ): types.VisitorOutput { + const context = new contexts.RenameExpressionVisitorContext(this, node, parent); + return this.visitWithSpecificContext('visitRenameExpression', context, input); + } } diff --git a/packages/kbn-esql-ast/src/visitor/types.ts b/packages/kbn-esql-ast/src/visitor/types.ts index a8ec5e9bd1785..beb0aed3570b2 100644 --- a/packages/kbn-esql-ast/src/visitor/types.ts +++ b/packages/kbn-esql-ast/src/visitor/types.ts @@ -59,7 +59,8 @@ export type ExpressionVisitorInput = AnyToVoid< VisitorInput & VisitorInput & VisitorInput & - VisitorInput + VisitorInput & + VisitorInput >; /** @@ -73,7 +74,8 @@ export type ExpressionVisitorOutput = | VisitorOutput | VisitorOutput | VisitorOutput - | VisitorOutput; + | VisitorOutput + | VisitorOutput; /** * Input that satisfies any command visitor input constraints. @@ -195,6 +197,11 @@ export interface VisitorMethods< any, any >; + visitRenameExpression?: Visitor< + contexts.RenameExpressionVisitorContext, + any, + any + >; } /** @@ -222,22 +229,6 @@ export type AstNodeToVisitorName = Node extends ESQ ? 'visitInlineCastExpression' : never; -/** - * Maps any AST node to the corresponding visitor context. - */ -export type AstNodeToVisitor< - Node extends VisitorAstNode, - Methods extends VisitorMethods = VisitorMethods -> = Methods[AstNodeToVisitorName]; - -/** - * Maps any AST node to its corresponding visitor context. - */ -export type AstNodeToContext< - Node extends VisitorAstNode, - Methods extends VisitorMethods = VisitorMethods -> = Parameters>>[0]; - /** * Asserts that a type is a function. */ diff --git a/packages/kbn-esql-ast/src/visitor/visitor.ts b/packages/kbn-esql-ast/src/visitor/visitor.ts index 3956fe126723e..1a4554f1f2cf4 100644 --- a/packages/kbn-esql-ast/src/visitor/visitor.ts +++ b/packages/kbn-esql-ast/src/visitor/visitor.ts @@ -12,10 +12,12 @@ import { VisitorContext } from './contexts'; import type { AstNodeToVisitorName, EnsureFunction, + ESQLAstExpressionNode, ESQLAstQueryNode, UndefinedToVoid, VisitorMethods, } from './types'; +import { ESQLCommand } from '../types'; export interface VisitorOptions< Methods extends VisitorMethods = VisitorMethods, @@ -86,6 +88,7 @@ export class Visitor< * Traverse the root node of ES|QL query with default context. * * @param node Query node to traverse. + * @param input Input to pass to the first visitor. * @returns The result of the query visitor. */ public visitQuery( @@ -95,4 +98,34 @@ export class Visitor< const queryContext = new QueryVisitorContext(this.ctx, node, null); return this.visit(queryContext, input); } + + /** + * Traverse starting from known command node with default context. + * + * @param node Command node to traverse. + * @param input Input to pass to the first visitor. + * @returns The output of the visitor. + */ + public visitCommand( + node: ESQLCommand, + input: UndefinedToVoid>[1]> + ) { + this.ctx.assertMethodExists('visitCommand'); + return this.ctx.visitCommand(null, node, input); + } + + /** + * Traverse starting from known expression node with default context. + * + * @param node Expression node to traverse. + * @param input Input to pass to the first visitor. + * @returns The output of the visitor. + */ + public visitExpression( + node: ESQLAstExpressionNode, + input: UndefinedToVoid>[1]> + ) { + this.ctx.assertMethodExists('visitExpression'); + return this.ctx.visitExpression(null, node, input); + } } diff --git a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts index 03ae190b6167f..8bf4ebc682074 100644 --- a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts +++ b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts @@ -77,17 +77,17 @@ describe('esql query helpers', () => { describe('getLimitFromESQLQuery', () => { it('should return default limit when ES|QL query is empty', () => { const limit = getLimitFromESQLQuery(''); - expect(limit).toBe(500); + expect(limit).toBe(1000); }); it('should return default limit when ES|QL query does not contain LIMIT command', () => { const limit = getLimitFromESQLQuery('FROM foo'); - expect(limit).toBe(500); + expect(limit).toBe(1000); }); it('should return default limit when ES|QL query contains invalid LIMIT command', () => { const limit = getLimitFromESQLQuery('FROM foo | LIMIT iAmNotANumber'); - expect(limit).toBe(500); + expect(limit).toBe(1000); }); it('should return limit when ES|QL query contains LIMIT command', () => { @@ -95,7 +95,7 @@ describe('esql query helpers', () => { expect(limit).toBe(10000); }); - it('should return last limit when ES|QL query contains multiple LIMIT command', () => { + it('should return minimum limit when ES|QL query contains multiple LIMIT command', () => { const limit = getLimitFromESQLQuery('FROM foo | LIMIT 200 | LIMIT 0'); expect(limit).toBe(0); }); diff --git a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts index 61a0b4c48c128..bdabcbfbdd6c8 100644 --- a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts +++ b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts @@ -8,7 +8,7 @@ import type { ESQLSource, ESQLFunction, ESQLColumn, ESQLSingleAstItem } from '@kbn/esql-ast'; import { getAstAndSyntaxErrors, Walker, walk } from '@kbn/esql-ast'; -const DEFAULT_ESQL_LIMIT = 500; +const DEFAULT_ESQL_LIMIT = 1000; // retrieves the index pattern from the aggregate query for ES|QL using ast parsing export function getIndexPatternFromESQLQuery(esql?: string) { @@ -40,14 +40,27 @@ export function hasTransformationalCommand(esql?: string) { } export function getLimitFromESQLQuery(esql: string): number { - const limitCommands = esql.match(new RegExp(/LIMIT\s[0-9]+/, 'ig')); - if (!limitCommands) { + const { ast } = getAstAndSyntaxErrors(esql); + const limitCommands = ast.filter(({ name }) => name === 'limit'); + if (!limitCommands || !limitCommands.length) { + return DEFAULT_ESQL_LIMIT; + } + const limits: number[] = []; + + walk(ast, { + visitLiteral: (node) => { + if (!isNaN(Number(node.value))) { + limits.push(Number(node.value)); + } + }, + }); + + if (!limits.length) { return DEFAULT_ESQL_LIMIT; } - const lastIndex = limitCommands.length - 1; - const split = limitCommands[lastIndex].split(' '); - return parseInt(split[1], 10); + // ES returns always the smallest limit + return Math.min(...limits); } export function removeDropCommandsFromESQLQuery(esql?: string): string { diff --git a/packages/kbn-esql-validation-autocomplete/README.md b/packages/kbn-esql-validation-autocomplete/README.md index b5a4fc4d71c61..f964033090c2d 100644 --- a/packages/kbn-esql-validation-autocomplete/README.md +++ b/packages/kbn-esql-validation-autocomplete/README.md @@ -209,12 +209,157 @@ Note that autocomplete works most of the time with incomplete/invalid queries, s Once the AST is produced there's a `getAstContext` function that finds the cursor position node (and its parent command), together with some hint like the type of current context: `expression`, `function`, `newCommand`, `option`. The most complex case is the `expression` as it can cover a multitude of cases. The function is highly commented in order to identify the specific cases, but there's probably some obscure area still to comment/clarify. -### Adding new commands/options/functions/etc... +### Automated testing -To update the definitions: +Both the validation and autocomplete engine are covered by extensive suites of tests. -1. open either appropriate definition file within the `definitions` folder and add a new entry to the relative array -2. if you are adding a function, run `yarn maketests` to add a set of fundamental validation tests for the new definition. If any of the suggested tests are wrong, feel free to correct them by hand. If it seems like a general problem, open an issue with the details so that we can update the generator code. -3. write new tests for validation and autocomplete +#### Running the tests -- if a new function requires a new type of test, make sure to write it manually +All the tests can be run using the `yarn jest:tests packages/kbn-esql-validation-autocomplete/path/to/test/file` command at the root of the repository. + +To run all autocomplete and validation tests you can specifically run + +`yarn test:jest packages/kbn-esql-validation-autocomplete/` + +#### Ongoing refactor + +The test suites are in a state of transition from an older pattern to a newer pattern and so they are more complicated than we would like. We aim to improve and simplify the DX over time. + +The older pattern is + +- a single test file for each engine, one for validation, one for autocomplete. These were always large files and have only grown. +- custom test methods: `testSuggestions` / `testErrorsAndWarnings` +- validation cases are recorded in a JSON file which is then used to check our results against a live Elasticsearch instance in a functional test + +The newer pattern is + +- splitting the tests into multiple smaller files, all found in `__tests__` directories +- standard test methods (`it`, `test`) with custom _assertion_ helpers +- validation cases are checked against Elasticsearch by injecting assertion helpers run API integration tests. This does not require a JSON file. + +#### Validation + +##### The new way + +Validation test logic is found in `packages/kbn-esql-validation-autocomplete/src/validation/__tests__`. + +Tests are found in files named with the following convention: `validation.some-description.test.ts`. + +Here is an example of a block in the new test format. + +```ts +describe('METRICS [ [ BY ]]', () => { + test('errors on invalid command start', async () => { + const { expectErrors } = await setup(); + + await expectErrors('m', [ + "SyntaxError: mismatched input 'm' expecting {'explain', 'from', 'meta', 'metrics', 'row', 'show'}", + ]); + await expectErrors('metrics ', [ + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", + ]); + }); +}); +``` + +`expectErrors` is created in the `setup()` factory. It has a very similar API to `testErrorsAndWarnings` however it is not itself a Jest test case. It is simply an assertion that is wrapped in a test case defined with the standard `test` or `it` function. + +##### The old way + +The old validation tests look like this + +```ts +testErrorsAndWarnings(`ROW var = NOT 5 LIKE "?a"`, [ + `Argument of [LIKE] must be [text], found value [5] type [integer]`, +]); +``` + +and are found in `packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts`. + +`testErrorsAndWarnings` supports `skip` and `only` modifiers e.g. `testErrorsAndWarnings.only('...')`. + +It accepts + +1. a query +2. a list of expected errors (can be empty) +3. a list of expected warnings (can be empty or omitted) + +The bulk of the validation tests are auto-generated from function definitions. All the generated function tests are found within the following describe block + +```ts +describe(FUNCTION_DESCRIBE_BLOCK_NAME, () => { + ... +}); +``` + +They are currently generated in CI when a new function definition is added. The generator script is at `packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts`. + +The generator can be run locally using the `cd packages/kbn-esql-validation-autocomplete && yarn make:tests`. + +It is not perfect and occasionally creates a test case that is invalid for a particular function. So, humans are allowed to edit the expected assertions for any test case—those edits will not be overwritten by the generator script. However, if a human deletes a test case, it will be added back next time the generator runs. So, we should edit the test cases to make them valid, not delete them. + +Running the tests in `validation.test.ts` populates `packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json` which is then used in `test/api_integration/apis/esql/errors.ts` to make sure our validator isn't giving users false positives. Therefore, the validation test suite should always be run after any changes have been made to it so that the JSON file stays in sync. + +#### Autocomplete + +##### The new way + +The new tests are found in `packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__`. + +They look like this. + +```ts +test('lists possible aggregations on space after command', async () => { + const { assertSuggestions } = await setup(); + const expected = ['var0 = ', ...allAggFunctions, ...allEvaFunctions]; + + await assertSuggestions('from a | stats /', expected); + await assertSuggestions('FROM a | STATS /', expected); +}); +``` + +`assertSuggestions` is created by the `setup` factory. It does not set up a Jest test case internally, so it needs to be wrapped in `test` or `it`. + +The suggestion position is calculated from the placement of `/` in the query. + +The arguments are as follows + +1. the query +2. the expected suggestions (`Array`) +3. options + +Options is + +```ts +export interface SuggestOptions { + triggerCharacter?: string; + callbacks?: ESQLCallbacks; +} +``` + +So, that allows you to customize the [trigger kind](https://microsoft.github.io/monaco-editor/typedoc/enums/languages.CompletionTriggerKind.html) in the `ctx` object and the field list and other callback results in `callbacks`. + +##### The old way + +All the legacy autocomplete tests are found in `packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts`. + +They look like this + +```ts +testSuggestions('from a | eval a = 1 year /', [ + ',', + '| ', + ...getFunctionSignaturesByReturnType('eval', 'any', { builtin: true, skipAssign: true }, [ + 'time_interval', + ]), +]); +``` + +Similarly to `testErrorsAndWarnings`, `testSuggestions` is an all-in-one utility that sets up a Jest test case internally. + +Its parameters are as follows + +1. the query +2. the expected suggestions (can be strings or `Partial`) +3. the trigger character. This should only be included if the test is intended to validate a "Trigger Character" trigger kind from Monaco ([ref](https://microsoft.github.io/monaco-editor/typedoc/enums/languages.CompletionTriggerKind.html#TriggerCharacter)) +4. custom callback data such as a list of indicies or a field list diff --git a/packages/kbn-esql-validation-autocomplete/index.ts b/packages/kbn-esql-validation-autocomplete/index.ts index 31bd8c16b76fb..77643f0786785 100644 --- a/packages/kbn-esql-validation-autocomplete/index.ts +++ b/packages/kbn-esql-validation-autocomplete/index.ts @@ -49,7 +49,7 @@ export { getCommandDefinition, getAllCommands, getCommandOption, - lookupColumn, + getColumnForASTNode as lookupColumn, shouldBeQuotedText, printFunctionSignature, checkFunctionArgMatchesDefinition as isEqualType, diff --git a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts index 3118c78f0dbf7..71bca915511de 100644 --- a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts +++ b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts @@ -21,8 +21,9 @@ import { SupportedDataType, FunctionDefinition, dataTypes, - isSupportedDataType, fieldTypes, + isFieldType, + FunctionParameter, } from '../src/definitions/types'; import { FUNCTION_DESCRIBE_BLOCK_NAME } from '../src/validation/function_describe_block_name'; import { getMaxMinNumberOfParams } from '../src/validation/helpers'; @@ -1110,7 +1111,7 @@ function getFieldMapping( return params.map(({ name: _name, type, constantOnly, literalOptions, ...rest }) => { const typeString: string = type as string; - if (isSupportedDataType(typeString)) { + if (isFieldType(typeString)) { if (useLiterals && literalOptions) { return { name: `"${literalOptions[0]}"`, @@ -1155,7 +1156,7 @@ function generateIncorrectlyTypedParameters( signatures: FunctionDefinition['signatures'], currentParams: FunctionDefinition['signatures'][number]['params'], availableFields: Array<{ name: string; type: SupportedDataType }> -) { +): { wrongFieldMapping: FunctionParameter[]; expectedErrors: string[] } { const literalValues = { string: `"a"`, number: '5', @@ -1260,7 +1261,7 @@ function generateIncorrectlyTypedParameters( }) .filter(nonNullable); - return { wrongFieldMapping, expectedErrors }; + return { wrongFieldMapping: wrongFieldMapping as FunctionParameter[], expectedErrors }; } /** diff --git a/packages/kbn-esql-validation-autocomplete/src/__tests__/helpers.ts b/packages/kbn-esql-validation-autocomplete/src/__tests__/helpers.ts index 273679ab1f267..020ee21940fd0 100644 --- a/packages/kbn-esql-validation-autocomplete/src/__tests__/helpers.ts +++ b/packages/kbn-esql-validation-autocomplete/src/__tests__/helpers.ts @@ -72,6 +72,7 @@ export function getCallbackMocks() { indexes.map((name) => ({ name, hidden: name.startsWith('.'), + type: 'Index', })) ), getPolicies: jest.fn(async () => policies), diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts index cdf4a6239a9ab..13d471d53d7ec 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts @@ -137,10 +137,27 @@ describe('autocomplete.suggest', () => { test('when typing inside function left paren', async () => { const { assertSuggestions } = await setup(); const expected = [ - ...getFieldNamesByType([...ESQL_COMMON_NUMERIC_TYPES, 'date', 'boolean', 'ip']), + ...getFieldNamesByType([ + ...ESQL_COMMON_NUMERIC_TYPES, + 'date', + 'boolean', + 'ip', + 'version', + 'text', + 'keyword', + ]), ...getFunctionSignaturesByReturnType( 'stats', - [...ESQL_COMMON_NUMERIC_TYPES, 'date', 'date_period', 'boolean', 'ip'], + [ + ...ESQL_COMMON_NUMERIC_TYPES, + 'date', + 'date_period', + 'boolean', + 'ip', + 'version', + 'text', + 'keyword', + ], { scalar: true, } diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.suggest.test.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.suggest.test.ts similarity index 87% rename from packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.suggest.test.ts rename to packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.suggest.test.ts index 7bb96f602c0dc..bafd33a56c204 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.suggest.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.suggest.test.ts @@ -7,10 +7,10 @@ */ import { getAstAndSyntaxErrors } from '@kbn/esql-ast'; -import { ESQLCallbacks } from '../shared/types'; -import * as autocomplete from './autocomplete'; -import { getCallbackMocks } from '../__tests__/helpers'; -import { EditorContext } from './types'; +import { ESQLCallbacks } from '../../shared/types'; +import * as autocomplete from '../autocomplete'; +import { getCallbackMocks } from '../../__tests__/helpers'; +import { EditorContext } from '../types'; const setup = async (caret = '?') => { if (caret.length !== 1) throw new Error('Caret must be a single character'); diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts index dfae9d76a73af..e8b1c42db2aed 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts @@ -20,7 +20,9 @@ import { camelCase, partition } from 'lodash'; import { getAstAndSyntaxErrors } from '@kbn/esql-ast'; import { FunctionParameter, + FunctionReturnType, isFieldType, + isReturnType, isSupportedDataType, SupportedDataType, } from '../definitions/types'; @@ -269,11 +271,7 @@ describe('autocomplete', () => { `dissect keywordField ${constantPattern} |`, ]; for (const subExpression of subExpressions) { - // Unskip once https://github.com/elastic/kibana/issues/190070 is fixed - testSuggestions.skip( - `from a | ${subExpression} grok /`, - getFieldNamesByType(ESQL_STRING_TYPES) - ); + testSuggestions(`from a | ${subExpression} grok /`, getFieldNamesByType(ESQL_STRING_TYPES)); testSuggestions(`from a | ${subExpression} grok keywordField /`, [constantPattern], ' '); testSuggestions(`from a | ${subExpression} grok keywordField ${constantPattern} /`, ['| ']); } @@ -757,7 +755,9 @@ describe('autocomplete', () => { ); const getTypesFromParamDefs = (paramDefs: FunctionParameter[]): SupportedDataType[] => - Array.from(new Set(paramDefs.map((p) => p.type))).filter(isSupportedDataType); + Array.from(new Set(paramDefs.map((p) => p.type))).filter( + isSupportedDataType + ) as SupportedDataType[]; const suggestedConstants = param.literalSuggestions || param.literalOptions; @@ -782,7 +782,9 @@ describe('autocomplete', () => { ), ...getFunctionSignaturesByReturnType( 'eval', - getTypesFromParamDefs(acceptsFieldParamDefs), + getTypesFromParamDefs(acceptsFieldParamDefs).filter( + isReturnType + ) as FunctionReturnType[], { scalar: true }, undefined, [fn.name] @@ -806,7 +808,7 @@ describe('autocomplete', () => { ), ...getFunctionSignaturesByReturnType( 'eval', - getTypesFromParamDefs(acceptsFieldParamDefs), + getTypesFromParamDefs(acceptsFieldParamDefs) as FunctionReturnType[], { scalar: true }, undefined, [fn.name] @@ -855,13 +857,7 @@ describe('autocomplete', () => { ], ' ' ); - testSuggestions('from a | eval a = 1 year /', [ - ',', - '| ', - ...getFunctionSignaturesByReturnType('eval', 'any', { builtin: true, skipAssign: true }, [ - 'time_interval', - ]), - ]); + testSuggestions('from a | eval a = 1 year /', [',', '| ', 'IS NOT NULL', 'IS NULL']); testSuggestions('from a | eval a = 1 day + 2 /', [',', '| ']); testSuggestions( 'from a | eval 1 day + 2 /', @@ -1024,8 +1020,7 @@ describe('autocomplete', () => { ]); // DISSECT field - // enable once https://github.com/elastic/kibana/issues/190070 is fixed - testSuggestions.skip('FROM index1 | DISSECT b/', getFieldNamesByType(ESQL_STRING_TYPES)); + testSuggestions('FROM index1 | DISSECT b/', getFieldNamesByType(ESQL_STRING_TYPES)); // DROP (first field) testSuggestions('FROM index1 | DROP f/', getFieldNamesByType('any')); @@ -1057,8 +1052,7 @@ describe('autocomplete', () => { ]); // GROK field - // enable once https://github.com/elastic/kibana/issues/190070 - testSuggestions.skip('FROM index1 | GROK f/', getFieldNamesByType(ESQL_STRING_TYPES)); + testSuggestions('FROM index1 | GROK f/', getFieldNamesByType(ESQL_STRING_TYPES), undefined); // KEEP (first field) testSuggestions('FROM index1 | KEEP f/', getFieldNamesByType('any')); @@ -1363,5 +1357,167 @@ describe('autocomplete', () => { ['keyword'] ).map((s) => (s.text.toLowerCase().includes('null') ? s : attachTriggerCommand(s))) ); + describe('field lists', () => { + // KEEP field + testSuggestions('FROM a | KEEP /', getFieldNamesByType('any').map(attachTriggerCommand)); + testSuggestions( + 'FROM a | KEEP d/', + getFieldNamesByType('any') + .map((text) => ({ + text, + rangeToReplace: { start: 15, end: 16 }, + })) + .map(attachTriggerCommand) + ); + testSuggestions( + 'FROM a | KEEP doubleFiel/', + getFieldNamesByType('any').map(attachTriggerCommand) + ); + testSuggestions( + 'FROM a | KEEP doubleField/', + ['doubleField, ', 'doubleField | '] + .map((text) => ({ + text, + filterText: 'doubleField', + rangeToReplace: { start: 15, end: 26 }, + })) + .map(attachTriggerCommand) + ); + testSuggestions('FROM a | KEEP doubleField /', ['| ', ',']); + + // Let's get funky with the field names + testSuggestions( + 'FROM a | KEEP @timestamp/', + ['@timestamp, ', '@timestamp | '] + .map((text) => ({ + text, + filterText: '@timestamp', + rangeToReplace: { start: 15, end: 25 }, + })) + .map(attachTriggerCommand), + undefined, + [[{ name: '@timestamp', type: 'date' }]] + ); + testSuggestions( + 'FROM a | KEEP foo.bar/', + ['foo.bar, ', 'foo.bar | '] + .map((text) => ({ + text, + filterText: 'foo.bar', + rangeToReplace: { start: 15, end: 22 }, + })) + .map(attachTriggerCommand), + undefined, + [[{ name: 'foo.bar', type: 'double' }]] + ); + + // @todo re-enable these tests when we can use AST to support this case + testSuggestions.skip('FROM a | KEEP `foo.bar`/', ['foo.bar, ', 'foo.bar | '], undefined, [ + [{ name: 'foo.bar', type: 'double' }], + ]); + testSuggestions.skip('FROM a | KEEP `foo`.`bar`/', ['foo.bar, ', 'foo.bar | '], undefined, [ + [{ name: 'foo.bar', type: 'double' }], + ]); + testSuggestions.skip('FROM a | KEEP `any#Char$Field`/', [ + '`any#Char$Field`, ', + '`any#Char$Field` | ', + ]); + + // Subsequent fields + testSuggestions( + 'FROM a | KEEP doubleField, dateFiel/', + getFieldNamesByType('any') + .filter((s) => s !== 'doubleField') + .map(attachTriggerCommand) + ); + testSuggestions('FROM a | KEEP doubleField, dateField/', ['dateField, ', 'dateField | ']); + }); + }); + + describe('Replacement ranges are attached when needed', () => { + testSuggestions('FROM a | WHERE doubleField IS NOT N/', [ + { text: 'IS NOT NULL', rangeToReplace: { start: 28, end: 35 } }, + { text: 'IS NULL', rangeToReplace: { start: 35, end: 35 } }, + '!= $0', + '< $0', + '<= $0', + '== $0', + '> $0', + '>= $0', + 'IN $0', + ]); + testSuggestions('FROM a | WHERE doubleField IS N/', [ + { text: 'IS NOT NULL', rangeToReplace: { start: 28, end: 31 } }, + { text: 'IS NULL', rangeToReplace: { start: 28, end: 31 } }, + { text: '!= $0', rangeToReplace: { start: 31, end: 31 } }, + '< $0', + '<= $0', + '== $0', + '> $0', + '>= $0', + 'IN $0', + ]); + testSuggestions('FROM a | EVAL doubleField IS NOT N/', [ + { text: 'IS NOT NULL', rangeToReplace: { start: 27, end: 34 } }, + 'IS NULL', + '% $0', + '* $0', + '+ $0', + '- $0', + '/ $0', + '!= $0', + '< $0', + '<= $0', + '== $0', + '> $0', + '>= $0', + 'IN $0', + ]); + testSuggestions('FROM a | SORT doubleField IS NOT N/', [ + { text: 'IS NOT NULL', rangeToReplace: { start: 27, end: 34 } }, + 'IS NULL', + '% $0', + '* $0', + '+ $0', + '- $0', + '/ $0', + '!= $0', + '< $0', + '<= $0', + '== $0', + '> $0', + '>= $0', + 'IN $0', + ]); + describe('dot-separated field names', () => { + testSuggestions( + 'FROM a | KEEP field.nam/', + [{ text: 'field.name', rangeToReplace: { start: 15, end: 24 } }], + undefined, + [[{ name: 'field.name', type: 'double' }]] + ); + // multi-line + testSuggestions( + 'FROM a\n| KEEP field.nam/', + [{ text: 'field.name', rangeToReplace: { start: 15, end: 24 } }], + undefined, + [[{ name: 'field.name', type: 'double' }]] + ); + // triple separator + testSuggestions( + 'FROM a\n| KEEP field.name.f/', + [{ text: 'field.name.foo', rangeToReplace: { start: 15, end: 27 } }], + undefined, + [[{ name: 'field.name.foo', type: 'double' }]] + ); + // whitespace — we can't support this case yet because + // we are relying on string checking instead of the AST :( + testSuggestions.skip( + 'FROM a | KEEP field . n/', + [{ text: 'field . name', rangeToReplace: { start: 15, end: 23 } }], + undefined, + [[{ name: 'field.name', type: 'double' }]] + ); + }); }); }); diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts index e775c3f05fe5f..556e4860738d7 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts @@ -20,7 +20,7 @@ import { partition } from 'lodash'; import { ESQL_NUMBER_TYPES, compareTypesWithLiterals, isNumericType } from '../shared/esql_types'; import type { EditorContext, SuggestionRawDefinition } from './types'; import { - lookupColumn, + getColumnForASTNode, getCommandDefinition, getCommandOption, getFunctionDefinition, @@ -46,6 +46,7 @@ import { getColumnExists, findPreviousWord, noCaseCompare, + getColumnByName, } from '../shared/helpers'; import { collectVariables, excludeVariablesFromCurrentCommand } from '../shared/variables'; import type { ESQLPolicy, ESQLRealField, ESQLVariable, ReferenceMaps } from '../validation/types'; @@ -76,6 +77,7 @@ import { buildValueDefinitions, getDateLiterals, buildFieldsDefinitionsWithMetadata, + TRIGGER_SUGGESTION_COMMAND, } from './factories'; import { EDITOR_MARKER, SINGLE_BACKTICK, METADATA_FIELDS } from '../shared/constants'; import { getAstContext, removeMarkerArgFromArgsList } from '../shared/context'; @@ -88,6 +90,7 @@ import { import { ESQLCallbacks } from '../shared/types'; import { getFunctionsToIgnoreForStats, + getOverlapRange, getParamAtPosition, getQueryForFields, getSourcesFromCommands, @@ -95,7 +98,13 @@ import { isAggFunctionUsedAlready, removeQuoteForSuggestedSources, } from './helper'; -import { FunctionParameter, FunctionReturnType, SupportedDataType } from '../definitions/types'; +import { + FunctionParameter, + FunctionReturnType, + SupportedDataType, + isParameterType, + isReturnType, +} from '../definitions/types'; type GetSourceFn = () => Promise; type GetDataStreamsForIntegrationFn = ( @@ -104,7 +113,7 @@ type GetDataStreamsForIntegrationFn = ( type GetFieldsByTypeFn = ( type: string | string[], ignored?: string[], - options?: { advanceCursorAndOpenSuggestions?: boolean; addComma?: boolean } + options?: { advanceCursor?: boolean; openSuggestions?: boolean; addComma?: boolean } ) => Promise; type GetFieldsMapFn = () => Promise>; type GetPoliciesFn = () => Promise; @@ -349,8 +358,8 @@ function getSourcesRetriever(resourceRetriever?: ESQLCallbacks) { return buildSourcesDefinitions( list .filter(({ hidden }) => !hidden) - .map(({ name, dataStreams, title }) => { - return { name, isIntegration: Boolean(dataStreams && dataStreams.length), title }; + .map(({ name, dataStreams, title, type }) => { + return { name, isIntegration: Boolean(dataStreams && dataStreams.length), title, type }; }) ); }; @@ -381,7 +390,7 @@ function workoutBuiltinOptions( ): { skipAssign: boolean } { // skip assign operator if it's a function or an existing field to avoid promoting shadowing return { - skipAssign: Boolean(!isColumnItem(nodeArg) || lookupColumn(nodeArg, references)), + skipAssign: Boolean(!isColumnItem(nodeArg) || getColumnForASTNode(nodeArg, references)), }; } @@ -455,7 +464,7 @@ function extractFinalTypeFromArg( return arg.literalType; } if (isColumnItem(arg)) { - const hit = lookupColumn(arg, references); + const hit = getColumnForASTNode(arg, references); if (hit) { return hit.type; } @@ -656,31 +665,81 @@ async function getExpressionSuggestionsByType( } // Suggest fields or variables if (argDef.type === 'column' || argDef.type === 'any') { - // ... | if ((!nodeArg || isNewExpression) && !endsWithNot) { - suggestions.push( - ...(await getFieldsOrFunctionsSuggestions( - [argDef.innerType || 'any'], - command.name, - option?.name, - getFieldsByType, - { - // TODO instead of relying on canHaveAssignments and other command name checks - // we should have a more generic way to determine if a command can have functions. - // I think it comes down to the definition of 'column' since 'any' should always - // include functions. - functions: canHaveAssignments || command.name === 'sort', - fields: !argDef.constantOnly, - variables: anyVariables, - literals: argDef.constantOnly, - }, - { - ignoreFields: isNewExpression - ? command.args.filter(isColumnItem).map(({ name }) => name) - : [], - } - )) + const fieldSuggestions = await getFieldsOrFunctionsSuggestions( + argDef.innerTypes || ['any'], + command.name, + option?.name, + getFieldsByType, + { + // TODO instead of relying on canHaveAssignments and other command name checks + // we should have a more generic way to determine if a command can have functions. + // I think it comes down to the definition of 'column' since 'any' should always + // include functions. + functions: canHaveAssignments || command.name === 'sort', + fields: !argDef.constantOnly, + variables: anyVariables, + literals: argDef.constantOnly, + }, + { + ignoreFields: isNewExpression + ? command.args.filter(isColumnItem).map(({ name }) => name) + : [], + } ); + + /** + * @TODO — this string manipulation is crude and can't support all cases + * Checking for a partial word and computing the replacement range should + * really be done using the AST node, but we'll have to refactor further upstream + * to make that available. This is a quick fix to support the most common case. + */ + const words = innerText.split(/\s+/); + const lastWord = words[words.length - 1]; + if (lastWord !== '') { + // ... | + + const rangeToReplace = { + start: innerText.length - lastWord.length + 1, + end: innerText.length + 1, + }; + + // check if lastWord is an existing field + const column = getColumnByName(lastWord, references); + if (column) { + // now we know that the user has already entered a column, + // so suggest comma and pipe + // const NON_ALPHANUMERIC_REGEXP = /[^a-zA-Z\d]/g; + // const textToUse = lastWord.replace(NON_ALPHANUMERIC_REGEXP, ''); + const textToUse = lastWord; + return [ + { ...pipeCompleteItem, text: ' | ' }, + { ...commaCompleteItem, text: ', ' }, + ].map((s) => ({ + ...s, + filterText: textToUse, + text: textToUse + s.text, + command: TRIGGER_SUGGESTION_COMMAND, + rangeToReplace, + })); + } else { + suggestions.push( + ...fieldSuggestions.map((suggestion) => ({ + ...suggestion, + command: TRIGGER_SUGGESTION_COMMAND, + rangeToReplace, + })) + ); + } + } else { + // ... | + suggestions.push( + ...fieldSuggestions.map((suggestion) => ({ + ...suggestion, + command: TRIGGER_SUGGESTION_COMMAND, + })) + ); + } } } if (argDef.type === 'function' || argDef.type === 'any') { @@ -688,7 +747,7 @@ async function getExpressionSuggestionsByType( // ... | STATS a // ... | EVAL a const nodeArgType = extractFinalTypeFromArg(nodeArg, references); - if (nodeArgType) { + if (isParameterType(nodeArgType)) { suggestions.push( ...getBuiltinCompatibleFunctionDefinition( command.name, @@ -746,7 +805,7 @@ async function getExpressionSuggestionsByType( ...getBuiltinCompatibleFunctionDefinition( command.name, undefined, - nodeArgType || 'any', + isParameterType(nodeArgType) ? nodeArgType : 'any', undefined, workoutBuiltinOptions(rightArg, references) ) @@ -784,6 +843,7 @@ async function getExpressionSuggestionsByType( const nodeArgType = extractFinalTypeFromArg(nodeArg, references); suggestions.push( ...(await getBuiltinFunctionNextArgument( + innerText, command, option, argDef, @@ -836,7 +896,7 @@ async function getExpressionSuggestionsByType( // ... | // In this case start suggesting something not strictly based on type suggestions.push( - ...(await getFieldsByType('any', [], { advanceCursorAndOpenSuggestions: true })), + ...(await getFieldsByType('any', [], { advanceCursor: true, openSuggestions: true })), ...(await getFieldsOrFunctionsSuggestions( ['any'], command.name, @@ -859,7 +919,7 @@ async function getExpressionSuggestionsByType( // i.e. ... | field >= // i.e. ... | field > 0 // i.e. ... | field + otherN - + // "FROM a | WHERE doubleField IS NOT N" if (nodeArgType) { if (isFunctionItem(nodeArg)) { if (nodeArg.name === 'not') { @@ -879,6 +939,7 @@ async function getExpressionSuggestionsByType( } else { suggestions.push( ...(await getBuiltinFunctionNextArgument( + innerText, command, option, argDef, @@ -889,7 +950,7 @@ async function getExpressionSuggestionsByType( )) ); } - } else { + } else if (isParameterType(nodeArgType)) { // i.e. ... | field suggestions.push( ...getBuiltinCompatibleFunctionDefinition( @@ -906,7 +967,7 @@ async function getExpressionSuggestionsByType( } } if (argDef.type === 'source') { - if (argDef.innerType === 'policy') { + if (argDef.innerTypes?.includes('policy')) { // ... | ENRICH const policies = await getPolicies(); suggestions.push(...(policies.length ? policies : [buildNoPoliciesAvailableDefinition()])); @@ -988,6 +1049,7 @@ async function getExpressionSuggestionsByType( } async function getBuiltinFunctionNextArgument( + queryText: string, command: ESQLCommand, option: ESQLCommandOption | undefined, argDef: { type: string }, @@ -1006,7 +1068,7 @@ async function getBuiltinFunctionNextArgument( ...getBuiltinCompatibleFunctionDefinition( command.name, option?.name, - nodeArgType || 'any', + isParameterType(nodeArgType) ? nodeArgType : 'any', undefined, workoutBuiltinOptions(nodeArg, references) ) @@ -1058,7 +1120,11 @@ async function getBuiltinFunctionNextArgument( if (isFnComplete.reason === 'wrongTypes') { if (nestedType) { // suggest something to complete the builtin function - if (nestedType !== argDef.type) { + if ( + nestedType !== argDef.type && + isParameterType(nestedType) && + isReturnType(argDef.type) + ) { suggestions.push( ...getBuiltinCompatibleFunctionDefinition( command.name, @@ -1072,7 +1138,16 @@ async function getBuiltinFunctionNextArgument( } } } - return suggestions; + return suggestions.map((s) => { + const overlap = getOverlapRange(queryText, s.text); + return { + ...s, + rangeToReplace: { + start: overlap.start, + end: overlap.end, + }, + }; + }); } function pushItUpInTheList(suggestions: SuggestionRawDefinition[], shouldPromote: boolean) { @@ -1115,7 +1190,8 @@ async function getFieldsOrFunctionsSuggestions( const filteredFieldsByType = pushItUpInTheList( (await (fields ? getFieldsByType(types, ignoreFields, { - advanceCursorAndOpenSuggestions: commandName === 'sort', + advanceCursor: commandName === 'sort', + openSuggestions: commandName === 'sort', }) : [])) as SuggestionRawDefinition[], functions @@ -1344,7 +1420,8 @@ async function getFunctionArgsSuggestions( ...pushItUpInTheList( await getFieldsByType(getTypesFromParamDefs(paramDefsWhichSupportFields) as string[], [], { addComma: shouldAddComma, - advanceCursorAndOpenSuggestions: hasMoreMandatoryArgs, + advanceCursor: hasMoreMandatoryArgs, + openSuggestions: hasMoreMandatoryArgs, }), true ) @@ -1636,6 +1713,7 @@ async function getOptionArgsSuggestions( if (isFunctionItem(nodeArg) && !isFunctionArgComplete(nodeArg, references).complete) { suggestions.push( ...(await getBuiltinFunctionNextArgument( + innerText, command, option, { type: argDef?.type || 'any' }, @@ -1686,7 +1764,8 @@ async function getOptionArgsSuggestions( } else if (isNewExpression || (isAssignment(nodeArg) && !isAssignmentComplete(nodeArg))) { suggestions.push( ...(await getFieldsByType(types[0] === 'column' ? ['any'] : types, [], { - advanceCursorAndOpenSuggestions: true, + advanceCursor: true, + openSuggestions: true, })) ); diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts index f4c9ad82b80cf..4ac3b3b24d1f6 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts @@ -132,7 +132,7 @@ export function getSuggestionCommandDefinition( export const buildFieldsDefinitionsWithMetadata = ( fields: ESQLRealField[], - options?: { advanceCursorAndOpenSuggestions?: boolean; addComma?: boolean } + options?: { advanceCursor?: boolean; openSuggestions?: boolean; addComma?: boolean } ): SuggestionRawDefinition[] => { return fields.map((field) => { const description = field.metadata?.description; @@ -143,7 +143,7 @@ export const buildFieldsDefinitionsWithMetadata = ( text: getSafeInsertText(field.name) + (options?.addComma ? ',' : '') + - (options?.advanceCursorAndOpenSuggestions ? ' ' : ''), + (options?.advanceCursor ? ' ' : ''), kind: 'Variable', detail: titleCaseType, documentation: description @@ -156,7 +156,7 @@ ${description}`, : undefined, // If there is a description, it is a field from ECS, so it should be sorted to the top sortText: description ? '1D' : 'D', - command: options?.advanceCursorAndOpenSuggestions ? TRIGGER_SUGGESTION_COMMAND : undefined, + command: options?.openSuggestions ? TRIGGER_SUGGESTION_COMMAND : undefined, }; }); }; @@ -187,9 +187,9 @@ export const buildVariablesDefinitions = (variables: string[]): SuggestionRawDef })); export const buildSourcesDefinitions = ( - sources: Array<{ name: string; isIntegration: boolean; title?: string }> + sources: Array<{ name: string; isIntegration: boolean; title?: string; type?: string }> ): SuggestionRawDefinition[] => - sources.map(({ name, isIntegration, title }) => ({ + sources.map(({ name, isIntegration, title, type }) => ({ label: title ?? name, text: getSafeInsertSourceText(name) + (!isIntegration ? ' ' : ''), isSnippet: isIntegration, @@ -199,7 +199,10 @@ export const buildSourcesDefinitions = ( defaultMessage: `Integration`, }) : i18n.translate('kbn-esql-validation-autocomplete.esql.autocomplete.sourceDefinition', { - defaultMessage: `Index`, + defaultMessage: '{type}', + values: { + type: type ?? 'Index', + }, }), sortText: 'A', command: TRIGGER_SUGGESTION_COMMAND, diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts index 65f6601c51c13..7d4c8c9cc111e 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts @@ -92,3 +92,42 @@ export function getSupportedTypesForBinaryOperators( .map(({ params }) => params[1].type) : [previousType]; } + +/** + * Checks the suggestion text for overlap with the current query. + * + * This is useful to determine the range of the existing query that should be + * replaced if the suggestion is accepted. + * + * For example + * QUERY: FROM source | WHERE field IS NO + * SUGGESTION: IS NOT NULL + * + * The overlap is "IS NO" and the range to replace is "IS NO" in the query. + * + * @param query + * @param suggestionText + * @returns + */ +export function getOverlapRange( + query: string, + suggestionText: string +): { start: number; end: number } { + let overlapLength = 0; + + // Convert both strings to lowercase for case-insensitive comparison + const lowerQuery = query.toLowerCase(); + const lowerSuggestionText = suggestionText.toLowerCase(); + + for (let i = 0; i <= lowerSuggestionText.length; i++) { + const substr = lowerSuggestionText.substring(0, i); + if (lowerQuery.endsWith(substr)) { + overlapLength = i; + } + } + + return { + start: Math.min(query.length - overlapLength + 1, query.length), + end: query.length, + }; +} diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts index f431eb9a27145..dc2624add8273 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/types.ts @@ -27,6 +27,8 @@ export interface SuggestionRawDefinition { label: string; /* The actual text to insert into the editor */ text: string; + /* Text to use for filtering the suggestions */ + filterText?: string; /** * Should the text be inserted as a snippet? * That is usually used for special behaviour like moving the cursor in a specific position @@ -57,6 +59,13 @@ export interface SuggestionRawDefinition { title: string; id: string; }; + /** + * The range that should be replaced when the suggestion is applied + */ + rangeToReplace?: { + start: number; + end: number; + }; } export interface EditorContext { diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/aggs.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/aggs.ts index 262d7a2fc7b32..4ce0ad1a0f230 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/aggs.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/aggs.ts @@ -155,6 +155,18 @@ export const statsAggregationFunctionDefinitions: FunctionDefinition[] = [ params: [{ name: 'column', type: 'ip', noNestingFunctions: true }], returnType: 'ip', }, + { + params: [{ name: 'column', type: 'version', noNestingFunctions: true }], + returnType: 'version', + }, + { + params: [{ name: 'column', type: 'keyword', noNestingFunctions: true }], + returnType: 'keyword', + }, + { + params: [{ name: 'column', type: 'text', noNestingFunctions: true }], + returnType: 'text', + }, ], examples: [`from index | stats result = max(field)`, `from index | stats max(field)`], }, @@ -186,6 +198,18 @@ export const statsAggregationFunctionDefinitions: FunctionDefinition[] = [ params: [{ name: 'column', type: 'ip', noNestingFunctions: true }], returnType: 'ip', }, + { + params: [{ name: 'column', type: 'version', noNestingFunctions: true }], + returnType: 'version', + }, + { + params: [{ name: 'column', type: 'keyword', noNestingFunctions: true }], + returnType: 'keyword', + }, + { + params: [{ name: 'column', type: 'text', noNestingFunctions: true }], + returnType: 'text', + }, ], examples: [`from index | stats result = min(field)`, `from index | stats min(field)`], }, diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/commands.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/commands.ts index 1718841711602..2e67461f073c2 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/commands.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/commands.ts @@ -415,8 +415,7 @@ export const commandDefinitions: CommandDefinition[] = [ signature: { multipleParams: false, params: [ - // innerType: 'string' is interpreted as keyword and text (see columnParamsWithInnerTypes) - { name: 'column', type: 'column', innerType: 'string' }, + { name: 'column', type: 'column', innerTypes: ['keyword', 'text'] }, { name: 'pattern', type: 'string', constantOnly: true }, ], }, @@ -433,8 +432,7 @@ export const commandDefinitions: CommandDefinition[] = [ signature: { multipleParams: false, params: [ - // innerType: 'string' is interpreted as keyword and text (see columnParamsWithInnerTypes) - { name: 'column', type: 'column', innerType: 'string' }, + { name: 'column', type: 'column', innerTypes: ['keyword', 'text'] }, { name: 'pattern', type: 'string', constantOnly: true }, ], }, @@ -449,7 +447,7 @@ export const commandDefinitions: CommandDefinition[] = [ modes: [], signature: { multipleParams: false, - params: [{ name: 'column', type: 'column', innerType: 'any' }], + params: [{ name: 'column', type: 'column', innerTypes: ['any'] }], }, }, { @@ -467,7 +465,7 @@ export const commandDefinitions: CommandDefinition[] = [ modes: [ENRICH_MODES], signature: { multipleParams: false, - params: [{ name: 'policyName', type: 'source', innerType: 'policy' }], + params: [{ name: 'policyName', type: 'source', innerTypes: ['policy'] }], }, }, ]; diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts index eec90bcd75c6a..c627bc0a62176 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts @@ -3268,16 +3268,6 @@ const mvCountDefinition: FunctionDefinition = { ], returnType: 'integer', }, - { - params: [ - { - name: 'field', - type: 'date_nanos', - optional: false, - }, - ], - returnType: 'integer', - }, { params: [ { @@ -3581,16 +3571,6 @@ const mvFirstDefinition: FunctionDefinition = { ], returnType: 'cartesian_shape', }, - { - params: [ - { - name: 'field', - type: 'date_nanos', - optional: false, - }, - ], - returnType: 'date_nanos', - }, { params: [ { @@ -3748,16 +3728,6 @@ const mvLastDefinition: FunctionDefinition = { ], returnType: 'cartesian_shape', }, - { - params: [ - { - name: 'field', - type: 'date_nanos', - optional: false, - }, - ], - returnType: 'date_nanos', - }, { params: [ { @@ -3895,16 +3865,6 @@ const mvMaxDefinition: FunctionDefinition = { ], returnType: 'boolean', }, - { - params: [ - { - name: 'field', - type: 'date_nanos', - optional: false, - }, - ], - returnType: 'date_nanos', - }, { params: [ { @@ -4085,16 +4045,6 @@ const mvMinDefinition: FunctionDefinition = { ], returnType: 'boolean', }, - { - params: [ - { - name: 'field', - type: 'date_nanos', - optional: false, - }, - ], - returnType: 'date_nanos', - }, { params: [ { @@ -4195,6 +4145,160 @@ const mvMinDefinition: FunctionDefinition = { ], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const mvPercentileDefinition: FunctionDefinition = { + type: 'eval', + name: 'mv_percentile', + description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.mv_percentile', { + defaultMessage: + 'Converts a multivalued field into a single valued field containing the value at which a certain percentage of observed values occur.', + }), + alias: undefined, + signatures: [ + { + params: [ + { + name: 'number', + type: 'double', + optional: false, + }, + { + name: 'percentile', + type: 'double', + optional: false, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'number', + type: 'double', + optional: false, + }, + { + name: 'percentile', + type: 'integer', + optional: false, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'number', + type: 'double', + optional: false, + }, + { + name: 'percentile', + type: 'long', + optional: false, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'number', + type: 'integer', + optional: false, + }, + { + name: 'percentile', + type: 'double', + optional: false, + }, + ], + returnType: 'integer', + }, + { + params: [ + { + name: 'number', + type: 'integer', + optional: false, + }, + { + name: 'percentile', + type: 'integer', + optional: false, + }, + ], + returnType: 'integer', + }, + { + params: [ + { + name: 'number', + type: 'integer', + optional: false, + }, + { + name: 'percentile', + type: 'long', + optional: false, + }, + ], + returnType: 'integer', + }, + { + params: [ + { + name: 'number', + type: 'long', + optional: false, + }, + { + name: 'percentile', + type: 'double', + optional: false, + }, + ], + returnType: 'long', + }, + { + params: [ + { + name: 'number', + type: 'long', + optional: false, + }, + { + name: 'percentile', + type: 'integer', + optional: false, + }, + ], + returnType: 'long', + }, + { + params: [ + { + name: 'number', + type: 'long', + optional: false, + }, + { + name: 'percentile', + type: 'long', + optional: false, + }, + ], + returnType: 'long', + }, + ], + supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'], + supportedOptions: ['by'], + validate: undefined, + examples: [ + 'ROW values = [5, 5, 10, 12, 5000]\n| EVAL p50 = MV_PERCENTILE(values, 50), median = MV_MEDIAN(values)', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const mvPseriesWeightedSumDefinition: FunctionDefinition = { type: 'eval', @@ -8373,6 +8477,7 @@ export const evalFunctionDefinitions = [ mvMaxDefinition, mvMedianDefinition, mvMinDefinition, + mvPercentileDefinition, mvPseriesWeightedSumDefinition, mvSliceDefinition, mvSortDefinition, diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/helpers.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/helpers.ts index 3773a7c30e3d1..a50780ac8ea95 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/helpers.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/helpers.ts @@ -41,7 +41,7 @@ function handleAdditionalArgs( criteria: boolean, additionalArgs: Array<{ name: string; - type: string | string[]; + type: FunctionParameterType | FunctionParameterType[]; optional?: boolean; reference?: string; }>, @@ -93,7 +93,7 @@ function printCommandArgument( return param.name || ''; } return `${param.name}${param.optional ? ':?' : ':'} ${param.type}${ - param.innerType ? `{${param.innerType}}` : '' + param.innerTypes ? `{${param.innerTypes}}` : '' }`; } diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/types.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/types.ts index d41a18ba99cfe..5880b62c77918 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/types.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/types.ts @@ -69,30 +69,42 @@ export const isSupportedDataType = ( * * The fate of these is uncertain. They may be removed in the future. */ -type ArrayType = - | 'double[]' - | 'unsigned_long[]' - | 'long[]' - | 'integer[]' - | 'counter_integer[]' - | 'counter_long[]' - | 'counter_double[]' - | 'keyword[]' - | 'text[]' - | 'boolean[]' - | 'any[]' - | 'date[]' - | 'date_period[]'; +const arrayTypes = [ + 'double[]', + 'unsigned_long[]', + 'long[]', + 'integer[]', + 'counter_integer[]', + 'counter_long[]', + 'counter_double[]', + 'keyword[]', + 'text[]', + 'boolean[]', + 'any[]', + 'date[]', + 'date_period[]', +] as const; + +export type ArrayType = (typeof arrayTypes)[number]; /** * This is the type of a parameter in a function definition. */ -export type FunctionParameterType = Omit | ArrayType | 'any'; +export type FunctionParameterType = Exclude | ArrayType | 'any'; + +export const isParameterType = (str: string | undefined): str is FunctionParameterType => + typeof str !== undefined && + str !== 'unsupported' && + ([...dataTypes, ...arrayTypes, 'any'] as string[]).includes(str as string); /** * This is the return type of a function definition. */ -export type FunctionReturnType = Omit | 'any' | 'void'; +export type FunctionReturnType = Exclude | 'any' | 'void'; + +export const isReturnType = (str: string | FunctionParameterType): str is FunctionReturnType => + str !== 'unsupported' && + (dataTypes.includes(str as SupportedDataType) || str === 'any' || str === 'void'); export interface FunctionDefinition { type: 'builtin' | 'agg' | 'eval'; @@ -154,13 +166,13 @@ export interface CommandBaseDefinition { hidden?: boolean; signature: { multipleParams: boolean; - // innerType here is useful to drill down the type in case of "column" + // innerTypes here is useful to drill down the type in case of "column" // i.e. column of type string params: Array<{ name: string; type: string; optional?: boolean; - innerType?: string; + innerTypes?: string[]; values?: string[]; valueDescriptions?: string[]; constantOnly?: boolean; diff --git a/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts index 0b9f704a43bcc..eb058558638b0 100644 --- a/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts +++ b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts @@ -40,6 +40,7 @@ import { FunctionDefinition, FunctionParameterType, FunctionReturnType, + ArrayType, } from '../definitions/types'; import type { ESQLRealField, ESQLVariable, ReferenceMaps } from '../validation/types'; import { removeMarkerArgFromArgsList } from './context'; @@ -248,28 +249,36 @@ function compareLiteralType(argType: string, item: ESQLLiteral) { /** * This function returns the variable or field matching a column */ -export function lookupColumn( +export function getColumnForASTNode( column: ESQLColumn, { fields, variables }: Pick ): ESQLRealField | ESQLVariable | undefined { const columnName = getQuotedColumnName(column); return ( - fields.get(columnName) || - variables.get(columnName)?.[0] || + getColumnByName(columnName, { fields, variables }) || // It's possible columnName has backticks "`fieldName`" // so we need to access the original name as well - fields.get(column.name) || - variables.get(column.name)?.[0] + getColumnByName(column.name, { fields, variables }) ); } +/** + * This function returns the variable or field matching a column + */ +export function getColumnByName( + columnName: string, + { fields, variables }: Pick +): ESQLRealField | ESQLVariable | undefined { + return fields.get(columnName) || variables.get(columnName)?.[0]; +} + const ARRAY_REGEXP = /\[\]$/; -export function isArrayType(type: string) { +export function isArrayType(type: string): type is ArrayType { return ARRAY_REGEXP.test(type); } -const arrayToSingularMap: Map = new Map([ +const arrayToSingularMap: Map = new Map([ ['double[]', 'double'], ['unsigned_long[]', 'unsigned_long'], ['long[]', 'long'], @@ -279,7 +288,7 @@ const arrayToSingularMap: Map = ne ['counter_double[]', 'counter_double'], ['keyword[]', 'keyword'], ['text[]', 'text'], - ['datetime[]', 'date'], + ['date[]', 'date'], ['date_period[]', 'date_period'], ['boolean[]', 'boolean'], ['any[]', 'any'], @@ -289,7 +298,7 @@ const arrayToSingularMap: Map = ne * Given an array type for example `string[]` it will return `string` */ export function extractSingularType(type: FunctionParameterType): FunctionParameterType { - return arrayToSingularMap.get(type) ?? type; + return isArrayType(type) ? arrayToSingularMap.get(type)! : type; } export function createMapFromList(arr: T[]): Map { @@ -378,7 +387,7 @@ export function getAllArrayTypes( types.push(subArg.literalType); } if (subArg.type === 'column') { - const hit = lookupColumn(subArg, references); + const hit = getColumnForASTNode(subArg, references); types.push(hit?.type || 'unsupported'); } if (subArg.type === 'timeInterval') { @@ -445,7 +454,7 @@ export function checkFunctionArgMatchesDefinition( return argType === 'time_literal' && inKnownTimeInterval(arg); } if (arg.type === 'column') { - const hit = lookupColumn(arg, references); + const hit = getColumnForASTNode(arg, references); const validHit = hit; if (!validHit) { return false; diff --git a/packages/kbn-esql-validation-autocomplete/src/shared/types.ts b/packages/kbn-esql-validation-autocomplete/src/shared/types.ts index 08e1cdccc37a3..04a8365c5e51c 100644 --- a/packages/kbn-esql-validation-autocomplete/src/shared/types.ts +++ b/packages/kbn-esql-validation-autocomplete/src/shared/types.ts @@ -20,6 +20,7 @@ export interface ESQLCallbacks { hidden: boolean; title?: string; dataStreams?: Array<{ name: string; title?: string }>; + type?: string; } >; getFieldsFor?: CallbackFn<{ query: string }, ESQLRealField>; diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts index c24a44dadef40..06d23a30c441d 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts @@ -89,7 +89,7 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => { ]); }); - test.skip('errors on unknown index', async () => { + test('errors on unknown index', async () => { const { expectErrors } = await setup(); await expectErrors(`FROM index, missingIndex`, ['Unknown index [missingIndex]']); diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json b/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json index 9eecf5156a892..75d45e85bd11a 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json +++ b/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json @@ -2685,7 +2685,7 @@ { "query": "from a_index | dissect doubleField \"%{firstWord}\"", "error": [ - "DISSECT only supports string type values, found [doubleField] of type [double]" + "DISSECT only supports keyword, text types values, found [doubleField] of type [double]" ], "warning": [] }, @@ -2779,7 +2779,7 @@ { "query": "from a_index | grok doubleField \"%{firstWord}\"", "error": [ - "GROK only supports string type values, found [doubleField] of type [double]" + "GROK only supports keyword, text types values, found [doubleField] of type [double]" ], "warning": [] }, @@ -16333,21 +16333,6 @@ "error": [], "warning": [] }, - { - "query": "from a_index | where mv_count(dateNanosField) > 0", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval var = mv_count(dateNanosField)", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval mv_count(dateNanosField)", - "error": [], - "warning": [] - }, { "query": "row var = mv_dedupe(true)", "error": [], @@ -17311,16 +17296,6 @@ "error": [], "warning": [] }, - { - "query": "from a_index | eval var = mv_first(dateNanosField)", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval mv_first(dateNanosField)", - "error": [], - "warning": [] - }, { "query": "row var = mv_last(true)", "error": [], @@ -17810,16 +17785,6 @@ "error": [], "warning": [] }, - { - "query": "from a_index | eval var = mv_last(dateNanosField)", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval mv_last(dateNanosField)", - "error": [], - "warning": [] - }, { "query": "row var = mv_max(true)", "error": [], @@ -18140,16 +18105,6 @@ "error": [], "warning": [] }, - { - "query": "from a_index | eval var = mv_max(dateNanosField)", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval mv_max(dateNanosField)", - "error": [], - "warning": [] - }, { "query": "row var = mv_median(5.5)", "error": [], @@ -18620,16 +18575,6 @@ "error": [], "warning": [] }, - { - "query": "from a_index | eval var = mv_min(dateNanosField)", - "error": [], - "warning": [] - }, - { - "query": "from a_index | eval mv_min(dateNanosField)", - "error": [], - "warning": [] - }, { "query": "row var = mv_slice(true, 5, 5)", "error": [], @@ -31915,8 +31860,162 @@ }, { "query": "from a_index | stats max(concat(\"20\", \"22\"))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats var = max(textField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats max(textField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where max(textField)", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | where max(textField) > 0", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(textField)", "error": [ - "Argument of [max] must be [double], found value [concat(\"20\",\"22\")] type [keyword]" + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(textField) > 0", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(textField)", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(textField) > 0", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | stats var = max(versionField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats max(versionField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats var = max(keywordField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats max(keywordField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where max(versionField)", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | where max(versionField) > 0", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | where max(keywordField)", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | where max(keywordField) > 0", + "error": [ + "WHERE does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(versionField)", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(versionField) > 0", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(versionField)", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(versionField) > 0", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(keywordField)", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = max(keywordField) > 0", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(keywordField)", + "error": [ + "EVAL does not support function max" + ], + "warning": [] + }, + { + "query": "from a_index | eval max(keywordField) > 0", + "error": [ + "EVAL does not support function max" ], "warning": [] }, @@ -32499,8 +32598,162 @@ }, { "query": "from a_index | stats min(concat(\"20\", \"22\"))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats var = min(textField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats min(textField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where min(textField)", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | where min(textField) > 0", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(textField)", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(textField) > 0", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(textField)", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(textField) > 0", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | stats var = min(versionField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats min(versionField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats var = min(keywordField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | stats min(keywordField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where min(versionField)", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | where min(versionField) > 0", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | where min(keywordField)", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | where min(keywordField) > 0", + "error": [ + "WHERE does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(versionField)", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(versionField) > 0", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(versionField)", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(versionField) > 0", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(keywordField)", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = min(keywordField) > 0", + "error": [ + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(keywordField)", "error": [ - "Argument of [min] must be [double], found value [concat(\"20\",\"22\")] type [keyword]" + "EVAL does not support function min" + ], + "warning": [] + }, + { + "query": "from a_index | eval min(keywordField) > 0", + "error": [ + "EVAL does not support function min" ], "warning": [] }, @@ -34937,6 +35190,42 @@ ], "warning": [] }, + { + "query": "from a_index | stats by bucket(dateField, textField)", + "error": [ + "Argument of [bucket] must be a constant, received [textField]" + ], + "warning": [] + }, + { + "query": "from a_index | stats by bin(dateField, textField)", + "error": [ + "Argument of [bin] must be a constant, received [textField]" + ], + "warning": [] + }, + { + "query": "from a_index | sort bucket(dateField, textField)", + "error": [ + "SORT does not support function bucket" + ], + "warning": [] + }, + { + "query": "from a_index | stats bucket(\"2022\", textField)", + "error": [ + "Argument of [bucket] must be a constant, received [textField]" + ], + "warning": [] + }, + { + "query": "from a_index | stats bucket(concat(\"20\", \"22\"), textField)", + "error": [ + "Argument of [bucket] must be [date], found value [concat(\"20\",\"22\")] type [keyword]", + "Argument of [bucket] must be a constant, received [textField]" + ], + "warning": [] + }, { "query": "from a_index | stats var = percentile(doubleField, doubleField)", "error": [ @@ -37079,6 +37368,307 @@ "error": [], "warning": [] }, + { + "query": "row var = mv_percentile(5.5, 5.5)", + "error": [], + "warning": [] + }, + { + "query": "row mv_percentile(5.5, 5.5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_double(true), to_double(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(5.5, 5)", + "error": [], + "warning": [] + }, + { + "query": "row mv_percentile(5.5, 5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_double(true), to_integer(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_double(true), 5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(5, 5.5)", + "error": [], + "warning": [] + }, + { + "query": "row mv_percentile(5, 5.5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_integer(true), to_double(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(5, 5)", + "error": [], + "warning": [] + }, + { + "query": "row mv_percentile(5, 5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_integer(true), to_integer(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(to_integer(true), 5)", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(5, to_double(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(5, to_integer(true))", + "error": [], + "warning": [] + }, + { + "query": "row var = mv_percentile(true, true)", + "error": [ + "Argument of [mv_percentile] must be [double], found value [true] type [boolean]", + "Argument of [mv_percentile] must be [double], found value [true] type [boolean]" + ], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(doubleField, doubleField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(booleanField, booleanField) > 0", + "error": [ + "Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]", + "Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]" + ], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(doubleField, integerField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(doubleField, longField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(integerField, doubleField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(integerField, integerField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(integerField, longField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(longField, doubleField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(longField, integerField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | where mv_percentile(longField, longField) > 0", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(doubleField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(doubleField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_double(booleanField), to_double(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(booleanField, booleanField)", + "error": [ + "Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]", + "Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]" + ], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(doubleField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(doubleField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_double(booleanField), to_integer(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(doubleField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(doubleField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_double(booleanField), longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(integerField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(integerField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_integer(booleanField), to_double(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(integerField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(integerField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_integer(booleanField), to_integer(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(integerField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(integerField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(to_integer(booleanField), longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(longField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(longField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(longField, to_double(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(longField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(longField, integerField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(longField, to_integer(booleanField))", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval var = mv_percentile(longField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(longField, longField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(doubleField, doubleField, extraArg)", + "error": [ + "Error: [mv_percentile] function expects exactly 2 arguments, got 3." + ], + "warning": [] + }, + { + "query": "from a_index | sort mv_percentile(doubleField, doubleField)", + "error": [], + "warning": [] + }, + { + "query": "from a_index | eval mv_percentile(null, null)", + "error": [], + "warning": [] + }, + { + "query": "row nullVar = null | eval mv_percentile(nullVar, nullVar)", + "error": [], + "warning": [] + }, { "query": "f", "error": [ @@ -37295,6 +37885,48 @@ ], "warning": [] }, + { + "query": "FROM index, missingIndex", + "error": [ + "Unknown index [missingIndex]" + ], + "warning": [] + }, + { + "query": "from average()", + "error": [ + "Unknown index [average()]" + ], + "warning": [] + }, + { + "query": "fRom custom_function()", + "error": [ + "Unknown index [custom_function()]" + ], + "warning": [] + }, + { + "query": "FROM indexes*", + "error": [ + "Unknown index [indexes*]" + ], + "warning": [] + }, + { + "query": "from numberField", + "error": [ + "Unknown index [numberField]" + ], + "warning": [] + }, + { + "query": "FROM policy", + "error": [ + "Unknown index [policy]" + ], + "warning": [] + }, { "query": "from index metadata _id", "error": [], diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts b/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts index ab5a7ec61329e..a4b097430851c 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts @@ -701,7 +701,7 @@ describe('validation logic', () => { // Do not try to validate the dissect pattern string testErrorsAndWarnings('from a_index | dissect textField "%{firstWord}"', []); testErrorsAndWarnings('from a_index | dissect doubleField "%{firstWord}"', [ - 'DISSECT only supports string type values, found [doubleField] of type [double]', + 'DISSECT only supports keyword, text types values, found [doubleField] of type [double]', ]); testErrorsAndWarnings('from a_index | dissect textField "%{firstWord}" option ', [ "SyntaxError: mismatched input '' expecting '='", @@ -748,11 +748,10 @@ describe('validation logic', () => { testErrorsAndWarnings('from a_index | grok textField %a', [ "SyntaxError: mismatched input '%' expecting QUOTED_STRING", ]); - // @TODO: investigate // Do not try to validate the grok pattern string testErrorsAndWarnings('from a_index | grok textField "%{firstWord}"', []); testErrorsAndWarnings('from a_index | grok doubleField "%{firstWord}"', [ - 'GROK only supports string type values, found [doubleField] of type [double]', + 'GROK only supports keyword, text types values, found [doubleField] of type [double]', ]); testErrorsAndWarnings('from a_index | grok textField "%{firstWord}" | keep firstWord', []); // testErrorsAndWarnings('from a_index | grok s* "%{a}"', [ @@ -4474,9 +4473,6 @@ describe('validation logic', () => { testErrorsAndWarnings('row mv_count(to_geopoint("POINT (30 10)"))', []); testErrorsAndWarnings('row var = mv_count(to_geopoint(to_geopoint("POINT (30 10)")))', []); testErrorsAndWarnings('row var = mv_count(to_geoshape(to_geopoint("POINT (30 10)")))', []); - testErrorsAndWarnings('from a_index | where mv_count(dateNanosField) > 0', []); - testErrorsAndWarnings('from a_index | eval var = mv_count(dateNanosField)', []); - testErrorsAndWarnings('from a_index | eval mv_count(dateNanosField)', []); }); describe('mv_dedupe', () => { @@ -4780,8 +4776,6 @@ describe('validation logic', () => { testErrorsAndWarnings('row mv_first(to_geopoint("POINT (30 10)"))', []); testErrorsAndWarnings('row var = mv_first(to_geopoint(to_geopoint("POINT (30 10)")))', []); testErrorsAndWarnings('row var = mv_first(to_geoshape(to_geopoint("POINT (30 10)")))', []); - testErrorsAndWarnings('from a_index | eval var = mv_first(dateNanosField)', []); - testErrorsAndWarnings('from a_index | eval mv_first(dateNanosField)', []); }); describe('mv_last', () => { @@ -4932,8 +4926,6 @@ describe('validation logic', () => { testErrorsAndWarnings('row mv_last(to_geopoint("POINT (30 10)"))', []); testErrorsAndWarnings('row var = mv_last(to_geopoint(to_geopoint("POINT (30 10)")))', []); testErrorsAndWarnings('row var = mv_last(to_geoshape(to_geopoint("POINT (30 10)")))', []); - testErrorsAndWarnings('from a_index | eval var = mv_last(dateNanosField)', []); - testErrorsAndWarnings('from a_index | eval mv_last(dateNanosField)', []); }); describe('mv_max', () => { @@ -5021,8 +5013,6 @@ describe('validation logic', () => { testErrorsAndWarnings('row nullVar = null | eval mv_max(nullVar)', []); testErrorsAndWarnings('from a_index | eval mv_max("2022")', []); testErrorsAndWarnings('from a_index | eval mv_max(concat("20", "22"))', []); - testErrorsAndWarnings('from a_index | eval var = mv_max(dateNanosField)', []); - testErrorsAndWarnings('from a_index | eval mv_max(dateNanosField)', []); }); describe('mv_median', () => { @@ -5160,8 +5150,6 @@ describe('validation logic', () => { testErrorsAndWarnings('row nullVar = null | eval mv_min(nullVar)', []); testErrorsAndWarnings('from a_index | eval mv_min("2022")', []); testErrorsAndWarnings('from a_index | eval mv_min(concat("20", "22"))', []); - testErrorsAndWarnings('from a_index | eval var = mv_min(dateNanosField)', []); - testErrorsAndWarnings('from a_index | eval mv_min(dateNanosField)', []); }); describe('mv_slice', () => { @@ -12282,8 +12270,86 @@ describe('validation logic', () => { testErrorsAndWarnings('from a_index | stats max(null)', []); testErrorsAndWarnings('row nullVar = null | stats max(nullVar)', []); testErrorsAndWarnings('from a_index | stats max("2022")', []); - testErrorsAndWarnings('from a_index | stats max(concat("20", "22"))', [ - 'Argument of [max] must be [double], found value [concat("20","22")] type [keyword]', + testErrorsAndWarnings('from a_index | stats max(concat("20", "22"))', []); + + testErrorsAndWarnings('from a_index | stats var = max(textField)', []); + + testErrorsAndWarnings('from a_index | stats max(textField)', []); + + testErrorsAndWarnings('from a_index | where max(textField)', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | where max(textField) > 0', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(textField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(textField) > 0', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(textField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(textField) > 0', [ + 'EVAL does not support function max', + ]); + testErrorsAndWarnings('from a_index | stats var = max(versionField)', []); + testErrorsAndWarnings('from a_index | stats max(versionField)', []); + testErrorsAndWarnings('from a_index | stats var = max(keywordField)', []); + testErrorsAndWarnings('from a_index | stats max(keywordField)', []); + + testErrorsAndWarnings('from a_index | where max(versionField)', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | where max(versionField) > 0', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | where max(keywordField)', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | where max(keywordField) > 0', [ + 'WHERE does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(versionField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(versionField) > 0', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(versionField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(versionField) > 0', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(keywordField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval var = max(keywordField) > 0', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(keywordField)', [ + 'EVAL does not support function max', + ]); + + testErrorsAndWarnings('from a_index | eval max(keywordField) > 0', [ + 'EVAL does not support function max', ]); }); @@ -12604,8 +12670,86 @@ describe('validation logic', () => { testErrorsAndWarnings('from a_index | stats min(null)', []); testErrorsAndWarnings('row nullVar = null | stats min(nullVar)', []); testErrorsAndWarnings('from a_index | stats min("2022")', []); - testErrorsAndWarnings('from a_index | stats min(concat("20", "22"))', [ - 'Argument of [min] must be [double], found value [concat("20","22")] type [keyword]', + testErrorsAndWarnings('from a_index | stats min(concat("20", "22"))', []); + + testErrorsAndWarnings('from a_index | stats var = min(textField)', []); + + testErrorsAndWarnings('from a_index | stats min(textField)', []); + + testErrorsAndWarnings('from a_index | where min(textField)', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | where min(textField) > 0', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(textField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(textField) > 0', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(textField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(textField) > 0', [ + 'EVAL does not support function min', + ]); + testErrorsAndWarnings('from a_index | stats var = min(versionField)', []); + testErrorsAndWarnings('from a_index | stats min(versionField)', []); + testErrorsAndWarnings('from a_index | stats var = min(keywordField)', []); + testErrorsAndWarnings('from a_index | stats min(keywordField)', []); + + testErrorsAndWarnings('from a_index | where min(versionField)', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | where min(versionField) > 0', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | where min(keywordField)', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | where min(keywordField) > 0', [ + 'WHERE does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(versionField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(versionField) > 0', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(versionField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(versionField) > 0', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(keywordField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval var = min(keywordField) > 0', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(keywordField)', [ + 'EVAL does not support function min', + ]); + + testErrorsAndWarnings('from a_index | eval min(keywordField) > 0', [ + 'EVAL does not support function min', ]); }); @@ -14565,6 +14709,26 @@ describe('validation logic', () => { 'Argument of [bin] must be a constant, received [longField]', ] ); + + testErrorsAndWarnings('from a_index | stats by bucket(dateField, textField)', [ + 'Argument of [bucket] must be a constant, received [textField]', + ]); + + testErrorsAndWarnings('from a_index | stats by bin(dateField, textField)', [ + 'Argument of [bin] must be a constant, received [textField]', + ]); + + testErrorsAndWarnings('from a_index | sort bucket(dateField, textField)', [ + 'SORT does not support function bucket', + ]); + + testErrorsAndWarnings('from a_index | stats bucket("2022", textField)', [ + 'Argument of [bucket] must be a constant, received [textField]', + ]); + testErrorsAndWarnings('from a_index | stats bucket(concat("20", "22"), textField)', [ + 'Argument of [bucket] must be [date], found value [concat("20","22")] type [keyword]', + 'Argument of [bucket] must be a constant, received [textField]', + ]); }); describe('percentile', () => { @@ -15807,6 +15971,171 @@ describe('validation logic', () => { [] ); }); + + describe('mv_percentile', () => { + testErrorsAndWarnings('row var = mv_percentile(5.5, 5.5)', []); + testErrorsAndWarnings('row mv_percentile(5.5, 5.5)', []); + testErrorsAndWarnings('row var = mv_percentile(to_double(true), to_double(true))', []); + testErrorsAndWarnings('row var = mv_percentile(5.5, 5)', []); + testErrorsAndWarnings('row mv_percentile(5.5, 5)', []); + testErrorsAndWarnings('row var = mv_percentile(to_double(true), to_integer(true))', []); + testErrorsAndWarnings('row var = mv_percentile(to_double(true), 5)', []); + testErrorsAndWarnings('row var = mv_percentile(5, 5.5)', []); + testErrorsAndWarnings('row mv_percentile(5, 5.5)', []); + testErrorsAndWarnings('row var = mv_percentile(to_integer(true), to_double(true))', []); + testErrorsAndWarnings('row var = mv_percentile(5, 5)', []); + testErrorsAndWarnings('row mv_percentile(5, 5)', []); + testErrorsAndWarnings('row var = mv_percentile(to_integer(true), to_integer(true))', []); + testErrorsAndWarnings('row var = mv_percentile(to_integer(true), 5)', []); + testErrorsAndWarnings('row var = mv_percentile(5, to_double(true))', []); + testErrorsAndWarnings('row var = mv_percentile(5, to_integer(true))', []); + + testErrorsAndWarnings('row var = mv_percentile(true, true)', [ + 'Argument of [mv_percentile] must be [double], found value [true] type [boolean]', + 'Argument of [mv_percentile] must be [double], found value [true] type [boolean]', + ]); + + testErrorsAndWarnings( + 'from a_index | where mv_percentile(doubleField, doubleField) > 0', + [] + ); + + testErrorsAndWarnings( + 'from a_index | where mv_percentile(booleanField, booleanField) > 0', + [ + 'Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]', + 'Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]', + ] + ); + + testErrorsAndWarnings( + 'from a_index | where mv_percentile(doubleField, integerField) > 0', + [] + ); + testErrorsAndWarnings('from a_index | where mv_percentile(doubleField, longField) > 0', []); + testErrorsAndWarnings( + 'from a_index | where mv_percentile(integerField, doubleField) > 0', + [] + ); + testErrorsAndWarnings( + 'from a_index | where mv_percentile(integerField, integerField) > 0', + [] + ); + testErrorsAndWarnings( + 'from a_index | where mv_percentile(integerField, longField) > 0', + [] + ); + testErrorsAndWarnings('from a_index | where mv_percentile(longField, doubleField) > 0', []); + testErrorsAndWarnings( + 'from a_index | where mv_percentile(longField, integerField) > 0', + [] + ); + testErrorsAndWarnings('from a_index | where mv_percentile(longField, longField) > 0', []); + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(doubleField, doubleField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(doubleField, doubleField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_double(booleanField), to_double(booleanField))', + [] + ); + + testErrorsAndWarnings('from a_index | eval mv_percentile(booleanField, booleanField)', [ + 'Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]', + 'Argument of [mv_percentile] must be [double], found value [booleanField] type [boolean]', + ]); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(doubleField, integerField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(doubleField, integerField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_double(booleanField), to_integer(booleanField))', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(doubleField, longField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(doubleField, longField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_double(booleanField), longField)', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(integerField, doubleField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(integerField, doubleField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_integer(booleanField), to_double(booleanField))', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(integerField, integerField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(integerField, integerField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_integer(booleanField), to_integer(booleanField))', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(integerField, longField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(integerField, longField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(to_integer(booleanField), longField)', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(longField, doubleField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(longField, doubleField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(longField, to_double(booleanField))', + [] + ); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(longField, integerField)', + [] + ); + testErrorsAndWarnings('from a_index | eval mv_percentile(longField, integerField)', []); + + testErrorsAndWarnings( + 'from a_index | eval var = mv_percentile(longField, to_integer(booleanField))', + [] + ); + + testErrorsAndWarnings('from a_index | eval var = mv_percentile(longField, longField)', []); + testErrorsAndWarnings('from a_index | eval mv_percentile(longField, longField)', []); + + testErrorsAndWarnings( + 'from a_index | eval mv_percentile(doubleField, doubleField, extraArg)', + ['Error: [mv_percentile] function expects exactly 2 arguments, got 3.'] + ); + + testErrorsAndWarnings('from a_index | sort mv_percentile(doubleField, doubleField)', []); + testErrorsAndWarnings('from a_index | eval mv_percentile(null, null)', []); + testErrorsAndWarnings('row nullVar = null | eval mv_percentile(nullVar, nullVar)', []); + }); }); }); diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/validation.ts b/packages/kbn-esql-validation-autocomplete/src/validation/validation.ts index 4de1adf4a3153..5a06cf3f6a246 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/validation.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/validation.ts @@ -30,7 +30,7 @@ import { import { areFieldAndVariableTypesCompatible, extractSingularType, - lookupColumn, + getColumnForASTNode, getCommandDefinition, getFunctionDefinition, isArrayType, @@ -295,7 +295,7 @@ function validateFunctionColumnArg( if ( !checkFunctionArgMatchesDefinition(actualArg, parameterDefinition, references, parentCommand) ) { - const columnHit = lookupColumn(actualArg, references); + const columnHit = getColumnForASTNode(actualArg, references); messages.push( getMessageFromId({ messageId: 'wrongArgumentType', @@ -873,18 +873,21 @@ function validateColumnForCommand( if (getColumnExists(column, references)) { const commandDef = getCommandDefinition(commandName); const columnParamsWithInnerTypes = commandDef.signature.params.filter( - ({ type, innerType }) => type === 'column' && innerType + ({ type, innerTypes }) => type === 'column' && innerTypes ); // this should be guaranteed by the columnCheck above - const columnRef = lookupColumn(column, references)!; + const columnRef = getColumnForASTNode(column, references)!; if (columnParamsWithInnerTypes.length) { - const hasSomeWrongInnerTypes = columnParamsWithInnerTypes.every(({ innerType }) => { - if (innerType === 'string' && isStringType(columnRef.type)) return false; - return innerType !== 'any' && innerType !== columnRef.type; + const hasSomeWrongInnerTypes = columnParamsWithInnerTypes.every(({ innerTypes }) => { + if (innerTypes?.includes('string') && isStringType(columnRef.type)) return false; + return innerTypes && !innerTypes.includes('any') && !innerTypes.includes(columnRef.type); }); if (hasSomeWrongInnerTypes) { - const supportedTypes = columnParamsWithInnerTypes.map(({ innerType }) => innerType); + const supportedTypes: string[] = columnParamsWithInnerTypes + .map(({ innerTypes }) => innerTypes) + .flat() + .filter((type) => type !== undefined) as string[]; messages.push( getMessageFromId({ diff --git a/packages/kbn-expandable-flyout/__mocks__/index.tsx b/packages/kbn-expandable-flyout/__mocks__/index.tsx new file mode 100644 index 0000000000000..1b35419219fbb --- /dev/null +++ b/packages/kbn-expandable-flyout/__mocks__/index.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 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 const useExpandableFlyoutApi = jest.fn(() => ({ + openFlyout: jest.fn(), + closeFlyout: jest.fn(), + openPanels: jest.fn(), + openRightPanel: jest.fn(), + openLeftPanel: jest.fn(), + openPreviewPanel: jest.fn(), + closeRightPanel: jest.fn(), + closeLeftPanel: jest.fn(), + closePreviewPanel: jest.fn(), + closePanels: jest.fn(), + previousPreviewPanel: jest.fn(), +})); + +export const useExpandableFlyoutState = jest.fn(); + +export const ExpandableFlyoutProvider = jest.fn(({ children }: React.PropsWithChildren<{}>) => { + return <>{children}; +}); + +export const withExpandableFlyoutProvider = ( + Component: React.ComponentType +) => { + return (props: T) => { + return ; + }; +}; + +export const ExpandableFlyout = jest.fn(); diff --git a/packages/kbn-expandable-flyout/index.ts b/packages/kbn-expandable-flyout/index.ts index e5eaae99c26f8..00f9b1521cc4d 100644 --- a/packages/kbn-expandable-flyout/index.ts +++ b/packages/kbn-expandable-flyout/index.ts @@ -14,6 +14,7 @@ export { useExpandableFlyoutState } from './src/hooks/use_expandable_flyout_stat export { type FlyoutState as ExpandableFlyoutState } from './src/state'; export { ExpandableFlyoutProvider } from './src/provider'; +export { withExpandableFlyoutProvider } from './src/with_provider'; export type { ExpandableFlyoutProps } from './src'; export type { FlyoutPanelProps, PanelPath, ExpandableFlyoutApi } from './src/types'; diff --git a/packages/kbn-expandable-flyout/src/index.test.tsx b/packages/kbn-expandable-flyout/src/index.test.tsx index d08a78c706781..2235cbd5d408b 100644 --- a/packages/kbn-expandable-flyout/src/index.test.tsx +++ b/packages/kbn-expandable-flyout/src/index.test.tsx @@ -110,4 +110,27 @@ describe('ExpandableFlyout', () => { expect(getByTestId(PREVIEW_SECTION_TEST_ID)).toBeInTheDocument(); }); + + it('should not render flyout when right has value but does not matches registered panels', () => { + const state = { + byId: { + [id]: { + right: { + id: 'key1', + }, + left: undefined, + preview: undefined, + }, + }, + }; + + const { queryByTestId } = render( + + + + ); + + expect(queryByTestId('my-test-flyout')).toBeNull(); + expect(queryByTestId(RIGHT_SECTION_TEST_ID)).toBeNull(); + }); }); diff --git a/packages/kbn-expandable-flyout/src/index.tsx b/packages/kbn-expandable-flyout/src/index.tsx index ba11b597e0b06..a112187bd733b 100644 --- a/packages/kbn-expandable-flyout/src/index.tsx +++ b/packages/kbn-expandable-flyout/src/index.tsx @@ -86,7 +86,8 @@ export const ExpandableFlyout: React.FC = ({ showPreview, }); - const hideFlyout = !left && !right && !preview?.length; + const hideFlyout = !(left && leftSection) && !(right && rightSection) && !preview?.length; + if (hideFlyout) { return null; } @@ -94,6 +95,7 @@ export const ExpandableFlyout: React.FC = ({ return ( { diff --git a/packages/kbn-expandable-flyout/src/with_provider.test.tsx b/packages/kbn-expandable-flyout/src/with_provider.test.tsx new file mode 100644 index 0000000000000..e262157048778 --- /dev/null +++ b/packages/kbn-expandable-flyout/src/with_provider.test.tsx @@ -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 { render } from '@testing-library/react'; +import { useExpandableFlyoutApi } from './hooks/use_expandable_flyout_api'; +import React from 'react'; +import { withExpandableFlyoutProvider } from './with_provider'; + +const TestComponent = () => { + useExpandableFlyoutApi(); + + return
; +}; + +describe('withExpandableFlyoutProvider', () => { + it('should throw when rendered without Expandable Provider', () => { + expect(() => render()).toThrow(); + }); + + it('should not throw when rendered with Expandable Provider', () => { + const TestComponentWithProvider = withExpandableFlyoutProvider(TestComponent); + expect(() => render()).not.toThrow(); + }); +}); diff --git a/packages/kbn-expandable-flyout/src/with_provider.tsx b/packages/kbn-expandable-flyout/src/with_provider.tsx new file mode 100644 index 0000000000000..a12b46a6405d0 --- /dev/null +++ b/packages/kbn-expandable-flyout/src/with_provider.tsx @@ -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 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 { ComponentType } from 'react'; +import { ExpandableFlyoutContextProviderProps } from './context'; +import { ExpandableFlyoutProvider } from './provider'; + +export const withExpandableFlyoutProvider = ( + Component: ComponentType, + expandableProviderProps?: ExpandableFlyoutContextProviderProps +) => { + return (props: Props) => { + return ( + + + + ); + }; +}; diff --git a/packages/kbn-ftr-common-functional-services/index.ts b/packages/kbn-ftr-common-functional-services/index.ts index 4bd3eca34c45c..36d76c7e2ffd7 100644 --- a/packages/kbn-ftr-common-functional-services/index.ts +++ b/packages/kbn-ftr-common-functional-services/index.ts @@ -10,6 +10,7 @@ import { ProvidedType } from '@kbn/test'; export { services as commonFunctionalServices } from './services/all'; import { KibanaServerProvider } from './services/kibana_server'; +export { KibanaServerProvider } from './services/kibana_server'; export type KibanaServer = ProvidedType; export { RetryService } from './services/retry'; @@ -18,6 +19,7 @@ import { EsArchiverProvider } from './services/es_archiver'; export type EsArchiver = ProvidedType; import { EsProvider } from './services/es'; +export { EsProvider } from './services/es'; export type Es = ProvidedType; import { SupertestWithoutAuthProvider } from './services/supertest_without_auth'; @@ -25,4 +27,14 @@ export type SupertestWithoutAuthProviderType = ProvidedType; + export type { FtrProviderContext } from './services/ftr_provider_context'; +export { runSavedObjInfoSvc } from './services/saved_object_info'; + +export type { BsearchService, SendOptions } from './services/bsearch'; +export { SavedObjectInfoService } from './services/saved_object_info'; +export { DeploymentService } from './services/deployment'; +export { IndexPatternsService } from './services/index_patterns'; +export { RandomnessService } from './services/randomness'; diff --git a/packages/kbn-ftr-common-functional-services/services/all.ts b/packages/kbn-ftr-common-functional-services/services/all.ts index 49308faeb3dd0..c6c0fb792bb81 100644 --- a/packages/kbn-ftr-common-functional-services/services/all.ts +++ b/packages/kbn-ftr-common-functional-services/services/all.ts @@ -10,6 +10,13 @@ import { EsArchiverProvider } from './es_archiver'; import { EsProvider } from './es'; import { KibanaServerProvider } from './kibana_server'; import { RetryService } from './retry'; +import { BsearchService } from './bsearch'; +import { ConsoleProvider } from './console'; +import { DeploymentService } from './deployment'; +import { EsDeleteAllIndicesProvider } from './es_delete_all_indices'; +import { IndexPatternsService } from './index_patterns'; +import { SavedObjectInfoService } from './saved_object_info'; +import { RandomnessService } from './randomness'; import { SupertestWithoutAuthProvider } from './supertest_without_auth'; import { SamlAuthProvider } from './saml_auth'; @@ -18,6 +25,13 @@ export const services = { kibanaServer: KibanaServerProvider, esArchiver: EsArchiverProvider, retry: RetryService, + bsearch: BsearchService, + console: ConsoleProvider, + deployment: DeploymentService, + esDeleteAllIndices: EsDeleteAllIndicesProvider, + indexPatterns: IndexPatternsService, + savedObjectInfo: SavedObjectInfoService, + randomness: RandomnessService, supertestWithoutAuth: SupertestWithoutAuthProvider, samlAuth: SamlAuthProvider, }; diff --git a/test/common/services/bsearch.ts b/packages/kbn-ftr-common-functional-services/services/bsearch.ts similarity index 98% rename from test/common/services/bsearch.ts rename to packages/kbn-ftr-common-functional-services/services/bsearch.ts index 81063813cec5f..b36834dedbca5 100644 --- a/test/common/services/bsearch.ts +++ b/packages/kbn-ftr-common-functional-services/services/bsearch.ts @@ -12,7 +12,7 @@ import type SuperTest from 'supertest'; import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { BFETCH_ROUTE_VERSION_LATEST } from '@kbn/bfetch-plugin/common'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; /** * Function copied from here: @@ -62,6 +62,7 @@ export interface SendOptions { * }); * expect(response).eql({ ... your value ... }); */ + export class BsearchService extends FtrService { private readonly retry = this.ctx.getService('retry'); diff --git a/packages/kbn-ftr-common-functional-services/services/console.ts b/packages/kbn-ftr-common-functional-services/services/console.ts new file mode 100644 index 0000000000000..1ca5128d83f7c --- /dev/null +++ b/packages/kbn-ftr-common-functional-services/services/console.ts @@ -0,0 +1,139 @@ +/* + * 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 { FtrProviderContext } from './ftr_provider_context'; + +export function ConsoleProvider({ getService }: FtrProviderContext) { + const client = getService('es'); + + const createIndex = async (indexName: string) => { + await client.indices.create({ + index: indexName, + body: { + mappings: { + properties: { + foo: { + type: 'text', + }, + }, + }, + }, + }); + }; + + const createAlias = async (indexName: string, aliasName: string) => { + await client.indices.putAlias({ + index: indexName, + name: aliasName, + }); + }; + + const createLegacyTemplate = async (templateName: string) => { + await client.indices.putTemplate({ + name: templateName, + body: { + index_patterns: ['*'], + }, + }); + }; + + const createComponentTemplate = async (templateName: string) => { + await client.cluster.putComponentTemplate({ + name: templateName, + body: { + template: { + mappings: { + properties: { + '@timestamp': { + type: 'date', + format: 'date_optional_time||epoch_millis', + }, + message: { + type: 'wildcard', + }, + }, + }, + }, + }, + }); + }; + + const createIndexTemplate = async ( + templateName: string, + indexPatterns: string[], + composedOf: string[] + ) => { + await client.indices.putIndexTemplate({ + name: templateName, + body: { + index_patterns: indexPatterns, + data_stream: {}, + composed_of: composedOf, + priority: 500, + }, + }); + }; + + const createDataStream = async (dataStream: string) => { + await client.indices.createDataStream({ + name: dataStream, + }); + }; + + const deleteIndex = async (indexName: string) => { + await client.indices.delete({ + index: indexName, + }); + }; + + const deleteAlias = async (indexName: string, aliasName: string) => { + await client.indices.deleteAlias({ + index: indexName, + name: aliasName, + }); + }; + + const deleteIndexTemplate = async (templateName: string) => { + await client.indices.deleteIndexTemplate({ + name: templateName, + }); + }; + + const deleteComponentTemplate = async (templateName: string) => { + await client.cluster.deleteComponentTemplate({ + name: templateName, + }); + }; + + const deleteLegacyTemplate = async (templateName: string) => { + await client.indices.deleteTemplate({ + name: templateName, + }); + }; + + const deleteDataStream = async (dataStream: string) => { + await client.indices.deleteDataStream({ + name: dataStream, + }); + }; + + return { + createIndex, + createAlias, + createLegacyTemplate, + createIndexTemplate, + createComponentTemplate, + createDataStream, + deleteIndex, + deleteAlias, + deleteLegacyTemplate, + deleteIndexTemplate, + deleteComponentTemplate, + deleteDataStream, + }; +} diff --git a/test/common/services/deployment.ts b/packages/kbn-ftr-common-functional-services/services/deployment.ts similarity index 96% rename from test/common/services/deployment.ts rename to packages/kbn-ftr-common-functional-services/services/deployment.ts index e61d6b360da19..28474a6bc60e2 100644 --- a/test/common/services/deployment.ts +++ b/packages/kbn-ftr-common-functional-services/services/deployment.ts @@ -11,7 +11,7 @@ import { Agent } from 'https'; import fetch from 'node-fetch'; import { getUrl } from '@kbn/test'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; export class DeploymentService extends FtrService { private readonly config = this.ctx.getService('config'); diff --git a/test/common/services/es_delete_all_indices.ts b/packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts similarity index 97% rename from test/common/services/es_delete_all_indices.ts rename to packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts index 5f0ecba2cbde8..cf3f93d9ef6aa 100644 --- a/test/common/services/es_delete_all_indices.ts +++ b/packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrProviderContext } from './ftr_provider_context'; export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { const log = getService('log'); diff --git a/test/common/services/index_patterns.ts b/packages/kbn-ftr-common-functional-services/services/index_patterns.ts similarity index 91% rename from test/common/services/index_patterns.ts rename to packages/kbn-ftr-common-functional-services/services/index_patterns.ts index 3fe02863b8568..6113040b927b3 100644 --- a/test/common/services/index_patterns.ts +++ b/packages/kbn-ftr-common-functional-services/services/index_patterns.ts @@ -6,10 +6,11 @@ * Side Public License, v 1. */ -import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import type { DataViewSpec } from '@kbn/data-plugin/common'; + import { INITIAL_REST_VERSION } from '@kbn/data-views-plugin/server/constants'; -import { DataViewSpec } from '@kbn/data-plugin/common'; -import { FtrService } from '../ftr_provider_context'; +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import { FtrService } from './ftr_provider_context'; export class IndexPatternsService extends FtrService { private readonly kibanaServer = this.ctx.getService('kibanaServer'); diff --git a/test/common/services/randomness.ts b/packages/kbn-ftr-common-functional-services/services/randomness.ts similarity index 97% rename from test/common/services/randomness.ts rename to packages/kbn-ftr-common-functional-services/services/randomness.ts index c799c34539f15..d3ea0c74ff5de 100644 --- a/test/common/services/randomness.ts +++ b/packages/kbn-ftr-common-functional-services/services/randomness.ts @@ -9,7 +9,7 @@ import Chance from 'chance'; import { ToolingLog } from '@kbn/tooling-log'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; let __CACHED_SEED__: number | undefined; function getSeed(log: ToolingLog) { diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/get_auth_provider.ts b/packages/kbn-ftr-common-functional-services/services/saml_auth/get_auth_provider.ts index 3f1ec7af917ff..dfe6d83908a00 100644 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/get_auth_provider.ts +++ b/packages/kbn-ftr-common-functional-services/services/saml_auth/get_auth_provider.ts @@ -6,20 +6,12 @@ * Side Public License, v 1. */ -import fs from 'fs'; import { type Config } from '@kbn/test'; -import { ToolingLog } from '@kbn/tooling-log'; -import { MOCK_IDP_REALM_NAME } from '@kbn/mock-idp-utils'; -import { KibanaServer } from '../..'; - import { ServerlessAuthProvider } from './serverless/auth_provider'; import { StatefulAuthProvider } from './stateful/auth_provider'; -import { createRole, createRoleMapping } from './stateful/create_role_mapping'; - -const STATEFUL_ADMIN_ROLE_MAPPING_PATH = './stateful/admin_mapping'; export interface AuthProvider { - getSupportedRoleDescriptors(): any; + getSupportedRoleDescriptors(): Record; getDefaultRole(): string; getRolesDefinitionPath(): string; getCommonRequestHeader(): { [key: string]: string }; @@ -28,26 +20,10 @@ export interface AuthProvider { export interface AuthProviderProps { config: Config; - kibanaServer: KibanaServer; - log: ToolingLog; } -export const getAuthProvider = async (props: AuthProviderProps) => { - const { config, log, kibanaServer } = props; +export const getAuthProvider = (props: AuthProviderProps) => { + const { config } = props; const isServerless = !!props.config.get('serverless'); - if (isServerless) { - return new ServerlessAuthProvider(config); - } - - const provider = new StatefulAuthProvider(); - // TODO: Move it to @kbn-es package, so that roles and its mapping are created before FTR services loading starts. - // 'viewer' and 'editor' roles are available by default, but we have to create 'admin' role - const adminRoleMapping = JSON.parse( - fs.readFileSync(require.resolve(STATEFUL_ADMIN_ROLE_MAPPING_PATH), 'utf8') - ); - await createRole({ roleName: 'admin', roleMapping: adminRoleMapping, kibanaServer, log }); - const roles = Object.keys(provider.getSupportedRoleDescriptors()); - // Creating roles mapping for mock-idp - await createRoleMapping({ name: MOCK_IDP_REALM_NAME, roles, config, log }); - return provider; + return isServerless ? new ServerlessAuthProvider(config) : new StatefulAuthProvider(); }; diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/saml_auth_provider.ts b/packages/kbn-ftr-common-functional-services/services/saml_auth/saml_auth_provider.ts index 4e79cad656197..af5dec4efea59 100644 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/saml_auth_provider.ts +++ b/packages/kbn-ftr-common-functional-services/services/saml_auth/saml_auth_provider.ts @@ -20,14 +20,13 @@ export interface RoleCredentials { cookieHeader: { Cookie: string }; } -export async function SamlAuthProvider({ getService }: FtrProviderContext) { +export function SamlAuthProvider({ getService }: FtrProviderContext) { const config = getService('config'); const log = getService('log'); - const kibanaServer = getService('kibanaServer'); const supertestWithoutAuth = getService('supertestWithoutAuth'); const isCloud = !!process.env.TEST_CLOUD; - const authRoleProvider = await getAuthProvider({ config, kibanaServer, log }); + const authRoleProvider = getAuthProvider({ config }); const supportedRoleDescriptors = authRoleProvider.getSupportedRoleDescriptors(); const supportedRoles = Object.keys(supportedRoleDescriptors); diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/serverless/auth_provider.ts b/packages/kbn-ftr-common-functional-services/services/saml_auth/serverless/auth_provider.ts index eecbe3a5862f2..d8cb8ae9b5f0d 100644 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/serverless/auth_provider.ts +++ b/packages/kbn-ftr-common-functional-services/services/saml_auth/serverless/auth_provider.ts @@ -49,7 +49,7 @@ export class ServerlessAuthProvider implements AuthProvider { this.rolesDefinitionPath = resolve(SERVERLESS_ROLES_ROOT_PATH, this.projectType, 'roles.yml'); } - getSupportedRoleDescriptors(): any { + getSupportedRoleDescriptors(): Record { return readRolesDescriptorsFromResource(this.rolesDefinitionPath); } getDefaultRole(): string { diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/admin_mapping.json b/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/admin_mapping.json deleted file mode 100644 index f8544f16bd239..0000000000000 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/admin_mapping.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "kibana":[ - { - "base":[ - "all" - ], - "feature":{ - - }, - "spaces":[ - "*" - ] - } - ], - "elasticsearch":{ - "cluster":[ - "all" - ], - "indices":[ - { - "names":[ - "*" - ], - "privileges":[ - "all" - ], - "allow_restricted_indices":false - }, - { - "names":[ - "*" - ], - "privileges":[ - "monitor", - "read", - "read_cross_cluster", - "view_index_metadata" - ], - "allow_restricted_indices":true - } - ], - "run_as":[ - - ] - } -} \ No newline at end of file diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/auth_provider.ts b/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/auth_provider.ts index cf27fd9d5d506..4dfe8ce6550d7 100644 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/auth_provider.ts +++ b/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/auth_provider.ts @@ -17,7 +17,7 @@ import { export class StatefulAuthProvider implements AuthProvider { private readonly rolesDefinitionPath = resolve(REPO_ROOT, STATEFUL_ROLES_ROOT_PATH, 'roles.yml'); - getSupportedRoleDescriptors(): any { + getSupportedRoleDescriptors(): Record { return readRolesDescriptorsFromResource(this.rolesDefinitionPath); } getDefaultRole() { diff --git a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/create_role_mapping.ts b/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/create_role_mapping.ts deleted file mode 100644 index 1e9b897362dc6..0000000000000 --- a/packages/kbn-ftr-common-functional-services/services/saml_auth/stateful/create_role_mapping.ts +++ /dev/null @@ -1,52 +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 { Config, createEsClientForFtrConfig } from '@kbn/test'; -import { ToolingLog } from '@kbn/tooling-log'; -import { KibanaServer } from '../../..'; - -export interface CreateRoleProps { - roleName: string; - roleMapping: string[]; - kibanaServer: KibanaServer; - log: ToolingLog; -} - -export interface CreateRoleMappingProps { - name: string; - roles: string[]; - config: Config; - log: ToolingLog; -} - -export async function createRole(props: CreateRoleProps) { - const { roleName, roleMapping, kibanaServer, log } = props; - log.debug(`Adding a role: ${roleName}`); - const { status, statusText } = await kibanaServer.request({ - path: `/api/security/role/${roleName}`, - method: 'PUT', - body: roleMapping, - retries: 0, - }); - if (status !== 204) { - throw new Error(`Expected status code of 204, received ${status} ${statusText}`); - } -} - -export async function createRoleMapping(props: CreateRoleMappingProps) { - const { name, roles, config, log } = props; - log.debug(`Creating a role mapping: {realm.name: ${name}, roles: ${roles}}`); - const esClient = createEsClientForFtrConfig(config); - await esClient.security.putRoleMapping({ - name, - roles, - enabled: true, - // @ts-ignore - rules: { field: { 'realm.name': name } }, - }); -} diff --git a/test/common/services/saved_object_info/index.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/index.ts similarity index 100% rename from test/common/services/saved_object_info/index.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/index.ts diff --git a/test/common/services/saved_object_info/saved_object_info.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts similarity index 97% rename from test/common/services/saved_object_info/saved_object_info.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts index a1b98cbd408bf..289c730cac17a 100644 --- a/test/common/services/saved_object_info/saved_object_info.ts +++ b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts @@ -13,7 +13,7 @@ import { flow, pipe } from 'fp-ts/function'; import * as TE from 'fp-ts/lib/TaskEither'; import * as T from 'fp-ts/lib/Task'; import { ToolingLog } from '@kbn/tooling-log'; -import { FtrService } from '../../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { print } from './utils'; const pluck = diff --git a/test/common/services/saved_object_info/saved_objects_info_svc.md b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_objects_info_svc.md similarity index 100% rename from test/common/services/saved_object_info/saved_objects_info_svc.md rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_objects_info_svc.md diff --git a/test/common/services/saved_object_info/use_with_jq.md b/packages/kbn-ftr-common-functional-services/services/saved_object_info/use_with_jq.md similarity index 100% rename from test/common/services/saved_object_info/use_with_jq.md rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/use_with_jq.md diff --git a/test/common/services/saved_object_info/utils.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/utils.ts similarity index 100% rename from test/common/services/saved_object_info/utils.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/utils.ts diff --git a/packages/kbn-ftr-common-functional-services/tsconfig.json b/packages/kbn-ftr-common-functional-services/tsconfig.json index ff10ec6c9d5fb..490eed5f7ac0e 100644 --- a/packages/kbn-ftr-common-functional-services/tsconfig.json +++ b/packages/kbn-ftr-common-functional-services/tsconfig.json @@ -16,9 +16,15 @@ "@kbn/es-archiver", "@kbn/test", "@kbn/expect", + "@kbn/search-types", + "@kbn/core-http-common", + "@kbn/bfetch-plugin", + "@kbn/data-plugin", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", "@kbn/repo-info", "@kbn/es", - "@kbn/mock-idp-utils" + "@kbn/data-views-plugin" ], "exclude": [ "target/**/*", diff --git a/packages/kbn-ftr-common-functional-ui-services/index.ts b/packages/kbn-ftr-common-functional-ui-services/index.ts index cd383a03e5f5d..f5f5b9df5b8ae 100644 --- a/packages/kbn-ftr-common-functional-ui-services/index.ts +++ b/packages/kbn-ftr-common-functional-ui-services/index.ts @@ -22,3 +22,4 @@ export { } from './services/remote/network_profiles'; export type { TimeoutOpt } from './types'; export { TestSubjects } from './services/test_subjects'; +export { SecurityService } from './services/security'; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/all.ts b/packages/kbn-ftr-common-functional-ui-services/services/all.ts index bffa7468e14ea..610697c69dfbf 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/all.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/all.ts @@ -12,6 +12,7 @@ import { FindProvider } from './find'; import { TestSubjects } from './test_subjects'; import { BrowserProvider } from './browser'; import { ToastsService } from './toasts'; +import { SecurityServiceProvider } from './security'; export const services = { retryOnStale: RetryOnStaleProvider, @@ -20,4 +21,5 @@ export const services = { testSubjects: TestSubjects, browser: BrowserProvider, toasts: ToastsService, + security: SecurityServiceProvider, }; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/browser.ts b/packages/kbn-ftr-common-functional-ui-services/services/browser.ts index c017433446d75..8ac46821c60bf 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/browser.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/browser.ts @@ -590,6 +590,27 @@ class BrowserService extends FtrService { await this.driver.executeScript('return window.localStorage.clear();'); } + /** + * Adds a value in session storage for the focused window/frame. + * + * @return {Promise} + */ + public async getSessionStorageItem(key: string): Promise { + return await this.driver.executeScript( + `return window.sessionStorage.getItem("${key}");` + ); + } + + /** + * Removes a value in session storage for the focused window/frame. + * + * @param {string} key + * @return {Promise} + */ + public async removeSessionStorageItem(key: string): Promise { + await this.driver.executeScript('return window.sessionStorage.removeItem(arguments[0]);', key); + } + /** * Clears session storage for the focused window/frame. * diff --git a/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts index 992fe27059e45..6f589ac6d1bb4 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts @@ -7,12 +7,18 @@ */ import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; -import { RetryService } from '@kbn/ftr-common-functional-services'; +import { + RetryService, + EsProvider, + KibanaServerProvider, +} from '@kbn/ftr-common-functional-services'; import { services as commonFunctionalUiServices } from './all'; const services = { ...commonFunctionalUiServices, retry: RetryService, + es: EsProvider, + kibanaServer: KibanaServerProvider, }; export type FtrProviderContext = GenericFtrProviderContext; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/remote/remote.ts b/packages/kbn-ftr-common-functional-ui-services/services/remote/remote.ts index 6eb10984eeb66..a4c45e7b24e7c 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/remote/remote.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/remote/remote.ts @@ -18,6 +18,16 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { const browserType: Browsers = config.get('browser.type'); type BrowserStorage = 'sessionStorage' | 'localStorage'; + const getSessionStorageItem = async (key: string) => { + try { + return await driver.executeScript(`return window.sessionStorage.getItem("${key}");`); + } catch (error) { + if (!error.message.includes(`Failed to read the 'sessionStorage' property from 'Window'`)) { + throw error; + } + } + }; + const clearBrowserStorage = async (storageType: BrowserStorage) => { try { await driver.executeScript(`window.${storageType}.clear();`); @@ -93,6 +103,32 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { lifecycle.afterTestSuite.add(async () => { await tryWebDriverCall(async () => { + // collect error message stashed in SessionStorage that indicate EuiProvider implementation error + const euiProviderWarning = await getSessionStorageItem('dev.euiProviderWarning'); + if (euiProviderWarning != null) { + let errorMessage: string; + let errorStack: string; + let pageHref: string; + let pageTitle: string; + try { + ({ + message: errorMessage, + stack: errorStack, + pageHref, + pageTitle, + } = JSON.parse(euiProviderWarning)); + } catch (error) { + throw new Error(`Found EuiProvider dev error, but the details could not be parsed`); + } + + log.error(`pageTitle: ${pageTitle}`); + log.error(`pageHref: ${pageHref}`); + log.error(`Error: ${errorMessage}`); + log.error(`Error stack: ${errorStack}`); + throw new Error(`Found EuiProvider dev error on: ${pageHref}`); + } + + // global cleanup const { width, height } = windowSizeStack.shift()!; await driver.manage().window().setRect({ width, height }); await clearBrowserStorage('sessionStorage'); diff --git a/packages/kbn-ftr-common-functional-ui-services/services/security/index.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/index.ts new file mode 100644 index 0000000000000..308b2f8b075a0 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/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 { SecurityService, SecurityServiceProvider } from './security'; diff --git a/test/common/services/security/role.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/role.ts similarity index 100% rename from test/common/services/security/role.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/role.ts diff --git a/test/common/services/security/role_mappings.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/role_mappings.ts similarity index 100% rename from test/common/services/security/role_mappings.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/role_mappings.ts diff --git a/test/common/services/security/security.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/security.ts similarity index 95% rename from test/common/services/security/security.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/security.ts index a182f225f2388..5a5ff531acd5e 100644 --- a/test/common/services/security/security.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/security.ts @@ -9,7 +9,7 @@ import { Role } from './role'; import { User } from './user'; import { RoleMappings } from './role_mappings'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; import { createTestUserService, TestUserSupertestProvider, TestUser } from './test_user'; import { createSystemIndicesUser } from './system_indices_user'; diff --git a/test/common/services/security/system_indices_user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts similarity index 97% rename from test/common/services/security/system_indices_user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts index 52e166c645093..9d6016ebb17e9 100644 --- a/test/common/services/security/system_indices_user.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts @@ -13,7 +13,7 @@ import { createEsClientForFtrConfig, createRemoteEsClientForFtrConfig, } from '@kbn/test'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; const SYSTEM_INDICES_SUPERUSER_ROLE = 'system_indices_superuser'; diff --git a/test/common/services/security/test_user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts similarity index 96% rename from test/common/services/security/test_user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts index f3012304a95bd..10a6da9f707dd 100644 --- a/test/common/services/security/test_user.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts @@ -9,10 +9,11 @@ import { format as formatUrl } from 'url'; import supertest from 'supertest'; -import { type Browser, TestSubjects } from '@kbn/ftr-common-functional-ui-services'; +import type { Browser } from '../browser'; +import type { TestSubjects } from '../test_subjects'; import { Role } from './role'; import { User } from './user'; -import { FtrService, FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService, FtrProviderContext } from '../ftr_provider_context'; const TEST_USER_NAME = 'test_user'; const TEST_USER_PASSWORD = 'changeme'; diff --git a/test/common/services/security/user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/user.ts similarity index 100% rename from test/common/services/security/user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/user.ts diff --git a/packages/kbn-grid-layout/README.md b/packages/kbn-grid-layout/README.md new file mode 100644 index 0000000000000..873eb55b1210b --- /dev/null +++ b/packages/kbn-grid-layout/README.md @@ -0,0 +1,3 @@ +# @kbn/grid-layout + +Contains a simple drag and drop layout engine for Kibana Dashboards. diff --git a/packages/kbn-grid-layout/grid/grid_height_smoother.tsx b/packages/kbn-grid-layout/grid/grid_height_smoother.tsx new file mode 100644 index 0000000000000..238d8996ae15e --- /dev/null +++ b/packages/kbn-grid-layout/grid/grid_height_smoother.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 { css } from '@emotion/react'; +import React, { PropsWithChildren, useEffect, useRef } from 'react'; +import { combineLatest } from 'rxjs'; +import { GridLayoutStateManager } from './types'; + +export const GridHeightSmoother = ({ + children, + gridLayoutStateManager, +}: PropsWithChildren<{ gridLayoutStateManager: GridLayoutStateManager }>) => { + // set the parent div size directly to smooth out height changes. + const smoothHeightRef = useRef(null); + useEffect(() => { + const subscription = combineLatest([ + gridLayoutStateManager.gridDimensions$, + gridLayoutStateManager.interactionEvent$, + ]).subscribe(([dimensions, interactionEvent]) => { + if (!smoothHeightRef.current) return; + if (!interactionEvent) { + smoothHeightRef.current.style.height = `${dimensions.height}px`; + return; + } + + /** + * When the user is interacting with an element, the page can grow, but it cannot + * shrink. This is to stop a behaviour where the page would scroll up automatically + * making the panel shrink or grow unpredictably. + */ + smoothHeightRef.current.style.height = `${Math.max( + dimensions.height ?? 0, + smoothHeightRef.current.getBoundingClientRect().height + )}px`; + }); + return () => subscription.unsubscribe(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( +
+ {children} +
+ ); +}; diff --git a/packages/kbn-grid-layout/grid/grid_layout.tsx b/packages/kbn-grid-layout/grid/grid_layout.tsx new file mode 100644 index 0000000000000..78259b1556c3e --- /dev/null +++ b/packages/kbn-grid-layout/grid/grid_layout.tsx @@ -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 { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; +import React from 'react'; +import { GridHeightSmoother } from './grid_height_smoother'; +import { GridOverlay } from './grid_overlay'; +import { GridRow } from './grid_row'; +import { GridLayoutData, GridSettings } from './types'; +import { useGridLayoutEvents } from './use_grid_layout_events'; +import { useGridLayoutState } from './use_grid_layout_state'; + +export const GridLayout = ({ + getCreationOptions, + renderPanelContents, +}: { + getCreationOptions: () => { initialLayout: GridLayoutData; gridSettings: GridSettings }; + renderPanelContents: (panelId: string) => React.ReactNode; +}) => { + const { gridLayoutStateManager, setDimensionsRef } = useGridLayoutState({ + getCreationOptions, + }); + useGridLayoutEvents({ gridLayoutStateManager }); + + const [gridLayout, runtimeSettings, interactionEvent] = useBatchedPublishingSubjects( + gridLayoutStateManager.gridLayout$, + gridLayoutStateManager.runtimeSettings$, + gridLayoutStateManager.interactionEvent$ + ); + + return ( + <> + +
{ + setDimensionsRef(divElement); + }} + > + {gridLayout.map((rowData, rowIndex) => { + return ( + { + const currentLayout = gridLayoutStateManager.gridLayout$.value; + currentLayout[rowIndex].isCollapsed = !currentLayout[rowIndex].isCollapsed; + gridLayoutStateManager.gridLayout$.next(currentLayout); + }} + setInteractionEvent={(nextInteractionEvent) => { + if (!nextInteractionEvent) { + gridLayoutStateManager.hideDragPreview(); + } + gridLayoutStateManager.interactionEvent$.next(nextInteractionEvent); + }} + ref={(element) => (gridLayoutStateManager.rowRefs.current[rowIndex] = element)} + /> + ); + })} +
+
+ + + ); +}; diff --git a/packages/kbn-grid-layout/grid/grid_overlay.tsx b/packages/kbn-grid-layout/grid/grid_overlay.tsx new file mode 100644 index 0000000000000..3050b721abcb2 --- /dev/null +++ b/packages/kbn-grid-layout/grid/grid_overlay.tsx @@ -0,0 +1,134 @@ +/* + * 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 { EuiPortal, EuiText, transparentize } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { euiThemeVars } from '@kbn/ui-theme'; +import React, { useRef, useState } from 'react'; +import { GridLayoutStateManager, PanelInteractionEvent } from './types'; + +type ScrollDirection = 'up' | 'down'; + +const scrollLabels: { [key in ScrollDirection]: string } = { + up: i18n.translate('kbnGridLayout.overlays.scrollUpLabel', { defaultMessage: 'Scroll up' }), + down: i18n.translate('kbnGridLayout.overlays.scrollDownLabel', { defaultMessage: 'Scroll down' }), +}; + +const scrollOnInterval = (direction: ScrollDirection) => { + const interval = setInterval(() => { + window.scroll({ + top: window.scrollY + (direction === 'down' ? 50 : -50), + behavior: 'smooth', + }); + }, 100); + return interval; +}; + +const ScrollOnHover = ({ direction, hide }: { hide: boolean; direction: ScrollDirection }) => { + const [isActive, setIsActive] = useState(false); + const scrollInterval = useRef(null); + const stopScrollInterval = () => { + if (scrollInterval.current) { + clearInterval(scrollInterval.current); + } + }; + + return ( +
{ + setIsActive(true); + scrollInterval.current = scrollOnInterval(direction); + }} + onMouseLeave={() => { + setIsActive(false); + stopScrollInterval(); + }} + css={css` + width: 100%; + position: fixed; + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + opacity: ${hide ? 0 : 1}; + transition: opacity 100ms linear; + padding: ${euiThemeVars.euiSizeM}; + ${direction === 'down' ? 'bottom: 0;' : 'top: 0;'} + `} + > + {direction === 'up' && ( +
+ )} +
+ + {scrollLabels[direction]} + +
+
+ ); +}; + +export const GridOverlay = ({ + interactionEvent, + gridLayoutStateManager, +}: { + interactionEvent?: PanelInteractionEvent; + gridLayoutStateManager: GridLayoutStateManager; +}) => { + return ( + +
+ + +
+
+ + ); +}; diff --git a/packages/kbn-grid-layout/grid/grid_panel.tsx b/packages/kbn-grid-layout/grid/grid_panel.tsx new file mode 100644 index 0000000000000..fc1ab5cb1e619 --- /dev/null +++ b/packages/kbn-grid-layout/grid/grid_panel.tsx @@ -0,0 +1,141 @@ +/* + * 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 { + EuiIcon, + EuiPanel, + euiFullHeight, + transparentize, + useEuiOverflowScroll, +} from '@elastic/eui'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import React, { useCallback, useRef } from 'react'; +import { GridPanelData, PanelInteractionEvent } from './types'; + +export const GridPanel = ({ + activePanelId, + panelData, + renderPanelContents, + setInteractionEvent, +}: { + panelData: GridPanelData; + activePanelId: string | undefined; + renderPanelContents: (panelId: string) => React.ReactNode; + setInteractionEvent: (interactionData?: Omit) => void; +}) => { + const panelRef = useRef(null); + const thisPanelActive = activePanelId === panelData.id; + + const interactionStart = useCallback( + (type: 'drag' | 'resize', e: React.MouseEvent) => { + if (!panelRef.current) return; + e.preventDefault(); + e.stopPropagation(); + const panelRect = panelRef.current.getBoundingClientRect(); + setInteractionEvent({ + type, + id: panelData.id, + panelDiv: panelRef.current, + mouseOffsets: { + top: e.clientY - panelRect.top, + left: e.clientX - panelRect.left, + right: e.clientX - panelRect.right, + bottom: e.clientY - panelRect.bottom, + }, + }); + }, + [panelData.id, setInteractionEvent] + ); + + return ( +
+ + {/* drag handle */} +
interactionStart('drag', e)} + > + +
+ {/* Resize handle */} +
interactionStart('resize', e)} + css={css` + right: 0; + bottom: 0; + opacity: 0; + margin: -2px; + position: absolute; + width: ${euiThemeVars.euiSizeL}; + height: ${euiThemeVars.euiSizeL}; + transition: opacity 0.2s, border 0.2s; + border-radius: 7px 0 7px 0; + border-bottom: 2px solid ${euiThemeVars.euiColorSuccess}; + border-right: 2px solid ${euiThemeVars.euiColorSuccess}; + :hover { + background-color: ${transparentize(euiThemeVars.euiColorSuccess, 0.05)}; + cursor: se-resize; + } + `} + /> +
+ {renderPanelContents(panelData.id)} +
+ +
+ ); +}; diff --git a/packages/kbn-grid-layout/grid/grid_row.tsx b/packages/kbn-grid-layout/grid/grid_row.tsx new file mode 100644 index 0000000000000..ce2d226fc2cb8 --- /dev/null +++ b/packages/kbn-grid-layout/grid/grid_row.tsx @@ -0,0 +1,128 @@ +/* + * 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 { EuiButtonIcon, EuiFlexGroup, EuiSpacer, EuiTitle, transparentize } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { euiThemeVars } from '@kbn/ui-theme'; +import React, { forwardRef, useMemo } from 'react'; +import { GridPanel } from './grid_panel'; +import { GridRowData, PanelInteractionEvent, RuntimeGridSettings } from './types'; + +const gridColor = transparentize(euiThemeVars.euiColorSuccess, 0.2); +const getGridBackgroundCSS = (settings: RuntimeGridSettings) => { + const { gutterSize, columnPixelWidth, rowHeight } = settings; + return css` + background-position: top -${gutterSize / 2}px left -${gutterSize / 2}px; + background-size: ${columnPixelWidth + gutterSize}px ${rowHeight + gutterSize}px; + background-image: linear-gradient(to right, ${gridColor} 1px, transparent 1px), + linear-gradient(to bottom, ${gridColor} 1px, transparent 1px); + `; +}; + +export const GridRow = forwardRef< + HTMLDivElement, + { + rowIndex: number; + rowData: GridRowData; + toggleIsCollapsed: () => void; + activePanelId: string | undefined; + targetRowIndex: number | undefined; + runtimeSettings: RuntimeGridSettings; + renderPanelContents: (panelId: string) => React.ReactNode; + setInteractionEvent: (interactionData?: PanelInteractionEvent) => void; + } +>( + ( + { + rowData, + rowIndex, + activePanelId, + targetRowIndex, + runtimeSettings, + toggleIsCollapsed, + renderPanelContents, + setInteractionEvent, + }, + gridRef + ) => { + const { gutterSize, columnCount, rowHeight } = runtimeSettings; + const isGridTargeted = activePanelId && targetRowIndex === rowIndex; + + // calculate row count based on the number of rows needed to fit all panels + const rowCount = useMemo(() => { + const maxRow = Object.values(rowData.panels).reduce((acc, panel) => { + return Math.max(acc, panel.row + panel.height); + }, 0); + return maxRow || 1; + }, [rowData]); + + return ( + <> + {rowIndex !== 0 && ( + <> + + + + +

{rowData.title}

+
+
+ + + )} + {!rowData.isCollapsed && ( +
+ {Object.values(rowData.panels).map((panelData) => ( + { + if (partialInteractionEvent) { + setInteractionEvent({ + ...partialInteractionEvent, + targetRowIndex: rowIndex, + }); + return; + } + setInteractionEvent(); + }} + /> + ))} +
+ )} + + ); + } +); diff --git a/packages/kbn-grid-layout/grid/resolve_grid_row.ts b/packages/kbn-grid-layout/grid/resolve_grid_row.ts new file mode 100644 index 0000000000000..1fb7d43dc35d2 --- /dev/null +++ b/packages/kbn-grid-layout/grid/resolve_grid_row.ts @@ -0,0 +1,107 @@ +/* + * 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 { GridPanelData, GridRowData } from './types'; + +const collides = (panelA: GridPanelData, panelB: GridPanelData) => { + if (panelA.id === panelB.id) return false; // same panel + if (panelA.column + panelA.width <= panelB.column) return false; // panel a is left of panel b + if (panelA.column >= panelB.column + panelB.width) return false; // panel a is right of panel b + if (panelA.row + panelA.height <= panelB.row) return false; // panel a is above panel b + if (panelA.row >= panelB.row + panelB.height) return false; // panel a is below panel b + return true; // boxes overlap +}; + +const getAllCollisionsWithPanel = ( + panelToCheck: GridPanelData, + gridLayout: GridRowData, + keysInOrder: string[] +): GridPanelData[] => { + const collidingPanels: GridPanelData[] = []; + for (const key of keysInOrder) { + const comparePanel = gridLayout.panels[key]; + if (comparePanel.id === panelToCheck.id) continue; + if (collides(panelToCheck, comparePanel)) { + collidingPanels.push(comparePanel); + } + } + return collidingPanels; +}; + +const getKeysInOrder = (rowData: GridRowData, draggedId?: string): string[] => { + const panelKeys = Object.keys(rowData.panels); + return panelKeys.sort((panelKeyA, panelKeyB) => { + const panelA = rowData.panels[panelKeyA]; + const panelB = rowData.panels[panelKeyB]; + + // sort by row first + if (panelA.row > panelB.row) return 1; + if (panelA.row < panelB.row) return -1; + + // if rows are the same. Is either panel being dragged? + if (panelA.id === draggedId) return -1; + if (panelB.id === draggedId) return 1; + + // if rows are the same and neither panel is being dragged, sort by column + if (panelA.column > panelB.column) return 1; + if (panelA.column < panelB.column) return -1; + + // fall back + return 1; + }); +}; + +const compactGridRow = (originalLayout: GridRowData) => { + const nextRowData = { ...originalLayout, panels: { ...originalLayout.panels } }; + // compact all vertical space. + const sortedKeysAfterMove = getKeysInOrder(nextRowData); + for (const panelKey of sortedKeysAfterMove) { + const panel = nextRowData.panels[panelKey]; + // try moving panel up one row at a time until it collides + while (panel.row > 0) { + const collisions = getAllCollisionsWithPanel( + { ...panel, row: panel.row - 1 }, + nextRowData, + sortedKeysAfterMove + ); + if (collisions.length !== 0) break; + panel.row -= 1; + } + } + return nextRowData; +}; + +export const resolveGridRow = ( + originalRowData: GridRowData, + dragRequest?: GridPanelData +): GridRowData => { + const nextRowData = { ...originalRowData, panels: { ...originalRowData.panels } }; + + // Apply drag request + if (dragRequest) { + nextRowData.panels[dragRequest.id] = dragRequest; + } + // return nextRowData; + + // push all panels down if they collide with another panel + const sortedKeys = getKeysInOrder(nextRowData, dragRequest?.id); + + for (const key of sortedKeys) { + const panel = nextRowData.panels[key]; + const collisions = getAllCollisionsWithPanel(panel, nextRowData, sortedKeys); + + for (const collision of collisions) { + const rowOverlap = panel.row + panel.height - collision.row; + if (rowOverlap > 0) { + collision.row += rowOverlap; + } + } + } + const compactedGrid = compactGridRow(nextRowData); + return compactedGrid; +}; diff --git a/packages/kbn-grid-layout/grid/types.ts b/packages/kbn-grid-layout/grid/types.ts new file mode 100644 index 0000000000000..1ef9b69fc997e --- /dev/null +++ b/packages/kbn-grid-layout/grid/types.ts @@ -0,0 +1,99 @@ +/* + * 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 { BehaviorSubject } from 'rxjs'; +import type { ObservedSize } from 'use-resize-observer/polyfilled'; +export interface GridCoordinate { + column: number; + row: number; +} + +export interface GridRect extends GridCoordinate { + width: number; + height: number; +} + +export interface GridPanelData extends GridRect { + id: string; +} + +export interface GridRowData { + title: string; + isCollapsed: boolean; + panels: { + [key: string]: GridPanelData; + }; +} + +export type GridLayoutData = GridRowData[]; + +export interface GridSettings { + gutterSize: number; + rowHeight: number; + columnCount: number; +} + +/** + * The runtime settings for the grid, including the pixel width of each column + * which is calculated on the fly based on the grid settings and the width of + * the containing element. + */ +export type RuntimeGridSettings = GridSettings & { columnPixelWidth: number }; + +export interface GridLayoutStateManager { + hideDragPreview: () => void; + updatePreviewElement: (rect: { + top: number; + left: number; + bottom: number; + right: number; + }) => void; + + gridDimensions$: BehaviorSubject; + gridLayout$: BehaviorSubject; + runtimeSettings$: BehaviorSubject; + rowRefs: React.MutableRefObject>; + dragPreviewRef: React.MutableRefObject; + interactionEvent$: BehaviorSubject; +} + +/** + * The information required to start a panel interaction. + */ +export interface PanelInteractionEvent { + /** + * The type of interaction being performed. + */ + type: 'drag' | 'resize'; + + /** + * The id of the panel being interacted with. + */ + id: string; + + /** + * The index of the grid row this panel interaction is targeting. + */ + targetRowIndex: number; + + /** + * The pixel rect of the panel being interacted with. + */ + panelDiv: HTMLDivElement; + + /** + * The pixel offsets from where the mouse was at drag start to the + * edges of the panel + */ + mouseOffsets: { + top: number; + left: number; + right: number; + bottom: number; + }; +} diff --git a/packages/kbn-grid-layout/grid/use_grid_layout_events.ts b/packages/kbn-grid-layout/grid/use_grid_layout_events.ts new file mode 100644 index 0000000000000..11e514674f883 --- /dev/null +++ b/packages/kbn-grid-layout/grid/use_grid_layout_events.ts @@ -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 { useEffect, useRef } from 'react'; +import { resolveGridRow } from './resolve_grid_row'; +import { GridPanelData, GridLayoutStateManager } from './types'; + +export const isGridDataEqual = (a?: GridPanelData, b?: GridPanelData) => { + return ( + a?.id === b?.id && + a?.column === b?.column && + a?.row === b?.row && + a?.width === b?.width && + a?.height === b?.height + ); +}; + +export const useGridLayoutEvents = ({ + gridLayoutStateManager, +}: { + gridLayoutStateManager: GridLayoutStateManager; +}) => { + const mouseClientPosition = useRef({ x: 0, y: 0 }); + const lastRequestedPanelPosition = useRef(undefined); + + // ----------------------------------------------------------------------------------------- + // Set up drag events + // ----------------------------------------------------------------------------------------- + useEffect(() => { + const { runtimeSettings$, interactionEvent$, gridLayout$ } = gridLayoutStateManager; + const calculateUserEvent = (e: Event) => { + if (!interactionEvent$.value) return; + e.preventDefault(); + e.stopPropagation(); + + const gridRowElements = gridLayoutStateManager.rowRefs.current; + const previewElement = gridLayoutStateManager.dragPreviewRef.current; + + const interactionEvent = interactionEvent$.value; + const isResize = interactionEvent?.type === 'resize'; + + const currentLayout = gridLayout$.value; + const currentGridData = (() => { + if (!interactionEvent) return; + for (const row of currentLayout) { + if (row.panels[interactionEvent.id]) return row.panels[interactionEvent.id]; + } + })(); + + if (!runtimeSettings$.value || !previewElement || !gridRowElements || !currentGridData) { + return; + } + + const mouseTargetPixel = { + x: mouseClientPosition.current.x, + y: mouseClientPosition.current.y, + }; + const panelRect = interactionEvent.panelDiv.getBoundingClientRect(); + const previewRect = { + left: isResize ? panelRect.left : mouseTargetPixel.x - interactionEvent.mouseOffsets.left, + top: isResize ? panelRect.top : mouseTargetPixel.y - interactionEvent.mouseOffsets.top, + bottom: mouseTargetPixel.y - interactionEvent.mouseOffsets.bottom, + right: mouseTargetPixel.x - interactionEvent.mouseOffsets.right, + }; + gridLayoutStateManager.updatePreviewElement(previewRect); + + // find the grid that the preview rect is over + const previewBottom = + previewRect.top + gridLayoutStateManager.runtimeSettings$.value.rowHeight; + const lastRowIndex = interactionEvent?.targetRowIndex; + const targetRowIndex = (() => { + if (isResize) return lastRowIndex; + + let highestOverlap = -Infinity; + let highestOverlapRowIndex = -1; + gridRowElements.forEach((row, index) => { + if (!row) return; + const rowRect = row.getBoundingClientRect(); + const overlap = + Math.min(previewBottom, rowRect.bottom) - Math.max(previewRect.top, rowRect.top); + if (overlap > highestOverlap) { + highestOverlap = overlap; + highestOverlapRowIndex = index; + } + }); + return highestOverlapRowIndex; + })(); + const hasChangedGridRow = targetRowIndex !== lastRowIndex; + + // re-render when the target row changes + if (hasChangedGridRow) { + interactionEvent$.next({ + ...interactionEvent, + targetRowIndex, + }); + } + + // calculate the requested grid position + const { columnCount, gutterSize, rowHeight, columnPixelWidth } = runtimeSettings$.value; + const targetedGridRow = gridRowElements[targetRowIndex]; + const targetedGridLeft = targetedGridRow?.getBoundingClientRect().left ?? 0; + const targetedGridTop = targetedGridRow?.getBoundingClientRect().top ?? 0; + + const maxColumn = isResize ? columnCount : columnCount - currentGridData.width; + + const localXCoordinate = isResize + ? previewRect.right - targetedGridLeft + : previewRect.left - targetedGridLeft; + const localYCoordinate = isResize + ? previewRect.bottom - targetedGridTop + : previewRect.top - targetedGridTop; + + const targetColumn = Math.min( + Math.max(Math.round(localXCoordinate / (columnPixelWidth + gutterSize)), 0), + maxColumn + ); + const targetRow = Math.max(Math.round(localYCoordinate / (rowHeight + gutterSize)), 0); + const requestedGridData = { ...currentGridData }; + if (isResize) { + requestedGridData.width = Math.max(targetColumn - requestedGridData.column, 1); + requestedGridData.height = Math.max(targetRow - requestedGridData.row, 1); + } else { + requestedGridData.column = targetColumn; + requestedGridData.row = targetRow; + } + + // resolve the new grid layout + if ( + hasChangedGridRow || + !isGridDataEqual(requestedGridData, lastRequestedPanelPosition.current) + ) { + lastRequestedPanelPosition.current = { ...requestedGridData }; + + // remove the panel from the row it's currently in. + const nextLayout = currentLayout.map((row, rowIndex) => { + const { [interactionEvent.id]: interactingPanel, ...otherPanels } = row.panels; + return { ...row, panels: { ...otherPanels } }; + }); + + // resolve destination grid + const destinationGrid = nextLayout[targetRowIndex]; + const resolvedDestinationGrid = resolveGridRow(destinationGrid, requestedGridData); + nextLayout[targetRowIndex] = resolvedDestinationGrid; + + // resolve origin grid + if (hasChangedGridRow) { + const originGrid = nextLayout[lastRowIndex]; + const resolvedOriginGrid = resolveGridRow(originGrid); + nextLayout[lastRowIndex] = resolvedOriginGrid; + } + gridLayout$.next(nextLayout); + } + }; + + const onMouseUp = (e: MouseEvent) => { + if (!interactionEvent$.value) return; + e.preventDefault(); + e.stopPropagation(); + + interactionEvent$.next(undefined); + gridLayoutStateManager.hideDragPreview(); + }; + + const onMouseMove = (e: MouseEvent) => { + mouseClientPosition.current = { x: e.clientX, y: e.clientY }; + calculateUserEvent(e); + }; + + document.addEventListener('mouseup', onMouseUp); + document.addEventListener('mousemove', onMouseMove); + document.addEventListener('scroll', calculateUserEvent); + return () => { + document.removeEventListener('mouseup', onMouseUp); + document.removeEventListener('mousemove', onMouseMove); + document.removeEventListener('scroll', calculateUserEvent); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); +}; diff --git a/packages/kbn-grid-layout/grid/use_grid_layout_state.ts b/packages/kbn-grid-layout/grid/use_grid_layout_state.ts new file mode 100644 index 0000000000000..182eb2a88cec8 --- /dev/null +++ b/packages/kbn-grid-layout/grid/use_grid_layout_state.ts @@ -0,0 +1,99 @@ +/* + * 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 { useEffect, useMemo, useRef } from 'react'; +import { BehaviorSubject, debounceTime } from 'rxjs'; +import useResizeObserver, { type ObservedSize } from 'use-resize-observer/polyfilled'; +import { + GridLayoutData, + GridLayoutStateManager, + GridSettings, + PanelInteractionEvent, + RuntimeGridSettings, +} from './types'; + +export const useGridLayoutState = ({ + getCreationOptions, +}: { + getCreationOptions: () => { initialLayout: GridLayoutData; gridSettings: GridSettings }; +}): { + gridLayoutStateManager: GridLayoutStateManager; + setDimensionsRef: (instance: HTMLDivElement | null) => void; +} => { + const rowRefs = useRef>([]); + const dragPreviewRef = useRef(null); + + // eslint-disable-next-line react-hooks/exhaustive-deps + const { initialLayout, gridSettings } = useMemo(() => getCreationOptions(), []); + + const gridLayoutStateManager = useMemo(() => { + const gridLayout$ = new BehaviorSubject(initialLayout); + const gridDimensions$ = new BehaviorSubject({ width: 0, height: 0 }); + const interactionEvent$ = new BehaviorSubject(undefined); + const runtimeSettings$ = new BehaviorSubject({ + ...gridSettings, + columnPixelWidth: 0, + }); + + return { + rowRefs, + gridLayout$, + dragPreviewRef, + gridDimensions$, + runtimeSettings$, + interactionEvent$, + updatePreviewElement: (previewRect: { + top: number; + bottom: number; + left: number; + right: number; + }) => { + if (!dragPreviewRef.current) return; + dragPreviewRef.current.style.opacity = '1'; + dragPreviewRef.current.style.left = `${previewRect.left}px`; + dragPreviewRef.current.style.top = `${previewRect.top}px`; + dragPreviewRef.current.style.width = `${Math.max( + previewRect.right - previewRect.left, + runtimeSettings$.value.columnPixelWidth + )}px`; + dragPreviewRef.current.style.height = `${Math.max( + previewRect.bottom - previewRect.top, + runtimeSettings$.value.rowHeight + )}px`; + }, + hideDragPreview: () => { + if (!dragPreviewRef.current) return; + dragPreviewRef.current.style.opacity = '0'; + }, + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + useEffect(() => { + // debounce width changes to avoid unnecessary column width recalculation. + const subscription = gridLayoutStateManager.gridDimensions$ + .pipe(debounceTime(250)) + .subscribe((dimensions) => { + const elementWidth = dimensions.width ?? 0; + const columnPixelWidth = + (elementWidth - gridSettings.gutterSize * (gridSettings.columnCount - 1)) / + gridSettings.columnCount; + gridLayoutStateManager.runtimeSettings$.next({ ...gridSettings, columnPixelWidth }); + }); + return () => subscription.unsubscribe(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const { ref: setDimensionsRef } = useResizeObserver({ + onResize: (dimensions) => { + gridLayoutStateManager.gridDimensions$.next(dimensions); + }, + }); + + return { gridLayoutStateManager, setDimensionsRef }; +}; diff --git a/packages/kbn-grid-layout/index.ts b/packages/kbn-grid-layout/index.ts new file mode 100644 index 0000000000000..4ebe1e7575527 --- /dev/null +++ b/packages/kbn-grid-layout/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 { GridLayout } from './grid/grid_layout'; +export type { GridLayoutData, GridPanelData, GridRowData, GridSettings } from './grid/types'; diff --git a/packages/kbn-grid-layout/jest.config.js b/packages/kbn-grid-layout/jest.config.js new file mode 100644 index 0000000000000..b4c6123bdccce --- /dev/null +++ b/packages/kbn-grid-layout/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-grid-layout'], +}; diff --git a/packages/kbn-grid-layout/kibana.jsonc b/packages/kbn-grid-layout/kibana.jsonc new file mode 100644 index 0000000000000..8063456ea0b5f --- /dev/null +++ b/packages/kbn-grid-layout/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-browser", + "id": "@kbn/grid-layout", + "owner": "@elastic/kibana-presentation" +} diff --git a/packages/kbn-grid-layout/package.json b/packages/kbn-grid-layout/package.json new file mode 100644 index 0000000000000..102eef2fa4d93 --- /dev/null +++ b/packages/kbn-grid-layout/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/grid-layout", + "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-grid-layout/tsconfig.json b/packages/kbn-grid-layout/tsconfig.json new file mode 100644 index 0000000000000..5a1888db0dc64 --- /dev/null +++ b/packages/kbn-grid-layout/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/presentation-publishing", + "@kbn/ui-theme", + "@kbn/i18n", + ] +} diff --git a/packages/kbn-grouping/src/components/accordion_panel/index.tsx b/packages/kbn-grouping/src/components/accordion_panel/index.tsx index ae13509b51a9e..37a531b386b47 100644 --- a/packages/kbn-grouping/src/components/accordion_panel/index.tsx +++ b/packages/kbn-grouping/src/components/accordion_panel/index.tsx @@ -102,7 +102,7 @@ const GroupPanelComponent = ({ ); const onToggle = useCallback( - (isOpen) => { + (isOpen: boolean) => { if (onToggleGroup) { onToggleGroup(isOpen, groupBucket); } diff --git a/packages/kbn-grouping/src/containers/query/types.ts b/packages/kbn-grouping/src/containers/query/types.ts index 69a284ecf7a59..c50e4f8b3391a 100644 --- a/packages/kbn-grouping/src/containers/query/types.ts +++ b/packages/kbn-grouping/src/containers/query/types.ts @@ -7,7 +7,7 @@ */ import type { - InlineScript, + Script, MappingRuntimeField, MappingRuntimeFields, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; @@ -52,7 +52,7 @@ export interface MainAggregation extends NamedAggregation { } export interface GroupingRuntimeField extends MappingRuntimeField { - script: InlineScript & { + script: Script & { params: Record; }; } diff --git a/packages/kbn-grouping/src/hooks/use_grouping.tsx b/packages/kbn-grouping/src/hooks/use_grouping.tsx index 284343a29d748..f01dcc29aa790 100644 --- a/packages/kbn-grouping/src/hooks/use_grouping.tsx +++ b/packages/kbn-grouping/src/hooks/use_grouping.tsx @@ -56,7 +56,7 @@ export type DynamicGroupingProps = Pick< /** Interface for configuring grouping package where T is the consumer `GroupingAggregation` * @interface GroupingArgs */ -interface GroupingArgs { +export interface GroupingArgs { componentProps: StaticGroupingProps; defaultGroupingOptions: GroupOption[]; fields: FieldSpec[]; diff --git a/packages/kbn-investigation-shared/README.md b/packages/kbn-investigation-shared/README.md new file mode 100644 index 0000000000000..07c07fe3e7081 --- /dev/null +++ b/packages/kbn-investigation-shared/README.md @@ -0,0 +1,3 @@ +# @kbn/investigation-shared + +Empty package generated by @kbn/generate diff --git a/packages/kbn-investigation-shared/index.ts b/packages/kbn-investigation-shared/index.ts new file mode 100644 index 0000000000000..de0577ee3ed83 --- /dev/null +++ b/packages/kbn-investigation-shared/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 * from './src'; diff --git a/packages/kbn-investigation-shared/jest.config.js b/packages/kbn-investigation-shared/jest.config.js new file mode 100644 index 0000000000000..97bfdd78ff319 --- /dev/null +++ b/packages/kbn-investigation-shared/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-investigation-shared'], +}; diff --git a/packages/kbn-investigation-shared/kibana.jsonc b/packages/kbn-investigation-shared/kibana.jsonc new file mode 100644 index 0000000000000..ffc2802ff3af9 --- /dev/null +++ b/packages/kbn-investigation-shared/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/investigation-shared", + "owner": "@elastic/obs-ux-management-team" +} diff --git a/packages/kbn-investigation-shared/package.json b/packages/kbn-investigation-shared/package.json new file mode 100644 index 0000000000000..bf4a97caf483e --- /dev/null +++ b/packages/kbn-investigation-shared/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/investigation-shared", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-investigation-shared/src/index.ts b/packages/kbn-investigation-shared/src/index.ts new file mode 100644 index 0000000000000..cf2c6a5e96f54 --- /dev/null +++ b/packages/kbn-investigation-shared/src/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 * from './rest_specs'; +export * from './schema'; diff --git a/packages/kbn-investigation-shared/src/rest_specs/create.ts b/packages/kbn-investigation-shared/src/rest_specs/create.ts new file mode 100644 index 0000000000000..cab2de27d5eb7 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/create.ts @@ -0,0 +1,30 @@ +/* + * 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 * as t from 'io-ts'; +import { investigationResponseSchema } from './investigation'; +import { alertOriginSchema, blankOriginSchema } from '../schema'; + +const createInvestigationParamsSchema = t.type({ + body: t.type({ + id: t.string, + title: t.string, + params: t.type({ + timeRange: t.type({ from: t.number, to: t.number }), + }), + origin: t.union([alertOriginSchema, blankOriginSchema]), + }), +}); + +const createInvestigationResponseSchema = investigationResponseSchema; + +type CreateInvestigationParams = t.TypeOf; +type CreateInvestigationResponse = t.OutputOf; + +export { createInvestigationParamsSchema, createInvestigationResponseSchema }; +export type { CreateInvestigationParams, CreateInvestigationResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/create_item.ts b/packages/kbn-investigation-shared/src/rest_specs/create_item.ts new file mode 100644 index 0000000000000..a0696df4040d8 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/create_item.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 * as t from 'io-ts'; +import { itemSchema } from '../schema'; +import { investigationItemResponseSchema } from './investigation_item'; + +const createInvestigationItemParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), + body: itemSchema, +}); + +const createInvestigationItemResponseSchema = investigationItemResponseSchema; + +type CreateInvestigationItemParams = t.TypeOf< + typeof createInvestigationItemParamsSchema.props.body +>; +type CreateInvestigationItemResponse = t.OutputOf; + +export { createInvestigationItemParamsSchema, createInvestigationItemResponseSchema }; +export type { CreateInvestigationItemParams, CreateInvestigationItemResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/create_note.ts b/packages/kbn-investigation-shared/src/rest_specs/create_note.ts new file mode 100644 index 0000000000000..0132b86093185 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/create_note.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 * as t from 'io-ts'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const createInvestigationNoteParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), + body: t.type({ + content: t.string, + }), +}); + +const createInvestigationNoteResponseSchema = investigationNoteResponseSchema; + +type CreateInvestigationNoteParams = t.TypeOf< + typeof createInvestigationNoteParamsSchema.props.body +>; +type CreateInvestigationNoteResponse = t.OutputOf; + +export { createInvestigationNoteParamsSchema, createInvestigationNoteResponseSchema }; +export type { CreateInvestigationNoteParams, CreateInvestigationNoteResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/delete.ts b/packages/kbn-investigation-shared/src/rest_specs/delete.ts new file mode 100644 index 0000000000000..52df3b250775d --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/delete.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 * as t from 'io-ts'; + +const deleteInvestigationParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), +}); + +type DeleteInvestigationParams = t.TypeOf; + +export { deleteInvestigationParamsSchema }; +export type { DeleteInvestigationParams }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts b/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts new file mode 100644 index 0000000000000..14ac6f763ce38 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/delete_item.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 * as t from 'io-ts'; + +const deleteInvestigationItemParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + itemId: t.string, + }), +}); + +type DeleteInvestigationItemParams = t.TypeOf< + typeof deleteInvestigationItemParamsSchema.props.path +>; + +export { deleteInvestigationItemParamsSchema }; +export type { DeleteInvestigationItemParams }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts b/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts new file mode 100644 index 0000000000000..80cae4a982721 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/delete_note.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 * as t from 'io-ts'; + +const deleteInvestigationNoteParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + noteId: t.string, + }), +}); + +type DeleteInvestigationNoteParams = t.TypeOf< + typeof deleteInvestigationNoteParamsSchema.props.path +>; + +export { deleteInvestigationNoteParamsSchema }; +export type { DeleteInvestigationNoteParams }; diff --git a/x-pack/plugins/observability_solution/investigate/common/schema/find.ts b/packages/kbn-investigation-shared/src/rest_specs/find.ts similarity index 77% rename from x-pack/plugins/observability_solution/investigate/common/schema/find.ts rename to packages/kbn-investigation-shared/src/rest_specs/find.ts index 4eb9d6f9bf66c..0bbb853117138 100644 --- a/x-pack/plugins/observability_solution/investigate/common/schema/find.ts +++ b/packages/kbn-investigation-shared/src/rest_specs/find.ts @@ -1,9 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 * as t from 'io-ts'; import { investigationResponseSchema } from './investigation'; @@ -22,8 +24,8 @@ const findInvestigationsResponseSchema = t.type({ results: t.array(investigationResponseSchema), }); -type FindInvestigationsParams = t.TypeOf; // Parsed payload used by the backend -type FindInvestigationsResponse = t.OutputOf; // Raw response sent to the frontend +type FindInvestigationsParams = t.TypeOf; +type FindInvestigationsResponse = t.OutputOf; export { findInvestigationsParamsSchema, findInvestigationsResponseSchema }; export type { FindInvestigationsParams, FindInvestigationsResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get.ts b/packages/kbn-investigation-shared/src/rest_specs/get.ts new file mode 100644 index 0000000000000..f0cc850116087 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/get.ts @@ -0,0 +1,24 @@ +/* + * 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 * as t from 'io-ts'; +import { investigationResponseSchema } from './investigation'; + +const getInvestigationParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), +}); + +const getInvestigationResponseSchema = investigationResponseSchema; + +type GetInvestigationParams = t.TypeOf; // Parsed payload used by the backend +type GetInvestigationResponse = t.OutputOf; // Raw response sent to the frontend + +export { getInvestigationParamsSchema, getInvestigationResponseSchema }; +export type { GetInvestigationParams, GetInvestigationResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_items.ts b/packages/kbn-investigation-shared/src/rest_specs/get_items.ts new file mode 100644 index 0000000000000..dde19ceda9243 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/get_items.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 * as t from 'io-ts'; +import { investigationItemResponseSchema } from './investigation_item'; + +const getInvestigationItemsParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), +}); + +const getInvestigationItemsResponseSchema = t.array(investigationItemResponseSchema); + +type GetInvestigationItemsResponse = t.OutputOf; + +export { getInvestigationItemsParamsSchema, getInvestigationItemsResponseSchema }; +export type { GetInvestigationItemsResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts b/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts new file mode 100644 index 0000000000000..7cd9aa1f3fe9c --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/get_notes.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 * as t from 'io-ts'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const getInvestigationNotesParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + }), +}); + +const getInvestigationNotesResponseSchema = t.array(investigationNoteResponseSchema); + +type GetInvestigationNotesResponse = t.OutputOf; + +export { getInvestigationNotesParamsSchema, getInvestigationNotesResponseSchema }; +export type { GetInvestigationNotesResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/index.ts b/packages/kbn-investigation-shared/src/rest_specs/index.ts new file mode 100644 index 0000000000000..9022266becf2a --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/index.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type * from './create'; +export type * from './create_note'; +export type * from './delete'; +export type * from './find'; +export type * from './get'; +export type * from './get_notes'; +export type * from './delete_note'; +export type * from './investigation_note'; +export type * from './create_item'; +export type * from './delete_item'; +export type * from './get_items'; +export type * from './investigation_item'; +export type * from './update_note'; + +export * from './create'; +export * from './create_note'; +export * from './delete'; +export * from './find'; +export * from './get'; +export * from './get_notes'; +export * from './delete_note'; +export * from './investigation_note'; +export * from './create_item'; +export * from './delete_item'; +export * from './get_items'; +export * from './investigation_item'; +export * from './update_note'; diff --git a/packages/kbn-investigation-shared/src/rest_specs/investigation.ts b/packages/kbn-investigation-shared/src/rest_specs/investigation.ts new file mode 100644 index 0000000000000..c2530ff0dc9a4 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/investigation.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as t from 'io-ts'; +import { investigationSchema } from '../schema'; + +const investigationResponseSchema = investigationSchema; + +type InvestigationResponse = t.OutputOf; + +export { investigationResponseSchema }; +export type { InvestigationResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts b/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts new file mode 100644 index 0000000000000..df9ec315e3277 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as t from 'io-ts'; +import { investigationItemSchema } from '../schema'; + +const investigationItemResponseSchema = investigationItemSchema; + +type InvestigationItemResponse = t.OutputOf; + +export { investigationItemResponseSchema }; +export type { InvestigationItemResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts b/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts new file mode 100644 index 0000000000000..5e6a15b327d8a --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as t from 'io-ts'; +import { investigationNoteSchema } from '../schema'; + +const investigationNoteResponseSchema = investigationNoteSchema; + +type InvestigationNoteResponse = t.OutputOf; + +export { investigationNoteResponseSchema }; +export type { InvestigationNoteResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/update_note.ts b/packages/kbn-investigation-shared/src/rest_specs/update_note.ts new file mode 100644 index 0000000000000..22e84db8242d4 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/update_note.ts @@ -0,0 +1,30 @@ +/* + * 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 * as t from 'io-ts'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const updateInvestigationNoteParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + noteId: t.string, + }), + body: t.type({ + content: t.string, + }), +}); + +const updateInvestigationNoteResponseSchema = investigationNoteResponseSchema; + +type UpdateInvestigationNoteParams = t.TypeOf< + typeof updateInvestigationNoteParamsSchema.props.body +>; +type UpdateInvestigationNoteResponse = t.OutputOf; + +export { updateInvestigationNoteParamsSchema, updateInvestigationNoteResponseSchema }; +export type { UpdateInvestigationNoteParams, UpdateInvestigationNoteResponse }; diff --git a/packages/kbn-investigation-shared/src/schema/index.ts b/packages/kbn-investigation-shared/src/schema/index.ts new file mode 100644 index 0000000000000..d6c017c963e7c --- /dev/null +++ b/packages/kbn-investigation-shared/src/schema/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * from './investigation'; +export * from './investigation_item'; +export * from './investigation_note'; +export * from './origin'; diff --git a/packages/kbn-investigation-shared/src/schema/investigation.ts b/packages/kbn-investigation-shared/src/schema/investigation.ts new file mode 100644 index 0000000000000..299d077d71e6c --- /dev/null +++ b/packages/kbn-investigation-shared/src/schema/investigation.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 * as t from 'io-ts'; +import { alertOriginSchema, blankOriginSchema } from './origin'; +import { investigationNoteSchema } from './investigation_note'; +import { investigationItemSchema } from './investigation_item'; + +const investigationSchema = t.type({ + id: t.string, + title: t.string, + createdAt: t.number, + createdBy: t.string, + params: t.type({ + timeRange: t.type({ from: t.number, to: t.number }), + }), + origin: t.union([alertOriginSchema, blankOriginSchema]), + status: t.union([t.literal('ongoing'), t.literal('closed')]), + notes: t.array(investigationNoteSchema), + items: t.array(investigationItemSchema), +}); + +export { investigationSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/investigation_item.ts b/packages/kbn-investigation-shared/src/schema/investigation_item.ts new file mode 100644 index 0000000000000..717bf246e3590 --- /dev/null +++ b/packages/kbn-investigation-shared/src/schema/investigation_item.ts @@ -0,0 +1,30 @@ +/* + * 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 * as t from 'io-ts'; + +const itemSchema = t.type({ + title: t.string, + type: t.string, + params: t.record(t.string, t.any), +}); + +const investigationItemSchema = t.intersection([ + t.type({ + id: t.string, + createdAt: t.number, + createdBy: t.string, + }), + itemSchema, +]); + +type Item = t.TypeOf; +type InvestigationItem = t.TypeOf; + +export type { Item, InvestigationItem }; +export { investigationItemSchema, itemSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/investigation_note.ts b/packages/kbn-investigation-shared/src/schema/investigation_note.ts new file mode 100644 index 0000000000000..53ecd11c77bb4 --- /dev/null +++ b/packages/kbn-investigation-shared/src/schema/investigation_note.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as t from 'io-ts'; + +const investigationNoteSchema = t.type({ + id: t.string, + content: t.string, + createdAt: t.number, + createdBy: t.string, +}); + +export { investigationNoteSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/origin.ts b/packages/kbn-investigation-shared/src/schema/origin.ts new file mode 100644 index 0000000000000..7d5c5447b633d --- /dev/null +++ b/packages/kbn-investigation-shared/src/schema/origin.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 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 * as t from 'io-ts'; + +const blankOriginSchema = t.type({ type: t.literal('blank') }); +const alertOriginSchema = t.type({ type: t.literal('alert'), id: t.string }); + +export { alertOriginSchema, blankOriginSchema }; diff --git a/packages/kbn-investigation-shared/tsconfig.json b/packages/kbn-investigation-shared/tsconfig.json new file mode 100644 index 0000000000000..2f9ddddbeea23 --- /dev/null +++ b/packages/kbn-investigation-shared/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts b/packages/kbn-io-ts-utils/src/props_to_schema/index.ts deleted file mode 100644 index 5915df1b0102e..0000000000000 --- a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts +++ /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 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 * as t from 'io-ts'; -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { schema, Type } from '@kbn/config-schema'; -import { isLeft } from 'fp-ts/lib/Either'; - -export function propsToSchema>(type: T): Type> { - return schema.object( - {}, - { - unknowns: 'allow', - validate: (val) => { - const decoded = type.decode(val); - - if (isLeft(decoded)) { - return PathReporter.report(decoded).join('\n'); - } - }, - } - ); -} diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 5145b1ee2a7f4..0ac791e1542ae 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -11,7 +11,6 @@ "**/*.ts" ], "kbn_references": [ - "@kbn/config-schema", "@kbn/core", "@kbn/datemath" ], diff --git a/packages/kbn-language-documentation-popover/src/components/documentation.scss b/packages/kbn-language-documentation-popover/src/components/documentation.scss index 752797decfa4e..2db3d25619d6e 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation.scss +++ b/packages/kbn-language-documentation-popover/src/components/documentation.scss @@ -62,8 +62,8 @@ } .documentation__docsText { - @include euiYScroll; padding: $euiSize; + @include euiYScroll; } .documentation__docsTextGroup, diff --git a/packages/kbn-managed-content-badge/index.ts b/packages/kbn-managed-content-badge/index.ts index a548520c01237..1fb38681fe2b4 100644 --- a/packages/kbn-managed-content-badge/index.ts +++ b/packages/kbn-managed-content-badge/index.ts @@ -9,9 +9,10 @@ import { i18n } from '@kbn/i18n'; import type { EuiToolTipProps } from '@elastic/eui'; import type { TopNavMenuBadgeProps } from '@kbn/navigation-plugin/public'; -export const getManagedContentBadge: (tooltipText: string) => TopNavMenuBadgeProps = ( - tooltipText -) => ({ +export const getManagedContentBadge: ( + tooltipText: string, + disableTooltipProps?: boolean +) => TopNavMenuBadgeProps = (tooltipText, enableTooltipProps = true) => ({ 'data-test-subj': 'managedContentBadge', badgeText: i18n.translate('managedContentBadge.text', { defaultMessage: 'Managed', @@ -21,8 +22,10 @@ export const getManagedContentBadge: (tooltipText: string) => TopNavMenuBadgePro }), color: 'primary', iconType: 'glasses', - toolTipProps: { - content: tooltipText, - position: 'bottom', - } as EuiToolTipProps, + toolTipProps: enableTooltipProps + ? ({ + content: tooltipText, + position: 'bottom', + } as EuiToolTipProps) + : undefined, }); diff --git a/packages/kbn-management/settings/components/field_input/code_editor.tsx b/packages/kbn-management/settings/components/field_input/code_editor.tsx index ac1ea672d8a15..397fd8b80492b 100644 --- a/packages/kbn-management/settings/components/field_input/code_editor.tsx +++ b/packages/kbn-management/settings/components/field_input/code_editor.tsx @@ -70,7 +70,7 @@ export const CodeEditor = ({ onChange, type, isReadOnly, name, ...props }: CodeE editorModel.setValue(trimmedValue); }, []); - const editorDidMount = useCallback( + const editorDidMount = useCallback>( (editor) => { setEditorCalculatedHeight(editor); 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 0dc9b8ddc406e..f77c66f5f15e1 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 @@ -13,6 +13,7 @@ import { getFieldInputValue } from '@kbn/management-settings-utilities'; import { useUpdate } from '@kbn/management-settings-utilities'; import { debounce } from 'lodash'; +import { OnInputChangeFn } from '@kbn/management-settings-types'; import { useServices } from '../services'; import { InputProps } from '../types'; import { TEST_SUBJ_PREFIX_FIELD } from '.'; @@ -39,7 +40,7 @@ export const ArrayInput = ({ const onUpdate = useUpdate({ onInputChange, field }); const updateValue = useCallback( - async (newValue: string, onUpdateFn) => { + async (newValue: string, onUpdateFn: OnInputChangeFn<'array'>) => { const parsedValue = newValue .replace(REGEX, ',') .split(',') 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 8a29429eff59f..303dfe3868664 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 @@ -12,6 +12,7 @@ import { EuiFieldNumber, EuiFieldNumberProps } from '@elastic/eui'; import { getFieldInputValue, useUpdate } from '@kbn/management-settings-utilities'; import { debounce } from 'lodash'; +import { OnInputChangeFn } from '@kbn/management-settings-types'; import { InputProps } from '../types'; import { TEST_SUBJ_PREFIX_FIELD } from '.'; import { useServices } from '../services'; @@ -36,7 +37,7 @@ export const NumberInput = ({ const onUpdate = useUpdate({ onInputChange, field }); const updateValue = useCallback( - async (newValue: number, onUpdateFn) => { + async (newValue: number, onUpdateFn: OnInputChangeFn<'number'>) => { const validationResponse = await validateChange(field.id, newValue); if (validationResponse.successfulValidation && !validationResponse.valid) { onUpdateFn({ diff --git a/packages/kbn-management/settings/setting_ids/index.ts b/packages/kbn-management/settings/setting_ids/index.ts index 2d09f5a2b2ad7..9f0c226717079 100644 --- a/packages/kbn-management/settings/setting_ids/index.ts +++ b/packages/kbn-management/settings/setting_ids/index.ts @@ -145,8 +145,6 @@ export const OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE = 'observability:entityCent export const OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID = 'observability:logSources'; export const OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID = 'observability:aiAssistantLogsIndexPattern'; -export const OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE = - 'observability:aiAssistantResponseLanguage'; export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING = 'observability:aiAssistantSimulatedFunctionCalling'; export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN = diff --git a/packages/kbn-monaco/src/console/parser.js b/packages/kbn-monaco/src/console/parser.js index e7369444ab85a..881370f5b9fac 100644 --- a/packages/kbn-monaco/src/console/parser.js +++ b/packages/kbn-monaco/src/console/parser.js @@ -37,24 +37,7 @@ export const createParser = () => { requestStartOffset = at - 1; requests.push({ startOffset: requestStartOffset }); }, - addRequestMethod = function(method) { - const lastRequest = getLastRequest(); - lastRequest.method = method; - requests.push(lastRequest); - requestEndOffset = at - 1; - }, - addRequestUrl = function(url) { - const lastRequest = getLastRequest(); - lastRequest.url = url; - requests.push(lastRequest); - requestEndOffset = at - 1; - }, - addRequestData = function(data) { - const lastRequest = getLastRequest(); - const dataArray = lastRequest.data || []; - dataArray.push(data); - lastRequest.data = dataArray; - requests.push(lastRequest); + updateRequestEnd = function () { requestEndOffset = at - 1; }, addRequestEnd = function() { @@ -409,17 +392,17 @@ export const createParser = () => { request = function () { white(); addRequestStart(); - const parsedMethod = method(); - addRequestMethod(parsedMethod); + method(); + updateRequestEnd(); strictWhite(); - const parsedUrl = url(); - addRequestUrl(parsedUrl); + url(); + updateRequestEnd(); strictWhite(); // advance to one new line newLine(); strictWhite(); if (ch == '{') { - const parsedObject = object(); - addRequestData(parsedObject); + object(); + updateRequestEnd(); } // multi doc request strictWhite(); // advance to one new line @@ -427,8 +410,8 @@ export const createParser = () => { strictWhite(); while (ch == '{') { // another object - const parsedObject = object(); - addRequestData(parsedObject); + object(); + updateRequestEnd(); strictWhite(); newLine(); strictWhite(); diff --git a/packages/kbn-monaco/src/console/parser.test.ts b/packages/kbn-monaco/src/console/parser.test.ts index 417fdd12e2c18..1529d907317cf 100644 --- a/packages/kbn-monaco/src/console/parser.test.ts +++ b/packages/kbn-monaco/src/console/parser.test.ts @@ -25,9 +25,7 @@ describe('console parser', () => { const { requests, errors } = parser(input) as ConsoleParserResult; expect(requests.length).toBe(1); expect(errors.length).toBe(0); - const { method, url, startOffset, endOffset } = requests[0]; - expect(method).toBe('GET'); - expect(url).toBe('_search'); + const { startOffset, endOffset } = requests[0]; // the start offset of the request is the beginning of the string expect(startOffset).toBe(0); // the end offset of the request is the end of the string @@ -38,6 +36,10 @@ describe('console parser', () => { const input = 'GET _search\nPOST _test_index'; const { requests } = parser(input) as ConsoleParserResult; expect(requests.length).toBe(2); + expect(requests[0].startOffset).toBe(0); + expect(requests[0].endOffset).toBe(11); + expect(requests[1].startOffset).toBe(12); + expect(requests[1].endOffset).toBe(28); }); it('parses a request with a request body', () => { @@ -45,15 +47,8 @@ describe('console parser', () => { 'GET _search\n' + '{\n' + ' "query": {\n' + ' "match_all": {}\n' + ' }\n' + '}'; const { requests } = parser(input) as ConsoleParserResult; expect(requests.length).toBe(1); - const { method, url, data } = requests[0]; - expect(method).toBe('GET'); - expect(url).toBe('_search'); - expect(data).toEqual([ - { - query: { - match_all: {}, - }, - }, - ]); + const { startOffset, endOffset } = requests[0]; + expect(startOffset).toBe(0); + expect(endOffset).toBe(52); }); }); diff --git a/packages/kbn-monaco/src/console/types.ts b/packages/kbn-monaco/src/console/types.ts index 346bd0e6beeeb..4ad7d28ac778b 100644 --- a/packages/kbn-monaco/src/console/types.ts +++ b/packages/kbn-monaco/src/console/types.ts @@ -14,9 +14,6 @@ export interface ErrorAnnotation { export interface ParsedRequest { startOffset: number; endOffset?: number; - method: string; - url?: string; - data?: Array>; } export interface ConsoleParserResult { errors: ErrorAnnotation[]; diff --git a/packages/kbn-monaco/src/esql/language.ts b/packages/kbn-monaco/src/esql/language.ts index 7c49da41a996e..958af9e80c1f6 100644 --- a/packages/kbn-monaco/src/esql/language.ts +++ b/packages/kbn-monaco/src/esql/language.ts @@ -100,9 +100,10 @@ export const ESQLLang: CustomLangModuleType = { (...uris) => workerProxyService.getWorker(uris), callbacks ); - const suggestionEntries = await astAdapter.autocomplete(model, position, context); + const suggestions = await astAdapter.autocomplete(model, position, context); return { - suggestions: wrapAsMonacoSuggestions(suggestionEntries.suggestions), + // @ts-expect-error because of range typing: https://github.com/microsoft/monaco-editor/issues/4638 + suggestions: wrapAsMonacoSuggestions(suggestions), }; }, }; diff --git a/packages/kbn-monaco/src/esql/lib/converters/suggestions.ts b/packages/kbn-monaco/src/esql/lib/converters/suggestions.ts index 0d02a19dda070..2eaf598a61974 100644 --- a/packages/kbn-monaco/src/esql/lib/converters/suggestions.ts +++ b/packages/kbn-monaco/src/esql/lib/converters/suggestions.ts @@ -6,29 +6,46 @@ * Side Public License, v 1. */ -import type { SuggestionRawDefinition } from '@kbn/esql-validation-autocomplete'; import { monaco } from '../../../monaco_imports'; -import { MonacoAutocompleteCommandDefinition } from '../types'; +import { + MonacoAutocompleteCommandDefinition, + SuggestionRawDefinitionWithMonacoRange, +} from '../types'; export function wrapAsMonacoSuggestions( - suggestions: SuggestionRawDefinition[] + suggestions: SuggestionRawDefinitionWithMonacoRange[] ): MonacoAutocompleteCommandDefinition[] { - return suggestions.map( - ({ label, text, asSnippet, kind, detail, documentation, sortText, command }) => ({ + return suggestions.map( + ({ label, - insertText: text, - kind: - kind in monaco.languages.CompletionItemKind - ? monaco.languages.CompletionItemKind[kind] - : monaco.languages.CompletionItemKind.Method, // fallback to Method + text, + asSnippet, + kind, detail, documentation, sortText, + filterText, command, - insertTextRules: asSnippet - ? monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet - : undefined, - range: undefined as unknown as monaco.IRange, - }) + range, + }) => { + const monacoSuggestion: MonacoAutocompleteCommandDefinition = { + label, + insertText: text, + filterText, + kind: + kind in monaco.languages.CompletionItemKind + ? monaco.languages.CompletionItemKind[kind] + : monaco.languages.CompletionItemKind.Method, // fallback to Method + detail, + documentation, + sortText, + command, + insertTextRules: asSnippet + ? monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet + : undefined, + range, + }; + return monacoSuggestion; + } ); } diff --git a/packages/kbn-monaco/src/esql/lib/esql_ast_provider.ts b/packages/kbn-monaco/src/esql/lib/esql_ast_provider.ts index 8aa2e16979c5b..95f31764d7a78 100644 --- a/packages/kbn-monaco/src/esql/lib/esql_ast_provider.ts +++ b/packages/kbn-monaco/src/esql/lib/esql_ast_provider.ts @@ -16,8 +16,9 @@ import { monaco } from '../../monaco_imports'; import type { ESQLWorker } from '../worker/esql_worker'; import { wrapAsMonacoMessages } from './converters/positions'; import { getHoverItem } from './hover/hover'; -import { monacoPositionToOffset } from './shared/utils'; +import { monacoPositionToOffset, offsetRangeToMonacoRange } from './shared/utils'; import { getSignatureHelp } from './signature'; +import { SuggestionRawDefinitionWithMonacoRange } from './types'; export class ESQLAstAdapter { constructor( @@ -66,17 +67,17 @@ export class ESQLAstAdapter { model: monaco.editor.ITextModel, position: monaco.Position, context: monaco.languages.CompletionContext - ) { + ): Promise { const getAstFn = await this.getAstWorker(model); const fullText = model.getValue(); const offset = monacoPositionToOffset(fullText, position); - const suggestionEntries = await suggest(fullText, offset, context, getAstFn, this.callbacks); - return { - suggestions: suggestionEntries.map((suggestion) => ({ - ...suggestion, - range: undefined as unknown as monaco.IRange, - })), - }; + const suggestions = await suggest(fullText, offset, context, getAstFn, this.callbacks); + for (const s of suggestions) { + (s as SuggestionRawDefinitionWithMonacoRange).range = s.rangeToReplace + ? offsetRangeToMonacoRange(fullText, s.rangeToReplace) + : undefined; + } + return suggestions; } async codeAction( diff --git a/packages/kbn-monaco/src/esql/lib/shared/utils.ts b/packages/kbn-monaco/src/esql/lib/shared/utils.ts index 9f2d6d4f22545..8b6762fafccf2 100644 --- a/packages/kbn-monaco/src/esql/lib/shared/utils.ts +++ b/packages/kbn-monaco/src/esql/lib/shared/utils.ts @@ -11,11 +11,75 @@ import type { monaco } from '../../../monaco_imports'; // From Monaco position to linear offset export function monacoPositionToOffset(expression: string, position: monaco.Position): number { const lines = expression.split(/\n/); - return lines - .slice(0, position.lineNumber) - .reduce( - (prev, current, index) => - prev + (index === position.lineNumber - 1 ? position.column - 1 : current.length + 1), - 0 - ); + let offset = 0; + + for (let i = 0; i < position.lineNumber - 1; i++) { + offset += lines[i].length + 1; // +1 for the newline character + } + + offset += position.column - 1; + + return offset; } + +/** + * Given an offset range, returns a monaco IRange object. + * @param expression + * @param range + * @returns + */ +export const offsetRangeToMonacoRange = ( + expression: string, + range: { start: number; end: number } +): { + startColumn: number; + endColumn: number; + startLineNumber: number; + endLineNumber: number; +} => { + let startColumn = 0; + let endColumn = 0; + // How far we are past the last newline character + let currentOffset = 0; + + let startLineNumber = 1; + let endLineNumber = 1; + let currentLine = 1; + + for (let i = 0; i < expression.length; i++) { + if (expression[i] === '\n') { + currentLine++; + currentOffset = i + 1; + } + + if (i === range.start) { + startLineNumber = currentLine; + startColumn = i - currentOffset; + } + + if (i === range.end) { + endLineNumber = currentLine; + endColumn = i - currentOffset; + break; // No need to continue once we find the end position + } + } + + // Handle the case where the start offset is past the end of the string + if (range.start >= expression.length) { + startLineNumber = currentLine; + startColumn = range.start - currentOffset; + } + + // Handle the case where the end offset is at the end or past the end of the string + if (range.end >= expression.length) { + endLineNumber = currentLine; + endColumn = range.end - currentOffset; + } + + return { + startColumn, + endColumn, + startLineNumber, + endLineNumber, + }; +}; diff --git a/packages/kbn-monaco/src/esql/lib/types.ts b/packages/kbn-monaco/src/esql/lib/types.ts index 6bd51a1690067..d16c40dcead1e 100644 --- a/packages/kbn-monaco/src/esql/lib/types.ts +++ b/packages/kbn-monaco/src/esql/lib/types.ts @@ -6,19 +6,27 @@ * Side Public License, v 1. */ +import { SuggestionRawDefinition } from '@kbn/esql-validation-autocomplete'; import { monaco } from '../../monaco_imports'; export type MonacoAutocompleteCommandDefinition = Pick< monaco.languages.CompletionItem, | 'label' | 'insertText' + | 'filterText' | 'kind' | 'detail' | 'documentation' | 'sortText' | 'insertTextRules' | 'command' - | 'range' ->; +> & { range?: monaco.IRange }; export type MonacoCodeAction = monaco.languages.CodeAction; + +export type SuggestionRawDefinitionWithMonacoRange = Omit< + SuggestionRawDefinition, + 'rangeToReplace' +> & { + range?: monaco.IRange; +}; diff --git a/packages/kbn-object-versioning-utils/README.md b/packages/kbn-object-versioning-utils/README.md new file mode 100644 index 0000000000000..65b4bdd1206ec --- /dev/null +++ b/packages/kbn-object-versioning-utils/README.md @@ -0,0 +1,3 @@ +# @kbn/object-versioning-utils + +Exports common utils from `@kbn/object-versioning` that are safe to be used both in the server and the browser. diff --git a/packages/kbn-object-versioning-utils/index.ts b/packages/kbn-object-versioning-utils/index.ts new file mode 100644 index 0000000000000..650ac1804edec --- /dev/null +++ b/packages/kbn-object-versioning-utils/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 { validateVersion } from './lib/validate_version'; diff --git a/packages/kbn-object-versioning-utils/jest.config.js b/packages/kbn-object-versioning-utils/jest.config.js new file mode 100644 index 0000000000000..2a127f38d568d --- /dev/null +++ b/packages/kbn-object-versioning-utils/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-object-versioning-utils'], +}; diff --git a/packages/kbn-object-versioning-utils/kibana.jsonc b/packages/kbn-object-versioning-utils/kibana.jsonc new file mode 100644 index 0000000000000..deba859afd364 --- /dev/null +++ b/packages/kbn-object-versioning-utils/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/object-versioning-utils", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/kbn-object-versioning-utils/lib/validate_version.ts b/packages/kbn-object-versioning-utils/lib/validate_version.ts new file mode 100644 index 0000000000000..8941e0ef9fdd1 --- /dev/null +++ b/packages/kbn-object-versioning-utils/lib/validate_version.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// import type { Version } from '@kbn/object-versioning'; +// Declaring it directly to avoid circular dependencies. +type Version = number; + +export const validateVersion = ( + version: unknown +): { result: true; value: Version } | { result: false; value: null } => { + if (typeof version === 'string') { + const isValid = /^\d+$/.test(version); + if (isValid) { + const parsed = parseInt(version, 10); + if (Number.isNaN(parsed)) { + return { result: false, value: null }; + } + return { result: true, value: parsed }; + } + return { result: false, value: null }; + } else { + const isValid = Number.isInteger(version); + if (isValid) { + return { + result: true, + value: version as Version, + }; + } + return { + result: false, + value: null, + }; + } +}; diff --git a/packages/kbn-object-versioning-utils/package.json b/packages/kbn-object-versioning-utils/package.json new file mode 100644 index 0000000000000..f608c88ab44aa --- /dev/null +++ b/packages/kbn-object-versioning-utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/object-versioning-utils", + "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-object-versioning-utils/tsconfig.json b/packages/kbn-object-versioning-utils/tsconfig.json new file mode 100644 index 0000000000000..a9e9e3ad3baac --- /dev/null +++ b/packages/kbn-object-versioning-utils/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + ] +} diff --git a/packages/kbn-object-versioning/kibana.jsonc b/packages/kbn-object-versioning/kibana.jsonc index c79023fdec49d..00f87ac804f47 100644 --- a/packages/kbn-object-versioning/kibana.jsonc +++ b/packages/kbn-object-versioning/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/object-versioning", "owner": "@elastic/appex-sharedux" } diff --git a/packages/kbn-object-versioning/lib/utils.ts b/packages/kbn-object-versioning/lib/utils.ts index e5531578c55bb..2a75bca650de2 100644 --- a/packages/kbn-object-versioning/lib/utils.ts +++ b/packages/kbn-object-versioning/lib/utils.ts @@ -7,7 +7,6 @@ */ import type { Type, ValidationError } from '@kbn/config-schema'; -import { Version } from './types'; /** * Validate an object based on a schema. @@ -29,30 +28,4 @@ export const validateObj = (obj: unknown, objSchema?: Type): ValidationErro } }; -export const validateVersion = ( - version: unknown -): { result: true; value: Version } | { result: false; value: null } => { - if (typeof version === 'string') { - const isValid = /^\d+$/.test(version); - if (isValid) { - const parsed = parseInt(version, 10); - if (Number.isNaN(parsed)) { - return { result: false, value: null }; - } - return { result: true, value: parsed }; - } - return { result: false, value: null }; - } else { - const isValid = Number.isInteger(version); - if (isValid) { - return { - result: true, - value: version as Version, - }; - } - return { - result: false, - value: null, - }; - } -}; +export { validateVersion } from '@kbn/object-versioning-utils'; diff --git a/packages/kbn-object-versioning/tsconfig.json b/packages/kbn-object-versioning/tsconfig.json index 35c4b501af791..42c549aef3ce6 100644 --- a/packages/kbn-object-versioning/tsconfig.json +++ b/packages/kbn-object-versioning/tsconfig.json @@ -18,5 +18,6 @@ "kbn_references": [ "@kbn/config-schema", "@kbn/safer-lodash-set", + "@kbn/object-versioning-utils", ] } diff --git a/packages/kbn-openapi-bundler/src/utils/extract_by_json_pointer.ts b/packages/kbn-openapi-bundler/src/utils/extract_by_json_pointer.ts index 3826621591866..8140fff7bd3a2 100644 --- a/packages/kbn-openapi-bundler/src/utils/extract_by_json_pointer.ts +++ b/packages/kbn-openapi-bundler/src/utils/extract_by_json_pointer.ts @@ -7,7 +7,7 @@ */ import chalk from 'chalk'; -import { dump } from 'js-yaml'; +import { safeDump } from 'js-yaml'; import { isPlainObjectType } from './is_plain_object_type'; /** @@ -32,7 +32,9 @@ export function extractByJsonPointer(document: unknown, pointer: string): unknow throw new Error( `JSON Pointer ${chalk.bold(pointer)} resolution failure. Expected ${chalk.magenta( path.join('/') - )} to be a plain object but it has type "${typeof target}" in \n\n${dump(document)}` + )} to be a plain object but it has type "${typeof target}" in \n\n${safeDump(document, { + skipInvalid: true, + })}` ); } @@ -66,7 +68,7 @@ export function extractObjectByJsonPointer( throw new Error( `JSON Pointer resolution failure. Expected ${chalk.magenta( pointer - )} to be a plain object in \n\n${dump(document)}` + )} to be a plain object in \n\n${safeDump(document, { skipInvalid: true })}` ); } diff --git a/packages/kbn-openapi-bundler/src/utils/read_document.ts b/packages/kbn-openapi-bundler/src/utils/read_document.ts index 49476c134e91f..31dc0aed79646 100644 --- a/packages/kbn-openapi-bundler/src/utils/read_document.ts +++ b/packages/kbn-openapi-bundler/src/utils/read_document.ts @@ -8,7 +8,7 @@ import fs from 'fs/promises'; import { basename, extname } from 'path'; -import { load } from 'js-yaml'; +import { safeLoad } from 'js-yaml'; import chalk from 'chalk'; import { logger } from '../logger'; import { isPlainObjectType } from './is_plain_object_type'; @@ -45,7 +45,7 @@ async function readYamlFile(filePath: string): Promise> // Typing load's result to Record is optimistic as we can't be sure // there is object inside a yaml file. We don't have this validation layer so far // but using JSON Schemas here should mitigate this problem. - return load(await fs.readFile(filePath, { encoding: 'utf8' })); + return safeLoad(await fs.readFile(filePath, { encoding: 'utf8' })); } async function readJsonFile(filePath: string): Promise> { diff --git a/packages/kbn-openapi-bundler/src/utils/write_yaml_document.ts b/packages/kbn-openapi-bundler/src/utils/write_yaml_document.ts index 980f898777aef..35a7f41d3d747 100644 --- a/packages/kbn-openapi-bundler/src/utils/write_yaml_document.ts +++ b/packages/kbn-openapi-bundler/src/utils/write_yaml_document.ts @@ -7,7 +7,7 @@ */ import fs from 'fs/promises'; -import { dump } from 'js-yaml'; +import { safeDump } from 'js-yaml'; import { dirname } from 'path'; export async function writeYamlDocument(filePath: string, document: unknown): Promise { @@ -23,21 +23,16 @@ export async function writeYamlDocument(filePath: string, document: unknown): Pr function stringifyToYaml(document: unknown): string { try { - // We don't want to have `undefined` values serialized into YAML. - // `JSON.stringify()` simply skips `undefined` values while js-yaml v 3.14 DOES NOT. - // js-yaml >= v4 has it fixed so `dump()`'s behavior is consistent with `JSON.stringify()`. - // Until js-yaml is updated to v4 use the hack with JSON serialization/deserialization. - const clearedDocument = JSON.parse(JSON.stringify(document)); - // Disable YAML Anchors https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases // It makes YAML much more human readable - return dump(clearedDocument, { + return safeDump(document, { noRefs: true, sortKeys: sortYamlKeys, + skipInvalid: true, // Skip invalid types like `undefined` }); } catch (e) { // Try to stringify with YAML Anchors enabled - return dump(document, { noRefs: false, sortKeys: sortYamlKeys }); + return safeDump(document, { noRefs: false, sortKeys: sortYamlKeys, skipInvalid: true }); } } diff --git a/packages/kbn-openapi-bundler/tests/bundler/bundle_specs.ts b/packages/kbn-openapi-bundler/tests/bundler/bundle_specs.ts index 59d5271fc0f87..66746979eaab1 100644 --- a/packages/kbn-openapi-bundler/tests/bundler/bundle_specs.ts +++ b/packages/kbn-openapi-bundler/tests/bundler/bundle_specs.ts @@ -16,7 +16,7 @@ import { unlinkSync, writeFileSync, } from 'fs'; -import { dump, load } from 'js-yaml'; +import { safeDump, safeLoad } from 'js-yaml'; import { OpenAPIV3 } from 'openapi-types'; import { bundle, BundlerConfig } from '../../src/openapi_bundler'; @@ -56,7 +56,10 @@ function dumpSpecs(folderPath: string, oasSpecs: Record { const [bundledSpec] = Object.values(readBundledSpecs(outputFolderPath)); - const expected = load( + const expected = safeLoad( readFileSync(join(folderToBundlePath, 'expected.yaml'), { encoding: 'utf8' }) ); diff --git a/packages/kbn-openapi-bundler/tests/bundler/circular.test.ts b/packages/kbn-openapi-bundler/tests/bundler/circular.test.ts index b711014a4ff34..90561369a7347 100644 --- a/packages/kbn-openapi-bundler/tests/bundler/circular.test.ts +++ b/packages/kbn-openapi-bundler/tests/bundler/circular.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { dump } from 'js-yaml'; +import { safeDump } from 'js-yaml'; import { OpenAPIV3 } from 'openapi-types'; import { bundleSpecs } from './bundle_specs'; import { createOASDocument } from '../create_oas_document'; @@ -48,7 +48,8 @@ describe('OpenAPI Bundler - circular specs', () => { }) ); - expect(dump(bundledSpec.paths['/api/some_api']!.get!.responses['200'])).toMatchInlineSnapshot(` + expect(safeDump(bundledSpec.paths['/api/some_api']!.get!.responses['200'])) + .toMatchInlineSnapshot(` "content: application/json: schema: &ref_0 diff --git a/packages/kbn-openapi-bundler/tests/merger/merge_specs.ts b/packages/kbn-openapi-bundler/tests/merger/merge_specs.ts index 0455bb1088369..92b7fc0901179 100644 --- a/packages/kbn-openapi-bundler/tests/merger/merge_specs.ts +++ b/packages/kbn-openapi-bundler/tests/merger/merge_specs.ts @@ -16,7 +16,7 @@ import { unlinkSync, writeFileSync, } from 'fs'; -import { dump, load } from 'js-yaml'; +import { safeDump, safeLoad } from 'js-yaml'; import { OpenAPIV3 } from 'openapi-types'; import { merge, MergerConfig } from '../../src/openapi_merger'; @@ -56,7 +56,10 @@ function dumpSpecs(folderPath: string, oasSpecs: Record; export const PlatformErrorResponse = z.object({ diff --git a/packages/kbn-openapi-common/schemas/primitives.gen.ts b/packages/kbn-openapi-common/schemas/primitives.gen.ts index a9027448d7e77..1a3477ec1735c 100644 --- a/packages/kbn-openapi-common/schemas/primitives.gen.ts +++ b/packages/kbn-openapi-common/schemas/primitives.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; /** * A string that is not empty and does not contain only whitespace diff --git a/packages/kbn-openapi-common/tsconfig.json b/packages/kbn-openapi-common/tsconfig.json index 168274f98f058..ca7d7e4715362 100644 --- a/packages/kbn-openapi-common/tsconfig.json +++ b/packages/kbn-openapi-common/tsconfig.json @@ -6,5 +6,7 @@ "exclude": ["target/**/*"], "extends": "../../tsconfig.base.json", "include": ["**/*.ts"], - "kbn_references": [] + "kbn_references": [ + "@kbn/zod", + ] } diff --git a/packages/kbn-openapi-generator/README.md b/packages/kbn-openapi-generator/README.md index cd3fe96f18601..1652588cbe15b 100644 --- a/packages/kbn-openapi-generator/README.md +++ b/packages/kbn-openapi-generator/README.md @@ -67,7 +67,7 @@ By default it uses the `zod_operation_schema` template which produces runtime ty Example of generated code: ```ts -import { z } from 'zod'; +import { z } from '@kbn/zod'; /* * NOTICE: Do not edit this file manually. diff --git a/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md b/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md index d50b3d1395864..3c7e96401edb4 100644 --- a/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md +++ b/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md @@ -210,7 +210,7 @@ components: Running OpenAPI Generator on that file will produce the following `.gen.ts` file ```ts -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type EntityId = z.infer; export const EntityId = z.string(); diff --git a/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars index 6e5d21363a5ae..fa750c7d1f8ab 100644 --- a/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars +++ b/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars @@ -7,13 +7,13 @@ {{> disclaimer}} -import type { ZodTypeDef } from 'zod'; -import { z } from 'zod'; +import type { ZodTypeDef } from '@kbn/zod'; +import { z } from '@kbn/zod'; import { requiredOptional, isValidDateMath, ArrayFromString, BooleanFromString } from '@kbn/zod-helpers'; {{#each imports}} -import { - {{#each this}}{{.}},{{/each}} +import { + {{#each this}}{{.}},{{/each}} } from "{{@key}}" {{/each}} diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index a33156e376972..aea38badef492 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -55,7 +55,7 @@ pageLoadAssetSize: expressionLegacyMetricVis: 23121 expressionMetric: 22238 expressionMetricVis: 23121 - expressionPartitionVis: 29700 + expressionPartitionVis: 44888 expressionRepeatImage: 22341 expressionRevealImage: 25675 expressions: 140958 @@ -136,8 +136,10 @@ pageLoadAssetSize: savedSearch: 16225 screenshotMode: 17856 screenshotting: 22870 + searchAssistant: 19831 searchConnectors: 30000 searchHomepage: 19831 + searchIndices: 20519 searchInferenceEndpoints: 20470 searchNotebooks: 18942 searchPlayground: 19325 diff --git a/packages/kbn-optimizer/src/common/bundle.test.ts b/packages/kbn-optimizer/src/common/bundle.test.ts index 59d730dd661be..58acd982bf383 100644 --- a/packages/kbn-optimizer/src/common/bundle.test.ts +++ b/packages/kbn-optimizer/src/common/bundle.test.ts @@ -59,7 +59,7 @@ it('creates cache keys', () => { }, "dllName": "manifest-name", "dllRefs": Object { - "./some-foo.ts": "1:ku/53aRMuAA+4TmQeCWA/w:GtuPW9agF2yecW0xAIHtUQ", + "./some-foo.ts": "1:8ZZnQFMG7xLG5lQakybjWCNbihQ:6Yk7GIWDT9j4uCAeHPI2xJcHgrE", }, "spec": Object { "banner": undefined, diff --git a/packages/kbn-optimizer/src/common/dll_manifest.ts b/packages/kbn-optimizer/src/common/dll_manifest.ts index 6192e6cd4135a..f4e86eb9ee948 100644 --- a/packages/kbn-optimizer/src/common/dll_manifest.ts +++ b/packages/kbn-optimizer/src/common/dll_manifest.ts @@ -19,7 +19,7 @@ export interface ParsedDllManifest { } const hash = (s: string) => { - return Crypto.createHash('md5').update(s).digest('base64').replace(/=+$/, ''); + return Crypto.createHash('sha1').update(s).digest('base64').replace(/=+$/, ''); }; export function parseDllManifest(manifest: DllManifest): ParsedDllManifest { diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 646b3c42da1ac..f81d0e89fb983 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -50,6 +50,7 @@ export function getWebpackConfig( profile: worker.profileWebpack, output: { + hashFunction: 'sha1', path: bundle.outputDir, filename: `${bundle.id}.${bundle.type}.js`, chunkFilename: `${bundle.id}.chunk.[id].js`, diff --git a/packages/kbn-reporting/common/schema_utils.ts b/packages/kbn-reporting/common/schema_utils.ts index 6e3d193489ec1..d32f93b237977 100644 --- a/packages/kbn-reporting/common/schema_utils.ts +++ b/packages/kbn-reporting/common/schema_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ByteSizeValue } from '@kbn/config-schema'; +import type { ByteSizeValue } from '@kbn/config-schema'; import moment from 'moment'; /* diff --git a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap index 3e16455f5006e..a3c634f582d43 100644 --- a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap +++ b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap @@ -44,7 +44,7 @@ Object { "paths": Object { "/foo/{id}": Object { "get": Object { - "operationId": "/foo/{id}#0", + "operationId": "%2Ffoo%2F%7Bid%7D#0", "parameters": Array [ Object { "description": "The version of the API to use", @@ -138,7 +138,7 @@ Object { "/bar": Object { "get": Object { "deprecated": true, - "operationId": "/bar#0", + "operationId": "%2Fbar#0", "parameters": Array [ Object { "description": "The version of the API to use", @@ -229,7 +229,7 @@ OK response oas-test-version-2", "/foo/{id}/{path*}": Object { "delete": Object { "description": "route description", - "operationId": "/foo/{id}/{path*}#2", + "operationId": "%2Ffoo%2F%7Bid%7D%2F%7Bpath*%7D#2", "parameters": Array [ Object { "description": "The version of the API to use", @@ -267,7 +267,7 @@ OK response oas-test-version-2", }, "get": Object { "description": "route description", - "operationId": "/foo/{id}/{path*}#0", + "operationId": "%2Ffoo%2F%7Bid%7D%2F%7Bpath*%7D#0", "parameters": Array [ Object { "description": "The version of the API to use", @@ -413,7 +413,7 @@ OK response oas-test-version-2", }, "post": Object { "description": "route description", - "operationId": "/foo/{id}/{path*}#1", + "operationId": "%2Ffoo%2F%7Bid%7D%2F%7Bpath*%7D#1", "parameters": Array [ Object { "description": "The version of the API to use", @@ -570,7 +570,7 @@ OK response oas-test-version-2", }, "/no-xsrf/{id}/{path*}": Object { "post": Object { - "operationId": "/no-xsrf/{id}/{path*}#1", + "operationId": "%2Fno-xsrf%2F%7Bid%7D%2F%7Bpath*%7D#1", "parameters": Array [ Object { "description": "The version of the API to use", @@ -721,7 +721,7 @@ Object { "paths": Object { "/recursive": Object { "get": Object { - "operationId": "/recursive#0", + "operationId": "%2Frecursive#0", "parameters": Array [ Object { "description": "The version of the API to use", @@ -804,7 +804,7 @@ Object { "paths": Object { "/foo/{id}": Object { "get": Object { - "operationId": "/foo/{id}#0", + "operationId": "%2Ffoo%2F%7Bid%7D#0", "parameters": Array [ Object { "description": "The version of the API to use", @@ -842,7 +842,7 @@ Object { }, "/test": Object { "get": Object { - "operationId": "/test#0", + "operationId": "%2Ftest#0", "parameters": Array [ Object { "description": "The version of the API to use", diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts index 09bb6064c2bcb..731e07d034ebc 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { schema } from '@kbn/config-schema'; export const sharedOas = { @@ -33,7 +33,7 @@ export const sharedOas = { '/bar': { get: { deprecated: true, - operationId: '/bar#0', + operationId: '%2Fbar#0', parameters: [ { description: 'The version of the API to use', @@ -152,7 +152,7 @@ export const sharedOas = { '/foo/{id}/{path*}': { get: { description: 'route description', - operationId: '/foo/{id}/{path*}#0', + operationId: '%2Ffoo%2F%7Bid%7D%2F%7Bpath*%7D#0', parameters: [ { description: 'The version of the API to use', @@ -276,7 +276,7 @@ export const sharedOas = { }, post: { description: 'route description', - operationId: '/foo/{id}/{path*}#1', + operationId: '%2Ffoo%2F%7Bid%7D%2F%7Bpath*%7D#1', parameters: [ { description: 'The version of the API to use', diff --git a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.test.ts b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.test.ts index 5c783e739d045..71f3ff1eeca70 100644 --- a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.test.ts +++ b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.test.ts @@ -110,6 +110,39 @@ describe('processEnum', () => { ], }, }, + { + name: 'correctly transforms schema.nullable inputs', + input: { + anyOf: [ + { + description: 'test', + type: 'object', + properties: { + test: { + type: 'string', + }, + }, + required: ['test'], + }, + { + enum: [], + nullable: true, + type: undefined, + }, + ], + } as OpenAPIV3.SchemaObject, + expected: { + description: 'test', + type: 'object', + properties: { + test: { + type: 'string', + }, + }, + required: ['test'], + nullable: true, + }, + }, ])('$name', ({ input, expected }) => { processEnum(input); expect(input).toEqual(expected); diff --git a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.ts b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.ts index 7bbb7ae2c26d0..fb2e3856ae495 100644 --- a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.ts +++ b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/enum.ts @@ -9,8 +9,38 @@ import type { OpenAPIV3 } from 'openapi-types'; import { isReferenceObject } from '../../../common'; -export const processEnum = (schema: OpenAPIV3.SchemaObject) => { - if (!schema.anyOf) return; +/** Identify special case output of schema.nullable() */ +const isNullableOutput = (schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject) => { + return ( + !isReferenceObject(schema) && + Object.keys(schema).length === 3 && + schema.enum?.length === 0 && + schema.nullable === true && + schema.type === undefined + ); +}; + +/** + * Handle special case output of schema.nullable() + * + * We go from: + * { anyOf: [ { type: 'string' }, { nullable: true, enum: [] } ] } + * + * To: + * { type: 'string', nullable: true } + */ +const processNullableOutput = (schema: OpenAPIV3.SchemaObject) => { + if (schema.anyOf!.length !== 2) return false; + const idx = schema.anyOf!.findIndex((item) => isNullableOutput(item)); + if (idx === -1) return false; + const anyOf = schema.anyOf!; + delete schema.anyOf; + schema.nullable = true; + Object.assign(schema, anyOf[1 - idx]); + return true; +}; + +const prettifyEnum = (schema: OpenAPIV3.SchemaObject) => { const result: unknown[] = []; let type: OpenAPIV3.SchemaObject['type']; for (const item of schema.anyOf!) { @@ -24,3 +54,9 @@ export const processEnum = (schema: OpenAPIV3.SchemaObject) => { schema.enum = result; delete schema.anyOf; }; + +export const processEnum = (schema: OpenAPIV3.SchemaObject) => { + if (!schema.anyOf) return; + if (processNullableOutput(schema)) return; + prettifyEnum(schema); +}; diff --git a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.test.ts b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.test.ts index fd7b127ef8726..ae257aaec1edf 100644 --- a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.test.ts +++ b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.test.ts @@ -11,13 +11,10 @@ import { joi2JsonInternal } from '../../parse'; import { processObject } from './object'; test.each([ - [ - schema.object({}), - { type: 'object', properties: {}, additionalProperties: false, required: [] }, - ], + [schema.object({}), { type: 'object', properties: {}, additionalProperties: false }], [ schema.object({ never: schema.never() }), - { type: 'object', properties: {}, additionalProperties: false, required: [] }, + { type: 'object', properties: {}, additionalProperties: false }, ], [ schema.object( diff --git a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.ts b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.ts index ec5888f986bd6..0b21134061c78 100644 --- a/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.ts +++ b/packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/post_process_mutations/mutations/object.ts @@ -38,7 +38,7 @@ const populateRequiredFields = (schema: OpenAPIV3.SchemaObject): void => { } } - schema.required = required; + if (required.length > 0) schema.required = required; }; const removeNeverType = (schema: OpenAPIV3.SchemaObject): void => { diff --git a/packages/kbn-router-to-openapispec/src/operation_id_counter.test.ts b/packages/kbn-router-to-openapispec/src/operation_id_counter.test.ts new file mode 100644 index 0000000000000..270b6b6e2c982 --- /dev/null +++ b/packages/kbn-router-to-openapispec/src/operation_id_counter.test.ts @@ -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 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 { createOperationIdCounter } from './operation_id_counter'; + +test('empty case', () => { + const opIdCounter = createOperationIdCounter(); + expect(opIdCounter('')).toBe('#0'); +}); + +test('other cases', () => { + const opIdCounter = createOperationIdCounter(); + const tests = [ + ['/', '%2F#0'], + ['/api/cool', '%2Fapi%2Fcool#0'], + ['/api/cool', '%2Fapi%2Fcool#1'], + ['/api/cool', '%2Fapi%2Fcool#2'], + ['/api/cool/{variable}', '%2Fapi%2Fcool%2F%7Bvariable%7D#0'], + ['/api/cool/{optionalVariable?}', '%2Fapi%2Fcool%2F%7BoptionalVariable%3F%7D#0'], + ['/api/cool/{optionalVariable?}', '%2Fapi%2Fcool%2F%7BoptionalVariable%3F%7D#1'], + ]; + + tests.forEach(([input, expected]) => { + expect(opIdCounter(input)).toBe(expected); + }); +}); diff --git a/packages/kbn-router-to-openapispec/src/operation_id_counter.ts b/packages/kbn-router-to-openapispec/src/operation_id_counter.ts index 91fe2adf395d8..0842ec88d094f 100644 --- a/packages/kbn-router-to-openapispec/src/operation_id_counter.ts +++ b/packages/kbn-router-to-openapispec/src/operation_id_counter.ts @@ -11,6 +11,7 @@ export type OperationIdCounter = (name: string) => string; export const createOperationIdCounter = () => { const operationIdCounters = new Map(); return (name: string): string => { + name = encodeURIComponent(name); // Aliases an operationId to ensure it is unique across // multiple method+path combinations sharing a name. // "search" -> "search#0", "search#1", etc. diff --git a/packages/kbn-screenshotting-server/README.md b/packages/kbn-screenshotting-server/README.md new file mode 100644 index 0000000000000..5dbac6d0ea00f --- /dev/null +++ b/packages/kbn-screenshotting-server/README.md @@ -0,0 +1,3 @@ +# @kbn/screenshotting-server + +Stateless code pertaining to the capture of screenshots for Kibana Reporting diff --git a/packages/kbn-screenshotting-server/index.ts b/packages/kbn-screenshotting-server/index.ts new file mode 100644 index 0000000000000..8ba3e368f4629 --- /dev/null +++ b/packages/kbn-screenshotting-server/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { args } from './src/args'; +export { ChromiumArchivePaths, type PackageInfo } from './src/paths'; +export { getChromiumPackage } from './src/get_chromium_package'; +export { type ConfigType, createConfig, config, durationToNumber } from './src/config'; +export { ConfigSchema } from './src/config/schema'; diff --git a/packages/kbn-screenshotting-server/jest.config.js b/packages/kbn-screenshotting-server/jest.config.js new file mode 100644 index 0000000000000..7436a349ebfc7 --- /dev/null +++ b/packages/kbn-screenshotting-server/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-screenshotting-server'], +}; diff --git a/packages/kbn-screenshotting-server/kibana.jsonc b/packages/kbn-screenshotting-server/kibana.jsonc new file mode 100644 index 0000000000000..1f2aa1c0f5794 --- /dev/null +++ b/packages/kbn-screenshotting-server/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-server", + "id": "@kbn/screenshotting-server", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/kbn-screenshotting-server/package.json b/packages/kbn-screenshotting-server/package.json new file mode 100644 index 0000000000000..11f02c6cb5c30 --- /dev/null +++ b/packages/kbn-screenshotting-server/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/screenshotting-server", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.test.ts b/packages/kbn-screenshotting-server/src/args.test.ts similarity index 89% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.test.ts rename to packages/kbn-screenshotting-server/src/args.test.ts index d66386deb1669..b3ed9a8a4003c 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.test.ts +++ b/packages/kbn-screenshotting-server/src/args.test.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 os from 'os'; diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.ts b/packages/kbn-screenshotting-server/src/args.ts similarity index 92% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.ts rename to packages/kbn-screenshotting-server/src/args.ts index 2337e452cdc94..a1b1b82e8a24a 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/args.ts +++ b/packages/kbn-screenshotting-server/src/args.ts @@ -1,12 +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. + * 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 os from 'os'; -import type { ConfigType } from '../../../config'; +import type { ConfigType } from './config'; interface WindowSize { height: number; diff --git a/x-pack/plugins/screenshotting/server/config/create_config.test.ts b/packages/kbn-screenshotting-server/src/config/create_config.test.ts similarity index 86% rename from x-pack/plugins/screenshotting/server/config/create_config.test.ts rename to packages/kbn-screenshotting-server/src/config/create_config.test.ts index 4bc5ff65727d0..9a6a7e1cdd579 100644 --- a/x-pack/plugins/screenshotting/server/config/create_config.test.ts +++ b/packages/kbn-screenshotting-server/src/config/create_config.test.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/screenshotting/server/config/create_config.ts b/packages/kbn-screenshotting-server/src/config/create_config.ts similarity index 89% rename from x-pack/plugins/screenshotting/server/config/create_config.ts rename to packages/kbn-screenshotting-server/src/config/create_config.ts index c2ab86b5de76e..099dc0b8cb9e6 100644 --- a/x-pack/plugins/screenshotting/server/config/create_config.ts +++ b/packages/kbn-screenshotting-server/src/config/create_config.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { set } from '@kbn/safer-lodash-set'; diff --git a/x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.test.ts b/packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.test.ts similarity index 92% rename from x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.test.ts rename to packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.test.ts index 0b5f503e86921..01e863556691d 100644 --- a/x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.test.ts +++ b/packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.test.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ jest.mock('getos', () => jest.fn()); diff --git a/x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.ts b/packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.ts similarity index 90% rename from x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.ts rename to packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.ts index 34986e804f45a..19b268f20439c 100644 --- a/x-pack/plugins/screenshotting/server/config/default_chromium_sandbox_disabled.ts +++ b/packages/kbn-screenshotting-server/src/config/default_chromium_sandbox_disabled.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 getOsSync from 'getos'; diff --git a/packages/kbn-screenshotting-server/src/config/index.ts b/packages/kbn-screenshotting-server/src/config/index.ts new file mode 100644 index 0000000000000..583952da6cba6 --- /dev/null +++ b/packages/kbn-screenshotting-server/src/config/index.ts @@ -0,0 +1,94 @@ +/* + * 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 { PluginConfigDescriptor } from '@kbn/core/server'; +import { ConfigSchema, ConfigType } from './schema'; + +/** + * Helper function + */ +export const durationToNumber = (value: number | moment.Duration): number => { + if (typeof value === 'number') { + return value; + } + return value.asMilliseconds(); +}; + +/** + * Screenshotting plugin configuration schema. + */ +export const config: PluginConfigDescriptor = { + schema: ConfigSchema, + deprecations: ({ renameFromRoot }) => [ + renameFromRoot('xpack.reporting.capture.networkPolicy', 'xpack.screenshotting.networkPolicy', { + level: 'warning', + }), + renameFromRoot( + 'xpack.reporting.capture.browser.autoDownload', + 'xpack.screenshotting.browser.autoDownload', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.browser.chromium.inspect', + 'xpack.screenshotting.browser.chromium.inspect', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.browser.chromium.disableSandbox', + 'xpack.screenshotting.browser.chromium.disableSandbox', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.browser.chromium.proxy.enabled', + 'xpack.screenshotting.browser.chromium.proxy.enabled', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.browser.chromium.proxy.server', + 'xpack.screenshotting.browser.chromium.proxy.server', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.browser.chromium.proxy.bypass', + 'xpack.screenshotting.browser.chromium.proxy.bypass', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.timeouts.openUrl', + 'xpack.screenshotting.capture.timeouts.openUrl', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.timeouts.renderComplete', + 'xpack.screenshotting.capture.timeouts.renderComplete', + { level: 'warning' } + ), + renameFromRoot( + 'xpack.reporting.capture.timeouts.waitForElements', + 'xpack.screenshotting.capture.timeouts.waitForElements', + { level: 'warning' } + ), + renameFromRoot('xpack.reporting.capture.zoom', 'xpack.screenshotting.capture.zoom', { + level: 'warning', + }), + renameFromRoot('xpack.reporting.capture.loadDelay', 'xpack.screenshotting.capture.loadDelay', { + level: 'warning', + }), + ], + exposeToUsage: { + networkPolicy: false, // show as [redacted] + capture: { + timeouts: { openUrl: true, renderComplete: true, waitForElements: true }, + loadDelay: true, + zoom: true, + }, + }, +}; + +export { createConfig } from './create_config'; +export type { ConfigType } from './schema'; diff --git a/x-pack/plugins/screenshotting/server/config/schema.ts b/packages/kbn-screenshotting-server/src/config/schema.ts similarity index 94% rename from x-pack/plugins/screenshotting/server/config/schema.ts rename to packages/kbn-screenshotting-server/src/config/schema.ts index 0dda1e3ae9981..ce542f2a849f4 100644 --- a/x-pack/plugins/screenshotting/server/config/schema.ts +++ b/packages/kbn-screenshotting-server/src/config/schema.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema, TypeOf, offeringBasedSchema } from '@kbn/config-schema'; diff --git a/packages/kbn-screenshotting-server/src/get_chromium_package.ts b/packages/kbn-screenshotting-server/src/get_chromium_package.ts new file mode 100644 index 0000000000000..af79341d0046a --- /dev/null +++ b/packages/kbn-screenshotting-server/src/get_chromium_package.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 os from 'os'; +import { ChromiumArchivePaths } from './paths'; + +const paths = new ChromiumArchivePaths(); + +export const getChromiumPackage = () => { + const platform = process.platform; + const architecture = os.arch(); + + const chromiumPackageInfo = paths.find(process.platform, architecture); + if (!chromiumPackageInfo) { + throw new Error(`Unsupported platform: ${platform}-${architecture}`); + } + return chromiumPackageInfo; +}; diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts b/packages/kbn-screenshotting-server/src/paths.ts similarity index 96% rename from x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts rename to packages/kbn-screenshotting-server/src/paths.ts index ba82fe21734e4..f3c339988567f 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts +++ b/packages/kbn-screenshotting-server/src/paths.ts @@ -1,8 +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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import path from 'path'; diff --git a/packages/kbn-screenshotting-server/tsconfig.json b/packages/kbn-screenshotting-server/tsconfig.json new file mode 100644 index 0000000000000..1ca4b9da2b0f6 --- /dev/null +++ b/packages/kbn-screenshotting-server/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/safer-lodash-set", + "@kbn/config-schema" + ] +} diff --git a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap index 1bfa3200b4243..1b462f58b2ed4 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap @@ -6,21 +6,21 @@ Object { "baseElement":
@@ -30,7 +30,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" id="generated-id__eui-combobox-id" role="combobox" @@ -74,21 +74,21 @@ Object { , "container":
@@ -98,7 +98,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" id="generated-id__eui-combobox-id" role="combobox" @@ -199,20 +199,20 @@ Object { "baseElement":
@@ -222,7 +222,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" disabled="" id="generated-id__eui-combobox-id" @@ -239,20 +239,20 @@ Object { , "container":
@@ -262,7 +262,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" disabled="" id="generated-id__eui-combobox-id" @@ -336,21 +336,21 @@ Object { "baseElement":
@@ -360,7 +360,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" id="generated-id__eui-combobox-id" role="combobox" @@ -393,21 +393,21 @@ Object { , "container":
@@ -417,7 +417,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" id="generated-id__eui-combobox-id" role="combobox" @@ -507,21 +507,21 @@ Object { "baseElement":
@@ -531,7 +531,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" disabled="" id="generated-id__eui-combobox-id" @@ -557,21 +557,21 @@ Object { , "container":
@@ -581,7 +581,7 @@ Object { aria-expanded="false" aria-invalid="false" autocomplete="off" - class="euiComboBox__input" + class="euiComboBox__input emotion-euiComboBoxInput" data-test-subj="comboBoxSearchInput" disabled="" id="generated-id__eui-combobox-id" diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx index 75c7001c462d5..bf7f77837fee4 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx @@ -64,7 +64,7 @@ export const AutocompleteFieldListsComponent: React.FC name, []); + const getLabel = useCallback(({ name }: ListSchema) => name, []); const optionsMemo = useMemo( () => filterFieldToList(listData, selectedField), diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx index 6d45d4d5ab37d..722bb33f9f303 100644 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx @@ -44,7 +44,7 @@ export const OperatorComponent: React.FC = ({ selectedField, 'aria-label': ariaLabel, }): JSX.Element => { - const getLabel = useCallback(({ message }): string => message, []); + const getLabel = useCallback(({ message }: OperatorOption): string => message, []); const optionsMemo = useMemo( (): OperatorOption[] => operatorOptions != null && operatorOptions.length > 0 diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts index 7a6f0231a9f59..94ce9b7b8da74 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { EndpointList } from '../model/endpoint_list_common.gen'; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts index f36f79f7b0b2a..a8ce0d06bec96 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemHumanId, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts index cd02179c2922f..bffe32c61efad 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemId, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts index ac1f955df209e..e00e21c0d9844 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { EndpointListItem } from '../model/endpoint_list_common.gen'; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts index 30f7c80ba257c..4152f49e9ba90 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionList, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts index e3661cb8099d3..28cf72345e008 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemId, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts index 38d8cd87a430e..e3dca2cdc27a9 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemId, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json b/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json index 750feb76c4bd2..7e3c3fd7396dc 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json @@ -6,5 +6,9 @@ "exclude": ["target/**/*"], "extends": "../../tsconfig.base.json", "include": ["**/*.ts"], - "kbn_references": ["@kbn/securitysolution-exceptions-common", "@kbn/openapi-common"] + "kbn_references": [ + "@kbn/securitysolution-exceptions-common", + "@kbn/openapi-common", + "@kbn/zod", + ] } diff --git a/packages/kbn-securitysolution-es-utils/src/transform_error/index.ts b/packages/kbn-securitysolution-es-utils/src/transform_error/index.ts index d893a3e1b4ed7..8fdf8fe32907c 100644 --- a/packages/kbn-securitysolution-es-utils/src/transform_error/index.ts +++ b/packages/kbn-securitysolution-es-utils/src/transform_error/index.ts @@ -9,7 +9,7 @@ import { errors } from '@elastic/elasticsearch'; import Boom from '@hapi/boom'; import { stringifyZodError } from '@kbn/zod-helpers'; -import { ZodError } from 'zod'; +import { ZodError } from '@kbn/zod'; import { BadRequestError } from '../bad_request_error'; export interface OutputError { diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json index c9296a28f35c7..e584d504cc9c0 100644 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ b/packages/kbn-securitysolution-es-utils/tsconfig.json @@ -15,5 +15,6 @@ ], "kbn_references": [ "@kbn/zod-helpers", + "@kbn/zod", ] } diff --git a/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx index a40393bac8fcc..ab5c81d30eb5a 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import type { FC } from 'react'; -import type { IconType, SearchFilterConfig } from '@elastic/eui'; +import type { EuiSearchBarProps, IconType, SearchFilterConfig } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiSearchBar } from '@elastic/eui'; import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; import type { GetExceptionItemProps } from '../types'; @@ -73,7 +73,7 @@ const SearchBarComponent: FC = ({ onSearch, onAddExceptionClick, }) => { - const handleOnSearch = useCallback( + const handleOnSearch = useCallback>( ({ queryText }): void => { onSearch({ search: queryText }); }, diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts index 3509b26499fc9..88154be8135eb 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListHumanId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts index a11dd91aedd44..b39449b737735 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts index e30f466cc056c..7fd4235fa3570 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { UUID, NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts index e050c211e1513..28879de7ff81e 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListName, diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts index 0797b7e3b9b01..808cc84807ab1 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts index d709fd5597b80..e44334ad60e5c 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts index e5c3f19b28aa2..65ea86f9f2f35 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListHumanId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts index bb62df2e43226..f4c4fc720951a 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts index 3c89952682847..9cf4d99c4d93a 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts index 6ae1aef1f15df..b478692515bda 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { ExceptionNamespaceType, ExceptionList } from '../model/exception_list_common.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts index ec25576cc9dfe..a1b6d0ce8e26b 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { BooleanFromString } from '@kbn/zod-helpers'; import { diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts index 360e4ec747d85..28f3d2ac62b8f 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { ExceptionListItemEntryArray } from './exception_list_item_entry.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts index c297388633429..d7a0e54487783 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { ListId, ListType } from '@kbn/securitysolution-lists-common/api/model/list_common.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts index 1cd161cbcbc20..d86025c948329 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts index 5c8d5a27c38d8..9ab5ae84446f5 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListItemId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts index d740f5843b5ce..94a9c6a51895b 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts index 8fb0760677873..7fa7febd0e066 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ExceptionListId, diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts index 963628a7be5c5..82e696cbf3825 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts +++ b/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { diff --git a/packages/kbn-securitysolution-exceptions-common/tsconfig.json b/packages/kbn-securitysolution-exceptions-common/tsconfig.json index 96bc2e233e73e..a51728703b383 100644 --- a/packages/kbn-securitysolution-exceptions-common/tsconfig.json +++ b/packages/kbn-securitysolution-exceptions-common/tsconfig.json @@ -9,6 +9,7 @@ "kbn_references": [ "@kbn/openapi-common", "@kbn/zod-helpers", - "@kbn/securitysolution-lists-common" + "@kbn/securitysolution-lists-common", + "@kbn/zod" ] } diff --git a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts b/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts index 0da36d21f405b..76946be77fc3d 100644 --- a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts +++ b/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts @@ -204,6 +204,26 @@ describe('Helpers', () => { ]) ).toBeTruthy(); }); + + test('it returns true if there are entries joined with an OR that have a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard?', field: '', operator: 'included' }], + }, + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard?*', field: '', operator: 'included' }], + }, + ]) + ).toBeTruthy(); + }); + test('it returns false if there are no exception entries with a wildcard and the wrong operator', () => { expect( hasWrongOperatorWithWildcard([ @@ -219,5 +239,25 @@ describe('Helpers', () => { ]) ).toBeFalsy(); }); + + test('it returns true if there are nested entries with a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [ + { type: 'match', value: 'nowildcard', field: '', operator: 'excluded' }, + { + field: '', + type: 'nested', + entries: [{ type: 'match', value: 'wildcard?', field: '', operator: 'excluded' }], + }, + ], + }, + ]) + ).toBeTruthy(); + }); }); }); diff --git a/packages/kbn-securitysolution-list-utils/src/helpers/index.ts b/packages/kbn-securitysolution-list-utils/src/helpers/index.ts index c969ac82c8a19..27598fb18110c 100644 --- a/packages/kbn-securitysolution-list-utils/src/helpers/index.ts +++ b/packages/kbn-securitysolution-list-utils/src/helpers/index.ts @@ -1032,7 +1032,16 @@ export const getMappingConflictsInfo = (field: DataViewField): FieldConflictsInf export const hasWrongOperatorWithWildcard = ( items: ExceptionsBuilderReturnExceptionItem[] ): boolean => { - const allEntries = items.flatMap((item) => item.entries); + // flattens array of multiple entries added with OR + const multipleEntries = items.flatMap((item) => item.entries); + // flattens nested entries + const allEntries = multipleEntries.flatMap((item) => { + if (item.type === 'nested') { + return item.entries; + } + return item; + }); + return allEntries.some((e) => { if (e.type !== 'list' && 'value' in e) { return validateHasWildcardWithWrongOperator({ diff --git a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts index 22c4a1c47bb8a..479f755956f52 100644 --- a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId, diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts index b2217f2016422..ebf5229162334 100644 --- a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type CreateListIndexResponse = z.infer; export const CreateListIndexResponse = z.object({ diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts index 94e1be2171921..da325ddefce0a 100644 --- a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListItemId, ListId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; import { ListItem } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts index fe058928eca0b..26eb9f522dbe2 100644 --- a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { BooleanFromString } from '@kbn/zod-helpers'; import { ListId } from '../model/list_common.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts index 3be609d0b8a92..2b4cbe10ab608 100644 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type DeleteListIndexResponse = z.infer; export const DeleteListIndexResponse = z.object({ diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts index d94b2f18d6158..20eb9b0d2c0d1 100644 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId } from '../model/list_common.gen'; import { ListItem } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts b/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts index 0e831e0887bd0..ddc71d79568ae 100644 --- a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId } from '../model/list_common.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts b/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts index adc9574833813..f3ae2fbcde50e 100644 --- a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { ListId } from '../model/list_common.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts b/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts index 96fcaa5eefca4..5ec1be6b381ad 100644 --- a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; import { List } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts b/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts index 5748e6a78e2c0..8f15c39a3bcb8 100644 --- a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId, ListType } from '../model/list_common.gen'; import { List } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts b/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts index f4a6a007fed9b..26c79eaaf7bbe 100644 --- a/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts b/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts index c70278df938ce..1d7ff3678565e 100644 --- a/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts @@ -15,7 +15,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId, diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts index 47eeb87d0f5d4..e4619e5def99b 100644 --- a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; import { List } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts index ce29d68bed7a7..0cf7f7594fbe3 100644 --- a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; import { ListItem } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts index c0f00a8718de1..fb04e41f9ac72 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId } from '../model/list_common.gen'; import { List } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts index 3658cb1001bed..813620934baa5 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type ReadListIndexResponse = z.infer; export const ReadListIndexResponse = z.object({ diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts index f981835219c80..e214e492c9cd7 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId } from '../model/list_common.gen'; import { ListItem } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts index 26dd21fed8652..7c3a97665f374 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type ListPrivileges = z.infer; export const ListPrivileges = z.object({ diff --git a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts index 833239a7eb82b..362cfc4361fba 100644 --- a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; import { List } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts index 069c101beaaf4..d8257e739b05f 100644 --- a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts +++ b/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts @@ -15,7 +15,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; import { ListItem } from '../model/list_schemas.gen'; diff --git a/packages/kbn-securitysolution-lists-common/tsconfig.json b/packages/kbn-securitysolution-lists-common/tsconfig.json index b6a14b40363c7..59070e0a49731 100644 --- a/packages/kbn-securitysolution-lists-common/tsconfig.json +++ b/packages/kbn-securitysolution-lists-common/tsconfig.json @@ -6,5 +6,9 @@ "exclude": ["target/**/*"], "extends": "../../tsconfig.base.json", "include": ["**/*.ts"], - "kbn_references": ["@kbn/zod-helpers", "@kbn/openapi-common"] + "kbn_references": [ + "@kbn/zod-helpers", + "@kbn/openapi-common", + "@kbn/zod", + ] } diff --git a/packages/kbn-server-http-tools/kibana.jsonc b/packages/kbn-server-http-tools/kibana.jsonc index c2b6aae999c2f..f540a5be09123 100644 --- a/packages/kbn-server-http-tools/kibana.jsonc +++ b/packages/kbn-server-http-tools/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/server-http-tools", "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-server-route-repository-client/index.ts b/packages/kbn-server-route-repository-client/index.ts index d2572e009bd66..dc2fd26f4ef53 100644 --- a/packages/kbn-server-route-repository-client/index.ts +++ b/packages/kbn-server-route-repository-client/index.ts @@ -7,4 +7,10 @@ */ export { createRepositoryClient } from './src/create_repository_client'; -export type { DefaultClientOptions } from '@kbn/server-route-repository-utils'; +export { isHttpFetchError } from './src/is_http_fetch_error'; + +export type { + DefaultClientOptions, + ClientRequestParamsOf, + RouteRepositoryClient, +} from '@kbn/server-route-repository-utils'; diff --git a/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts b/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts new file mode 100644 index 0000000000000..82d19cafb404e --- /dev/null +++ b/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IHttpFetchError, isHttpFetchError as coreIsHttpFetchError } from '@kbn/core-http-browser'; + +interface ErrorBody { + statusCode: number; + message: string; + error: string; +} + +export function isHttpFetchError(error: unknown): error is IHttpFetchError { + return coreIsHttpFetchError(error); +} diff --git a/packages/kbn-server-route-repository-client/tsconfig.json b/packages/kbn-server-route-repository-client/tsconfig.json index 8ef10ede60a1a..8e70ce9851750 100644 --- a/packages/kbn-server-route-repository-client/tsconfig.json +++ b/packages/kbn-server-route-repository-client/tsconfig.json @@ -16,5 +16,6 @@ "kbn_references": [ "@kbn/server-route-repository-utils", "@kbn/core-lifecycle-browser", + "@kbn/core-http-browser", ] } diff --git a/packages/kbn-server-route-repository-utils/index.ts b/packages/kbn-server-route-repository-utils/index.ts index bfcc03c0e64c5..ce2139badd8e6 100644 --- a/packages/kbn-server-route-repository-utils/index.ts +++ b/packages/kbn-server-route-repository-utils/index.ts @@ -24,4 +24,6 @@ export type { DefaultClientOptions, DefaultRouteCreateOptions, DefaultRouteHandlerResources, + IoTsParamsObject, + ZodParamsObject, } from './src/typings'; diff --git a/packages/kbn-server-route-repository-utils/src/typings.ts b/packages/kbn-server-route-repository-utils/src/typings.ts index 0539d9ea1d38e..92580c852e40e 100644 --- a/packages/kbn-server-route-repository-utils/src/typings.ts +++ b/packages/kbn-server-route-repository-utils/src/typings.ts @@ -9,16 +9,49 @@ import type { HttpFetchOptions } from '@kbn/core-http-browser'; import type { IKibanaResponse } from '@kbn/core-http-server'; import type { - RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, Logger, + RequestHandlerContext, RouteConfigOptions, RouteMethod, - KibanaRequest, - KibanaResponseFactory, } from '@kbn/core/server'; +import { z } from '@kbn/zod'; import * as t from 'io-ts'; import { RequiredKeys } from 'utility-types'; +type PathMaybeOptional }> = RequiredKeys< + T['path'] +> extends never + ? { path?: T['path'] } + : { path: T['path'] }; + +type QueryMaybeOptional }> = RequiredKeys< + T['query'] +> extends never + ? { query?: T['query'] } + : { query: T['query'] }; + +type BodyMaybeOptional }> = RequiredKeys< + T['body'] +> extends never + ? { body?: T['body'] } + : { body: T['body'] }; + +type ParamsMaybeOptional< + TPath extends Record, + TQuery extends Record, + TBody extends Record +> = PathMaybeOptional<{ path: TPath }> & + QueryMaybeOptional<{ query: TQuery }> & + BodyMaybeOptional<{ body: TBody }>; + +type ZodMaybeOptional = ParamsMaybeOptional< + T['path'], + T['query'], + T['body'] +>; + type MaybeOptional }> = RequiredKeys< T['params'] > extends never @@ -30,7 +63,13 @@ type WithoutIncompatibleMethods = Omit t.Encoder; }; -export type RouteParamsRT = WithoutIncompatibleMethods< +export type ZodParamsObject = z.ZodObject<{ + path?: any; + query?: any; + body?: any; +}>; + +export type IoTsParamsObject = WithoutIncompatibleMethods< t.Type<{ path?: any; query?: any; @@ -38,6 +77,8 @@ export type RouteParamsRT = WithoutIncompatibleMethods< }> >; +export type RouteParamsRT = IoTsParamsObject | ZodParamsObject; + export interface RouteState { [endpoint: string]: ServerRoute; } @@ -82,6 +123,10 @@ type ClientRequestParamsOfType = ? MaybeOptional<{ params: t.OutputOf; }> + : TRouteParamsRT extends z.Schema + ? MaybeOptional<{ + params: ZodMaybeOptional>; + }> : {}; type DecodedRequestParamsOfType = @@ -89,6 +134,10 @@ type DecodedRequestParamsOfType = ? MaybeOptional<{ params: t.TypeOf; }> + : TRouteParamsRT extends z.Schema + ? MaybeOptional<{ + params: ZodMaybeOptional>; + }> : {}; export type EndpointOf = @@ -145,7 +194,7 @@ type MaybeOptionalArgs> = RequiredKeys extends export type RouteRepositoryClient< TServerRouteRepository extends ServerRouteRepository, - TAdditionalClientOptions extends Record + TAdditionalClientOptions extends Record = DefaultClientOptions > = >( endpoint: TEndpoint, ...args: MaybeOptionalArgs< diff --git a/packages/kbn-server-route-repository-utils/tsconfig.json b/packages/kbn-server-route-repository-utils/tsconfig.json index 0f3dd221ec6b7..cb5d9846f6cc8 100644 --- a/packages/kbn-server-route-repository-utils/tsconfig.json +++ b/packages/kbn-server-route-repository-utils/tsconfig.json @@ -19,5 +19,6 @@ "@kbn/core-http-browser", "@kbn/core-http-server", "@kbn/core", + "@kbn/zod", ] } diff --git a/packages/kbn-server-route-repository/README.md b/packages/kbn-server-route-repository/README.md index f46a8f3ee3677..c34cf6654ba43 100644 --- a/packages/kbn-server-route-repository/README.md +++ b/packages/kbn-server-route-repository/README.md @@ -88,9 +88,7 @@ The client can be created either in `setup` or `start`. > browser/plugin.ts ```javascript -import { isHttpFetchError } from '@kbn/core-http-browser'; -import { DefaultClientOptions } from '@kbn/server-route-repository-utils'; -import { createRepositoryClient } from '@kbn/server-route-repository-client'; +import { createRepositoryClient, isHttpFetchError, DefaultClientOptions } from '@kbn/server-route-repository-client'; import type { MyPluginRouteRepository } from '../server/plugin'; export type MyPluginRepositoryClient = @@ -127,22 +125,22 @@ The client translates the endpoint and the options (including request parameters ## Request parameter validation -When creating your routes, you can also provide an `io-ts` codec to be used when validating incoming requests. +When creating your routes, you can provide either a `zod` schema or an `io-ts` codec to be used when validating incoming requests. ```javascript -import * as t from 'io-ts'; +import { z } from '@kbn/zod'; const myRoute = createMyPluginServerRoute({ - endpoint: 'GET /internal/my_plugin/route/{my_path_param}', - params: t.type({ - path: t.type({ - my_path_param: t.string, + endpoint: 'POST /internal/my_plugin/route/{my_path_param}', + params: z.object({ + path: z.object({ + my_path_param: z.string(), }), - query: t.type({ - my_query_param: t.string, + query: z.object({ + my_query_param: z.string(), }), - body: t.type({ - my_body_param: t.string, + body: z.object({ + my_body_param: z.string(), }), }), handler: async (resources) => { @@ -162,7 +160,7 @@ The `params` object is added to the route resources. When calling this endpoint, it will look like this: ```javascript -client('GET /internal/my_plugin/route/{my_path_param}', { +client('POST /internal/my_plugin/route/{my_path_param}', { params: { path: { my_path_param: 'some_path_value', @@ -179,6 +177,9 @@ client('GET /internal/my_plugin/route/{my_path_param}', { Where the shape of `params` is typed to match the expected shape, meaning you don't need to manually use the codec when calling the route. +> When using `zod` you also opt into the Kibana platforms automatic OpenAPI specification generation tooling. +> By adding `server.oas.enabled: true` to your `kibana.yml` and visiting `/api/oas?pluginId=yourPluginId` you can see the generated specification. + ## Public routes To define a public route, you need to change the endpoint path and add a version. diff --git a/packages/kbn-server-route-repository/index.ts b/packages/kbn-server-route-repository/index.ts index e4e43523d25c3..5a2bcb89ec3a4 100644 --- a/packages/kbn-server-route-repository/index.ts +++ b/packages/kbn-server-route-repository/index.ts @@ -9,7 +9,8 @@ export { formatRequest, parseEndpoint } from '@kbn/server-route-repository-utils'; export { createServerRouteFactory } from './src/create_server_route_factory'; export { decodeRequestParams } from './src/decode_request_params'; -export { routeValidationObject } from './src/route_validation_object'; +export { stripNullishRequestParameters } from './src/strip_nullish_request_parameters'; +export { passThroughValidationObject } from './src/validation_objects'; export { registerRoutes } from './src/register_routes'; export type { @@ -24,4 +25,5 @@ export type { RouteState, DefaultRouteCreateOptions, DefaultRouteHandlerResources, + IoTsParamsObject, } from '@kbn/server-route-repository-utils'; diff --git a/packages/kbn-server-route-repository/src/decode_request_params.test.ts b/packages/kbn-server-route-repository/src/decode_request_params.test.ts index 0cb8d280f28e4..9041f68643317 100644 --- a/packages/kbn-server-route-repository/src/decode_request_params.test.ts +++ b/packages/kbn-server-route-repository/src/decode_request_params.test.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { jsonRt } from '@kbn/io-ts-utils'; + import * as t from 'io-ts'; import { decodeRequestParams } from './decode_request_params'; @@ -14,10 +14,9 @@ describe('decodeRequestParams', () => { const decode = () => { return decodeRequestParams( { - params: { + path: { serviceName: 'opbeans-java', }, - body: null, query: { start: '', }, @@ -48,11 +47,10 @@ describe('decodeRequestParams', () => { const decode = () => { return decodeRequestParams( { - params: { + path: { serviceName: 'opbeans-java', extraKey: '', }, - body: null, query: { start: '', }, @@ -74,81 +72,4 @@ describe('decodeRequestParams', () => { path.extraKey" `); }); - - it('returns the decoded output', () => { - const decode = () => { - return decodeRequestParams( - { - params: {}, - query: { - _inspect: 'true', - }, - body: null, - }, - t.type({ - query: t.type({ - _inspect: jsonRt.pipe(t.boolean), - }), - }) - ); - }; - - expect(decode).not.toThrow(); - - expect(decode()).toEqual({ - query: { - _inspect: true, - }, - }); - }); - - it('strips empty params', () => { - const decode = () => { - return decodeRequestParams( - { - params: {}, - query: {}, - body: {}, - }, - t.type({ - body: t.any, - }) - ); - }; - - expect(decode).not.toThrow(); - - expect(decode()).toEqual({}); - }); - - it('allows excess keys in an any type', () => { - const decode = () => { - return decodeRequestParams( - { - params: {}, - query: {}, - body: { - body: { - query: 'foo', - }, - }, - }, - t.type({ - body: t.type({ - body: t.any, - }), - }) - ); - }; - - expect(decode).not.toThrow(); - - expect(decode()).toEqual({ - body: { - body: { - query: 'foo', - }, - }, - }); - }); }); diff --git a/packages/kbn-server-route-repository/src/decode_request_params.ts b/packages/kbn-server-route-repository/src/decode_request_params.ts index bae6e4d4a0e12..fe7c93b2e7397 100644 --- a/packages/kbn-server-route-repository/src/decode_request_params.ts +++ b/packages/kbn-server-route-repository/src/decode_request_params.ts @@ -7,32 +7,16 @@ */ import Boom from '@hapi/boom'; import { formatErrors, strictKeysRt } from '@kbn/io-ts-utils'; -import { RouteParamsRT } from '@kbn/server-route-repository-utils'; +import { IoTsParamsObject } from '@kbn/server-route-repository-utils'; import { isLeft } from 'fp-ts/lib/Either'; import * as t from 'io-ts'; -import { isEmpty, isPlainObject, omitBy } from 'lodash'; -interface KibanaRequestParams { - body: unknown; - query: unknown; - params: unknown; -} - -export function decodeRequestParams( - params: KibanaRequestParams, +export function decodeRequestParams( + params: Partial<{ path: any; query: any; body: any }>, paramsRt: T ): t.OutputOf { - const paramMap = omitBy( - { - path: params.params, - body: params.body, - query: params.query, - }, - (val) => val === null || val === undefined || (isPlainObject(val) && isEmpty(val)) - ); - // decode = validate - const result = strictKeysRt(paramsRt).decode(paramMap); + const result = strictKeysRt(paramsRt).decode(params); if (isLeft(result)) { throw Boom.badRequest(formatErrors(result.left)); diff --git a/packages/kbn-server-route-repository/src/make_zod_validation_object.test.ts b/packages/kbn-server-route-repository/src/make_zod_validation_object.test.ts new file mode 100644 index 0000000000000..b06bfebe613c5 --- /dev/null +++ b/packages/kbn-server-route-repository/src/make_zod_validation_object.test.ts @@ -0,0 +1,50 @@ +/* + * 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 { z } from '@kbn/zod'; +import { makeZodValidationObject } from './make_zod_validation_object'; +import { noParamsValidationObject } from './validation_objects'; + +describe('makeZodValidationObject', () => { + it('translate path to params', () => { + const schema = z.object({ + path: z.object({}), + }); + + expect(makeZodValidationObject(schema)).toMatchObject({ + params: expect.anything(), + }); + }); + + it('makes all object types strict', () => { + const schema = z.object({ + path: z.object({}), + query: z.object({}), + body: z.string(), + }); + + const pathStrictSpy = jest.spyOn(schema.shape.path, 'strict'); + const queryStrictSpy = jest.spyOn(schema.shape.query, 'strict'); + + expect(makeZodValidationObject(schema)).toEqual({ + params: pathStrictSpy.mock.results[0].value, + query: queryStrictSpy.mock.results[0].value, + body: schema.shape.body, + }); + }); + + it('sets key to strict empty if schema is missing key', () => { + const schema = z.object({}); + + expect(makeZodValidationObject(schema)).toStrictEqual({ + params: noParamsValidationObject.params, + query: noParamsValidationObject.query, + body: noParamsValidationObject.body, + }); + }); +}); diff --git a/packages/kbn-server-route-repository/src/make_zod_validation_object.ts b/packages/kbn-server-route-repository/src/make_zod_validation_object.ts new file mode 100644 index 0000000000000..5e3634f6f0333 --- /dev/null +++ b/packages/kbn-server-route-repository/src/make_zod_validation_object.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ZodObject, ZodAny } from '@kbn/zod'; +import { ZodParamsObject } from '@kbn/server-route-repository-utils'; +import { noParamsValidationObject } from './validation_objects'; + +export function makeZodValidationObject(params: ZodParamsObject) { + return { + params: params.shape.path ? asStrict(params.shape.path) : noParamsValidationObject.params, + query: params.shape.query ? asStrict(params.shape.query) : noParamsValidationObject.query, + body: params.shape.body ? asStrict(params.shape.body) : noParamsValidationObject.body, + }; +} + +function asStrict(schema: ZodAny) { + if (schema instanceof ZodObject) { + return schema.strict(); + } else { + return schema; + } +} diff --git a/packages/kbn-server-route-repository/src/register_routes.test.ts b/packages/kbn-server-route-repository/src/register_routes.test.ts index 39180a093835a..8be38bb5891cc 100644 --- a/packages/kbn-server-route-repository/src/register_routes.test.ts +++ b/packages/kbn-server-route-repository/src/register_routes.test.ts @@ -6,59 +6,39 @@ * Side Public License, v 1. */ -import * as t from 'io-ts'; import { CoreSetup, kibanaResponseFactory } from '@kbn/core/server'; import { loggerMock } from '@kbn/logging-mocks'; -import { registerRoutes } from './register_routes'; -import { routeValidationObject } from './route_validation_object'; +import { z } from '@kbn/zod'; +import * as t from 'io-ts'; import { NEVER } from 'rxjs'; +import * as makeZodValidationObject from './make_zod_validation_object'; +import { registerRoutes } from './register_routes'; +import { passThroughValidationObject, noParamsValidationObject } from './validation_objects'; describe('registerRoutes', () => { - const get = jest.fn(); - - const getAddVersion = jest.fn(); - const getWithVersion = jest.fn((_options) => { + const post = jest.fn(); + const postAddVersion = jest.fn(); + const postWithVersion = jest.fn((_options) => { return { - addVersion: getAddVersion, + addVersion: postAddVersion, }; }); - const createRouter = jest.fn().mockReturnValue({ - get, + post, versioned: { - get: getWithVersion, + post: postWithVersion, }, }); - - const internalOptions = { - internal: true, - }; - const publicOptions = { - public: true, - }; - - const internalHandler = jest.fn().mockResolvedValue('internal'); - const publicHandler = jest - .fn() - .mockResolvedValue( - kibanaResponseFactory.custom({ statusCode: 201, body: { message: 'public' } }) - ); - const errorHandler = jest.fn().mockRejectedValue(new Error('error')); - + const coreSetup = { + http: { + createRouter, + }, + } as unknown as CoreSetup; const mockLogger = loggerMock.create(); const mockService = jest.fn(); const mockContext = {}; const mockRequest = { - body: { - bodyParam: 'body', - }, - query: { - queryParam: 'query', - }, - params: { - pathParam: 'path', - }, events: { aborted$: NEVER, }, @@ -66,99 +46,129 @@ describe('registerRoutes', () => { beforeEach(() => { jest.clearAllMocks(); + }); - const coreSetup = { - http: { - createRouter, - }, - } as unknown as CoreSetup; - - const paramsRt = t.type({ - body: t.type({ - bodyParam: t.string, - }), - query: t.type({ - queryParam: t.string, - }), - path: t.type({ - pathParam: t.string, - }), - }); - - registerRoutes({ - core: coreSetup, - repository: { - 'GET /internal/app/feature': { - endpoint: 'GET /internal/app/feature', - handler: internalHandler, - params: paramsRt, - options: internalOptions, - }, - 'GET /api/app/feature version': { - endpoint: 'GET /api/app/feature version', - handler: publicHandler, - params: paramsRt, - options: publicOptions, - }, - 'GET /internal/app/feature/error': { - endpoint: 'GET /internal/app/feature/error', - handler: errorHandler, - params: paramsRt, - options: internalOptions, + it('creates a router and defines the routes', () => { + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + handler: jest.fn(), + options: { + internal: true, }, }, - dependencies: { - aService: mockService, + 'POST /api/public_route version': { + endpoint: 'POST /api/public_route version', + handler: jest.fn(), + options: { + public: true, + }, }, - logger: mockLogger, }); - }); - it('creates a router and defines the routes', () => { expect(createRouter).toHaveBeenCalledTimes(1); - expect(get).toHaveBeenCalledTimes(2); + expect(post).toHaveBeenCalledTimes(1); - const [internalRoute] = get.mock.calls[0]; - expect(internalRoute.path).toEqual('/internal/app/feature'); - expect(internalRoute.options).toEqual(internalOptions); - expect(internalRoute.validate).toEqual(routeValidationObject); + const [internalRoute] = post.mock.calls[0]; + expect(internalRoute.path).toEqual('/internal/route'); + expect(internalRoute.options).toEqual({ + internal: true, + }); + expect(internalRoute.validate).toEqual(noParamsValidationObject); - expect(getWithVersion).toHaveBeenCalledTimes(1); - const [publicRoute] = getWithVersion.mock.calls[0]; - expect(publicRoute.path).toEqual('/api/app/feature'); - expect(publicRoute.options).toEqual(publicOptions); + expect(postWithVersion).toHaveBeenCalledTimes(1); + const [publicRoute] = postWithVersion.mock.calls[0]; + expect(publicRoute.path).toEqual('/api/public_route'); + expect(publicRoute.options).toEqual({ + public: true, + }); expect(publicRoute.access).toEqual('public'); - expect(getAddVersion).toHaveBeenCalledTimes(1); - const [versionedRoute] = getAddVersion.mock.calls[0]; + expect(postAddVersion).toHaveBeenCalledTimes(1); + const [versionedRoute] = postAddVersion.mock.calls[0]; expect(versionedRoute.version).toEqual('version'); expect(versionedRoute.validate).toEqual({ - request: routeValidationObject, + request: noParamsValidationObject, }); }); + it('does not allow any params if no schema is provided', () => { + const pathDoesNotAllowExcessKeys = () => { + noParamsValidationObject.params.parse({ + unexpectedKey: 'not_allowed', + }); + }; + const queryDoesNotAllowExcessKeys = () => { + noParamsValidationObject.query.parse({ + unexpectedKey: 'not_allowed', + }); + }; + const bodyDoesNotAllowExcessKeys = () => { + noParamsValidationObject.body.parse({ + unexpectedKey: 'not_allowed', + }); + }; + + expect(pathDoesNotAllowExcessKeys).toThrowErrorMatchingInlineSnapshot(` + "[ + { + \\"code\\": \\"unrecognized_keys\\", + \\"keys\\": [ + \\"unexpectedKey\\" + ], + \\"path\\": [], + \\"message\\": \\"Unrecognized key(s) in object: 'unexpectedKey'\\" + } + ]" + `); + expect(queryDoesNotAllowExcessKeys).toThrowErrorMatchingInlineSnapshot(` + "[ + { + \\"code\\": \\"unrecognized_keys\\", + \\"keys\\": [ + \\"unexpectedKey\\" + ], + \\"path\\": [], + \\"message\\": \\"Unrecognized key(s) in object: 'unexpectedKey'\\" + } + ]" + `); + expect(bodyDoesNotAllowExcessKeys).toThrowErrorMatchingInlineSnapshot(` + "[ + { + \\"code\\": \\"unrecognized_keys\\", + \\"keys\\": [ + \\"unexpectedKey\\" + ], + \\"path\\": [], + \\"message\\": \\"Unrecognized key(s) in object: 'unexpectedKey'\\" + } + ]" + `); + }); + it('calls the route handler with all dependencies', async () => { - const [_, internalRouteHandler] = get.mock.calls[0]; - await internalRouteHandler(mockContext, mockRequest, kibanaResponseFactory); + const handler = jest.fn(); + + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + handler, + }, + }); - const [args] = internalHandler.mock.calls[0]; + const [_, wrappedHandler] = post.mock.calls[0]; + await wrappedHandler(mockContext, mockRequest, kibanaResponseFactory); + + expect(handler).toBeCalledTimes(1); + const [args] = handler.mock.calls[0]; expect(Object.keys(args).sort()).toEqual( ['aService', 'request', 'response', 'context', 'params', 'logger'].sort() ); const { params, logger, aService, request, response, context } = args; - expect(params).toEqual({ - body: { - bodyParam: 'body', - }, - query: { - queryParam: 'query', - }, - path: { - pathParam: 'path', - }, - }); + expect(params).toEqual(undefined); expect(request).toBe(mockRequest); expect(response).toBe(kibanaResponseFactory); expect(context).toBe(mockContext); @@ -167,38 +177,226 @@ describe('registerRoutes', () => { }); it('wraps a plain route handler result into a response', async () => { - const [_, internalRouteHandler] = get.mock.calls[0]; - const internalResult = await internalRouteHandler( - mockContext, - mockRequest, - kibanaResponseFactory - ); + const handler = jest.fn().mockResolvedValue('result'); - expect(internalHandler).toHaveBeenCalledTimes(1); - expect(internalResult).toEqual({ + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + handler, + }, + }); + + const [_, wrappedHandler] = post.mock.calls[0]; + const result = await wrappedHandler(mockContext, mockRequest, kibanaResponseFactory); + + expect(handler).toHaveBeenCalledTimes(1); + expect(result).toEqual({ status: 200, - payload: 'internal', - options: { body: 'internal' }, + payload: 'result', + options: { body: 'result' }, }); }); it('allows for route handlers to define a custom response', async () => { - const [_, publicRouteHandler] = getAddVersion.mock.calls[0]; - const publicResult = await publicRouteHandler(mockContext, mockRequest, kibanaResponseFactory); + const handler = jest + .fn() + .mockResolvedValue( + kibanaResponseFactory.custom({ statusCode: 201, body: { message: 'result' } }) + ); + + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + handler, + }, + }); - expect(publicHandler).toHaveBeenCalledTimes(1); - expect(publicResult).toEqual({ status: 201, payload: { message: 'public' }, options: {} }); + const [_, wrappedHandler] = post.mock.calls[0]; + const result = await wrappedHandler(mockContext, mockRequest, kibanaResponseFactory); + + expect(handler).toHaveBeenCalledTimes(1); + expect(result).toEqual({ status: 201, payload: { message: 'result' }, options: {} }); }); it('translates errors thrown in a route handler to an error response', async () => { - const [_, errorRouteHandler] = get.mock.calls[1]; - const errorResult = await errorRouteHandler(mockContext, mockRequest, kibanaResponseFactory); + const handler = jest.fn().mockRejectedValue(new Error('error')); + + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + handler, + }, + }); - expect(errorHandler).toHaveBeenCalledTimes(1); - expect(errorResult).toEqual({ + const [_, wrappedHandler] = post.mock.calls[0]; + const error = await wrappedHandler(mockContext, mockRequest, kibanaResponseFactory); + + expect(handler).toHaveBeenCalledTimes(1); + expect(error).toEqual({ status: 500, payload: { message: 'error', attributes: { data: {} } }, options: {}, }); }); + + describe('when using zod', () => { + const makeZodValidationObjectSpy = jest.spyOn( + makeZodValidationObject, + 'makeZodValidationObject' + ); + + const zodParamsRt = z.object({ + body: z.object({ + bodyParam: z.string(), + }), + query: z.object({ + queryParam: z.string(), + }), + path: z.object({ + pathParam: z.string(), + }), + }); + + it('uses Core validation', () => { + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + params: zodParamsRt, + handler: jest.fn, + }, + }); + + const [internalRoute] = post.mock.calls[0]; + expect(makeZodValidationObjectSpy).toHaveBeenCalledWith(zodParamsRt); + expect(internalRoute.validate).toEqual(makeZodValidationObjectSpy.mock.results[0].value); + }); + + it('passes on params', async () => { + const handler = jest.fn(); + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + params: zodParamsRt, + handler, + }, + }); + + const [_, wrappedHandler] = post.mock.calls[0]; + + await wrappedHandler( + mockContext, + { + ...mockRequest, + params: { + pathParam: 'path', + }, + query: { + queryParam: 'query', + }, + body: { + bodyParam: 'body', + }, + }, + kibanaResponseFactory + ); + + expect(handler).toBeCalledTimes(1); + const [args] = handler.mock.calls[0]; + const { params } = args; + expect(params).toEqual({ + path: { + pathParam: 'path', + }, + query: { + queryParam: 'query', + }, + body: { + bodyParam: 'body', + }, + }); + }); + }); + + describe('when using io-ts', () => { + const iotsParamsRt = t.type({ + body: t.type({ + bodyParam: t.string, + }), + query: t.type({ + queryParam: t.string, + }), + path: t.type({ + pathParam: t.string, + }), + }); + + it('bypasses Core validation', () => { + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + params: iotsParamsRt, + handler: jest.fn, + }, + }); + + const [internalRoute] = post.mock.calls[0]; + expect(internalRoute.validate).toEqual(passThroughValidationObject); + }); + + it('decodes params', async () => { + const handler = jest.fn(); + callRegisterRoutes({ + 'POST /internal/route': { + endpoint: 'POST /internal/route', + params: iotsParamsRt, + handler, + }, + }); + + const [_, wrappedHandler] = post.mock.calls[0]; + + await wrappedHandler( + mockContext, + { + ...mockRequest, + params: { + pathParam: 'path', + }, + query: { + queryParam: 'query', + }, + body: { + bodyParam: 'body', + }, + }, + kibanaResponseFactory + ); + + expect(handler).toBeCalledTimes(1); + const [args] = handler.mock.calls[0]; + const { params } = args; + expect(params).toEqual({ + path: { + pathParam: 'path', + }, + query: { + queryParam: 'query', + }, + body: { + bodyParam: 'body', + }, + }); + }); + }); + + function callRegisterRoutes(repository: any) { + registerRoutes({ + core: coreSetup, + logger: mockLogger, + dependencies: { + aService: mockService, + }, + repository, + }); + } }); diff --git a/packages/kbn-server-route-repository/src/register_routes.ts b/packages/kbn-server-route-repository/src/register_routes.ts index fcf3c5c3281ee..56f42fb499225 100644 --- a/packages/kbn-server-route-repository/src/register_routes.ts +++ b/packages/kbn-server-route-repository/src/register_routes.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import { errors } from '@elastic/elasticsearch'; import { isBoom } from '@hapi/boom'; import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; @@ -12,15 +13,17 @@ import type { KibanaRequest, KibanaResponseFactory } from '@kbn/core-http-server import { isKibanaResponse } from '@kbn/core-http-server'; import type { CoreSetup } from '@kbn/core-lifecycle-server'; import type { Logger } from '@kbn/logging'; -import * as t from 'io-ts'; -import { merge, pick } from 'lodash'; import { ServerRoute, ServerRouteCreateOptions, + ZodParamsObject, parseEndpoint, } from '@kbn/server-route-repository-utils'; -import { decodeRequestParams } from './decode_request_params'; -import { routeValidationObject } from './route_validation_object'; +import { isZod } from '@kbn/zod'; +import { merge } from 'lodash'; +import { passThroughValidationObject, noParamsValidationObject } from './validation_objects'; +import { validateAndDecodeParams } from './validate_and_decode_params'; +import { makeZodValidationObject } from './make_zod_validation_object'; const CLIENT_CLOSED_REQUEST = { statusCode: 499, @@ -55,12 +58,7 @@ export function registerRoutes>({ response: KibanaResponseFactory ) => { try { - const runtimeType = params || t.strict({}); - - const validatedParams = decodeRequestParams( - pick(request, 'params', 'body', 'query'), - runtimeType - ); + const validatedParams = validateAndDecodeParams(request, params); const { aborted, result } = await Promise.race([ handler({ @@ -122,12 +120,21 @@ export function registerRoutes>({ logger.debug(`Registering endpoint ${endpoint}`); + let validationObject; + if (params === undefined) { + validationObject = noParamsValidationObject; + } else if (isZod(params)) { + validationObject = makeZodValidationObject(params as ZodParamsObject); + } else { + validationObject = passThroughValidationObject; + } + if (!version) { router[method]( { path: pathname, options, - validate: routeValidationObject, + validate: validationObject, }, wrappedHandler ); @@ -140,7 +147,7 @@ export function registerRoutes>({ { version, validate: { - request: routeValidationObject, + request: validationObject, }, }, wrappedHandler diff --git a/packages/kbn-server-route-repository/src/route_validation_object.ts b/packages/kbn-server-route-repository/src/route_validation_object.ts deleted file mode 100644 index 9d033e31fc324..0000000000000 --- a/packages/kbn-server-route-repository/src/route_validation_object.ts +++ /dev/null @@ -1,20 +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 { schema } from '@kbn/config-schema'; - -const anyObject = schema.object({}, { unknowns: 'allow' }); - -export const routeValidationObject = { - // `body` can be null, but `validate` expects non-nullable types - // if any validation is defined. Not having validation currently - // means we don't get the payload. See - // https://github.com/elastic/kibana/issues/50179 - body: schema.nullable(schema.oneOf([anyObject, schema.string()])), - params: anyObject, - query: anyObject, -}; diff --git a/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.test.ts b/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.test.ts new file mode 100644 index 0000000000000..b76c28048aeb3 --- /dev/null +++ b/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.test.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { stripNullishRequestParameters } from './strip_nullish_request_parameters'; + +describe('stripNullishRequestParameters', () => { + it('translate params to path', () => { + expect( + stripNullishRequestParameters({ + params: { + something: 'test', + }, + }) + ).toEqual({ + path: { + something: 'test', + }, + }); + }); + + it('removes invalid values', () => { + expect( + stripNullishRequestParameters({ + params: undefined, + query: null, + body: {}, + }) + ).toEqual({}); + }); +}); diff --git a/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.ts b/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.ts new file mode 100644 index 0000000000000..06668ac55a95a --- /dev/null +++ b/packages/kbn-server-route-repository/src/strip_nullish_request_parameters.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 { omitBy, isPlainObject, isEmpty } from 'lodash'; + +interface KibanaRequestParams { + body?: unknown; + query?: unknown; + params?: unknown; +} + +export function stripNullishRequestParameters(params: KibanaRequestParams) { + return omitBy<{ path: any; body: any; query: any }>( + { + path: params.params, + query: params.query, + body: params.body, + }, + (val) => val === null || val === undefined || (isPlainObject(val) && isEmpty(val)) + ); +} diff --git a/packages/kbn-server-route-repository/src/test_types.ts b/packages/kbn-server-route-repository/src/test_types.ts index 16447a6ef000f..ce4fbb6303c5c 100644 --- a/packages/kbn-server-route-repository/src/test_types.ts +++ b/packages/kbn-server-route-repository/src/test_types.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ import * as t from 'io-ts'; +import { z } from '@kbn/zod'; import { kibanaResponseFactory } from '@kbn/core/server'; import { EndpointOf, ReturnOf, RouteRepositoryClient } from '@kbn/server-route-repository-utils'; import { createServerRouteFactory } from './create_server_route_factory'; @@ -39,6 +40,18 @@ createServerRouteFactory<{}, {}>()({ }, }); +createServerRouteFactory<{}, {}>()({ + endpoint: 'GET /internal/endpoint_with_params', + params: z.object({ + path: z.object({ + serviceName: z.string(), + }), + }), + handler: async (resources) => { + assertType<{ params: { path: { serviceName: string } } }>(resources); + }, +}); + // Resources should be passed to the request handler. createServerRouteFactory<{ context: { getSpaceId: () => string } }, {}>()({ endpoint: 'GET /internal/endpoint_with_params', @@ -53,6 +66,19 @@ createServerRouteFactory<{ context: { getSpaceId: () => string } }, {}>()({ }, }); +createServerRouteFactory<{ context: { getSpaceId: () => string } }, {}>()({ + endpoint: 'GET /internal/endpoint_with_params', + params: z.object({ + path: z.object({ + serviceName: z.string(), + }), + }), + handler: async ({ context }) => { + const spaceId = context.getSpaceId(); + assertType(spaceId); + }, +}); + // Create options are available when registering a route. createServerRouteFactory<{}, { options: { tags: string[] } }>()({ endpoint: 'GET /internal/endpoint_with_params', @@ -125,6 +151,36 @@ const repository = { }; }, }), + ...createServerRoute({ + endpoint: 'GET /internal/endpoint_with_params_zod', + params: z.object({ + path: z.object({ + serviceName: z.string(), + }), + }), + handler: async () => { + return { + yesParamsForMe: true, + }; + }, + }), + ...createServerRoute({ + endpoint: 'GET /internal/endpoint_with_optional_params_zod', + params: z + .object({ + path: z + .object({ + serviceName: z.string(), + }) + .partial(), + }) + .partial(), + handler: async () => { + return { + someParamsForMe: true, + }; + }, + }), ...createServerRoute({ endpoint: 'GET /internal/endpoint_returning_result', handler: async () => { @@ -153,6 +209,10 @@ assertType>>([ 'GET /internal/endpoint_with_params', 'GET /internal/endpoint_without_params', 'GET /internal/endpoint_with_optional_params', + 'GET /internal/endpoint_with_params_zod', + 'GET /internal/endpoint_with_optional_params_zod', + 'GET /internal/endpoint_returning_result', + 'GET /internal/endpoint_returning_kibana_response', ]); // @ts-expect-error Type '"this_endpoint_does_not_exist"' is not assignable to type '"endpoint_without_params" | "endpoint_with_params" | "endpoint_with_optional_params"' @@ -208,11 +268,23 @@ client('GET /internal/endpoint_with_params', { timeout: 1, }); +client('GET /internal/endpoint_with_params_zod', { + params: { + // @ts-expect-error property 'serviceName' is missing in type '{}' + path: {}, + }, + timeout: 1, +}); + // Params are optional if the codec has no required keys client('GET /internal/endpoint_with_optional_params', { timeout: 1, }); +client('GET /internal/endpoint_with_optional_params_zod', { + timeout: 1, +}); + // If optional, an error will still occur if the params do not match client('GET /internal/endpoint_with_optional_params', { timeout: 1, @@ -222,6 +294,14 @@ client('GET /internal/endpoint_with_optional_params', { }, }); +client('GET /internal/endpoint_with_optional_params_zod', { + timeout: 1, + params: { + // @ts-expect-error Object literal may only specify known properties, and 'path' does not exist in type + path: '', + }, +}); + // The return type is correctly inferred client('GET /internal/endpoint_with_params', { params: { @@ -241,6 +321,24 @@ client('GET /internal/endpoint_with_params', { }>(res); }); +client('GET /internal/endpoint_with_params_zod', { + params: { + path: { + serviceName: '', + }, + }, + timeout: 1, +}).then((res) => { + assertType<{ + noParamsForMe: boolean; + // @ts-expect-error Property 'noParamsForMe' is missing in type + }>(res); + + assertType<{ + yesParamsForMe: boolean; + }>(res); +}); + client('GET /internal/endpoint_returning_result', { timeout: 1, }).then((res) => { @@ -261,7 +359,7 @@ client('GET /internal/endpoint_returning_kibana_response', { assertType<{ path: { serviceName: string } }>( decodeRequestParams( { - params: { + path: { serviceName: 'serviceName', }, body: undefined, @@ -275,7 +373,7 @@ assertType<{ path: { serviceName: boolean } }>( // @ts-expect-error The types of 'path.serviceName' are incompatible between these types. decodeRequestParams( { - params: { + path: { serviceName: 'serviceName', }, body: undefined, diff --git a/packages/kbn-server-route-repository/src/validate_and_decode_params.test.ts b/packages/kbn-server-route-repository/src/validate_and_decode_params.test.ts new file mode 100644 index 0000000000000..a60c6322f1d7a --- /dev/null +++ b/packages/kbn-server-route-repository/src/validate_and_decode_params.test.ts @@ -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 { KibanaRequest } from '@kbn/core-http-server'; +import { z } from '@kbn/zod'; +import * as t from 'io-ts'; +import { validateAndDecodeParams } from './validate_and_decode_params'; + +describe('validateAndDecodeParams', () => { + it('does nothing if no schema is provided', () => { + const request = {} as KibanaRequest; + expect(validateAndDecodeParams(request, undefined)).toEqual(undefined); + }); + + it('only does formatting when using zod', () => { + const request = { + params: { + my_path_param: 'test', + }, + query: {}, + } as KibanaRequest; + + expect(validateAndDecodeParams(request, z.object({}))).toEqual({ + path: { + my_path_param: 'test', + }, + }); + }); + + it('additionally performs validation when using zod', () => { + const schema = t.type({ + path: t.type({ + my_path_param: t.string, + }), + }); + + const validRequest = { + params: { + my_path_param: 'test', + }, + query: {}, + } as KibanaRequest; + + expect(validateAndDecodeParams(validRequest, schema)).toEqual({ + path: { + my_path_param: 'test', + }, + }); + + const invalidRequest = { + params: { + my_unexpected_param: 'test', + }, + } as KibanaRequest; + const shouldThrow = () => { + return validateAndDecodeParams(invalidRequest, schema); + }; + + expect(shouldThrow).toThrowErrorMatchingInlineSnapshot(` + "Failed to validate: + in /path/my_path_param: undefined does not match expected type string" + `); + }); +}); diff --git a/packages/kbn-server-route-repository/src/validate_and_decode_params.ts b/packages/kbn-server-route-repository/src/validate_and_decode_params.ts new file mode 100644 index 0000000000000..36faf00e40afd --- /dev/null +++ b/packages/kbn-server-route-repository/src/validate_and_decode_params.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaRequest } from '@kbn/core-http-server'; +import { ZodParamsObject, IoTsParamsObject } from '@kbn/server-route-repository-utils'; +import { isZod } from '@kbn/zod'; +import { decodeRequestParams } from './decode_request_params'; +import { stripNullishRequestParameters } from './strip_nullish_request_parameters'; + +export function validateAndDecodeParams( + request: KibanaRequest, + paramsSchema: ZodParamsObject | IoTsParamsObject | undefined +) { + if (paramsSchema === undefined) { + return undefined; + } + + const params = stripNullishRequestParameters({ + params: request.params, + body: request.body, + query: request.query, + }); + + if (isZod(paramsSchema)) { + // Already validated by platform + return params; + } + + return decodeRequestParams(params, paramsSchema); +} diff --git a/packages/kbn-server-route-repository/src/validation_objects.ts b/packages/kbn-server-route-repository/src/validation_objects.ts new file mode 100644 index 0000000000000..9b4bab477ae3c --- /dev/null +++ b/packages/kbn-server-route-repository/src/validation_objects.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { z } from '@kbn/zod'; + +export const passThroughValidationObject = { + body: z.any(), + params: z.any(), + query: z.any(), +}; + +export const noParamsValidationObject = { + params: z.object({}).strict(), + query: z.object({}).strict(), + body: z.union([ + // If the route uses POST, the body should be empty object or null + z.object({}).strict(), + z.null(), + // If the route uses GET, body is undefined, + z.undefined(), + ]), +}; diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index 5202a5bf0c422..bb8a0847c39b6 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -12,7 +12,6 @@ "**/*.ts" ], "kbn_references": [ - "@kbn/config-schema", "@kbn/io-ts-utils", "@kbn/core-http-request-handler-context-server", "@kbn/core-http-server", @@ -21,6 +20,7 @@ "@kbn/core", "@kbn/logging-mocks", "@kbn/server-route-repository-utils", + "@kbn/zod", ], "exclude": [ "target/**/*", diff --git a/packages/kbn-telemetry-tools/kibana.jsonc b/packages/kbn-telemetry-tools/kibana.jsonc index f36e6d272b81b..cf1d0def824e4 100644 --- a/packages/kbn-telemetry-tools/kibana.jsonc +++ b/packages/kbn-telemetry-tools/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/telemetry-tools", "devOnly": true, "owner": "@elastic/kibana-core" diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts index 2b62900ae5c30..13f4a5bd8e281 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -// eslint-disable-next-line @kbn/imports/no_boundary_crossing import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { getUsageCollector } from './get_usage_collector'; diff --git a/packages/kbn-test/src/auth/session_manager.test.ts b/packages/kbn-test/src/auth/session_manager.test.ts new file mode 100644 index 0000000000000..fe5e0e9fb9198 --- /dev/null +++ b/packages/kbn-test/src/auth/session_manager.test.ts @@ -0,0 +1,330 @@ +/* + * 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 { ToolingLog } from '@kbn/tooling-log'; +import { Cookie } from 'tough-cookie'; +import { Session } from './saml_auth'; +import { SamlSessionManager, SupportedRoles } from './session_manager'; +import * as samlAuth from './saml_auth'; +import * as helper from './helper'; +import { Role, User, UserProfile } from './types'; +import { SERVERLESS_ROLES_ROOT_PATH } from '@kbn/es'; +import { resolve } from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; + +const log = new ToolingLog(); + +const supportedRoles: SupportedRoles = { + roles: ['admin', 'editor', 'viewer'], + sourcePath: 'test/roles.yml', +}; +const roleViewer = 'viewer'; +const roleEditor = 'editor'; +const cloudUsersFilePath = resolve(REPO_ROOT, SERVERLESS_ROLES_ROOT_PATH, 'role_users.json'); + +const createLocalSAMLSessionMock = jest.spyOn(samlAuth, 'createLocalSAMLSession'); +const getSecurityProfileMock = jest.spyOn(samlAuth, 'getSecurityProfile'); +const readCloudUsersFromFileMock = jest.spyOn(helper, 'readCloudUsersFromFile'); +const isValidHostnameMock = jest.spyOn(helper, 'isValidHostname'); + +jest.mock('../kbn_client/kbn_client', () => { + return { + KbnClient: jest.fn(), + }; +}); +const get = jest.fn(); + +describe('SamlSessionManager', () => { + let createCloudSAMLSessionMock: jest.SpyInstance; + beforeEach(() => { + createCloudSAMLSessionMock = jest.spyOn(samlAuth, 'createCloudSAMLSession'); + }); + + describe('for local session', () => { + beforeEach(() => { + jest.resetAllMocks(); + jest + .requireMock('../kbn_client/kbn_client') + .KbnClient.mockImplementation(() => ({ version: { get } })); + get.mockImplementation(() => Promise.resolve('8.12.0')); + + createLocalSAMLSessionMock.mockResolvedValue(new Session(cookieInstance, testEmail)); + }); + + const hostOptions = { + protocol: 'http' as 'http' | 'https', + hostname: 'localhost', + port: 5620, + username: 'elastic', + password: 'changeme', + }; + const isCloud = false; + const samlSessionManagerOptions = { + hostOptions, + isCloud, + log, + cloudUsersFilePath, + }; + const testEmail = 'testuser@elastic.com'; + const testFullname = 'Test User'; + const cookieInstance = Cookie.parse( + 'sid=kbn_cookie_value; Path=/; Expires=Wed, 01 Oct 2023 07:00:00 GMT' + )!; + + test('should create an instance of SamlSessionManager', () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + expect(samlSessionManager).toBeInstanceOf(SamlSessionManager); + }); + + test(`'getSessionCookieForRole' should return the actual cookie value`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const cookie = await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope( + roleViewer + ); + expect(cookie).toBe(cookieInstance.value); + }); + + test(`'getApiCredentialsForRole' should return {Cookie: }`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const credentials = await samlSessionManager.getApiCredentialsForRole(roleViewer); + expect(credentials).toEqual({ Cookie: `${cookieInstance.cookieString()}` }); + }); + + test(`'getSessionCookieForRole' should call 'createLocalSAMLSession' only once for the same role`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleEditor); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); + expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(2); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + }); + + test(`'getEmail' return the correct email`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const email = await samlSessionManager.getEmail(roleEditor); + expect(email).toBe(testEmail); + }); + + test(`'getUserData' should call security API and return user profile data`, async () => { + const testData: UserProfile = { + username: '6ta90xc', + roles: [roleEditor], + full_name: testFullname, + email: testEmail, + enabled: true, + elastic_cloud_user: false, + }; + getSecurityProfileMock.mockResolvedValueOnce(testData); + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const userData = await samlSessionManager.getUserData(roleViewer); + + expect(userData).toEqual(testData); + }); + + test(`throws error when role is not in 'supportedRoles'`, async () => { + const nonExistingRole = 'tester'; + const expectedErrorMessage = `Role '${nonExistingRole}' is not in the supported list: ${supportedRoles.roles.join( + ', ' + )}. Add role descriptor in ${supportedRoles.sourcePath} to enable it for testing`; + const samlSessionManager = new SamlSessionManager({ + ...samlSessionManagerOptions, + supportedRoles, + }); + await expect( + samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) + ).rejects.toThrow(expectedErrorMessage); + await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( + expectedErrorMessage + ); + await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( + expectedErrorMessage + ); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + }); + + test(`doesn't throw error when supportedRoles is not defined`, async () => { + const nonExistingRole = 'tester'; + const testData: UserProfile = { + username: '6ta90xc', + roles: [nonExistingRole], + full_name: testFullname, + email: testEmail, + enabled: true, + elastic_cloud_user: false, + }; + getSecurityProfileMock.mockResolvedValueOnce(testData); + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole); + await samlSessionManager.getApiCredentialsForRole(nonExistingRole); + await samlSessionManager.getUserData(nonExistingRole); + expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(1); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + expect(getSecurityProfileMock.mock.calls).toHaveLength(1); + }); + }); + + describe('for cloud session', () => { + const hostOptions = { + protocol: 'https' as 'http' | 'https', + hostname: 'cloud', + username: 'elastic', + password: 'changeme', + }; + const isCloud = true; + const samlSessionManagerOptions = { + hostOptions, + isCloud, + log, + cloudUsersFilePath, + }; + const cloudCookieInstance = Cookie.parse( + 'sid=cloud_cookie_value; Path=/; Expires=Wed, 01 Oct 2023 07:00:00 GMT' + )!; + const cloudEmail = 'viewer@elastic.co'; + const cloudFullname = 'Test Viewer'; + const cloudUsers = new Array<[Role, User]>(); + cloudUsers.push(['viewer', { email: 'viewer@elastic.co', password: 'p1234' }]); + cloudUsers.push(['editor', { email: 'editor@elastic.co', password: 'p1234' }]); + + describe('handles errors', () => { + beforeEach(() => { + jest.resetAllMocks(); + jest + .requireMock('../kbn_client/kbn_client') + .KbnClient.mockImplementation(() => ({ version: { get } })); + get.mockImplementationOnce(() => Promise.resolve('8.12.0')); + + readCloudUsersFromFileMock.mockReturnValue(cloudUsers); + }); + + test('should throw error if TEST_CLOUD_HOST_NAME is not set', async () => { + createCloudSAMLSessionMock.mockRestore(); + isValidHostnameMock.mockReturnValueOnce(false); + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await expect( + samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer) + ).rejects.toThrow( + 'SAML Authentication requires TEST_CLOUD_HOST_NAME env variable to be set' + ); + }); + }); + + beforeEach(() => { + jest.resetAllMocks(); + jest + .requireMock('../kbn_client/kbn_client') + .KbnClient.mockImplementation(() => ({ version: { get } })); + get.mockImplementationOnce(() => Promise.resolve('8.12.0')); + + createCloudSAMLSessionMock.mockResolvedValue(new Session(cloudCookieInstance, cloudEmail)); + readCloudUsersFromFileMock.mockReturnValue(cloudUsers); + }); + + test('should create an instance of SamlSessionManager', () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + expect(samlSessionManager).toBeInstanceOf(SamlSessionManager); + }); + + test(`'getSessionCookieForRole' should return the actual cookie value`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + createCloudSAMLSessionMock.mockResolvedValue(new Session(cloudCookieInstance, cloudEmail)); + const cookie = await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope( + roleViewer + ); + expect(cookie).toBe(cloudCookieInstance.value); + }); + + test(`'getApiCredentialsForRole' should return {Cookie: }`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const credentials = await samlSessionManager.getApiCredentialsForRole(roleViewer); + expect(credentials).toEqual({ Cookie: `${cloudCookieInstance.cookieString()}` }); + }); + + test(`'getSessionCookieForRole' should call 'createCloudSAMLSession' only once for the same role`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleEditor); + await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); + expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(0); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(2); + }); + + test(`'getEmail' return the correct email`, async () => { + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const email = await samlSessionManager.getEmail(roleViewer); + expect(email).toBe(cloudEmail); + }); + + test(`'getUserData' should call security API and return user profile data`, async () => { + const testData: UserProfile = { + username: '92qab123', + roles: [roleViewer], + full_name: cloudFullname, + email: cloudEmail, + enabled: true, + elastic_cloud_user: true, + }; + getSecurityProfileMock.mockResolvedValueOnce(testData); + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + const userData = await samlSessionManager.getUserData(roleViewer); + + expect(userData).toEqual(testData); + }); + + test(`throws error for non-existing role when 'supportedRoles' is defined`, async () => { + const nonExistingRole = 'tester'; + const expectedErrorMessage = `Role '${nonExistingRole}' is not in the supported list: ${supportedRoles.roles.join( + ', ' + )}. Add role descriptor in ${supportedRoles.sourcePath} to enable it for testing`; + const samlSessionManager = new SamlSessionManager({ + ...samlSessionManagerOptions, + supportedRoles, + }); + await expect( + samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) + ).rejects.toThrow(expectedErrorMessage); + await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( + expectedErrorMessage + ); + await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( + expectedErrorMessage + ); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + }); + + test(`throws error for non-existing role when 'supportedRoles' is not defined`, async () => { + const nonExistingRole = 'tester'; + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await expect( + samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) + ).rejects.toThrow(`User with '${nonExistingRole}' role is not defined`); + await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( + `User with '${nonExistingRole}' role is not defined` + ); + await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( + `User with '${nonExistingRole}' role is not defined` + ); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + }); + + test(`throws error when credentials are not specified for the role`, async () => { + const noCredentialsRole = 'admin'; + const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); + await expect( + samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(noCredentialsRole) + ).rejects.toThrow(`User with '${noCredentialsRole}' role is not defined`); + await expect(samlSessionManager.getApiCredentialsForRole(noCredentialsRole)).rejects.toThrow( + `User with '${noCredentialsRole}' role is not defined` + ); + await expect(samlSessionManager.getUserData(noCredentialsRole)).rejects.toThrow( + `User with '${noCredentialsRole}' role is not defined` + ); + expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); + }); + }); +}); diff --git a/packages/kbn-test/src/auth/sesson_manager.test.ts b/packages/kbn-test/src/auth/sesson_manager.test.ts deleted file mode 100644 index 929517e7c5a10..0000000000000 --- a/packages/kbn-test/src/auth/sesson_manager.test.ts +++ /dev/null @@ -1,325 +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 { ToolingLog } from '@kbn/tooling-log'; -import { Cookie } from 'tough-cookie'; -import { Session } from './saml_auth'; -import { SamlSessionManager, SupportedRoles } from './session_manager'; -import * as samlAuth from './saml_auth'; -import * as helper from './helper'; -import { Role, User, UserProfile } from './types'; -import { SERVERLESS_ROLES_ROOT_PATH } from '@kbn/es'; -import { resolve } from 'path'; -import { REPO_ROOT } from '@kbn/repo-info'; - -const log = new ToolingLog(); - -const supportedRoles: SupportedRoles = { - roles: ['admin', 'editor', 'viewer'], - sourcePath: 'test/roles.yml', -}; -const roleViewer = 'viewer'; -const roleEditor = 'editor'; -const cloudUsersFilePath = resolve(REPO_ROOT, SERVERLESS_ROLES_ROOT_PATH, 'role_users.json'); - -const createLocalSAMLSessionMock = jest.spyOn(samlAuth, 'createLocalSAMLSession'); -const createCloudSAMLSessionMock = jest.spyOn(samlAuth, 'createCloudSAMLSession'); -const getSecurityProfileMock = jest.spyOn(samlAuth, 'getSecurityProfile'); -const readCloudUsersFromFileMock = jest.spyOn(helper, 'readCloudUsersFromFile'); -const isValidHostnameMock = jest.spyOn(helper, 'isValidHostname'); - -jest.mock('../kbn_client/kbn_client', () => { - return { - KbnClient: jest.fn(), - }; -}); -const get = jest.fn(); - -describe('SamlSessionManager', () => { - describe('for local session', () => { - beforeEach(() => { - jest.resetAllMocks(); - jest - .requireMock('../kbn_client/kbn_client') - .KbnClient.mockImplementation(() => ({ version: { get } })); - get.mockImplementation(() => Promise.resolve('8.12.0')); - - createLocalSAMLSessionMock.mockResolvedValue(new Session(cookieInstance, testEmail)); - }); - - const hostOptions = { - protocol: 'http' as 'http' | 'https', - hostname: 'localhost', - port: 5620, - username: 'elastic', - password: 'changeme', - }; - const isCloud = false; - const samlSessionManagerOptions = { - hostOptions, - isCloud, - log, - cloudUsersFilePath, - }; - const testEmail = 'testuser@elastic.com'; - const testFullname = 'Test User'; - const cookieInstance = Cookie.parse( - 'sid=kbn_cookie_value; Path=/; Expires=Wed, 01 Oct 2023 07:00:00 GMT' - )!; - - test('should create an instance of SamlSessionManager', () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - expect(samlSessionManager).toBeInstanceOf(SamlSessionManager); - }); - - test(`'getSessionCookieForRole' should return the actual cookie value`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const cookie = await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope( - roleViewer - ); - expect(cookie).toBe(cookieInstance.value); - }); - - test(`'getApiCredentialsForRole' should return {Cookie: }`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const credentials = await samlSessionManager.getApiCredentialsForRole(roleViewer); - expect(credentials).toEqual({ Cookie: `${cookieInstance.cookieString()}` }); - }); - - test(`'getSessionCookieForRole' should call 'createLocalSAMLSession' only once for the same role`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleEditor); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); - expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(2); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - }); - - test(`'getEmail' return the correct email`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const email = await samlSessionManager.getEmail(roleEditor); - expect(email).toBe(testEmail); - }); - - test(`'getUserData' should call security API and return user profile data`, async () => { - const testData: UserProfile = { - username: '6ta90xc', - roles: [roleEditor], - full_name: testFullname, - email: testEmail, - enabled: true, - elastic_cloud_user: false, - }; - getSecurityProfileMock.mockResolvedValueOnce(testData); - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const userData = await samlSessionManager.getUserData(roleViewer); - - expect(userData).toEqual(testData); - }); - - test(`throws error when role is not in 'supportedRoles'`, async () => { - const nonExistingRole = 'tester'; - const expectedErrorMessage = `Role '${nonExistingRole}' is not in the supported list: ${supportedRoles.roles.join( - ', ' - )}. Add role descriptor in ${supportedRoles.sourcePath} to enable it for testing`; - const samlSessionManager = new SamlSessionManager({ - ...samlSessionManagerOptions, - supportedRoles, - }); - await expect( - samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) - ).rejects.toThrow(expectedErrorMessage); - await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( - expectedErrorMessage - ); - await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( - expectedErrorMessage - ); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - }); - - test(`doesn't throw error when supportedRoles is not defined`, async () => { - const nonExistingRole = 'tester'; - const testData: UserProfile = { - username: '6ta90xc', - roles: [nonExistingRole], - full_name: testFullname, - email: testEmail, - enabled: true, - elastic_cloud_user: false, - }; - getSecurityProfileMock.mockResolvedValueOnce(testData); - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole); - await samlSessionManager.getApiCredentialsForRole(nonExistingRole); - await samlSessionManager.getUserData(nonExistingRole); - expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(1); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - expect(getSecurityProfileMock.mock.calls).toHaveLength(1); - }); - }); - - describe('for cloud session', () => { - const hostOptions = { - protocol: 'https' as 'http' | 'https', - hostname: 'cloud', - username: 'elastic', - password: 'changeme', - }; - const isCloud = true; - const samlSessionManagerOptions = { - hostOptions, - isCloud, - log, - cloudUsersFilePath, - }; - const cloudCookieInstance = Cookie.parse( - 'sid=cloud_cookie_value; Path=/; Expires=Wed, 01 Oct 2023 07:00:00 GMT' - )!; - const cloudEmail = 'viewer@elastic.co'; - const cloudFullname = 'Test Viewer'; - const cloudUsers = new Array<[Role, User]>(); - cloudUsers.push(['viewer', { email: 'viewer@elastic.co', password: 'p1234' }]); - cloudUsers.push(['editor', { email: 'editor@elastic.co', password: 'p1234' }]); - - describe('handles errors', () => { - beforeEach(() => { - jest.resetAllMocks(); - jest - .requireMock('../kbn_client/kbn_client') - .KbnClient.mockImplementation(() => ({ version: { get } })); - get.mockImplementationOnce(() => Promise.resolve('8.12.0')); - - readCloudUsersFromFileMock.mockReturnValue(cloudUsers); - }); - - test('should throw error if TEST_CLOUD_HOST_NAME is not set', async () => { - isValidHostnameMock.mockReturnValueOnce(false); - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await expect( - samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer) - ).rejects.toThrow( - 'SAML Authentication requires TEST_CLOUD_HOST_NAME env variable to be set' - ); - }); - }); - - beforeEach(() => { - jest.resetAllMocks(); - jest - .requireMock('../kbn_client/kbn_client') - .KbnClient.mockImplementation(() => ({ version: { get } })); - get.mockImplementationOnce(() => Promise.resolve('8.12.0')); - - createCloudSAMLSessionMock.mockResolvedValue(new Session(cloudCookieInstance, cloudEmail)); - readCloudUsersFromFileMock.mockReturnValue(cloudUsers); - }); - - test('should create an instance of SamlSessionManager', () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - expect(samlSessionManager).toBeInstanceOf(SamlSessionManager); - }); - - test(`'getSessionCookieForRole' should return the actual cookie value`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - createCloudSAMLSessionMock.mockResolvedValue(new Session(cloudCookieInstance, cloudEmail)); - const cookie = await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope( - roleViewer - ); - expect(cookie).toBe(cloudCookieInstance.value); - }); - - test(`'getApiCredentialsForRole' should return {Cookie: }`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const credentials = await samlSessionManager.getApiCredentialsForRole(roleViewer); - expect(credentials).toEqual({ Cookie: `${cloudCookieInstance.cookieString()}` }); - }); - - test(`'getSessionCookieForRole' should call 'createCloudSAMLSession' only once for the same role`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleEditor); - await samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(roleViewer); - expect(createLocalSAMLSessionMock.mock.calls).toHaveLength(0); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(2); - }); - - test(`'getEmail' return the correct email`, async () => { - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const email = await samlSessionManager.getEmail(roleViewer); - expect(email).toBe(cloudEmail); - }); - - test(`'getUserData' should call security API and return user profile data`, async () => { - const testData: UserProfile = { - username: '92qab123', - roles: [roleViewer], - full_name: cloudFullname, - email: cloudEmail, - enabled: true, - elastic_cloud_user: true, - }; - getSecurityProfileMock.mockResolvedValueOnce(testData); - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - const userData = await samlSessionManager.getUserData(roleViewer); - - expect(userData).toEqual(testData); - }); - - test(`throws error for non-existing role when 'supportedRoles' is defined`, async () => { - const nonExistingRole = 'tester'; - const expectedErrorMessage = `Role '${nonExistingRole}' is not in the supported list: ${supportedRoles.roles.join( - ', ' - )}. Add role descriptor in ${supportedRoles.sourcePath} to enable it for testing`; - const samlSessionManager = new SamlSessionManager({ - ...samlSessionManagerOptions, - supportedRoles, - }); - await expect( - samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) - ).rejects.toThrow(expectedErrorMessage); - await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( - expectedErrorMessage - ); - await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( - expectedErrorMessage - ); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - }); - - test(`throws error for non-existing role when 'supportedRoles' is not defined`, async () => { - const nonExistingRole = 'tester'; - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await expect( - samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(nonExistingRole) - ).rejects.toThrow(`User with '${nonExistingRole}' role is not defined`); - await expect(samlSessionManager.getApiCredentialsForRole(nonExistingRole)).rejects.toThrow( - `User with '${nonExistingRole}' role is not defined` - ); - await expect(samlSessionManager.getUserData(nonExistingRole)).rejects.toThrow( - `User with '${nonExistingRole}' role is not defined` - ); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - }); - - test(`throws error when credentials are not specified for the role`, async () => { - const noCredentialsRole = 'admin'; - const samlSessionManager = new SamlSessionManager(samlSessionManagerOptions); - await expect( - samlSessionManager.getInteractiveUserSessionCookieWithRoleScope(noCredentialsRole) - ).rejects.toThrow(`User with '${noCredentialsRole}' role is not defined`); - await expect(samlSessionManager.getApiCredentialsForRole(noCredentialsRole)).rejects.toThrow( - `User with '${noCredentialsRole}' role is not defined` - ); - await expect(samlSessionManager.getUserData(noCredentialsRole)).rejects.toThrow( - `User with '${noCredentialsRole}' role is not defined` - ); - expect(createCloudSAMLSessionMock.mock.calls).toHaveLength(0); - }); - }); -}); diff --git a/packages/kbn-test/src/es/test_es_cluster.ts b/packages/kbn-test/src/es/test_es_cluster.ts index a2078a1e56e16..df83fa89cf607 100644 --- a/packages/kbn-test/src/es/test_es_cluster.ts +++ b/packages/kbn-test/src/es/test_es_cluster.ts @@ -202,6 +202,7 @@ export function createTestEsCluster< license, basePath, esArgs, + resources: files, }; return new (class TestCluster { @@ -297,7 +298,7 @@ export function createTestEsCluster< // If we have multiple nodes, we shouldn't try setting up the native realm // right away or wait for ES to be green, the cluster isn't ready. So we only // set it up after the last node is started. - skipNativeRealmSetup: this.nodes.length > 1 && i < this.nodes.length - 1, + skipSecuritySetup: this.nodes.length > 1 && i < this.nodes.length - 1, skipReadyCheck: this.nodes.length > 1 && i < this.nodes.length - 1, onEarlyExit, writeLogsToPath, diff --git a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts index f15fb0035d670..3f498eb5f4606 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts @@ -118,10 +118,13 @@ const STANDARD_LIST_TYPES = [ 'infrastructure-monitoring-log-view', 'apm-indices', // Fleet saved object types + 'ingest_manager_settings', 'ingest-outputs', 'ingest-download-sources', 'ingest-agent-policies', + 'fleet-agent-policies', 'ingest-package-policies', + 'fleet-package-policies', 'epm-packages', 'epm-packages-assets', 'fleet-preconfiguration-deletion-record', diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index dcab34c0845a3..a6b36c221d3c1 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { memo, useState, useCallback, useEffect } from 'react'; +import React, { memo, useState, useCallback, useEffect, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode } from '@elastic/eui'; @@ -16,6 +16,7 @@ import { LanguageDocumentationPopover, type LanguageDocumentationSections, } from '@kbn/language-documentation-popover'; +import { getLimitFromESQLQuery } from '@kbn/esql-utils'; import { type MonacoMessage, getDocumentationSections } from '../helpers'; import { ErrorsWarningsFooterPopover } from './errors_warnings_popover'; import { QueryHistoryAction, QueryHistory } from './query_history'; @@ -98,6 +99,8 @@ export const EditorFooter = memo(function EditorFooter({ [runQuery, updateQuery] ); + const limit = useMemo(() => getLimitFromESQLQuery(code), [code]); + useEffect(() => { async function getDocumentation() { const sections = await getDocumentationSections('esql'); @@ -126,9 +129,16 @@ export const EditorFooter = memo(function EditorFooter({ responsive={false} > - + - + {/* If there is no space and no @timestamp detected hide the information */} {(detectedTimestamp || !isSpaceReduced) && !hideTimeFilterInfo && ( - + )} + + + + +

+ {isSpaceReduced + ? i18n.translate( + 'textBasedEditor.query.textBasedLanguagesEditor.limitInfoReduced', + { + defaultMessage: 'LIMIT {limit}', + values: { limit }, + } + ) + : i18n.translate( + 'textBasedEditor.query.textBasedLanguagesEditor.limitInfo', + { + defaultMessage: 'LIMIT {limit} rows', + values: { limit }, + } + )} +

+
+
+
+
{errors && errors.length > 0 && ( + ), + }, + // Do not edit manually... automatically generated by scripts/generate_esql_docs.ts + { + label: i18n.translate( + 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_percentile', + { + defaultMessage: 'MV_PERCENTILE', + } + ), + description: ( + + + ### MV_PERCENTILE + Converts a multivalued field into a single valued field containing the value at which a certain percentage of observed values occur. + + \`\`\` + ROW values = [5, 5, 10, 12, 5000] + | EVAL p50 = MV_PERCENTILE(values, 50), median = MV_MEDIAN(values) + \`\`\` `, description: 'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)', @@ -3370,6 +3403,7 @@ export const functions = { ROW string = ["1953-09-02T00:00:00.000Z", "1964-06-02T00:00:00.000Z", "1964-06-02 00:00:00"] | EVAL datetime = TO_DATETIME(string) \`\`\` + Note: Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded. `, description: 'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)', diff --git a/packages/kbn-text-based-editor/src/helpers.test.ts b/packages/kbn-text-based-editor/src/helpers.test.ts index 797e68ce99056..c8b46a75ce444 100644 --- a/packages/kbn-text-based-editor/src/helpers.test.ts +++ b/packages/kbn-text-based-editor/src/helpers.test.ts @@ -249,8 +249,36 @@ describe('helpers', function () { }; const indices = await getIndicesList(updatedDataViewsMock); expect(indices).toStrictEqual([ - { name: '.system1', hidden: true }, - { name: 'logs', hidden: false }, + { name: '.system1', hidden: true, type: 'Index' }, + { name: 'logs', hidden: false, type: 'Index' }, + ]); + }); + + it('should type correctly the aliases', async function () { + const dataViewsMock = dataViewPluginMocks.createStartContract(); + const updatedDataViewsMock = { + ...dataViewsMock, + getIndices: jest.fn().mockResolvedValue([ + { + name: 'alias1', + title: 'system1', + tags: [ + { + name: 'Alias', + type: 'alias', + }, + ], + }, + { + name: 'logs', + title: 'logs', + }, + ]), + }; + const indices = await getIndicesList(updatedDataViewsMock); + expect(indices).toStrictEqual([ + { name: 'alias1', hidden: false, type: 'Alias' }, + { name: 'logs', hidden: false, type: 'Index' }, ]); }); }); @@ -283,7 +311,7 @@ describe('helpers', function () { ]), }; const indices = await getRemoteIndicesList(updatedDataViewsMock); - expect(indices).toStrictEqual([{ name: 'remote:logs', hidden: false }]); + expect(indices).toStrictEqual([{ name: 'remote:logs', hidden: false, type: 'Index' }]); }); }); }); diff --git a/packages/kbn-text-based-editor/src/helpers.ts b/packages/kbn-text-based-editor/src/helpers.ts index 95652a942d7dd..9e3bea6ee0abf 100644 --- a/packages/kbn-text-based-editor/src/helpers.ts +++ b/packages/kbn-text-based-editor/src/helpers.ts @@ -209,7 +209,11 @@ export const getIndicesList = async (dataViews: DataViewsPublicPluginStart) => { pattern: '*', isRollupIndex: () => false, }); - return indices.map((index) => ({ name: index.name, hidden: index.name.startsWith('.') })); + + return indices.map((index) => { + const [tag] = index?.tags ?? []; + return { name: index.name, hidden: index.name.startsWith('.'), type: tag?.name ?? 'Index' }; + }); }; export const getRemoteIndicesList = async (dataViews: DataViewsPublicPluginStart) => { @@ -223,7 +227,10 @@ export const getRemoteIndicesList = async (dataViews: DataViewsPublicPluginStart return !index.startsWith('.') && !Boolean(source.item.indices); }); - return finalIndicesList.map((source) => ({ name: source.name, hidden: false })); + return finalIndicesList.map((source) => { + const [tag] = source?.tags ?? []; + return { name: source.name, hidden: false, type: tag?.name ?? 'Index' }; + }); }; // refresh the esql cache entry after 10 minutes @@ -261,6 +268,7 @@ const getIntegrations = async (core: CoreStart) => { hidden: false, title: source.title, dataStreams: source.dataStreams, + type: 'Integration', })) ?? [] ); }; diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx index 1337d204759b1..db558ae186b7f 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx @@ -71,22 +71,14 @@ describe('TextBasedLanguagesEditor', () => { }); it('should render the date info with no @timestamp found', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect( component.find('[data-test-subj="TextBasedLangEditor-date-info"]').at(0).text() ).toStrictEqual('@timestamp not found'); }); it('should render the feedback link', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect(component.find('[data-test-subj="TextBasedLangEditor-feedback-link"]').length).not.toBe( 0 ); @@ -95,7 +87,6 @@ describe('TextBasedLanguagesEditor', () => { it('should not render the date info if hideTimeFilterInfo is set to true', async () => { const newProps = { ...props, - isCodeEditorExpanded: true, hideTimeFilterInfo: true, }; const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); @@ -105,7 +96,6 @@ describe('TextBasedLanguagesEditor', () => { it('should render the date info with @timestamp found if detectedTimestamp is given', async () => { const newProps = { ...props, - isCodeEditorExpanded: true, detectedTimestamp: '@timestamp', }; const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); @@ -114,10 +104,16 @@ describe('TextBasedLanguagesEditor', () => { ).toStrictEqual('@timestamp found'); }); + it('should render the limit information', async () => { + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); + expect( + component.find('[data-test-subj="TextBasedLangEditor-limit-info"]').at(0).text() + ).toStrictEqual('LIMIT 1000 rows'); + }); + it('should render the query history action if isLoading is defined', async () => { const newProps = { ...props, - isCodeEditorExpanded: true, isLoading: true, }; const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); @@ -128,11 +124,7 @@ describe('TextBasedLanguagesEditor', () => { }); it('should not render the query history action if isLoading is undefined', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect( component.find('[data-test-subj="TextBasedLangEditor-toggle-query-history-button-container"]') .length @@ -142,7 +134,6 @@ describe('TextBasedLanguagesEditor', () => { it('should not render the query history action if hideQueryHistory is set to true', async () => { const newProps = { ...props, - isCodeEditorExpanded: true, hideQueryHistory: true, }; const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); @@ -153,13 +144,9 @@ describe('TextBasedLanguagesEditor', () => { }); it('should render the correct buttons for the expanded code editor mode', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; let component: ReactWrapper; await act(async () => { - component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); }); component!.update(); expect( @@ -171,20 +158,12 @@ describe('TextBasedLanguagesEditor', () => { }); it('should render the resize for the expanded code editor mode', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect(component.find('[data-test-subj="TextBasedLangEditor-resize"]').length).not.toBe(0); }); it('should render the footer for the expanded code editor mode', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect(component.find('[data-test-subj="TextBasedLangEditor-footer"]').length).not.toBe(0); expect(component.find('[data-test-subj="TextBasedLangEditor-footer-lines"]').at(0).text()).toBe( '1 line' @@ -192,18 +171,13 @@ describe('TextBasedLanguagesEditor', () => { }); it('should render the run query text', async () => { - const newProps = { - ...props, - isCodeEditorExpanded: true, - }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); expect(component.find('[data-test-subj="TextBasedLangEditor-run-query"]').length).not.toBe(0); }); it('should not render the run query text if the hideRunQueryText prop is set to true', async () => { const newProps = { ...props, - isCodeEditorExpanded: true, hideRunQueryText: true, }; const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); @@ -214,7 +188,6 @@ describe('TextBasedLanguagesEditor', () => { const onTextLangQuerySubmit = jest.fn(); const newProps = { ...props, - isCodeEditorExpanded: true, hideRunQueryText: true, editorIsInline: true, onTextLangQuerySubmit, diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx index 326dc471a86c1..4fd0f994520d6 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx @@ -192,6 +192,14 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ setIsHistoryOpen(status); }, []); + const showSuggestionsIfEmptyQuery = useCallback(() => { + if (editorModel.current?.getValueLength() === 0) { + setImmediate(() => { + editor1.current?.trigger(undefined, 'editor.action.triggerSuggest', {}); + }); + } + }, []); + const openTimePickerPopover = useCallback(() => { const currentCursorPosition = editor1.current?.getPosition(); const editorCoords = editor1.current?.getDomNode()!.getBoundingClientRect(); @@ -275,7 +283,8 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ const onEditorFocus = useCallback(() => { setIsCodeEditorExpandedFocused(true); - }, []); + showSuggestionsIfEmptyQuery(); + }, [showSuggestionsIfEmptyQuery]); const { cache: esqlFieldsCache, memoizedFieldsFromESQL } = useMemo(() => { // need to store the timing of the first request so we can atomically clear the cache per query @@ -682,6 +691,8 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ editor.onDidLayoutChange((layoutInfoEvent) => { onLayoutChangeRef.current(layoutInfoEvent); }); + + editor.onDidChangeModelContent(showSuggestionsIfEmptyQuery); }} />
diff --git a/packages/kbn-tooling-log/src/__snapshots__/tooling_log.test.ts.snap b/packages/kbn-tooling-log/src/__snapshots__/tooling_log.test.ts.snap index 7742c2bb681d0..de1d9c02f024e 100644 --- a/packages/kbn-tooling-log/src/__snapshots__/tooling_log.test.ts.snap +++ b/packages/kbn-tooling-log/src/__snapshots__/tooling_log.test.ts.snap @@ -9,6 +9,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "debug", @@ -24,6 +25,7 @@ Array [ "args": Array [ [Error: error message], ], + "context": undefined, "indent": 0, "source": undefined, "type": "error", @@ -34,6 +36,7 @@ Array [ "args": Array [ "string message", ], + "context": undefined, "indent": 0, "source": undefined, "type": "error", @@ -52,6 +55,7 @@ Array [ "args": Array [ "foo", ], + "context": undefined, "indent": 0, "source": undefined, "type": "debug", @@ -60,6 +64,7 @@ Array [ "args": Array [ "bar", ], + "context": undefined, "indent": 0, "source": undefined, "type": "info", @@ -68,6 +73,7 @@ Array [ "args": Array [ "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "verbose", @@ -81,6 +87,7 @@ Array [ "args": Array [ "foo", ], + "context": undefined, "indent": 0, "source": undefined, "type": "debug", @@ -89,6 +96,7 @@ Array [ "args": Array [ "bar", ], + "context": undefined, "indent": 0, "source": undefined, "type": "info", @@ -97,6 +105,7 @@ Array [ "args": Array [ "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "verbose", @@ -111,6 +120,7 @@ Array [ "args": Array [ "foo", ], + "context": undefined, "indent": 1, "source": undefined, "type": "debug", @@ -121,6 +131,7 @@ Array [ "args": Array [ "bar", ], + "context": undefined, "indent": 3, "source": undefined, "type": "debug", @@ -131,6 +142,7 @@ Array [ "args": Array [ "baz", ], + "context": undefined, "indent": 6, "source": undefined, "type": "debug", @@ -141,6 +153,7 @@ Array [ "args": Array [ "box", ], + "context": undefined, "indent": 4, "source": undefined, "type": "debug", @@ -151,6 +164,7 @@ Array [ "args": Array [ "foo", ], + "context": undefined, "indent": 0, "source": undefined, "type": "debug", @@ -168,6 +182,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "info", @@ -185,6 +200,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "success", @@ -202,6 +218,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "verbose", @@ -219,6 +236,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "warning", @@ -236,6 +254,7 @@ Array [ "bar", "baz", ], + "context": undefined, "indent": 0, "source": undefined, "type": "write", diff --git a/packages/kbn-tooling-log/src/message.ts b/packages/kbn-tooling-log/src/message.ts index 082c0e65d48b2..df8485d906337 100644 --- a/packages/kbn-tooling-log/src/message.ts +++ b/packages/kbn-tooling-log/src/message.ts @@ -20,4 +20,6 @@ export interface Message { source?: string; /** args passed to the logging method */ args: any[]; + /** an identifier of the logging entity */ + context?: string; } diff --git a/packages/kbn-tooling-log/src/tooling_log.ts b/packages/kbn-tooling-log/src/tooling_log.ts index bef4320be2356..a3e124892a033 100644 --- a/packages/kbn-tooling-log/src/tooling_log.ts +++ b/packages/kbn-tooling-log/src/tooling_log.ts @@ -25,6 +25,13 @@ export interface ToolingLogOptions { * writers on either log will update the other too. */ parent?: ToolingLog; + + /** + * A string, conveniently the name of the script, + * that will be prepended to log messages. + * Can be useful to identify which entity is emitting the log. + */ + context?: string; } export class ToolingLog implements SomeDevLog { @@ -32,6 +39,7 @@ export class ToolingLog implements SomeDevLog { private writers$: Rx.BehaviorSubject; private readonly written$: Rx.Subject; private readonly type: string | undefined; + private readonly context: string | undefined; constructor(writerConfig?: ToolingLogTextWriterConfig, options?: ToolingLogOptions) { this.indentWidth$ = options?.parent ? options.parent.indentWidth$ : new Rx.BehaviorSubject(0); @@ -45,6 +53,7 @@ export class ToolingLog implements SomeDevLog { this.written$ = options?.parent ? options.parent.written$ : new Rx.Subject(); this.type = options?.type; + this.context = options?.context; } /** @@ -93,31 +102,31 @@ export class ToolingLog implements SomeDevLog { } public verbose(...args: any[]) { - this.sendToWriters('verbose', args); + this.sendToWriters({ type: 'verbose', context: this.context }, args); } public debug(...args: any[]) { - this.sendToWriters('debug', args); + this.sendToWriters({ type: 'debug', context: this.context }, args); } public info(...args: any[]) { - this.sendToWriters('info', args); + this.sendToWriters({ type: 'info', context: this.context }, args); } public success(...args: any[]) { - this.sendToWriters('success', args); + this.sendToWriters({ type: 'success', context: this.context }, args); } public warning(...args: any[]) { - this.sendToWriters('warning', args); + this.sendToWriters({ type: 'warning', context: this.context }, args); } public error(error: Error | string) { - this.sendToWriters('error', [error]); + this.sendToWriters({ type: 'error', context: this.context }, [error]); } public write(...args: any[]) { - this.sendToWriters('write', args); + this.sendToWriters({ type: 'write' }, args); } public getWriters() { @@ -143,7 +152,7 @@ export class ToolingLog implements SomeDevLog { }); } - private sendToWriters(type: MessageTypes, args: any[]) { + private sendToWriters({ type, context }: { type: MessageTypes; context?: string }, args: any[]) { const indent = this.indentWidth$.getValue(); const writers = this.writers$.getValue(); const msg: Message = { @@ -151,6 +160,7 @@ export class ToolingLog implements SomeDevLog { indent, source: this.type, args, + context, }; let written = false; diff --git a/packages/kbn-tooling-log/src/tooling_log_collecting_writer.ts b/packages/kbn-tooling-log/src/tooling_log_collecting_writer.ts index 6f73563f4a2c5..5550d86181446 100644 --- a/packages/kbn-tooling-log/src/tooling_log_collecting_writer.ts +++ b/packages/kbn-tooling-log/src/tooling_log_collecting_writer.ts @@ -26,16 +26,16 @@ export class ToolingLogCollectingWriter extends ToolingLogTextWriter { } /** - * Called by ToolingLog, extends messages with the source if message includes one. + * Called by ToolingLog, extends messages with the source and context if message include it. */ write(msg: Message) { - if (msg.source) { - return super.write({ - ...msg, - args: [`source[${msg.source}]`, ...msg.args], - }); - } + const args = [ + msg.source ? `source[${msg.source}]` : null, + msg.context ? `context[${msg.context}]` : null, + ] + .filter(Boolean) + .concat(msg.args); - return super.write(msg); + return super.write({ ...msg, args }); } } diff --git a/packages/kbn-tooling-log/src/tooling_log_text_writer.ts b/packages/kbn-tooling-log/src/tooling_log_text_writer.ts index 063edd75a14cb..5d097d23de818 100644 --- a/packages/kbn-tooling-log/src/tooling_log_text_writer.ts +++ b/packages/kbn-tooling-log/src/tooling_log_text_writer.ts @@ -103,7 +103,8 @@ export class ToolingLogTextWriter implements Writer { } } - const prefix = has(MSG_PREFIXES, msg.type) ? MSG_PREFIXES[msg.type] : ''; + let prefix = has(MSG_PREFIXES, msg.type) ? MSG_PREFIXES[msg.type] : ''; + prefix = msg.context ? prefix + `[${msg.context}] ` : prefix; ToolingLogTextWriter.write(this.writeTo, prefix, msg); return true; } diff --git a/packages/kbn-unified-data-table/README.md b/packages/kbn-unified-data-table/README.md index 7a2db17781ad1..0dd94c7c0977d 100644 --- a/packages/kbn-unified-data-table/README.md +++ b/packages/kbn-unified-data-table/README.md @@ -13,7 +13,7 @@ Props description: | **dataView** | DataView | The used data view. | | **loadingState** | DataLoadingState | Determines if data is currently loaded. | | **onFilter** | DocViewFilterFn | Function to add a filter in the grid cell or document flyout. | -| **onResize** | (optional)(colSettings: { columnId: string; width: number }) => void; | Function triggered when a column is resized by the user. | +| **onResize** | (optional)(colSettings: { columnId: string; width: number | undefind }) => void; | Function triggered when a column is resized by the user, passes `undefined` for auto-width. | | **onSetColumns** | (columns: string[], hideTimeColumn: boolean) => void; | Function to set all columns. | | **onSort** | (optional)(sort: string[][]) => void; | Function to change sorting of the documents, skipped when isSortEnabled is set to false. | | **rows** | (optional)DataTableRecord[] | Array of documents provided by Elasticsearch. | @@ -50,7 +50,8 @@ Props description: | **visibleCellActions** | (optional)number | An optional value for a custom number of the visible cell actions in the table. By default is up to 3. | | **externalCustomRenderers** | (optional)Record React.ReactNode>; | An optional settings for a specified fields rendering like links. Applied only for the listed fields rendering. | | **consumer** | (optional)string | Name of the UnifiedDataTable consumer component or application. | -| **componentsTourSteps** | (optional)Record | Optional key/value pairs to set guided onboarding steps ids for a data table components included to guided tour. | +| **componentsTourSteps** | (optional)Record | Optional key/value pairs to set guided onboarding steps ids for a data table components included to guided tour. |~~~~ +| **onUpdateDataGridDensity** | (optional)(DataGridDensity) => void; | Optional callback when the data grid density configuration is modified. | *Required **services** list: ``` @@ -80,7 +81,7 @@ Usage example: onFilter={() => { // Add logic to refetch the data when the filter by field was added/removed. Refetch data. }} - onResize={(colSettings: { columnId: string; width: number }) => { + onResize={(colSettings: { columnId: string; width: number | undefined }) => { // Update the table state with the new width for the column }} onSetColumns={(columns: string[], hideTimeColumn: boolean) => { diff --git a/packages/kbn-unified-data-table/index.ts b/packages/kbn-unified-data-table/index.ts index 7dace83c3774e..a41845e30f5f9 100644 --- a/packages/kbn-unified-data-table/index.ts +++ b/packages/kbn-unified-data-table/index.ts @@ -14,7 +14,7 @@ export { } from './src/components/row_height_settings'; export { getDisplayedColumns } from './src/utils/columns'; export { getTextBasedColumnsMeta } from './src/utils/get_columns_meta'; -export { ROWS_HEIGHT_OPTIONS } from './src/constants'; +export { ROWS_HEIGHT_OPTIONS, DataGridDensity } from './src/constants'; export { JSONCodeEditorCommonMemoized } from './src/components/json_code_editor/json_code_editor_common'; @@ -24,7 +24,7 @@ export * as columnActions from './src/components/actions/columns'; export { getRowsPerPageOptions } from './src/utils/rows_per_page'; export { popularizeField } from './src/utils/popularize_field'; -export { useColumns } from './src/hooks/use_data_grid_columns'; +export { useColumns, type UseColumnsProps } from './src/hooks/use_data_grid_columns'; export { OPEN_DETAILS, SELECT_ROW } from './src/components/data_table_columns'; // TODO: deprecate? export { DataTableRowControl } from './src/components/data_table_row_control'; diff --git a/packages/kbn-unified-data-table/kibana.jsonc b/packages/kbn-unified-data-table/kibana.jsonc index 3fe1b76b931c3..b80f8b6a55596 100644 --- a/packages/kbn-unified-data-table/kibana.jsonc +++ b/packages/kbn-unified-data-table/kibana.jsonc @@ -2,5 +2,8 @@ "type": "shared-browser", "id": "@kbn/unified-data-table", "description": "Contains functionality for the unified data table which can be integrated into apps", - "owner": "@elastic/kibana-data-discovery" + "owner": [ + "@elastic/kibana-data-discovery", + "@elastic/security-threat-hunting-investigations" + ] } diff --git a/packages/kbn-unified-data-table/src/components/actions/columns.test.ts b/packages/kbn-unified-data-table/src/components/actions/columns.test.ts index d8480cf2067b4..21b2e0b0bb355 100644 --- a/packages/kbn-unified-data-table/src/components/actions/columns.test.ts +++ b/packages/kbn-unified-data-table/src/components/actions/columns.test.ts @@ -10,9 +10,10 @@ import { getStateColumnActions } from './columns'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { Capabilities } from '@kbn/core/types'; import { dataViewsMock } from '../../../__mocks__/data_views'; +import { UnifiedDataTableSettings } from '../../types'; function getStateColumnAction( - state: { columns?: string[]; sort?: string[][] }, + state: { columns?: string[]; sort?: string[][]; settings?: UnifiedDataTableSettings }, setAppState: (state: { columns: string[]; sort?: string[][] }) => void ) { return getStateColumnActions({ @@ -28,6 +29,7 @@ function getStateColumnAction( columns: state.columns, sort: state.sort, defaultOrder: 'desc', + settings: state.settings, }); } @@ -41,6 +43,7 @@ describe('Test column actions', () => { actions.onAddColumn('test'); expect(setAppState).toHaveBeenCalledWith({ columns: ['test'] }); }); + test('getStateColumnActions with columns and sort in state', () => { const setAppState = jest.fn(); const actions = getStateColumnAction( @@ -77,4 +80,95 @@ describe('Test column actions', () => { columns: ['second', 'first'], }); }); + + it('should pass settings to setAppState', () => { + const setAppState = jest.fn(); + const settings: UnifiedDataTableSettings = { columns: { first: { width: 100 } } }; + const actions = getStateColumnAction({ columns: ['first'], settings }, setAppState); + actions.onAddColumn('second'); + expect(setAppState).toHaveBeenCalledWith({ columns: ['first', 'second'], settings }); + setAppState.mockClear(); + actions.onRemoveColumn('second'); + expect(setAppState).toHaveBeenCalledWith({ columns: ['first'], settings, sort: [] }); + setAppState.mockClear(); + actions.onMoveColumn('first', 0); + expect(setAppState).toHaveBeenCalledWith({ columns: ['first'], settings }); + setAppState.mockClear(); + actions.onSetColumns(['first', 'second'], true); + expect(setAppState).toHaveBeenCalledWith({ columns: ['first', 'second'], settings }); + setAppState.mockClear(); + }); + + it('should clean up settings to remove non-existing columns', () => { + const setAppState = jest.fn(); + const actions = getStateColumnAction( + { + columns: ['first', 'second', 'third'], + settings: { columns: { first: { width: 100 }, second: { width: 200 } } }, + }, + setAppState + ); + actions.onRemoveColumn('second'); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['first', 'third'], + settings: { columns: { first: { width: 100 } } }, + sort: [], + }); + setAppState.mockClear(); + actions.onSetColumns(['first', 'third'], true); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['first', 'third'], + settings: { columns: { first: { width: 100 } } }, + }); + }); + + it('should reset the last column to auto width if only absolute width columns remain', () => { + const setAppState = jest.fn(); + let actions = getStateColumnAction( + { + columns: ['first', 'second', 'third'], + settings: { columns: { second: { width: 100 }, third: { width: 100, display: 'test' } } }, + }, + setAppState + ); + actions.onRemoveColumn('first'); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['second', 'third'], + settings: { columns: { second: { width: 100 }, third: { display: 'test' } } }, + sort: [], + }); + setAppState.mockClear(); + actions = getStateColumnAction( + { + columns: ['first', 'second', 'third'], + settings: { columns: { second: { width: 100 }, third: { width: 100 } } }, + }, + setAppState + ); + actions.onSetColumns(['second', 'third'], true); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['second', 'third'], + settings: { columns: { second: { width: 100 } } }, + }); + }); + + it('should not reset the last column to auto width if there are remaining auto width columns', () => { + const setAppState = jest.fn(); + const actions = getStateColumnAction( + { columns: ['first', 'second', 'third'], settings: { columns: { third: { width: 100 } } } }, + setAppState + ); + actions.onRemoveColumn('first'); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['second', 'third'], + settings: { columns: { third: { width: 100 } } }, + sort: [], + }); + setAppState.mockClear(); + actions.onSetColumns(['second', 'third'], true); + expect(setAppState).toHaveBeenCalledWith({ + columns: ['second', 'third'], + settings: { columns: { third: { width: 100 } } }, + }); + }); }); diff --git a/packages/kbn-unified-data-table/src/components/actions/columns.ts b/packages/kbn-unified-data-table/src/components/actions/columns.ts index 3355902ece86e..d69d1fe90a361 100644 --- a/packages/kbn-unified-data-table/src/components/actions/columns.ts +++ b/packages/kbn-unified-data-table/src/components/actions/columns.ts @@ -5,52 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { Capabilities } from '@kbn/core/public'; + +import type { Capabilities } from '@kbn/core/public'; import type { DataViewsContract } from '@kbn/data-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; +import { omit } from 'lodash'; import { popularizeField } from '../../utils/popularize_field'; - -/** - * Helper function to provide a fallback to a single _source column if the given array of columns - * is empty, and removes _source if there are more than 1 columns given - * @param columns - * @param useNewFieldsApi should a new fields API be used - */ -function buildColumns(columns: string[], useNewFieldsApi = false) { - if (columns.length > 1 && columns.indexOf('_source') !== -1) { - return columns.filter((col) => col !== '_source'); - } else if (columns.length !== 0) { - return columns; - } - return useNewFieldsApi ? [] : ['_source']; -} - -export function addColumn(columns: string[], columnName: string, useNewFieldsApi?: boolean) { - if (columns.includes(columnName)) { - return columns; - } - return buildColumns([...columns, columnName], useNewFieldsApi); -} - -export function removeColumn(columns: string[], columnName: string, useNewFieldsApi?: boolean) { - if (!columns.includes(columnName)) { - return columns; - } - return buildColumns( - columns.filter((col) => col !== columnName), - useNewFieldsApi - ); -} - -export function moveColumn(columns: string[], columnName: string, newIndex: number) { - if (newIndex < 0 || newIndex >= columns.length || !columns.includes(columnName)) { - return columns; - } - const modifiedColumns = [...columns]; - modifiedColumns.splice(modifiedColumns.indexOf(columnName), 1); // remove at old index - modifiedColumns.splice(newIndex, 0, columnName); // insert before new index - return modifiedColumns; -} +import type { UnifiedDataTableSettings } from '../../types'; export function getStateColumnActions({ capabilities, @@ -61,34 +22,50 @@ export function getStateColumnActions({ columns, sort, defaultOrder, + settings, }: { capabilities: Capabilities; dataView: DataView; dataViews: DataViewsContract; useNewFieldsApi: boolean; - setAppState: (state: { columns: string[]; sort?: string[][] }) => void; + setAppState: (state: { + columns: string[]; + sort?: string[][]; + settings?: UnifiedDataTableSettings; + }) => void; columns?: string[]; sort: string[][] | undefined; defaultOrder: string; + settings?: UnifiedDataTableSettings; }) { function onAddColumn(columnName: string) { popularizeField(dataView, columnName, dataViews, capabilities); const nextColumns = addColumn(columns || [], columnName, useNewFieldsApi); const nextSort = columnName === '_score' && !sort?.length ? [['_score', defaultOrder]] : sort; - setAppState({ columns: nextColumns, sort: nextSort }); + setAppState({ columns: nextColumns, sort: nextSort, settings }); } function onRemoveColumn(columnName: string) { popularizeField(dataView, columnName, dataViews, capabilities); + const nextColumns = removeColumn(columns || [], columnName, useNewFieldsApi); // The state's sort property is an array of [sortByColumn,sortDirection] const nextSort = sort && sort.length ? sort.filter((subArr) => subArr[0] !== columnName) : []; - setAppState({ columns: nextColumns, sort: nextSort }); + + let nextSettings = cleanColumnSettings(nextColumns, settings); + + // When columns are removed, reset the last column to auto width if only absolute + // width columns remain, to ensure the columns fill the available grid space + if (nextColumns.length < (columns?.length ?? 0)) { + nextSettings = adjustLastColumnWidth(nextColumns, nextSettings); + } + + setAppState({ columns: nextColumns, sort: nextSort, settings: nextSettings }); } function onMoveColumn(columnName: string, newIndex: number) { const nextColumns = moveColumn(columns || [], columnName, newIndex); - setAppState({ columns: nextColumns }); + setAppState({ columns: nextColumns, settings }); } function onSetColumns(nextColumns: string[], hideTimeColumn: boolean) { @@ -98,7 +75,15 @@ export function getStateColumnActions({ ? (nextColumns || []).slice(1) : nextColumns; - setAppState({ columns: actualColumns }); + let nextSettings = cleanColumnSettings(nextColumns, settings); + + // When columns are removed, reset the last column to auto width if only absolute + // width columns remain, to ensure the columns fill the available grid space + if (actualColumns.length < (columns?.length ?? 0)) { + nextSettings = adjustLastColumnWidth(actualColumns, nextSettings); + } + + setAppState({ columns: actualColumns, settings: nextSettings }); } return { onAddColumn, @@ -107,3 +92,94 @@ export function getStateColumnActions({ onSetColumns, }; } + +/** + * Helper function to provide a fallback to a single _source column if the given array of columns + * is empty, and removes _source if there are more than 1 columns given + * @param columns + * @param useNewFieldsApi should a new fields API be used + */ +function buildColumns(columns: string[], useNewFieldsApi = false) { + if (columns.length > 1 && columns.indexOf('_source') !== -1) { + return columns.filter((col) => col !== '_source'); + } else if (columns.length !== 0) { + return columns; + } + return useNewFieldsApi ? [] : ['_source']; +} + +function addColumn(columns: string[], columnName: string, useNewFieldsApi?: boolean) { + if (columns.includes(columnName)) { + return columns; + } + return buildColumns([...columns, columnName], useNewFieldsApi); +} + +function removeColumn(columns: string[], columnName: string, useNewFieldsApi?: boolean) { + if (!columns.includes(columnName)) { + return columns; + } + return buildColumns( + columns.filter((col) => col !== columnName), + useNewFieldsApi + ); +} + +function moveColumn(columns: string[], columnName: string, newIndex: number) { + if (newIndex < 0 || newIndex >= columns.length || !columns.includes(columnName)) { + return columns; + } + const modifiedColumns = [...columns]; + modifiedColumns.splice(modifiedColumns.indexOf(columnName), 1); // remove at old index + modifiedColumns.splice(newIndex, 0, columnName); // insert before new index + return modifiedColumns; +} + +function cleanColumnSettings( + columns: string[], + settings?: UnifiedDataTableSettings +): UnifiedDataTableSettings | undefined { + const columnSettings = settings?.columns; + + if (!columnSettings) { + return settings; + } + + const nextColumnSettings = columns.reduce>( + (acc, column) => (columnSettings[column] ? { ...acc, [column]: columnSettings[column] } : acc), + {} + ); + + return { ...settings, columns: nextColumnSettings }; +} + +function adjustLastColumnWidth( + columns: string[], + settings?: UnifiedDataTableSettings +): UnifiedDataTableSettings | undefined { + const columnSettings = settings?.columns; + + if (!columns.length || !columnSettings) { + return settings; + } + + const hasAutoWidthColumn = columns.some((colId) => columnSettings[colId]?.width == null); + + if (hasAutoWidthColumn) { + return settings; + } + + const lastColumn = columns[columns.length - 1]; + const lastColumnSettings = omit(columnSettings[lastColumn] ?? {}, 'width'); + const lastColumnSettingsOptional = Object.keys(lastColumnSettings).length + ? { [lastColumn]: lastColumnSettings } + : undefined; + + return { + ...settings, + columns: { + ...omit(columnSettings, lastColumn), + ...lastColumnSettingsOptional, + }, + }; +} diff --git a/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx b/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx index 63856a2c82ac2..92f072c2da472 100644 --- a/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx +++ b/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx @@ -108,7 +108,7 @@ describe('CompareDocuments', () => { "data-test-subj": "unifiedDataTableCompareDocuments", "gridStyle": Object { "border": "horizontal", - "cellPadding": "l", + "cellPadding": "s", "fontSize": "s", "header": "underline", "rowHover": "highlight", diff --git a/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx b/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx index 5679ac0f236b9..e636a88d1f841 100644 --- a/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx +++ b/packages/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx @@ -24,7 +24,7 @@ import { AdditionalFieldGroups } from '@kbn/unified-field-list'; import { memoize } from 'lodash'; import React, { useMemo, useState } from 'react'; import useLocalStorage from 'react-use/lib/useLocalStorage'; -import { GRID_STYLE } from '../../constants'; +import { DATA_GRID_STYLE_DEFAULT } from '../../constants'; import { ComparisonControls } from './comparison_controls'; import { renderComparisonToolbar } from './comparison_toolbar'; import { useComparisonCellValue } from './hooks/use_comparison_cell_value'; @@ -55,7 +55,7 @@ export interface CompareDocumentsProps { const COMPARISON_ROW_HEIGHT: EuiDataGridRowHeightsOptions = { defaultHeight: 'auto' }; const COMPARISON_IN_MEMORY: EuiDataGridInMemory = { level: 'sorting' }; -const COMPARISON_GRID_STYLE: EuiDataGridStyle = { ...GRID_STYLE, stripes: undefined }; +const COMPARISON_GRID_STYLE: EuiDataGridStyle = { ...DATA_GRID_STYLE_DEFAULT, stripes: undefined }; const getStorageKey = (consumer: string, key: string) => `${consumer}:dataGridComparison${key}`; diff --git a/packages/kbn-unified-data-table/src/components/data_table.test.tsx b/packages/kbn-unified-data-table/src/components/data_table.test.tsx index f5749eaee4bf0..f78405f12be82 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.test.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.test.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React from 'react'; +import React, { useCallback, useState } from 'react'; import { ReactWrapper } from 'enzyme'; import { EuiButton, @@ -33,6 +33,10 @@ import { DatatableColumnType } from '@kbn/expressions-plugin/common'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { CELL_CLASS } from '../utils/get_render_cell_value'; +import { defaultTimeColumnWidth } from '../constants'; +import { useColumns } from '../hooks/use_data_grid_columns'; +import { capabilitiesServiceMock } from '@kbn/core-capabilities-browser-mocks'; +import { dataViewsMock } from '../../__mocks__/data_views'; const mockUseDataGridColumnsCellActions = jest.fn((prop: unknown) => []); jest.mock('@kbn/cell-actions', () => ({ @@ -90,6 +94,56 @@ const DataTable = (props: Partial) => ( ); +const capabilities = capabilitiesServiceMock.createStartContract().capabilities; + +const renderDataTable = (props: Partial) => { + const DataTableWrapped = () => { + const [columns, setColumns] = useState(props.columns ?? []); + const [settings, setSettings] = useState(props.settings); + + const { onSetColumns } = useColumns({ + capabilities, + dataView: dataViewMock, + dataViews: dataViewsMock, + setAppState: useCallback((state) => { + if (state.columns) { + setColumns(state.columns); + } + if (state.settings) { + setSettings(state.settings); + } + }, []), + useNewFieldsApi: true, + columns, + settings, + }); + + return ( + + { + setSettings({ + ...settings, + columns: { + ...settings?.columns, + [columnId]: { + width, + }, + }, + }); + }} + /> + + ); + }; + + render(); +}; + async function getComponent(props: UnifiedDataTableProps = getProps()) { const component = mountWithIntl(); await act(async () => { @@ -265,34 +319,19 @@ describe('UnifiedDataTable', () => { describe('edit field button', () => { it('should render the edit field button if onFieldEdited is provided', async () => { - const component = await getComponent({ - ...getProps(), - columns: ['message'], - onFieldEdited: jest.fn(), - }); - expect(findTestSubject(component, 'dataGridHeaderCellActionGroup-message').exists()).toBe( - false - ); - findTestSubject(component, 'dataGridHeaderCell-message').find('button').simulate('click'); - expect(findTestSubject(component, 'dataGridHeaderCellActionGroup-message').exists()).toBe( - true - ); - expect(findTestSubject(component, 'gridEditFieldButton').exists()).toBe(true); + renderDataTable({ columns: ['message'], onFieldEdited: jest.fn() }); + expect(screen.queryByTestId('dataGridHeaderCellActionGroup-message')).not.toBeInTheDocument(); + userEvent.click(screen.getByRole('button', { name: 'message' })); + expect(screen.getByTestId('dataGridHeaderCellActionGroup-message')).toBeInTheDocument(); + expect(screen.getByTestId('gridEditFieldButton')).toBeInTheDocument(); }); it('should not render the edit field button if onFieldEdited is not provided', async () => { - const component = await getComponent({ - ...getProps(), - columns: ['message'], - }); - expect(findTestSubject(component, 'dataGridHeaderCellActionGroup-message').exists()).toBe( - false - ); - findTestSubject(component, 'dataGridHeaderCell-message').find('button').simulate('click'); - expect(findTestSubject(component, 'dataGridHeaderCellActionGroup-message').exists()).toBe( - true - ); - expect(findTestSubject(component, 'gridEditFieldButton').exists()).toBe(false); + renderDataTable({ columns: ['message'] }); + expect(screen.queryByTestId('dataGridHeaderCellActionGroup-message')).not.toBeInTheDocument(); + userEvent.click(screen.getByRole('button', { name: 'message' })); + expect(screen.getByTestId('dataGridHeaderCellActionGroup-message')).toBeInTheDocument(); + expect(screen.queryByTestId('gridEditFieldButton')).not.toBeInTheDocument(); }); }); @@ -423,16 +462,18 @@ describe('UnifiedDataTable', () => { "additionalControls": null, "showColumnSelector": false, "showDisplaySelector": Object { - "additionalDisplaySettings": , + "additionalDisplaySettings": + + , "allowDensity": false, "allowResetButton": false, "allowRowHeight": false, @@ -455,15 +496,17 @@ describe('UnifiedDataTable', () => { "additionalControls": null, "showColumnSelector": false, "showDisplaySelector": Object { - "additionalDisplaySettings": , + "additionalDisplaySettings": + + , "allowDensity": false, "allowResetButton": false, "allowRowHeight": false, @@ -741,7 +784,7 @@ describe('UnifiedDataTable', () => { expect(grid.hasClass('euiDataGrid--bordersHorizontal')).toBeTruthy(); expect(grid.hasClass('euiDataGrid--fontSizeSmall')).toBeTruthy(); - expect(grid.hasClass('euiDataGrid--paddingLarge')).toBeTruthy(); + expect(grid.hasClass('euiDataGrid--paddingSmall')).toBeTruthy(); expect(grid.hasClass('euiDataGrid--rowHoverHighlight')).toBeTruthy(); expect(grid.hasClass('euiDataGrid--headerUnderline')).toBeTruthy(); expect(grid.hasClass('euiDataGrid--stripes')).toBeTruthy(); @@ -789,14 +832,6 @@ describe('UnifiedDataTable', () => { }); describe('document comparison', () => { - const renderDataTable = (props: Partial) => { - render( - - - - ); - }; - const getSelectedDocumentsButton = () => screen.queryByTestId('unifiedDataTableSelectionBtn'); const selectDocument = (document: EsHitRecord) => @@ -916,4 +951,75 @@ describe('UnifiedDataTable', () => { expect(findTestSubject(component, 'dataGridHeaderCell-colorIndicator').exists()).toBeFalsy(); }); }); + + describe('columns', () => { + // Default column width in EUI is hardcoded to 100px for Jest envs + const EUI_DEFAULT_COLUMN_WIDTH = '100px'; + const getColumnHeader = (name: string) => screen.getByRole('columnheader', { name }); + const queryColumnHeader = (name: string) => screen.queryByRole('columnheader', { name }); + const getButton = (name: string) => screen.getByRole('button', { name }); + const queryButton = (name: string) => screen.queryByRole('button', { name }); + + it('should reset the last column to auto width if only absolute width columns remain', async () => { + renderDataTable({ + columns: ['message', 'extension', 'bytes'], + settings: { + columns: { + extension: { width: 50 }, + bytes: { width: 50 }, + }, + }, + }); + expect(getColumnHeader('message')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + expect(getColumnHeader('extension')).toHaveStyle({ width: '50px' }); + expect(getColumnHeader('bytes')).toHaveStyle({ width: '50px' }); + userEvent.click(getButton('message')); + userEvent.click(getButton('Remove column'), undefined, { skipPointerEventsCheck: true }); + expect(queryColumnHeader('message')).not.toBeInTheDocument(); + expect(getColumnHeader('extension')).toHaveStyle({ width: '50px' }); + expect(getColumnHeader('bytes')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + }); + + it('should not reset the last column to auto width when there are remaining auto width columns', async () => { + renderDataTable({ + columns: ['message', 'extension', 'bytes'], + settings: { + columns: { + bytes: { width: 50 }, + }, + }, + }); + expect(getColumnHeader('message')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + expect(getColumnHeader('extension')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + expect(getColumnHeader('bytes')).toHaveStyle({ width: '50px' }); + userEvent.click(getButton('message')); + userEvent.click(getButton('Remove column'), undefined, { skipPointerEventsCheck: true }); + expect(queryColumnHeader('message')).not.toBeInTheDocument(); + expect(getColumnHeader('extension')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + expect(getColumnHeader('bytes')).toHaveStyle({ width: '50px' }); + }); + + it('should show the reset width button only for absolute width columns, and allow resetting to default width', async () => { + renderDataTable({ + columns: ['message', 'extension'], + settings: { + columns: { + '@timestamp': { width: 50 }, + extension: { width: 50 }, + }, + }, + }); + expect(getColumnHeader('@timestamp')).toHaveStyle({ width: '50px' }); + userEvent.click(getButton('@timestamp')); + userEvent.click(getButton('Reset width'), undefined, { skipPointerEventsCheck: true }); + expect(getColumnHeader('@timestamp')).toHaveStyle({ width: `${defaultTimeColumnWidth}px` }); + expect(getColumnHeader('message')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + userEvent.click(getButton('message')); + expect(queryButton('Reset width')).not.toBeInTheDocument(); + expect(getColumnHeader('extension')).toHaveStyle({ width: '50px' }); + userEvent.click(getButton('extension')); + userEvent.click(getButton('Reset width'), undefined, { skipPointerEventsCheck: true }); + expect(getColumnHeader('extension')).toHaveStyle({ width: EUI_DEFAULT_COLUMN_WIDTH }); + }); + }); }); diff --git a/packages/kbn-unified-data-table/src/components/data_table.tsx b/packages/kbn-unified-data-table/src/components/data_table.tsx index 5068115fed76d..96c5004c61a95 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.tsx @@ -26,9 +26,10 @@ import { EuiDataGridInMemory, EuiDataGridControlColumn, EuiDataGridCustomBodyProps, - EuiDataGridToolBarVisibilityDisplaySelectorOptions, EuiDataGridStyle, EuiDataGridProps, + EuiHorizontalRule, + EuiDataGridToolBarVisibilityDisplaySelectorOptions, } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; import { @@ -45,6 +46,7 @@ import type { ThemeServiceStart } from '@kbn/react-kibana-context-common'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { AdditionalFieldGroups } from '@kbn/unified-field-list'; +import { DATA_GRID_DENSITY_STYLE_MAP, useDataGridDensity } from '../hooks/use_data_grid_density'; import { UnifiedDataTableSettings, ValueToStringConverter, @@ -70,10 +72,11 @@ import { getSchemaDetectors } from './data_table_schema'; import { DataTableDocumentToolbarBtn } from './data_table_document_selection'; import { useRowHeightsOptions } from '../hooks/use_row_heights_options'; import { + DATA_GRID_STYLE_DEFAULT, DEFAULT_ROWS_PER_PAGE, - GRID_STYLE, ROWS_HEIGHT_OPTIONS, toolbarVisibility as toolbarVisibilityDefaults, + DataGridDensity, } from '../constants'; import { UnifiedDataTableFooter } from './data_table_footer'; import { UnifiedDataTableAdditionalDisplaySettings } from './data_table_additional_display_settings'; @@ -161,9 +164,9 @@ export interface UnifiedDataTableProps { */ onFilter?: DocViewFilterFn; /** - * Function triggered when a column is resized by the user + * Function triggered when a column is resized by the user, passes `undefined` for auto-width */ - onResize?: (colSettings: { columnId: string; width: number }) => void; + onResize?: (colSettings: { columnId: string; width: number | undefined }) => void; /** * Function to set all columns */ @@ -232,6 +235,14 @@ export interface UnifiedDataTableProps { * Update row height state */ onUpdateRowHeight?: (rowHeight: number) => void; + /** + * Density from state + */ + dataGridDensityState?: DataGridDensity; + /** + * Callback when the data grid density configuration is modified + */ + onUpdateDataGridDensity?: (dataGridDensity: DataGridDensity) => void; /** * Is text base lang mode enabled */ @@ -468,6 +479,8 @@ export const UnifiedDataTable = ({ cellContext, renderCellPopover, getRowIndicator, + dataGridDensityState, + onUpdateDataGridDensity, }: UnifiedDataTableProps) => { const { fieldFormats, toastNotifications, dataViewFieldEditor, uiSettings, storage, data } = services; @@ -610,6 +623,23 @@ export const UnifiedDataTable = ({ return getShouldShowFieldHandler(dataViewFields, dataView, showMultiFields); }, [dataView, showMultiFields]); + const { dataGridDensity, onChangeDataGridDensity } = useDataGridDensity({ + storage, + consumer, + dataGridDensityState, + onUpdateDataGridDensity, + }); + + const gridStyle = useMemo( + () => ({ + ...DATA_GRID_STYLE_DEFAULT, + ...DATA_GRID_DENSITY_STYLE_MAP[dataGridDensity], + onChange: onChangeDataGridDensity, + ...gridStyleOverride, + }), + [dataGridDensity, onChangeDataGridDensity, gridStyleOverride] + ); + /** * Cell rendering */ @@ -625,6 +655,7 @@ export const UnifiedDataTable = ({ maxEntries: maxDocFieldsDisplayed, externalCustomRenderers, isPlainRecord, + isCompressed: dataGridDensity === DataGridDensity.COMPACT, }), [ dataView, @@ -635,6 +666,7 @@ export const UnifiedDataTable = ({ fieldFormats, externalCustomRenderers, isPlainRecord, + dataGridDensity, ] ); @@ -778,6 +810,7 @@ export const UnifiedDataTable = ({ showColumnTokens, headerRowHeightLines, customGridColumnsConfiguration, + onResize, }), [ columnsMeta, @@ -792,6 +825,7 @@ export const UnifiedDataTable = ({ isPlainRecord, isSortEnabled, onFilter, + onResize, settings, showColumnTokens, toastNotifications, @@ -950,34 +984,41 @@ export const UnifiedDataTable = ({ [renderCustomToolbar, additionalControls] ); - const showDisplaySelector = useMemo(() => { - const options: EuiDataGridToolBarVisibilityDisplaySelectorOptions = {}; - - if (onUpdateRowHeight) { - options.allowDensity = false; - } - - if (onUpdateRowHeight || onUpdateHeaderRowHeight || onUpdateSampleSize) { - options.allowRowHeight = false; - options.allowResetButton = false; - options.additionalDisplaySettings = ( - - ); + const showDisplaySelector = useMemo((): + | EuiDataGridToolBarVisibilityDisplaySelectorOptions + | undefined => { + if ( + !onUpdateDataGridDensity && + !onUpdateRowHeight && + !onUpdateHeaderRowHeight && + !onUpdateSampleSize + ) { + return; } - return Object.keys(options).length ? options : undefined; + return { + allowDensity: Boolean(onUpdateDataGridDensity), + allowRowHeight: false, + allowResetButton: false, + additionalDisplaySettings: ( + <> + {onUpdateDataGridDensity ? : null} + + + ), + }; }, [ headerRowHeight, headerRowHeightLines, @@ -992,6 +1033,7 @@ export const UnifiedDataTable = ({ rowHeight, rowHeightLines, sampleSizeState, + onUpdateDataGridDensity, ]); const inMemory = useMemo(() => { @@ -1101,6 +1143,8 @@ export const UnifiedDataTable = ({ /> ) : ( >( (event) => { - if (!event.target.value) { + if (!('value' in event.target) || !event.target.value) { setActiveSampleSize(''); return; } diff --git a/packages/kbn-unified-data-table/src/components/data_table_columns.test.tsx b/packages/kbn-unified-data-table/src/components/data_table_columns.test.tsx index 6f438567dd94c..99a9e4767c6d1 100644 --- a/packages/kbn-unified-data-table/src/components/data_table_columns.test.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table_columns.test.tsx @@ -50,6 +50,7 @@ describe('Data table columns', function () { hasEditDataViewPermission: () => servicesMock.dataViewFieldEditor.userPermissions.editIndexPattern(), onFilter: () => {}, + onResize: () => {}, }); expect(actual).toMatchSnapshot(); }); @@ -72,6 +73,7 @@ describe('Data table columns', function () { hasEditDataViewPermission: () => servicesMock.dataViewFieldEditor.userPermissions.editIndexPattern(), onFilter: () => {}, + onResize: () => {}, }); expect(actual).toMatchSnapshot(); }); @@ -99,6 +101,7 @@ describe('Data table columns', function () { message: { type: 'string', esType: 'keyword' }, timestamp: { type: 'date', esType: 'dateTime' }, }, + onResize: () => {}, }); expect(actual).toMatchSnapshot(); }); @@ -297,6 +300,7 @@ describe('Data table columns', function () { hasEditDataViewPermission: () => servicesMock.dataViewFieldEditor.userPermissions.editIndexPattern(), onFilter: () => {}, + onResize: () => {}, }); expect(actual).toMatchSnapshot(); }); @@ -324,6 +328,7 @@ describe('Data table columns', function () { hasEditDataViewPermission: () => servicesMock.dataViewFieldEditor.userPermissions.editIndexPattern(), onFilter: () => {}, + onResize: () => {}, }); expect(actual).toMatchSnapshot(); }); @@ -356,6 +361,7 @@ describe('Data table columns', function () { columnsMeta: { extension: { type: 'string' }, }, + onResize: () => {}, }); expect(gridColumns[1].schema).toBe('string'); }); @@ -386,6 +392,7 @@ describe('Data table columns', function () { columnsMeta: { var_test: { type: 'number' }, }, + onResize: () => {}, }); expect(gridColumns[1].schema).toBe('numeric'); }); @@ -412,6 +419,7 @@ describe('Data table columns', function () { extension: { type: 'string' }, message: { type: 'string', esType: 'keyword' }, }, + onResize: () => {}, }); const extensionGridColumn = gridColumns[0]; @@ -442,6 +450,7 @@ describe('Data table columns', function () { extension: { type: 'string' }, message: { type: 'string', esType: 'keyword' }, }, + onResize: () => {}, }); expect(customizedGridColumns).toMatchSnapshot(); @@ -484,6 +493,7 @@ describe('Data table columns', function () { }, hasEditDataViewPermission: () => servicesMock.dataViewFieldEditor.userPermissions.editIndexPattern(), + onResize: () => {}, }); const columnDisplayNames = customizedGridColumns.map((column) => column.displayAsText); expect(columnDisplayNames.includes('test_column_one')).toBeTruthy(); diff --git a/packages/kbn-unified-data-table/src/components/data_table_columns.tsx b/packages/kbn-unified-data-table/src/components/data_table_columns.tsx index f345c1093d9d1..cb90e18054891 100644 --- a/packages/kbn-unified-data-table/src/components/data_table_columns.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table_columns.tsx @@ -12,6 +12,7 @@ import { type EuiDataGridColumn, type EuiDataGridColumnCellAction, EuiScreenReaderOnly, + EuiListGroupItemProps, } from '@elastic/eui'; import { type DataView, DataViewField } from '@kbn/data-views-plugin/public'; import { ToastsStart, IUiSettingsClient } from '@kbn/core/public'; @@ -30,6 +31,7 @@ import { import { buildCopyColumnNameButton, buildCopyColumnValuesButton } from './build_copy_column_button'; import { buildEditFieldButton } from './build_edit_field_button'; import { DataTableColumnHeader, DataTableTimeColumnHeader } from './data_table_column_header'; +import { UnifiedDataTableProps } from './data_table'; export const getColumnDisplayName = ( columnName: string, @@ -105,6 +107,7 @@ function buildEuiGridColumn({ headerRowHeight, customGridColumnsConfiguration, columnDisplay, + onResize, }: { numberOfColumns: number; columnName: string; @@ -126,6 +129,7 @@ function buildEuiGridColumn({ headerRowHeight?: number; customGridColumnsConfiguration?: CustomGridColumnsConfiguration; columnDisplay?: string; + onResize: UnifiedDataTableProps['onResize']; }) { const dataViewField = !isPlainRecord ? dataView.getFieldByName(columnName) @@ -142,6 +146,26 @@ function buildEuiGridColumn({ editField && dataViewField && buildEditFieldButton({ hasEditDataViewPermission, dataView, field: dataViewField, editField }); + const resetWidthButton: EuiListGroupItemProps | undefined = + onResize && columnWidth > 0 + ? { + // @ts-expect-error + // We need to force a key here because EuiListGroup uses the array index as a key by default, + // which causes re-render issues with conditional items like this one, and can result in + // incorrect attributes (e.g. title) on the HTML element as well as test failures + key: 'reset-width', + label: i18n.translate('unifiedDataTable.grid.resetColumnWidthButton', { + defaultMessage: 'Reset width', + }), + iconType: 'refresh', + size: 'xs', + iconProps: { size: 'm' }, + onClick: () => { + onResize({ columnId: columnName, width: undefined }); + }, + 'data-test-subj': 'unifiedDataTableResetColumnWidth', + } + : undefined; const columnDisplayName = getColumnDisplayName( columnName, @@ -193,6 +217,7 @@ function buildEuiGridColumn({ showMoveLeft: !defaultColumns, showMoveRight: !defaultColumns, additional: [ + ...(resetWidthButton ? [resetWidthButton] : []), ...(columnName === '__source' ? [] : [ @@ -268,6 +293,7 @@ export function getEuiGridColumns({ showColumnTokens, headerRowHeightLines, customGridColumnsConfiguration, + onResize, }: { columns: string[]; columnsCellActions?: EuiDataGridColumnCellAction[][]; @@ -290,6 +316,7 @@ export function getEuiGridColumns({ showColumnTokens?: boolean; headerRowHeightLines: number; customGridColumnsConfiguration?: CustomGridColumnsConfiguration; + onResize: UnifiedDataTableProps['onResize']; }) { const getColWidth = (column: string) => settings?.columns?.[column]?.width ?? 0; const headerRowHeight = deserializeHeaderRowHeight(headerRowHeightLines); @@ -317,6 +344,7 @@ export function getEuiGridColumns({ headerRowHeight, customGridColumnsConfiguration, columnDisplay: settings?.columns?.[column]?.display, + onResize, }) ); } diff --git a/packages/kbn-unified-data-table/src/components/source_document.tsx b/packages/kbn-unified-data-table/src/components/source_document.tsx index 3726159a6b2ea..952ca2d6103be 100644 --- a/packages/kbn-unified-data-table/src/components/source_document.tsx +++ b/packages/kbn-unified-data-table/src/components/source_document.tsx @@ -37,6 +37,7 @@ export function SourceDocument({ fieldFormats, dataTestSubj = 'discoverCellDescriptionList', className, + isCompressed = true, }: { useTopLevelObjectColumns: boolean; row: DataTableRecord; @@ -48,6 +49,7 @@ export function SourceDocument({ fieldFormats: FieldFormatsStart; dataTestSubj?: string; className?: string; + isCompressed?: boolean; }) { const pairs: FormattedHit = useTopLevelObjectColumns ? getTopLevelObjectPairs(row.raw, columnId, dataView, shouldShowFieldHandler).slice( @@ -59,7 +61,7 @@ export function SourceDocument({ return ( diff --git a/packages/kbn-unified-data-table/src/constants.ts b/packages/kbn-unified-data-table/src/constants.ts index c7cf1793039a5..e795b170dbc0b 100644 --- a/packages/kbn-unified-data-table/src/constants.ts +++ b/packages/kbn-unified-data-table/src/constants.ts @@ -5,13 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { EuiDataGridStyle } from '@elastic/eui'; +import type { EuiDataGridStyle } from '@elastic/eui'; export const DEFAULT_CONTROL_COLUMN_WIDTH = 24; export const DEFAULT_ROWS_PER_PAGE = 100; export const MAX_LOADED_GRID_ROWS = 10000; - export const ROWS_PER_PAGE_OPTIONS = [10, 25, 50, DEFAULT_ROWS_PER_PAGE, 250, 500]; /** * Row height might be a value from -1 to 20 @@ -29,13 +28,27 @@ export const defaultMonacoEditorWidth = 370; export const defaultTimeColumnWidth = 212; export const kibanaJSON = 'kibana-json'; -export const GRID_STYLE: EuiDataGridStyle = { - border: 'horizontal', +export const DATA_GRID_STYLE_COMPACT: EuiDataGridStyle = { + cellPadding: 's', fontSize: 's', +}; + +export const DATA_GRID_STYLE_NORMAL: EuiDataGridStyle = { + cellPadding: 'm', + fontSize: 'm', +}; + +export const DATA_GRID_STYLE_EXPANDED: EuiDataGridStyle = { cellPadding: 'l', + fontSize: 'l', +}; + +export const DATA_GRID_STYLE_DEFAULT: EuiDataGridStyle = { + ...DATA_GRID_STYLE_COMPACT, + border: 'horizontal', + stripes: true, rowHover: 'highlight', header: 'underline', - stripes: true, }; export const toolbarVisibility = { @@ -44,3 +57,9 @@ export const toolbarVisibility = { allowReorder: true, }, }; + +export enum DataGridDensity { + COMPACT = 'compact', + NORMAL = 'normal', + EXPANDED = 'expanded', +} diff --git a/packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts b/packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts index 088f7b0491c69..4346d23a6584f 100644 --- a/packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts +++ b/packages/kbn-unified-data-table/src/hooks/use_data_grid_columns.ts @@ -12,16 +12,22 @@ import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public' import { Capabilities } from '@kbn/core/public'; import { isEqual } from 'lodash'; import { getStateColumnActions } from '../components/actions/columns'; +import { UnifiedDataTableSettings } from '../types'; -interface UseColumnsProps { +export interface UseColumnsProps { capabilities: Capabilities; dataView: DataView; dataViews: DataViewsContract; useNewFieldsApi: boolean; - setAppState: (state: { columns: string[]; sort?: string[][] }) => void; + setAppState: (state: { + columns: string[]; + sort?: string[][]; + settings?: UnifiedDataTableSettings; + }) => void; columns?: string[]; sort?: string[][]; defaultOrder?: string; + settings?: UnifiedDataTableSettings; } export const useColumns = ({ @@ -33,6 +39,7 @@ export const useColumns = ({ columns, sort, defaultOrder = 'desc', + settings, }: UseColumnsProps) => { const [usedColumns, setUsedColumns] = useState(getColumns(columns, useNewFieldsApi)); useEffect(() => { @@ -53,6 +60,7 @@ export const useColumns = ({ columns: usedColumns, sort, defaultOrder, + settings, }), [ capabilities, @@ -60,6 +68,7 @@ export const useColumns = ({ dataViews, defaultOrder, setAppState, + settings, sort, useNewFieldsApi, usedColumns, diff --git a/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.test.tsx b/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.test.tsx new file mode 100644 index 0000000000000..8a6e3c96477ea --- /dev/null +++ b/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.test.tsx @@ -0,0 +1,75 @@ +/* + * 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 { Storage } from '@kbn/kibana-utils-plugin/public'; +import { renderHook } from '@testing-library/react-hooks'; +import { useDataGridDensity } from './use_data_grid_density'; +import { DATA_GRID_STYLE_EXPANDED, DataGridDensity } from '../constants'; + +const localStorageMock = { + get: jest.fn(), + set: jest.fn(), +}; + +describe('useDataGridDensity', () => { + beforeEach(() => { + localStorageMock.get.mockClear(); + localStorageMock.set.mockClear(); + }); + + it('should read from local storage', () => { + localStorageMock.get.mockReturnValue(DataGridDensity.NORMAL); + const { result } = renderHook(() => + useDataGridDensity({ + storage: localStorageMock as unknown as Storage, + consumer: 'discover', + }) + ); + const { + current: { dataGridDensity }, + } = result; + expect(dataGridDensity).toBe(DataGridDensity.NORMAL); + }); + + it('should update local storage when onChangeDataGridDensity is called', () => { + const { result } = renderHook(() => + useDataGridDensity({ + storage: localStorageMock as unknown as Storage, + consumer: 'discover', + }) + ); + const { + current: { onChangeDataGridDensity }, + } = result; + + onChangeDataGridDensity(DATA_GRID_STYLE_EXPANDED); + + expect(localStorageMock.set).toBeCalledWith( + 'discover:dataGridDensity', + DataGridDensity.EXPANDED + ); + }); + + it('should call provided onUpdateDataGridDensity with the updated value', () => { + const onUpdateDataGridDensity = jest.fn(); + const { result } = renderHook(() => + useDataGridDensity({ + storage: localStorageMock as unknown as Storage, + consumer: 'discover', + onUpdateDataGridDensity, + }) + ); + const { + current: { onChangeDataGridDensity }, + } = result; + + onChangeDataGridDensity(DATA_GRID_STYLE_EXPANDED); + + expect(onUpdateDataGridDensity).toBeCalledWith(DataGridDensity.EXPANDED); + }); +}); diff --git a/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.ts b/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.ts new file mode 100644 index 0000000000000..a53f95e23fb85 --- /dev/null +++ b/packages/kbn-unified-data-table/src/hooks/use_data_grid_density.ts @@ -0,0 +1,68 @@ +/* + * 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 { EuiDataGridStyle } from '@elastic/eui'; +import type { Storage } from '@kbn/kibana-utils-plugin/public'; +import { useCallback, useMemo } from 'react'; +import { + DATA_GRID_STYLE_COMPACT, + DATA_GRID_STYLE_EXPANDED, + DATA_GRID_STYLE_NORMAL, + DataGridDensity, +} from '../constants'; + +export const DATA_GRID_DENSITY_STYLE_MAP = { + [DataGridDensity.COMPACT]: DATA_GRID_STYLE_COMPACT, + [DataGridDensity.NORMAL]: DATA_GRID_STYLE_NORMAL, + [DataGridDensity.EXPANDED]: DATA_GRID_STYLE_EXPANDED, +}; + +interface UseDataGridDensityProps { + storage: Storage; + consumer: string; + dataGridDensityState?: DataGridDensity; + onUpdateDataGridDensity?: (density: DataGridDensity) => void; +} + +export const DATA_GRID_DENSITY_STORAGE_KEY = 'dataGridDensity'; + +export function getDensityFromStyle(style: EuiDataGridStyle) { + return style.cellPadding === DATA_GRID_STYLE_COMPACT.cellPadding && + style.fontSize === DATA_GRID_STYLE_COMPACT.fontSize + ? DataGridDensity.COMPACT + : style.cellPadding === DATA_GRID_STYLE_NORMAL.cellPadding && + style.fontSize === DATA_GRID_STYLE_NORMAL.fontSize + ? DataGridDensity.NORMAL + : DataGridDensity.EXPANDED; +} + +export const useDataGridDensity = ({ + storage, + consumer, + dataGridDensityState, + onUpdateDataGridDensity, +}: UseDataGridDensityProps) => { + const storageKey = `${consumer}:${DATA_GRID_DENSITY_STORAGE_KEY}`; + const dataGridDensity = useMemo(() => { + return dataGridDensityState ?? storage.get(storageKey) ?? DataGridDensity.COMPACT; + }, [dataGridDensityState, storage, storageKey]); + + const onChangeDataGridDensity = useCallback( + (gridStyle: EuiDataGridStyle) => { + const newDensity = getDensityFromStyle(gridStyle); + storage.set(storageKey, newDensity); + onUpdateDataGridDensity?.(newDensity); + }, + [storageKey, storage, onUpdateDataGridDensity] + ); + + return { + dataGridDensity, + onChangeDataGridDensity, + }; +}; diff --git a/packages/kbn-unified-data-table/src/types.ts b/packages/kbn-unified-data-table/src/types.ts index b08818e1a861a..f06c4c4096c0c 100644 --- a/packages/kbn-unified-data-table/src/types.ts +++ b/packages/kbn-unified-data-table/src/types.ts @@ -19,6 +19,8 @@ import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { EuiDataGridControlColumn } from '@elastic/eui/src/components/datagrid/data_grid_types'; import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; +export type { DataGridDensity } from './constants'; + /** * User configurable state of data grid, persisted in saved search */ @@ -58,6 +60,7 @@ export type DataGridCellValueElementProps = EuiDataGridCellValueElementProps & { dataView: DataView; fieldFormats: FieldFormatsStart; closePopover: () => void; + isCompressed?: boolean; }; export type CustomCellRenderer = Record< diff --git a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx index 04d160bef5c2e..5d9894e9bcd2c 100644 --- a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx +++ b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx @@ -224,6 +224,7 @@ describe('Unified data table cell rendering', function () { maxEntries: 100, shouldShowFieldHandler: showFieldHandler, row: rows[0], + isCompressed: true, }); }); @@ -329,6 +330,7 @@ describe('Unified data table cell rendering', function () { shouldShowFieldHandler: showFieldHandler, row: rows[0], isPlainRecord: true, + isCompressed: true, }); }); @@ -367,6 +369,7 @@ describe('Unified data table cell rendering', function () { maxEntries: 100, shouldShowFieldHandler: showFieldHandler, row: rows[0], + isCompressed: true, }); }); @@ -406,6 +409,7 @@ describe('Unified data table cell rendering', function () { maxEntries: 1, shouldShowFieldHandler: showFieldHandler, row: rows[0], + isCompressed: true, }); }); @@ -519,6 +523,7 @@ describe('Unified data table cell rendering', function () { shouldShowFieldHandler: showFieldHandler, useTopLevelObjectColumns: true, row: rows[0], + isCompressed: true, }); }); @@ -559,6 +564,7 @@ describe('Unified data table cell rendering', function () { shouldShowFieldHandler: showFieldHandler, useTopLevelObjectColumns: true, row: rows[0], + isCompressed: true, }); }); diff --git a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.tsx b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.tsx index 6a10b0950946d..1b856d665d301 100644 --- a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.tsx +++ b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.tsx @@ -36,6 +36,7 @@ export const getRenderCellValueFn = ({ maxEntries, externalCustomRenderers, isPlainRecord, + isCompressed = true, }: { dataView: DataView; rows: DataTableRecord[] | undefined; @@ -46,6 +47,7 @@ export const getRenderCellValueFn = ({ maxEntries: number; externalCustomRenderers?: CustomCellRenderer; isPlainRecord?: boolean; + isCompressed?: boolean; }) => { return function UnifiedDataTableRenderCellValue({ rowIndex, @@ -95,6 +97,7 @@ export const getRenderCellValueFn = ({ dataView={dataView} fieldFormats={fieldFormats} closePopover={closePopover} + isCompressed={isCompressed} /> ); @@ -134,6 +137,7 @@ export const getRenderCellValueFn = ({ shouldShowFieldHandler={shouldShowFieldHandler} maxEntries={maxEntries} isPlainRecord={isPlainRecord} + isCompressed={isCompressed} /> ); } diff --git a/packages/kbn-unified-data-table/tsconfig.json b/packages/kbn-unified-data-table/tsconfig.json index 0f55e72d44e0a..ca3372bd40f30 100644 --- a/packages/kbn-unified-data-table/tsconfig.json +++ b/packages/kbn-unified-data-table/tsconfig.json @@ -38,5 +38,6 @@ "@kbn/shared-ux-utility", "@kbn/unified-field-list", "@kbn/core-notifications-browser", + "@kbn/core-capabilities-browser-mocks", ] } diff --git a/packages/kbn-unified-doc-viewer/src/components/field_name/field_name.tsx b/packages/kbn-unified-doc-viewer/src/components/field_name/field_name.tsx index d7f380195947a..4c57fa6cc0dc9 100644 --- a/packages/kbn-unified-doc-viewer/src/components/field_name/field_name.tsx +++ b/packages/kbn-unified-doc-viewer/src/components/field_name/field_name.tsx @@ -8,14 +8,7 @@ import React from 'react'; import './field_name.scss'; -import { - EuiBadge, - EuiFlexGroup, - EuiFlexItem, - EuiToolTip, - EuiHighlight, - EuiIcon, -} from '@elastic/eui'; +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip, EuiHighlight } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { FieldIcon, FieldIconProps } from '@kbn/react-field'; @@ -30,7 +23,6 @@ interface Props { fieldIconProps?: Omit; scripted?: boolean; highlight?: string; - isPinned?: boolean; } export function FieldName({ @@ -40,7 +32,6 @@ export function FieldName({ fieldIconProps, scripted = false, highlight = '', - isPinned = false, }: Props) { const typeName = getFieldTypeName(fieldType); const displayName = @@ -63,17 +54,6 @@ export function FieldName({ - {isPinned && ( - - - - )} diff --git a/packages/kbn-utils/kibana.jsonc b/packages/kbn-utils/kibana.jsonc index 2c4efc0a67651..516d42bb2e8ba 100644 --- a/packages/kbn-utils/kibana.jsonc +++ b/packages/kbn-utils/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/utils", "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-visualization-ui-components/components/color_picker.tsx b/packages/kbn-visualization-ui-components/components/color_picker.tsx index 3a2613d16d665..442140e82c2b6 100644 --- a/packages/kbn-visualization-ui-components/components/color_picker.tsx +++ b/packages/kbn-visualization-ui-components/components/color_picker.tsx @@ -28,6 +28,17 @@ const tooltipContent = { }), }; +export interface ColorPickerProps { + overwriteColor?: string | null; + defaultColor?: string | null; + isClearable?: boolean; + setConfig: (config: { color?: string }) => void; + label?: string; + disableHelpTooltip?: boolean; + disabledMessage?: string; + showAlpha?: boolean; +} + export const ColorPicker = ({ overwriteColor, defaultColor, @@ -37,16 +48,7 @@ export const ColorPicker = ({ disableHelpTooltip, disabledMessage, showAlpha, -}: { - overwriteColor?: string | null; - defaultColor?: string | null; - isClearable?: boolean; - setConfig: (config: { color?: string }) => void; - label?: string; - disableHelpTooltip?: boolean; - disabledMessage?: string; - showAlpha?: boolean; -}) => { +}: ColorPickerProps) => { const [colorText, setColorText] = useState(overwriteColor || defaultColor); const [validatedColor, setValidatedColor] = useState(overwriteColor || defaultColor); const [currentColorAlpha, setCurrentColorAlpha] = useState(getColorAlpha(colorText)); diff --git a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx index b954c37e3f7d1..3c031ac82da06 100644 --- a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx +++ b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx @@ -33,6 +33,18 @@ export const defaultFilter: Query = { language: 'kuery', }; +export interface FilterQueryInputProps { + inputFilter: Query | undefined; + onChange: (query: Query) => void; + dataView: DataViewBase; + helpMessage?: string | null; + label?: string; + initiallyOpen?: boolean; + ['data-test-subj']?: string; + queryInputServices: QueryInputServices; + appName: string; +} + export function FilterQueryInput({ inputFilter, onChange, @@ -43,17 +55,7 @@ export function FilterQueryInput({ ['data-test-subj']: dataTestSubj, queryInputServices, appName, -}: { - inputFilter: Query | undefined; - onChange: (query: Query) => void; - dataView: DataViewBase; - helpMessage?: string | null; - label?: string; - initiallyOpen?: boolean; - ['data-test-subj']?: string; - queryInputServices: QueryInputServices; - appName: string; -}) { +}: FilterQueryInputProps) { const [filterPopoverOpen, setFilterPopoverOpen] = useState(Boolean(initiallyOpen)); const onClosePopup: EuiPopoverProps['closePopover'] = useCallback(() => { diff --git a/packages/kbn-visualization-ui-components/index.ts b/packages/kbn-visualization-ui-components/index.ts index 239849da05a50..44fcc3448aee2 100644 --- a/packages/kbn-visualization-ui-components/index.ts +++ b/packages/kbn-visualization-ui-components/index.ts @@ -31,7 +31,7 @@ export { ChartSwitchTrigger, } from './components'; -export { isFieldLensCompatible } from './util'; +export { isFieldLensCompatible, sharedSetOfIcons, hasIcon, iconSortCriteria } from './util'; export type { DataType, @@ -40,6 +40,7 @@ export type { IconSet, AccessorConfig, QueryInputServices, + ColorPickerProps, } from './components'; -export type { FormatFactory, LineStyle } from './types'; +export type { FormatFactory, LineStyle, SharedSetOfIcons } from './types'; diff --git a/packages/kbn-visualization-ui-components/types.ts b/packages/kbn-visualization-ui-components/types.ts index 2e72eb9a305cf..eb06837db4562 100644 --- a/packages/kbn-visualization-ui-components/types.ts +++ b/packages/kbn-visualization-ui-components/types.ts @@ -11,3 +11,18 @@ import type { IFieldFormat, SerializedFieldFormat } from '@kbn/field-formats-plu export type FormatFactory = (mapping?: SerializedFieldFormat) => IFieldFormat; export type LineStyle = 'solid' | 'dashed' | 'dotted'; + +// This is a line of shared icon names used by Reference Lines, Annotations and Metric chart +export type SharedSetOfIcons = + | 'empty' + | 'asterisk' + | 'alert' + | 'bell' + | 'bolt' + | 'bug' + | 'editorComment' + | 'flag' + | 'heart' + | 'mapMarker' + | 'starEmpty' + | 'tag'; diff --git a/packages/kbn-visualization-ui-components/util.ts b/packages/kbn-visualization-ui-components/util.ts index 2eb71ee858759..070d82ddf1ba3 100644 --- a/packages/kbn-visualization-ui-components/util.ts +++ b/packages/kbn-visualization-ui-components/util.ts @@ -7,6 +7,92 @@ */ import { DataViewField, isNestedField } from '@kbn/data-views-plugin/common'; +import { i18n } from '@kbn/i18n'; +import type { IconSet } from './components'; +import type { SharedSetOfIcons } from './types'; export const isFieldLensCompatible = (field: DataViewField) => !isNestedField(field) && (!!field.aggregatable || !!field.scripted); + +/** + * Icon checking logic. It makes sure an icon has actual content. + */ +export function hasIcon(icon: string | undefined): icon is string { + return icon != null && icon !== 'empty'; +} + +/** + * Sorting criteria for icons sets. It makes sure empty icon is always on top. + */ +export function iconSortCriteria(a: IconSet[number], b: IconSet[number]) { + if (a.value === 'empty') { + return -1; + } + if (b.value === 'empty') { + return 1; + } + return a.value.localeCompare(b.value); +} + +/** + * This is the minimal icons set. + * So far it is computed from Reference line and Metric chart icons. + * Needs to consider annotation icons set too in the future. + */ + +export const sharedSetOfIcons: IconSet = [ + { + value: 'empty', + label: i18n.translate('visualizationUiComponents.iconSelect.noIconLabel', { + defaultMessage: 'None', + }), + }, + { + value: 'asterisk', + label: i18n.translate('visualizationUiComponents.iconSelect.asteriskIconLabel', { + defaultMessage: 'Asterisk', + }), + }, + { + value: 'bell', + label: i18n.translate('visualizationUiComponents.iconSelect.bellIconLabel', { + defaultMessage: 'Bell', + }), + }, + { + value: 'bolt', + label: i18n.translate('visualizationUiComponents.iconSelect.boltIconLabel', { + defaultMessage: 'Bolt', + }), + }, + { + value: 'bug', + label: i18n.translate('visualizationUiComponents.iconSelect.bugIconLabel', { + defaultMessage: 'Bug', + }), + }, + { + value: 'editorComment', + label: i18n.translate('visualizationUiComponents.iconSelect.commentIconLabel', { + defaultMessage: 'Comment', + }), + }, + { + value: 'alert', + label: i18n.translate('visualizationUiComponents.iconSelect.alertIconLabel', { + defaultMessage: 'Alert', + }), + }, + { + value: 'flag', + label: i18n.translate('visualizationUiComponents.iconSelect.flagIconLabel', { + defaultMessage: 'Flag', + }), + }, + { + value: 'tag', + label: i18n.translate('visualizationUiComponents.iconSelect.tagIconLabel', { + defaultMessage: 'Tag', + }), + }, +]; diff --git a/packages/kbn-yarn-lock-validator/index.ts b/packages/kbn-yarn-lock-validator/index.ts index 819f81bf210a2..67f37fd554a61 100644 --- a/packages/kbn-yarn-lock-validator/index.ts +++ b/packages/kbn-yarn-lock-validator/index.ts @@ -9,3 +9,4 @@ export { readYarnLock } from './src/yarn_lock'; export type { YarnLock } from './src/yarn_lock'; export { validateDependencies } from './src/validate_yarn_lock'; +export { findProductionDependencies } from './src/find_production_dependencies'; diff --git a/packages/kbn-zod-helpers/src/array_from_string.test.ts b/packages/kbn-zod-helpers/src/array_from_string.test.ts index ba27fddb0c9b5..af6647563b5e4 100644 --- a/packages/kbn-zod-helpers/src/array_from_string.test.ts +++ b/packages/kbn-zod-helpers/src/array_from_string.test.ts @@ -7,7 +7,7 @@ */ import { ArrayFromString } from './array_from_string'; -import * as z from 'zod'; +import * as z from '@kbn/zod'; describe('ArrayFromString', () => { const itemsSchema = z.string(); diff --git a/packages/kbn-zod-helpers/src/array_from_string.ts b/packages/kbn-zod-helpers/src/array_from_string.ts index 24247e2d14c40..02e2a66e46a2a 100644 --- a/packages/kbn-zod-helpers/src/array_from_string.ts +++ b/packages/kbn-zod-helpers/src/array_from_string.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import * as z from 'zod'; +import * as z from '@kbn/zod'; /** * This is a helper schema to convert comma separated strings to arrays. Useful diff --git a/packages/kbn-zod-helpers/src/boolean_from_string.ts b/packages/kbn-zod-helpers/src/boolean_from_string.ts index d73e77ea1bddc..8ba06106b6093 100644 --- a/packages/kbn-zod-helpers/src/boolean_from_string.ts +++ b/packages/kbn-zod-helpers/src/boolean_from_string.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import * as z from 'zod'; +import * as z from '@kbn/zod'; /** * This is a helper schema to convert a boolean string ("true" or "false") to a diff --git a/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts b/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts index a72eb96d3b968..7dae823e4c1b1 100644 --- a/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts +++ b/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { TypeOf, ZodType } from 'zod'; +import type { TypeOf, ZodType } from '@kbn/zod'; import type { RouteValidationFunction, RouteValidationResultFactory } from '@kbn/core/server'; import { stringifyZodError } from './stringify_zod_error'; diff --git a/packages/kbn-zod-helpers/src/expect_parse_error.ts b/packages/kbn-zod-helpers/src/expect_parse_error.ts index 9e5fcb3fd565c..8840e596af17c 100644 --- a/packages/kbn-zod-helpers/src/expect_parse_error.ts +++ b/packages/kbn-zod-helpers/src/expect_parse_error.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { SafeParseError, SafeParseReturnType } from 'zod'; +import type { SafeParseError, SafeParseReturnType } from '@kbn/zod'; export function expectParseError( result: SafeParseReturnType diff --git a/packages/kbn-zod-helpers/src/expect_parse_success.ts b/packages/kbn-zod-helpers/src/expect_parse_success.ts index 8c9e518c27b87..25eff77e08059 100644 --- a/packages/kbn-zod-helpers/src/expect_parse_success.ts +++ b/packages/kbn-zod-helpers/src/expect_parse_success.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { SafeParseReturnType, SafeParseSuccess } from 'zod'; +import type { SafeParseReturnType, SafeParseSuccess } from '@kbn/zod'; import { stringifyZodError } from './stringify_zod_error'; export function expectParseSuccess( diff --git a/packages/kbn-zod-helpers/src/is_valid_date_math.ts b/packages/kbn-zod-helpers/src/is_valid_date_math.ts index 8f3bd26f692a7..b55b64484c852 100644 --- a/packages/kbn-zod-helpers/src/is_valid_date_math.ts +++ b/packages/kbn-zod-helpers/src/is_valid_date_math.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import * as z from 'zod'; +import * as z from '@kbn/zod'; import dateMath from '@kbn/datemath'; function validateDateMath(time: string): boolean { diff --git a/packages/kbn-zod-helpers/src/safe_parse_result.ts b/packages/kbn-zod-helpers/src/safe_parse_result.ts index 4e9b701a18faf..aa0f756da7ec0 100644 --- a/packages/kbn-zod-helpers/src/safe_parse_result.ts +++ b/packages/kbn-zod-helpers/src/safe_parse_result.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import * as z from 'zod'; +import * as z from '@kbn/zod'; /** * Safely parse a payload against a schema, returning the output or undefined. diff --git a/packages/kbn-zod-helpers/src/stringify_zod_error.ts b/packages/kbn-zod-helpers/src/stringify_zod_error.ts index 1fbaec8bbac85..708a3ab44f7f2 100644 --- a/packages/kbn-zod-helpers/src/stringify_zod_error.ts +++ b/packages/kbn-zod-helpers/src/stringify_zod_error.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ZodError, ZodIssue } from 'zod'; +import { ZodError, ZodIssue } from '@kbn/zod'; const MAX_ERRORS = 5; diff --git a/packages/kbn-zod-helpers/tsconfig.json b/packages/kbn-zod-helpers/tsconfig.json index fbe3b91a89493..9eab856c8c4d2 100644 --- a/packages/kbn-zod-helpers/tsconfig.json +++ b/packages/kbn-zod-helpers/tsconfig.json @@ -6,5 +6,9 @@ "exclude": ["target/**/*"], "extends": "../../tsconfig.base.json", "include": ["**/*.ts"], - "kbn_references": ["@kbn/datemath", "@kbn/core"] + "kbn_references": [ + "@kbn/datemath", + "@kbn/core", + "@kbn/zod", + ] } diff --git a/packages/react/kibana_mount/utils.ts b/packages/react/kibana_mount/utils.ts index d012a373f6a09..10294c8f0f818 100644 --- a/packages/react/kibana_mount/utils.ts +++ b/packages/react/kibana_mount/utils.ts @@ -17,7 +17,7 @@ export const useIfMounted = () => { [] ); - const ifMounted = useCallback((func) => { + const ifMounted = useCallback((func?: () => void) => { if (isMounted.current && func) { func(); } diff --git a/packages/serverless/settings/observability_project/index.ts b/packages/serverless/settings/observability_project/index.ts index 07a9c84e210ff..bcaab96e8bd0a 100644 --- a/packages/serverless/settings/observability_project/index.ts +++ b/packages/serverless/settings/observability_project/index.ts @@ -34,7 +34,6 @@ export const OBSERVABILITY_PROJECT_SETTINGS = [ settings.OBSERVABILITY_APM_ENABLE_SERVICE_INVENTORY_TABLE_SEARCH_BAR, settings.OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE, settings.OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID, - settings.OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE, settings.OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING, settings.OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN, ]; diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx index 76c36c03c0ac6..8a811c95ff298 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx @@ -73,6 +73,7 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active [`nav-item-isActive`]: isActive, }); const buttonDataTestSubj = classNames(`panelOpener`, `panelOpener-${path}`, { + [`panelOpener-id-${id}`]: id, [`panelOpener-deepLinkId-${deepLink?.id}`]: !!deepLink, }); diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx index ff79824176268..19757bc533d68 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx @@ -19,6 +19,17 @@ import classNames from 'classnames'; import { usePanel } from './context'; import { getNavPanelStyles, getPanelWrapperStyles } from './styles'; +import { PanelNavNode } from './types'; + +const getTestSubj = (selectedNode: PanelNavNode | null): string | undefined => { + if (!selectedNode) return; + + const deeplinkId = selectedNode.deepLink?.id; + return classNames(`sideNavPanel`, { + [`sideNavPanel-id-${selectedNode.id}`]: selectedNode.id, + [`sideNavPanel-deepLinkId-${deeplinkId}`]: !!deeplinkId, + }); +}; export const NavigationPanel: FC = () => { const { euiTheme } = useEuiTheme(); @@ -67,7 +78,7 @@ export const NavigationPanel: FC = () => { hasShadow borderRadius="none" paddingSize="m" - data-test-subj="sideNavPanel" + data-test-subj={getTestSubj(selectedNode)} > {getContent()} diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/panel/types.ts b/packages/shared-ux/chrome/navigation/src/ui/components/panel/types.ts index 25b2e00c83a81..04ebf2ec0b76b 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/panel/types.ts +++ b/packages/shared-ux/chrome/navigation/src/ui/components/panel/types.ts @@ -27,7 +27,7 @@ export type ContentProvider = (nodeId: string) => PanelContent | void; export type PanelNavNode = Pick< ChromeProjectNavigationNode, - 'id' | 'children' | 'path' | 'sideNavStatus' + 'id' | 'children' | 'path' | 'sideNavStatus' | 'deepLink' > & { title: string | ReactNode; }; diff --git a/packages/shared-ux/page/solution_nav/src/solution_nav.scss b/packages/shared-ux/page/solution_nav/src/solution_nav.scss index 3456364009e60..694045f9a8c94 100644 --- a/packages/shared-ux/page/solution_nav/src/solution_nav.scss +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.scss @@ -10,11 +10,11 @@ } .kbnSolutionNav { - @include euiYScroll; - display: flex; flex-direction: column; + @include euiYScroll; + @include euiBreakpoint('m', 'l', 'xl') { width: $solutionNavWidth; padding: $euiSizeL; diff --git a/packages/shared-ux/table_persist/README.md b/packages/shared-ux/table_persist/README.md new file mode 100644 index 0000000000000..08688990ce450 --- /dev/null +++ b/packages/shared-ux/table_persist/README.md @@ -0,0 +1,51 @@ +# @kbn/shared-ux-table-persist + +This package contains the `useEuiTablePersist` hook that can be used in components +containing Eui tables for storing their page size ("rows per page" value) or +the current sort criteria in local storage so that the user's preferences for +these properties can persist. + +The package also exports some table-related constants (e.g. `DEFAULT_PAGE_SIZE_OPTIONS`) +for use across tables in Kibana Stack Management for consistency. + +Usage: + +``` +interface Props { + items: T[]; +} + +const MyTableComponent: FunctionComponent = ({ items }) => { + const columns = [ + { + field: 'name', + name: 'Name', + sortable: true, + }, + ... + ]; + + const { pageSize, sorting, onTableChange } = useEuiTablePersist({ + tableId: 'myTableId', + initialPageSize: 50, + initialSort: { + field: 'name', + direction: 'asc', + }, + }); + + const pagination = { + pageSize, + pageSizeOptions: DEFAULT_PAGE_SIZE_OPTIONS, + }; + + return ( + + ); +}; +``` diff --git a/packages/shared-ux/table_persist/index.ts b/packages/shared-ux/table_persist/index.ts new file mode 100644 index 0000000000000..b92d69bdbc7d5 --- /dev/null +++ b/packages/shared-ux/table_persist/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 { useEuiTablePersist, DEFAULT_PAGE_SIZE_OPTIONS } from './src'; diff --git a/packages/shared-ux/table_persist/jest.config.js b/packages/shared-ux/table_persist/jest.config.js new file mode 100644 index 0000000000000..34e5873f082de --- /dev/null +++ b/packages/shared-ux/table_persist/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/shared-ux/table_persist'], +}; diff --git a/packages/shared-ux/table_persist/kibana.jsonc b/packages/shared-ux/table_persist/kibana.jsonc new file mode 100644 index 0000000000000..4a29533855f99 --- /dev/null +++ b/packages/shared-ux/table_persist/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/shared-ux-table-persist", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/shared-ux/table_persist/package.json b/packages/shared-ux/table_persist/package.json new file mode 100644 index 0000000000000..794822093eeed --- /dev/null +++ b/packages/shared-ux/table_persist/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/shared-ux-table-persist", + "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/shared-ux/table_persist/src/constants.ts b/packages/shared-ux/table_persist/src/constants.ts new file mode 100644 index 0000000000000..60421e14edb43 --- /dev/null +++ b/packages/shared-ux/table_persist/src/constants.ts @@ -0,0 +1,12 @@ +/* + * 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 const DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100]; +export const DEFAULT_INITIAL_PAGE_SIZE = 50; + +export const LOCAL_STORAGE_PREFIX = 'tablePersist'; diff --git a/packages/shared-ux/table_persist/src/index.ts b/packages/shared-ux/table_persist/src/index.ts new file mode 100644 index 0000000000000..300fbc451e717 --- /dev/null +++ b/packages/shared-ux/table_persist/src/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 { useEuiTablePersist } from './use_table_persist'; +export { DEFAULT_PAGE_SIZE_OPTIONS } from './constants'; diff --git a/packages/shared-ux/table_persist/src/storage.ts b/packages/shared-ux/table_persist/src/storage.ts new file mode 100644 index 0000000000000..1f3d416711bd8 --- /dev/null +++ b/packages/shared-ux/table_persist/src/storage.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 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 { LOCAL_STORAGE_PREFIX } from './constants'; + +type IStorageEngine = typeof window.localStorage; + +class Storage { + engine: IStorageEngine = window.localStorage; + prefix: string = LOCAL_STORAGE_PREFIX; + + encode(val: unknown) { + return JSON.stringify(val); + } + + decode(val: string | null) { + if (typeof val === 'string') { + return JSON.parse(val); + } + } + + encodeKey(key: string) { + return `${this.prefix}:${key}`; + } + + set(key: string, val: unknown) { + this.engine.setItem(this.encodeKey(key), this.encode(val)); + return val; + } + + has(key: string) { + return this.engine.getItem(this.encodeKey(key)) != null; + } + + get(key: string, _default?: T) { + if (this.has(key)) { + return this.decode(this.engine.getItem(this.encodeKey(key))); + } else { + return _default; + } + } +} + +export function createStorage() { + return new Storage(); +} diff --git a/packages/shared-ux/table_persist/src/types.ts b/packages/shared-ux/table_persist/src/types.ts new file mode 100644 index 0000000000000..be6a32459b440 --- /dev/null +++ b/packages/shared-ux/table_persist/src/types.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 interface PropertySort { + field: keyof T; + direction: 'asc' | 'desc'; +} + +export interface PersistData { + pageSize?: number; + sort?: PropertySort; +} diff --git a/packages/shared-ux/table_persist/src/use_table_persist.test.ts b/packages/shared-ux/table_persist/src/use_table_persist.test.ts new file mode 100644 index 0000000000000..7626a3a2d518d --- /dev/null +++ b/packages/shared-ux/table_persist/src/use_table_persist.test.ts @@ -0,0 +1,130 @@ +/* + * 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 { Criteria } from '@elastic/eui'; +import { renderHook, act } from '@testing-library/react-hooks'; +import { useEuiTablePersist } from './use_table_persist'; +import { createStorage } from './storage'; // Mock this if it's external + +jest.mock('./storage'); + +describe('useEuiTablePersist', () => { + const mockStorage = { + get: jest.fn(), + set: jest.fn(), + }; + + beforeEach(() => { + (createStorage as jest.Mock).mockReturnValue(mockStorage); + mockStorage.get.mockClear(); + mockStorage.set.mockClear(); + }); + + it('should initialize with default values if local storage is empty', () => { + mockStorage.get.mockReturnValueOnce(undefined); + + const { result } = renderHook(() => useEuiTablePersist({ tableId: 'testTable' })); + + expect(result.current.pageSize).toBe(50); // Default initialPageSize + expect(result.current.sorting).toBe(true); // Allow sorting by default + expect(mockStorage.get).toHaveBeenCalledWith('testTable', undefined); + }); + + it('should initialize with values from local storage', () => { + const persistedData = { pageSize: 25, sort: { field: 'name', direction: 'asc' } }; + mockStorage.get.mockReturnValueOnce(persistedData); + + const { result } = renderHook(() => useEuiTablePersist({ tableId: 'testTable' })); + + expect(result.current.pageSize).toBe(25); + expect(result.current.sorting).toEqual({ sort: { field: 'name', direction: 'asc' } }); + }); + + it('should update pageSize and sort in state and local storage when onTableChange is called', () => { + const persistedData = { pageSize: 25, sort: { field: 'name', direction: 'asc' } }; + mockStorage.get.mockReturnValueOnce(persistedData); + + const { result } = renderHook(() => useEuiTablePersist({ tableId: 'testTable' })); + + const nextCriteria = { + page: { size: 100 }, + sort: { field: 'age', direction: 'desc' }, + }; + + act(() => { + result.current.onTableChange(nextCriteria as Criteria); + }); + + expect(result.current.pageSize).toBe(100); + expect(result.current.sorting).toEqual({ sort: { field: 'age', direction: 'desc' } }); + expect(mockStorage.set).toHaveBeenCalledWith('testTable', { + pageSize: 100, + sort: { field: 'age', direction: 'desc' }, + }); + }); + + it('should call customOnTableChange if provided', () => { + const customOnTableChange = jest.fn(); + + const { result } = renderHook(() => + useEuiTablePersist({ + tableId: 'testTable', + customOnTableChange, + }) + ); + + const nextCriteria = { + page: { size: 20 }, + sort: { field: 'age', direction: 'desc' }, + }; + + act(() => { + result.current.onTableChange(nextCriteria as Criteria); + }); + + expect(customOnTableChange).toHaveBeenCalledWith(nextCriteria); + }); + + it('should maintain sort and pageSize if new values are not provided on change', () => { + const persistedData = { pageSize: 25, sort: { field: 'name', direction: 'asc' } }; + mockStorage.get.mockReturnValueOnce(persistedData); + + const { result } = renderHook(() => useEuiTablePersist({ tableId: 'testTable' })); + + act(() => { + result.current.onTableChange({}); // Empty change + }); + + expect(result.current.pageSize).toBe(25); + expect(result.current.sorting).toEqual({ sort: { field: 'name', direction: 'asc' } }); + expect(mockStorage.set).not.toHaveBeenCalled(); + }); + + it('should remove sort in state and local storage if field is an empty string', () => { + const persistedData = { pageSize: 25, sort: { field: 'name', direction: 'asc' } }; + mockStorage.get.mockReturnValueOnce(persistedData); + + const { result } = renderHook(() => useEuiTablePersist({ tableId: 'testTable' })); + + const nextCriteria = { + page: { size: 100 }, + sort: { field: '', direction: 'asc' }, + }; + + act(() => { + result.current.onTableChange(nextCriteria as Criteria); + }); + + expect(result.current.pageSize).toBe(100); + expect(result.current.sorting).toEqual(true); + expect(mockStorage.set).toHaveBeenCalledWith('testTable', { + pageSize: 100, + sort: undefined, + }); + }); +}); diff --git a/packages/shared-ux/table_persist/src/use_table_persist.ts b/packages/shared-ux/table_persist/src/use_table_persist.ts new file mode 100644 index 0000000000000..031a072420f5d --- /dev/null +++ b/packages/shared-ux/table_persist/src/use_table_persist.ts @@ -0,0 +1,94 @@ +/* + * 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 { useState, useCallback } from 'react'; +import { Criteria } from '@elastic/eui'; +import { DEFAULT_INITIAL_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS } from './constants'; +import { createStorage } from './storage'; +import { validatePersistData } from './validate_persist_data'; +import { PersistData, PropertySort } from './types'; + +export interface EuiTablePersistProps { + /** A unique id that will be included in the local storage variable for this table. */ + tableId: string; + /** (Optional) Specifies a custom onTableChange handler. */ + customOnTableChange?: (change: Criteria) => void; + /** (Optional) Specifies a custom initial table sorting. */ + initialSort?: PropertySort; + /** (Optional) Specifies a custom initial page size for the table. Defaults to 50. */ + initialPageSize?: number; + /** (Optional) Specifies custom page size options for the table. + * Defaults to {@link DEFAULT_PAGE_SIZE_OPTIONS} */ + pageSizeOptions?: number[]; +} + +/** + * A hook that stores and retrieves from local storage the table page size and sort criteria. + * Returns the persisting page size and sort and the onTableChange handler that should be passed + * as props to an Eui table component. + */ +export const useEuiTablePersist = ({ + tableId, + customOnTableChange, + initialSort, + initialPageSize, + pageSizeOptions, +}: EuiTablePersistProps) => { + const storage = createStorage(); + const storedPersistData = storage.get(tableId, undefined); + + const { pageSize: storagePageSize, sort: storageSort }: PersistData = validatePersistData( + storedPersistData, + pageSizeOptions ?? DEFAULT_PAGE_SIZE_OPTIONS + ); + + const [pageSize, setPageSize] = useState( + storagePageSize ?? initialPageSize ?? DEFAULT_INITIAL_PAGE_SIZE + ); + const [sort, setSort] = useState | undefined>(storageSort ?? initialSort); + const sorting = sort ? { sort } : true; // If sort is undefined, return true to allow sorting + + const onTableChange = useCallback( + (nextValues: Criteria) => { + if (customOnTableChange) { + customOnTableChange(nextValues); + } + + let nextSort: PropertySort | undefined; + const isSortRemoved = nextValues.sort?.field?.toString() === ''; // `field` is an empty string when sort is removed from this field + if (nextValues.sort?.field && nextValues.sort?.direction) { + // Both field and direction are needed for a valid sort criteria + nextSort = nextValues.sort; + } + + if (nextValues.sort?.field || nextValues.sort?.direction) { + setSort(nextSort); + } + + const nextPageSize = nextValues.page?.size; + if (nextPageSize) { + setPageSize(nextPageSize); + } + + if ( + (nextPageSize && nextPageSize !== storagePageSize) || + (nextSort && nextSort !== storageSort) || + isSortRemoved + ) { + const nextPersistData: PersistData = { + pageSize: nextPageSize, + sort: nextSort, + }; + storage.set(tableId, nextPersistData); + } + }, + [customOnTableChange, storage, storagePageSize, storageSort, tableId] + ); + + return { pageSize, sorting, onTableChange }; +}; diff --git a/packages/shared-ux/table_persist/src/validate_persist_data.ts b/packages/shared-ux/table_persist/src/validate_persist_data.ts new file mode 100644 index 0000000000000..ee98125022365 --- /dev/null +++ b/packages/shared-ux/table_persist/src/validate_persist_data.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 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 utility function used to validate a table persist data. + * If any of the properties is not valid, it is returned with undefined value. + * + * @param data The data to be validated + * @param pageSizeOptions The table page size options that are available + */ +export const validatePersistData = (data: any, pageSizeOptions: number[]) => { + const pageSize = data?.pageSize; + const sort = data?.sort; + + let validatedPageSize = pageSize; + let validatedSort = sort; + + if (pageSize && !pageSizeOptions.includes(pageSize)) { + validatedPageSize = undefined; + } + + if (sort) { + const field = sort.field; + const direction = sort.direction; + if (typeof field !== 'string' || !['asc', 'desc'].includes(direction)) { + validatedSort = undefined; + } + } + + return { pageSize: validatedPageSize, sort: validatedSort }; +}; diff --git a/packages/shared-ux/table_persist/src/validate_persist_date.test.ts b/packages/shared-ux/table_persist/src/validate_persist_date.test.ts new file mode 100644 index 0000000000000..00c779709f9af --- /dev/null +++ b/packages/shared-ux/table_persist/src/validate_persist_date.test.ts @@ -0,0 +1,140 @@ +/* + * 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 { validatePersistData } from './validate_persist_data'; + +describe('validatePersistData', () => { + const TEST_PAGE_SIZE_OPTIONS = [50, 100]; + + const TEST_VALID_DATA = { + pageSize: 50, + sort: { + field: 'name', + direction: 'asc', + }, + }; + + it('returns valid data', () => { + expect(validatePersistData(TEST_VALID_DATA, TEST_PAGE_SIZE_OPTIONS)).toEqual(TEST_VALID_DATA); + }); + + it('returns valid data when pageSize is undefined', () => { + const data = { + sort: { + field: 'name', + direction: 'asc', + }, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual(data); + }); + + it('returns valid data when sort is undefined', () => { + const data = { + pageSize: 100, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual(data); + }); + + it('returns valid data when provided data is not object', () => { + expect(validatePersistData('test', TEST_PAGE_SIZE_OPTIONS)).toEqual({}); + }); + + it('returns valid data when provided data contains invalid properties', () => { + const data = { + foo: 'bar', + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({}); + }); + + it('returns valid data when provided data is undefined', () => { + expect(validatePersistData(undefined, TEST_PAGE_SIZE_OPTIONS)).toEqual({}); + }); + + describe('pageSize validation', () => { + it("does not accept pageSize if it's not of type number", () => { + const data = { + pageSize: 'test', + sort: TEST_VALID_DATA.sort, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + sort: TEST_VALID_DATA.sort, + }); + }); + + it("does not accept pageSize if it's not one of the available options", () => { + const data = { + pageSize: 3, + sort: TEST_VALID_DATA.sort, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + sort: TEST_VALID_DATA.sort, + }); + }); + }); + + describe('sort validation', () => { + it("does not accept sort if it doesn't contain direction property", () => { + const data = { + pageSize: TEST_VALID_DATA.pageSize, + sort: { + field: 'name', + }, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + pageSize: TEST_VALID_DATA.pageSize, + }); + }); + + it("does not accept sort if it doesn't contain field property", () => { + const data = { + pageSize: TEST_VALID_DATA.pageSize, + sort: { + direction: 'asc', + }, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + pageSize: TEST_VALID_DATA.pageSize, + }); + }); + + it('does not accept sort if its field property is not of type string, number, or symbol', () => { + const data = { + pageSize: TEST_VALID_DATA.pageSize, + sort: { + field: false, + direction: 'asc', + }, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + pageSize: TEST_VALID_DATA.pageSize, + }); + }); + + it('does not accept sort if its direction property is not `asc` or `desc`', () => { + const data = { + pageSize: TEST_VALID_DATA.pageSize, + sort: { + field: 'name', + direction: 'test', + }, + }; + + expect(validatePersistData(data, TEST_PAGE_SIZE_OPTIONS)).toEqual({ + pageSize: TEST_VALID_DATA.pageSize, + }); + }); + }); +}); diff --git a/packages/shared-ux/table_persist/tsconfig.json b/packages/shared-ux/table_persist/tsconfig.json new file mode 100644 index 0000000000000..60e639fea37e0 --- /dev/null +++ b/packages/shared-ux/table_persist/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/renovate.json b/renovate.json index 6f9e87e5e07a0..774dce52e3515 100644 --- a/renovate.json +++ b/renovate.json @@ -2,7 +2,7 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:recommended", "helpers:pinGitHubActionDigests", "helpers:pinGitHubActionDigestsToSemver"], "ignorePaths": ["**/__fixtures__/**", "**/fixtures/**"], - "enabledManagers": ["npm", "github-actions", "custom.regex"], + "enabledManagers": ["npm", "github-actions", "custom.regex", "devcontainer"], "baseBranches": ["main", "7.17"], "prConcurrentLimit": 0, "prHourlyLimit": 0, @@ -21,15 +21,32 @@ "enabled": false }, { - "matchPackageNames": [ - "docker.elastic.co/wolfi/chainguard-base" - ], + "groupName": "devcontainer", + "reviewers": ["team:kibana-operations"], + "matchBaseBranches": ["main"], + "labels": ["Team:Operations", "release_note:skip", "backport:current-major"], + "enabled": true, + "matchManagers": ["devcontainer"] + }, + { + "groupName": "chainguard", + "matchPackageNames": ["docker.elastic.co/wolfi/chainguard-base"], + "reviewers": ["team:kibana-operations"], + "matchBaseBranches": ["main"], + "labels": ["Team:Operations", "release_note:skip"], "enabled": true }, { - "groupName": "GitHub actions", + "groupName": "operations actions", "matchManagers": ["github-actions"], - "matchPackageNames": ["actions/checkout"], + "matchPackageNames": [ + "actions/checkout", + "elastic/github-actions/project-assigner", + "hmarr/auto-approve-action", + "octokit/graphql-action", + "sergeysova/jq-action", + "sourenlouv/backport" + ], "reviewers": ["team:kibana-operations"], "matchBaseBranches": ["main"], "labels": ["Team:Operations", "backport:all-open", "release_note:skip"], @@ -61,7 +78,7 @@ }, { "groupName": "LaunchDarkly", - "matchDepNames": ["launchdarkly-js-client-sdk", "@launchdarkly/node-server-sdk"], + "matchDepNames": ["launchdarkly-js-client-sdk", "@launchdarkly/node-server-sdk", "launchdarkly/find-code-references"], "reviewers": ["team:kibana-security", "team:kibana-core"], "matchBaseBranches": ["main"], "labels": ["release_note:skip", "Team:Security", "Team:Core", "backport:prev-minor"], @@ -76,6 +93,14 @@ "labels": ["release_note:skip", "Team:Core", "backport:skip"], "enabled": true }, + { + "groupName": "@elastic/ebt", + "matchDepNames": ["@elastic/ebt"], + "reviewers": ["team:kibana-core"], + "matchBaseBranches": ["main"], + "labels": ["release_note:skip", "Team:Core", "backport:skip"], + "enabled": true + }, { "groupName": "ansi-regex", "matchDepNames": ["ansi-regex"], @@ -207,6 +232,18 @@ "minimumReleaseAge": "7 days", "enabled": true }, + { + "groupName": "CodeQL", + "matchDepNames": [ + "github/codeql-action/analyze", + "github/codeql-action/init" + ], + "reviewers": ["team:kibana-security"], + "matchBaseBranches": ["main"], + "labels": ["Team:Security", "release_note:skip", "backport:all-open"], + "minimumReleaseAge": "7 days", + "enabled": true + }, { "groupName": "ftr", "matchDepNames": [ @@ -416,15 +453,6 @@ "minimumReleaseAge": "7 days", "enabled": true }, - { - "groupName": "machine learning modules", - "matchDepNames": ["apidoc-markdown"], - "reviewers": ["team:ml-ui"], - "matchBaseBranches": ["main"], - "labels": ["Team:ML", "release_note:skip", "backport:all-open"], - "minimumReleaseAge": "7 days", - "enabled": true - }, { "groupName": "Kibana ES|QL Team", "matchDepNames": ["recast"], @@ -449,6 +477,14 @@ "matchBaseBranches": ["main"], "labels": ["release_note:skip", "backport:all-open", "Team:Visualizations"], "enabled": true + }, + { + "groupName": "Serve swagger docs", + "matchDepNames": ["express", "swagger-jsdoc", "swagger-ui-express"], + "reviewers": ["team:obs-entities"], + "matchBaseBranches": ["main"], + "labels": ["release_note:skip", "team:obs-entities"], + "enabled": true } ], "customManagers": [ diff --git a/scripts/check_prod_native_modules.js b/scripts/check_prod_native_modules.js new file mode 100644 index 0000000000000..f47bcc4946c85 --- /dev/null +++ b/scripts/check_prod_native_modules.js @@ -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. + */ + +require('../src/setup_node_env'); +require('@kbn/check-prod-native-modules-cli'); diff --git a/scripts/enabled_ftr_configs.js b/scripts/enabled_ftr_configs.js index ccece9f370115..942d9b70d3042 100644 --- a/scripts/enabled_ftr_configs.js +++ b/scripts/enabled_ftr_configs.js @@ -19,7 +19,7 @@ var allManifestPaths = Object.values(manifestsSource).flat(); try { for (var manifestRelPath of allManifestPaths) { - var manifest = yaml.load(fs.readFileSync(manifestRelPath, 'utf8')); + var manifest = yaml.safeLoad(fs.readFileSync(manifestRelPath, 'utf8')); if (manifest.enabled) { manifest.enabled.forEach(function (x) { console.log(x); diff --git a/scripts/quick_checks.js b/scripts/quick_checks.js new file mode 100644 index 0000000000000..db6a3b1daeef4 --- /dev/null +++ b/scripts/quick_checks.js @@ -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. + */ + +require('../src/setup_node_env'); +require('../src/dev/run_quick_checks'); diff --git a/scripts/saved_objs_info.js b/scripts/saved_objs_info.js index f17a2897b83da..229565921ba90 100644 --- a/scripts/saved_objs_info.js +++ b/scripts/saved_objs_info.js @@ -7,4 +7,4 @@ */ require('../src/setup_node_env'); -require('@kbn/test-suites-src/common/services/saved_object_info').runSavedObjInfoSvc(); +require('@kbn/ftr-common-functional-services').runSavedObjInfoSvc(); diff --git a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts index 6d978b2d33ca4..de0afdf85ea16 100644 --- a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts +++ b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts @@ -90,7 +90,7 @@ describe('checking migration metadata changes on all registered SO types', () => "endpoint:unified-user-artifact-manifest": "71c7fcb52c658b21ea2800a6b6a76972ae1c776e", "endpoint:user-artifact-manifest": "1c3533161811a58772e30cdc77bac4631da3ef2b", "enterprise_search_telemetry": "9ac912e1417fc8681e0cd383775382117c9e3d3d", - "entity-definition": "331a2ba0ee9f24936ef049683549c8af7e46f03a", + "entity-definition": "61be3e95966045122b55e181bb39658b1dc9bbe9", "entity-discovery-api-key": "c267a65c69171d1804362155c1378365f5acef88", "epm-packages": "8042d4a1522f6c4e6f5486e791b3ffe3a22f88fd", "epm-packages-assets": "7a3e58efd9a14191d0d1a00b8aaed30a145fd0b1", @@ -98,17 +98,19 @@ describe('checking migration metadata changes on all registered SO types', () => "event_loop_delays_daily": "01b967e8e043801357503de09199dfa3853bab88", "exception-list": "4aebc4e61fb5d608cae48eaeb0977e8db21c61a4", "exception-list-agnostic": "6d3262d58eee28ac381ec9654f93126a58be6f5d", - "favorites": "ef282e9fb5a91df3cc88409a9f86d993fb51a6e9", + "favorites": "a68c7c8ae22eaddcca324d8b3bfc80a94e3eec3a", "file": "6b65ae5899b60ebe08656fd163ea532e557d3c98", "file-upload-usage-collection-telemetry": "06e0a8c04f991e744e09d03ab2bd7f86b2088200", "fileShare": "5be52de1747d249a221b5241af2838264e19aaa1", + "fleet-agent-policies": "f57d3b70e4175a19a18f18ee72a379ceec82e1fc", "fleet-fleet-server-host": "69be15f6b6f2a2875ad3c7050ddea7a87f505417", "fleet-message-signing-keys": "93421f43fed2526b59092a4e3c65d64bc2266c0f", + "fleet-package-policies": "2f4d524adb49a5281d3af0b66bb3003ba0ff2e44", "fleet-preconfiguration-deletion-record": "c52ea1e13c919afe8a5e8e3adbb7080980ecc08e", "fleet-proxy": "6cb688f0d2dd856400c1dbc998b28704ff70363d", "fleet-setup-lock": "0dc784792c79b5af5a6e6b5dcac06b0dbaa90bde", "fleet-space-settings": "b278e82a33978900e53a1253884b5bdbd929c9bb", - "fleet-uninstall-tokens": "ed8aa37e3cdd69e4360709e64944bb81cae0c025", + "fleet-uninstall-tokens": "371a691206845b364bcf6d3693ca7905ffdb71a4", "graph-workspace": "5cc6bb1455b078fd848c37324672163f09b5e376", "guided-onboarding-guide-state": "d338972ed887ac480c09a1a7fbf582d6a3827c91", "guided-onboarding-plugin-state": "bc109e5ef46ca594fdc179eda15f3095ca0a37a4", @@ -120,7 +122,7 @@ describe('checking migration metadata changes on all registered SO types', () => "ingest-download-sources": "279a68147e62e4d8858c09ad1cf03bd5551ce58d", "ingest-outputs": "daafff49255ab700e07491376fe89f04fc998b91", "ingest-package-policies": "53a94064674835fdb35e5186233bcd7052eabd22", - "ingest_manager_settings": "91445219e7115ff0c45d1dabd5d614a80b421797", + "ingest_manager_settings": "e794576a05d19dd5306a1e23cbb82c09bffabd65", "inventory-view": "b8683c8e352a286b4aca1ab21003115a4800af83", "kql-telemetry": "93c1d16c1a0dfca9c8842062cf5ef8f62ae401ad", "legacy-url-alias": "9b8cca3fbb2da46fd12823d3cd38fdf1c9f24bc8", @@ -145,7 +147,7 @@ describe('checking migration metadata changes on all registered SO types', () => "risk-engine-configuration": "aea0c371a462e6d07c3ceb3aff11891b47feb09d", "rules-settings": "892a2918ebaeba809a612b8d97cec0b07c800b5f", "sample-data-telemetry": "37441b12f5b0159c2d6d5138a494c9f440e950b5", - "search": "4579401660a4089d5122b2fc8624825cb97b0480", + "search": "0aa6eefb37edd3145be340a8b67779c2ca578b22", "search-session": "b2fcd840e12a45039ada50b1355faeafa39876d1", "search-telemetry": "b568601618744720b5662946d3103e3fb75fe8ee", "security-rule": "07abb4d7e707d91675ec0495c73816394c7b521f", diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts index c02f9bc47d36e..1a8806e8dd707 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts @@ -106,7 +106,8 @@ async function createRoot({ logFileName }: CreateRootConfig) { // suite is very long, the 10mins default can cause timeouts jest.setTimeout(15 * 60 * 1000); -describe('migration v2', () => { +// FLAKY: https://github.com/elastic/kibana/issues/156117 +describe.skip('migration v2', () => { let esServer: TestElasticsearchUtils; let rootA: Root; let rootB: Root; @@ -182,7 +183,8 @@ describe('migration v2', () => { errors.push(err.message); }) ); - if (i < instances.length - 1) { + if (i < instances.length - 2) { + // We wait between instances, but not after the last one await delay(delayInSec * 1000); } } diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts index fff7d32d78af5..e7c1034ba4a1e 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts @@ -67,6 +67,8 @@ const previouslyRegisteredTypes = [ 'file-upload-usage-collection-telemetry', 'fleet-agent-actions', 'fleet-agent-events', + 'fleet-agent-policies', + 'fleet-package-policies', 'fleet-agents', 'fleet-enrollment-api-keys', 'fleet-fleet-server-host', diff --git a/src/dev/build/tasks/nodejs/clean_node_builds_task.ts b/src/dev/build/tasks/nodejs/clean_node_builds_task.ts index 6498efdcce19f..1b4a8475c7dcc 100644 --- a/src/dev/build/tasks/nodejs/clean_node_builds_task.ts +++ b/src/dev/build/tasks/nodejs/clean_node_builds_task.ts @@ -15,12 +15,12 @@ export const CleanNodeBuilds: Task = { for (const platform of config.getTargetPlatforms()) { await deleteAll( [ - build.resolvePathForPlatform(platform, '*/node/lib/node_modules'), - build.resolvePathForPlatform(platform, '*/node/bin/npm'), - build.resolvePathForPlatform(platform, '*/node/bin/npx'), - build.resolvePathForPlatform(platform, '*/node/bin/corepack'), - build.resolvePathForPlatform(platform, '*/node/CHANGELOG.md'), - build.resolvePathForPlatform(platform, '*/node/README.md'), + build.resolvePathForPlatform(platform, 'node/*/lib/node_modules'), + build.resolvePathForPlatform(platform, 'node/*/bin/npm'), + build.resolvePathForPlatform(platform, 'node/*/bin/npx'), + build.resolvePathForPlatform(platform, 'node/*/bin/corepack'), + build.resolvePathForPlatform(platform, 'node/*/CHANGELOG.md'), + build.resolvePathForPlatform(platform, 'node/*/README.md'), ], log ); diff --git a/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts b/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts index ebd62f83798d7..7a37b6c86065f 100644 --- a/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts +++ b/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts @@ -8,7 +8,7 @@ import { readFileSync, writeFileSync } from 'fs'; import { resolve } from 'path'; -import { dump } from 'js-yaml'; +import { safeDump } from 'js-yaml'; import { Build, Config, mkdirp } from '../../lib'; export async function createOSPackageKibanaYML(config: Config, build: Build) { @@ -24,7 +24,7 @@ export async function createOSPackageKibanaYML(config: Config, build: Build) { [/#pid.file:.*/g, 'pid.file: /run/kibana/kibana.pid'], [ /#logging.appenders.default:.*kibana\.log\n/gs, - dump({ + safeDump({ logging: { appenders: { file: { diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 75237f0ea3594..e2ffab235f34e 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -412,7 +412,11 @@ kibana_vars=( xpack.securitySolution.packagerTaskInterval xpack.securitySolution.prebuiltRulesPackageVersion xpack.spaces.maxSpaces + xpack.task_manager.capacity xpack.task_manager.claim_strategy + xpack.task_manager.discovery.active_nodes_lookback + xpack.task_manager.discovery.interval + xpack.task_manager.kibanas_per_partition xpack.task_manager.max_attempts xpack.task_manager.max_workers xpack.task_manager.monitored_aggregated_stats_refresh_rate diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 344b8901c77ea..46225c5266048 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -50,7 +50,7 @@ export async function runDockerGenerator( */ if (flags.baseImage === 'wolfi') baseImageName = - 'docker.elastic.co/wolfi/chainguard-base:latest@sha256:dcbcd1932d7180cacc83add309cec026aa75dadc1f2c6a2238db5b41dd100b15'; + 'docker.elastic.co/wolfi/chainguard-base:latest@sha256:c16d3ad6cebf387e8dd2ad769f54320c4819fbbaa21e729fad087c7ae223b4d0'; let imageFlavor = ''; if (flags.baseImage === 'ubi') imageFlavor += `-ubi`; diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml index 6f0ab62dd1361..4dc8ff9868dc1 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml @@ -60,7 +60,27 @@ maintainers: name: 'Alexander Klepal' username: 'alexander.klepal' cht_member: true - - email: "yalabe.dukuly@anchore.com" - name: "Yalabe Dukuly" - username: "yalabe.dukuly" - cht_member: true + - cht_member: false + email: larry.gregory@elastic.co + name: Larry Gregory + username: legrego + - cht_member: false + email: aleh.zasypkin@elastic.co + name: Aleh Zasypkin + username: azasypkin + - cht_member: false + email: kurt.greiner@elastic.co + name: Kurt Greiner + username: kc13greiner + - cht_member: false + email: jeramy.soucy@elastic.co + name: Jeramy Soucy + username: jeramysoucy + - cht_member: false + email: sid.mantri@elastic.co + name: Sid Mantri + username: sidmantri + - cht_member: false + email: elena.shostak@elastic.co + name: Elena Shostak + username: elena.shostak diff --git a/src/dev/eslint/types.eslint.config.template.js b/src/dev/eslint/types.eslint.config.template.js index db17de6f08e3e..2d7cf7f667f3d 100644 --- a/src/dev/eslint/types.eslint.config.template.js +++ b/src/dev/eslint/types.eslint.config.template.js @@ -26,7 +26,7 @@ module.exports = { }, overrides: [ { - files: ['server/**/*'], + files: ['server/**/*', '*functional*/**/*', '*api_integration*/**/*'], rules: { // Let's focus on server-side errors first to avoid server crashes. // We'll tackle /public eventually. diff --git a/src/dev/i18n_tools/__fixtures__/extraction_signatures/template_literal_var.ts b/src/dev/i18n_tools/__fixtures__/extraction_signatures/template_literal_var.ts new file mode 100644 index 0000000000000..1c482370ad725 --- /dev/null +++ b/src/dev/i18n_tools/__fixtures__/extraction_signatures/template_literal_var.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 { i18n } from '@kbn/i18n'; + +const e = new Error('Should not work'); + +i18n.translate('contains_variable', { + defaultMessage: `value passed into literal directly (e: ${e.message})`, +}); + +i18n.translate('no_variable', { + defaultMessage: `template literal without any variable expressions (e: {errorMessage})`, + values: { errorMessage: e.message }, +}); diff --git a/src/dev/i18n_tools/extractors/call_expt.ts b/src/dev/i18n_tools/extractors/call_expt.ts index 3677b71fb2bb5..df3d05dc6b73e 100644 --- a/src/dev/i18n_tools/extractors/call_expt.ts +++ b/src/dev/i18n_tools/extractors/call_expt.ts @@ -286,6 +286,15 @@ export function extractMessageDescriptor( break; } } + } else if (typescript.isTemplateExpression(initializer)) { + initializer.forEachChild((child) => { + if (typescript.isTemplateSpan(child)) { + const messageText = initializer.getFullText(); + throw new Error( + `Template literals with variable substitution is not supported. please pass variables via the 'values' object instead. Message ${messageText}` + ); + } + }); } // {id: `id`} else if (typescript.isNoSubstitutionTemplateLiteral(initializer)) { diff --git a/src/dev/i18n_tools/extractors/formatjs.test.ts b/src/dev/i18n_tools/extractors/formatjs.test.ts index 85c1642519e80..3df36c0c7447b 100644 --- a/src/dev/i18n_tools/extractors/formatjs.test.ts +++ b/src/dev/i18n_tools/extractors/formatjs.test.ts @@ -267,6 +267,14 @@ describe('formatJS Runner', () => { } `); }); + + it('throws when template literal has a variable', async () => { + await expect(async () => + formatJsFixtureRunner('template_literal_var.ts') + ).rejects.toMatchInlineSnapshot( + `[Error: Error parsing file template_literal_var.ts: Error: Template literals with variable substitution is not supported. please pass variables via the 'values' object instead. Message \`value passed into literal directly (e: \${e.message})\`]` + ); + }); }); describe('extraction inside react components', () => { diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index b859c92a36f36..0ebeb9f0a518f 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -86,7 +86,7 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@8.5.3': ['Elastic License 2.0'], - '@elastic/eui@95.6.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@95.7.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary '@bufbuild/protobuf@1.2.1': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause) diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 0ea6dbb3d8b58..f89d32ac555b7 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -112,6 +112,7 @@ export const IGNORE_DIRECTORY_GLOBS = [ 'packages/*', 'packages/core/*/*', 'packages/kbn-pm/src/utils/__fixtures__/*', + 'packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/*/node_modules/*', 'x-pack/dev-tools', 'packages/kbn-optimizer/src/__fixtures__/mock_repo/x-pack', 'typings/*', diff --git a/src/dev/run_quick_checks.ts b/src/dev/run_quick_checks.ts new file mode 100644 index 0000000000000..cdb59bdce3cb2 --- /dev/null +++ b/src/dev/run_quick_checks.ts @@ -0,0 +1,196 @@ +/* + * 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 { exec } from 'child_process'; +import { availableParallelism } from 'os'; +import { join, isAbsolute } from 'path'; +import { readdirSync, readFileSync } from 'fs'; + +import { run, RunOptions } from '@kbn/dev-cli-runner'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { ToolingLog } from '@kbn/tooling-log'; + +const MAX_PARALLELISM = availableParallelism(); +const buildkiteQuickchecksFolder = join('.buildkite', 'scripts', 'steps', 'checks'); +const quickChecksList = join(buildkiteQuickchecksFolder, 'quick_checks.txt'); +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +interface CheckResult { + success: boolean; + script: string; + output: string; + durationMs: number; +} + +const scriptOptions: RunOptions = { + description: ` + Runs sanity-testing quick-checks in parallel. + - arguments (--file, --dir, --checks) are exclusive - only one can be used at a time. + `, + flags: { + string: ['dir', 'checks', 'file'], + help: ` + --file Run all checks from a given file. (default='${quickChecksList}') + --dir Run all checks in a given directory. + --checks Runs all scripts given in this parameter. (comma or newline delimited) + `, + }, + log: { + context: 'quick-checks', + defaultLevel: process.env.CI === 'true' ? 'debug' : 'info', + }, +}; + +let logger: ToolingLog; +void run(async ({ log, flagsReader }) => { + logger = log; + + const scriptsToRun = collectScriptsToRun({ + targetFile: flagsReader.string('file'), + targetDir: flagsReader.string('dir'), + checks: flagsReader.string('checks'), + }); + + logger.write( + `--- Running ${scriptsToRun.length} checks, with parallelism ${MAX_PARALLELISM}...`, + scriptsToRun + ); + const startTime = Date.now(); + const results = await runAllChecks(scriptsToRun); + + logger.write('--- All checks finished.'); + printResults(startTime, results); + + const failedChecks = results.filter((check) => !check.success); + if (failedChecks.length > 0) { + logger.write(`--- ${failedChecks.length} quick check(s) failed. ❌`); + logger.write(`See above for details.`); + process.exitCode = 1; + } else { + logger.write('--- All checks passed. ✅'); + return results; + } +}, scriptOptions); + +function collectScriptsToRun(inputOptions: { + targetFile: string | undefined; + targetDir: string | undefined; + checks: string | undefined; +}) { + const { targetFile, targetDir, checks } = inputOptions; + if ([targetFile, targetDir, checks].filter(Boolean).length > 1) { + throw new Error('Only one of --file, --dir, or --checks can be used at a time.'); + } + + if (targetDir) { + const targetDirAbsolute = isAbsolute(targetDir) ? targetDir : join(REPO_ROOT, targetDir); + return readdirSync(targetDirAbsolute).map((file) => join(targetDir, file)); + } else if (checks) { + return checks + .trim() + .split(/[,\n]/) + .map((script) => script.trim()); + } else { + const targetFileWithDefault = targetFile || quickChecksList; + const targetFileAbsolute = isAbsolute(targetFileWithDefault) + ? targetFileWithDefault + : join(REPO_ROOT, targetFileWithDefault); + + return readFileSync(targetFileAbsolute, 'utf-8') + .trim() + .split('\n') + .map((line) => line.trim()); + } +} + +async function runAllChecks(scriptsToRun: string[]) { + const checksRunning: Array> = []; + const checksFinished: CheckResult[] = []; + + while (scriptsToRun.length > 0 || checksRunning.length > 0) { + while (scriptsToRun.length > 0 && checksRunning.length < MAX_PARALLELISM) { + const script = scriptsToRun.shift(); + if (!script) { + continue; + } + + const check = runCheckAsync(script); + checksRunning.push(check); + check.then((result) => { + checksRunning.splice(checksRunning.indexOf(check), 1); + checksFinished.push(result); + }); + } + + await sleep(1000); + } + + return checksFinished; +} + +async function runCheckAsync(script: string): Promise { + logger.info(`Starting check: ${script}`); + const startTime = Date.now(); + + return new Promise((resolve) => { + const scriptProcess = exec(script); + let output = ''; + const appendToOutput = (data: string | Buffer) => (output += data); + + scriptProcess.stdout?.on('data', appendToOutput); + scriptProcess.stderr?.on('data', appendToOutput); + + scriptProcess.on('exit', (code) => { + const result: CheckResult = { + success: code === 0, + script, + output, + durationMs: Date.now() - startTime, + }; + if (code === 0) { + logger.info(`Passed check: ${script} in ${humanizeTime(result.durationMs)}`); + } else { + logger.warning(`Failed check: ${script} in ${humanizeTime(result.durationMs)}`); + } + + resolve(result); + }); + }); +} + +function printResults(startTimestamp: number, results: CheckResult[]) { + const totalDuration = results.reduce((acc, result) => acc + result.durationMs, 0); + const total = humanizeTime(totalDuration); + const effective = humanizeTime(Date.now() - startTimestamp); + logger.info(`- Total time: ${total}, effective: ${effective}`); + + results.forEach((result) => { + logger.write( + `--- ${result.success ? '✅' : '❌'} ${result.script}: ${humanizeTime(result.durationMs)}` + ); + if (result.success) { + logger.debug(result.output); + } else { + logger.warning(result.output); + } + }); +} + +function humanizeTime(ms: number) { + if (ms < 1000) { + return `${ms}ms`; + } + + const minutes = Math.floor(ms / 1000 / 60); + const seconds = Math.floor((ms - minutes * 60 * 1000) / 1000); + if (minutes === 0) { + return `${seconds}s`; + } else { + return `${minutes}m ${seconds}s`; + } +} diff --git a/src/plugins/chart_expressions/common/color_categories.test.ts b/src/plugins/chart_expressions/common/color_categories.test.ts new file mode 100644 index 0000000000000..cbd02e149ecdc --- /dev/null +++ b/src/plugins/chart_expressions/common/color_categories.test.ts @@ -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 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 { getColorCategories } from './color_categories'; + +const extensions = ['gz', 'css', '', 'rpm', 'deb', 'zip', null]; +const getExtension = (i: number) => extensions[i % extensions.length]; + +const basicDatatableRows: DatatableRow[] = Array.from({ length: 30 }).map((_, i) => ({ + count: i, + extension: getExtension(i), +})); + +const isTransposedDatatableRows: DatatableRow[] = Array.from({ length: 30 }).map((_, i) => ({ + count: i, + ['safari---extension']: getExtension(i), + ['chrome---extension']: getExtension(i + 1), + ['firefox---extension']: getExtension(i + 2), +})); + +describe('getColorCategories', () => { + it('should return all categories from datatable rows', () => { + expect(getColorCategories(basicDatatableRows, 'extension')).toEqual([ + 'gz', + 'css', + '', + 'rpm', + 'deb', + 'zip', + 'null', + ]); + }); + + it('should exclude selected categories from datatable rows', () => { + expect(getColorCategories(basicDatatableRows, 'extension', false, ['', null])).toEqual([ + 'gz', + 'css', + 'rpm', + 'deb', + 'zip', + ]); + }); + + it('should return categories across all transpose columns of datatable rows', () => { + expect(getColorCategories(isTransposedDatatableRows, 'extension', true)).toEqual([ + 'gz', + 'css', + '', + 'rpm', + 'deb', + 'zip', + 'null', + ]); + }); + + it('should exclude selected categories across all transpose columns of datatable rows', () => { + expect(getColorCategories(isTransposedDatatableRows, 'extension', true, ['', null])).toEqual([ + 'gz', + 'css', + 'rpm', + 'deb', + 'zip', + ]); + }); +}); diff --git a/src/plugins/chart_expressions/common/color_categories.ts b/src/plugins/chart_expressions/common/color_categories.ts index 0bb8811f2701a..3699c89d2c8ce 100644 --- a/src/plugins/chart_expressions/common/color_categories.ts +++ b/src/plugins/chart_expressions/common/color_categories.ts @@ -15,27 +15,38 @@ import { isMultiFieldKey } from '@kbn/data-plugin/common'; */ export function getColorCategories( rows: DatatableRow[], - accessor?: string + accessor?: string, + isTransposed?: boolean, + exclude?: any[] ): Array { - return accessor - ? rows.reduce<{ keys: Set; categories: Array }>( - (acc, r) => { - const value = r[accessor]; - if (value === undefined) { - return acc; - } + const ids = isTransposed + ? Object.keys(rows[0]).filter((key) => accessor && key.endsWith(accessor)) + : accessor + ? [accessor] + : []; + + return rows + .flatMap((r) => + ids + .map((id) => r[id]) + .filter((v) => !(v === undefined || exclude?.includes(v))) + .map((v) => { // 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 key = (isMultiFieldKey(v) ? v.keys : [v]).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 - : []; + return { key, stringifiedKeys }; + }) + ) + .reduce<{ keys: Set; categories: Array }>( + (acc, { key, stringifiedKeys }) => { + 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/expression_gauge/public/components/__snapshots__/gauge_component.test.tsx.snap b/src/plugins/chart_expressions/expression_gauge/public/components/__snapshots__/gauge_component.test.tsx.snap index d35d9ea5b8479..00f2044dd9366 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/__snapshots__/gauge_component.test.tsx.snap +++ b/src/plugins/chart_expressions/expression_gauge/public/components/__snapshots__/gauge_component.test.tsx.snap @@ -93,7 +93,7 @@ exports[`GaugeComponent renders the chart 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -117,11 +117,11 @@ exports[`GaugeComponent renders the chart 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx index 0e1ebe988e602..145571da11022 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx @@ -194,7 +194,7 @@ export const GaugeComponent: FC = ({ const getColor = useCallback( ( - value, + value: number, paletteConfig: PaletteOutput, bands: number[], percentageMode?: boolean diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx index 3687113d9aee0..7311adee7a202 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx @@ -428,14 +428,12 @@ describe('MetricVisComponent', function () { const [[visConfig]] = component.find(Metric).props().data!; - expect(visConfig!.value).toMatchInlineSnapshot( - ` + expect(visConfig!.value).toMatchInlineSnapshot(` Array [ "text-28.984375", "text-100", ] - ` - ); + `); }); it('should display multi-values numeric values formatted and without quotes', () => { @@ -451,14 +449,24 @@ describe('MetricVisComponent', function () { const [[visConfig]] = component.find(Metric).props().data!; - expect(visConfig!.value).toMatchInlineSnapshot( - ` + expect(visConfig!.value).toMatchInlineSnapshot(` Array [ "number-28.984375", "number-100", ] - ` - ); + `); + }); + + it('should display an empty tile if no data is provided', () => { + const newTable = { + ...table, + rows: [], + }; + const component = shallow(); + + const [[visConfig]] = component.find(Metric).props().data!; + + expect(visConfig!.value).toMatchInlineSnapshot(`NaN`); }); }); diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx index 4ed15f5f72554..d0f6b6f3399e6 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx @@ -163,7 +163,7 @@ export const MetricVis = ({ ); const onWillRender = useCallback(() => { - const maxTileSideLength = grid.current.length * grid.current[0].length > 1 ? 200 : 300; + const maxTileSideLength = grid.current.length * grid.current[0]?.length > 1 ? 200 : 300; const event: ChartSizeEvent = { name: 'chartSize', data: { @@ -197,8 +197,15 @@ export const MetricVis = ({ ? getColumnByAccessor(config.dimensions.max, data.columns)?.id : undefined; + // For a sigle tile configuration, either no breakdown or with a collapse by, provide + // a fallback in case of missing data. Make sure to provide an exact "null" value to render a N/A metric. + // For reference, undefined will render as - instead of N/A and it is used in a breakdown scenario + const firstRowForNonBreakdown = ( + data.rows.length ? data.rows : [{ [primaryMetricColumn.id]: null }] + ).slice(0, 1); + const metricConfigs: MetricSpec['data'][number] = ( - breakdownByColumn ? data.rows : data.rows.slice(0, 1) + breakdownByColumn ? data.rows : firstRowForNonBreakdown ).map((row, rowIdx) => { const value: number | string = row[primaryMetricColumn.id] !== null ? row[primaryMetricColumn.id] : NaN; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/components/__snapshots__/partition_vis_component.test.tsx.snap b/src/plugins/chart_expressions/expression_partition_vis/public/components/__snapshots__/partition_vis_component.test.tsx.snap index 432768530222b..e822610217971 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/components/__snapshots__/partition_vis_component.test.tsx.snap +++ b/src/plugins/chart_expressions/expression_partition_vis/public/components/__snapshots__/partition_vis_component.test.tsx.snap @@ -323,7 +323,7 @@ exports[`PartitionVisComponent should render correct structure for donut 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -347,11 +347,11 @@ exports[`PartitionVisComponent should render correct structure for donut 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -1257,7 +1257,7 @@ exports[`PartitionVisComponent should render correct structure for mosaic 1`] = 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -1281,11 +1281,11 @@ exports[`PartitionVisComponent should render correct structure for mosaic 1`] = ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -2251,7 +2251,7 @@ exports[`PartitionVisComponent should render correct structure for multi-metric 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -2275,11 +2275,11 @@ exports[`PartitionVisComponent should render correct structure for multi-metric ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -3247,7 +3247,7 @@ exports[`PartitionVisComponent should render correct structure for pie 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -3271,11 +3271,11 @@ exports[`PartitionVisComponent should render correct structure for pie 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -4181,7 +4181,7 @@ exports[`PartitionVisComponent should render correct structure for treemap 1`] = 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -4205,11 +4205,11 @@ exports[`PartitionVisComponent should render correct structure for treemap 1`] = ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -5070,7 +5070,7 @@ exports[`PartitionVisComponent should render correct structure for waffle 1`] = 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -5094,11 +5094,11 @@ exports[`PartitionVisComponent should render correct structure for waffle 1`] = ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, 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 0c7f855c66390..b76bc5ec611b7 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 @@ -18,6 +18,8 @@ import { Wordcloud, RenderChangeListener, LEGACY_LIGHT_THEME, + ElementClickListener, + WordCloudElementEvent, } from '@elastic/charts'; import { EmptyPlaceholder } from '@kbn/charts-plugin/public'; import { @@ -190,13 +192,13 @@ export const TagCloudChart = ({ [] ); - const handleWordClick = useCallback( + const handleWordClick = useCallback( (elements) => { if (!bucket) { return; } const termsBucketId = getColumnByAccessor(bucket, visData.columns)!.id; - const clickedValue = elements[0][0].text; + const clickedValue = (elements[0] as WordCloudElementEvent)[0].text; const columnIndex = visData.columns.findIndex((col) => col.id === termsBucketId); if (columnIndex < 0) { 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 624ed9afcd299..789878ac673fa 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 @@ -665,7 +665,7 @@ exports[`XYChart component it renders area 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -689,11 +689,11 @@ exports[`XYChart component it renders area 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -1747,8 +1747,8 @@ exports[`XYChart component it renders area 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -2220,7 +2220,7 @@ exports[`XYChart component it renders bar 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -2244,11 +2244,11 @@ exports[`XYChart component it renders bar 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -3302,8 +3302,8 @@ exports[`XYChart component it renders bar 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -3775,7 +3775,7 @@ exports[`XYChart component it renders horizontal bar 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -3799,11 +3799,11 @@ exports[`XYChart component it renders horizontal bar 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -4857,8 +4857,8 @@ exports[`XYChart component it renders horizontal bar 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -5330,7 +5330,7 @@ exports[`XYChart component it renders line 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -5354,11 +5354,11 @@ exports[`XYChart component it renders line 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -6412,8 +6412,8 @@ exports[`XYChart component it renders line 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -6885,7 +6885,7 @@ exports[`XYChart component it renders stacked area 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -6909,11 +6909,11 @@ exports[`XYChart component it renders stacked area 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -7967,8 +7967,8 @@ exports[`XYChart component it renders stacked area 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -8440,7 +8440,7 @@ exports[`XYChart component it renders stacked bar 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -8464,11 +8464,11 @@ exports[`XYChart component it renders stacked bar 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -9522,8 +9522,8 @@ exports[`XYChart component it renders stacked bar 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -9995,7 +9995,7 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = ` 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -10019,11 +10019,11 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = ` ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -11077,8 +11077,8 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = ` minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -11580,7 +11580,7 @@ exports[`XYChart component split chart should render split chart if both, splitR 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -11604,11 +11604,11 @@ exports[`XYChart component split chart should render split chart if both, splitR ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -12858,8 +12858,8 @@ exports[`XYChart component split chart should render split chart if both, splitR minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -13373,7 +13373,7 @@ exports[`XYChart component split chart should render split chart if splitColumnA 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -13397,11 +13397,11 @@ exports[`XYChart component split chart should render split chart if splitColumnA ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -14646,8 +14646,8 @@ exports[`XYChart component split chart should render split chart if splitColumnA minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} @@ -15159,7 +15159,7 @@ exports[`XYChart component split chart should render split chart if splitRowAcce 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -15183,11 +15183,11 @@ exports[`XYChart component split chart should render split chart if splitRowAcce ], "vertical": Object { "dash": Array [ - 4, - 4, + 0, + 0, ], "opacity": 1, - "stroke": "#eaedf3", + "stroke": "#E9EDF3", "strokeWidth": 1, "visible": true, }, @@ -16432,8 +16432,8 @@ exports[`XYChart component split chart should render split chart if splitRowAcce minBarHeight={1} paletteService={ Object { - "get": [Function], - "getAll": [Function], + "get": [MockFunction], + "getAll": [MockFunction], } } shouldShowValueLabels={true} 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 c5223a270eadd..ffdb868ecff53 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 @@ -48,8 +48,8 @@ interface Props { endValue?: EndValue | undefined; paletteService: PaletteRegistry; formattedDatatables: DatatablesWithFormatInfo; - syncColors?: boolean; - timeZone?: string; + syncColors: boolean; + timeZone: string; emphasizeFitting?: boolean; fillOpacity?: number; minBarHeight: number; 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 990d1ab93a1bc..0dd7ca05a2c9d 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 @@ -98,7 +98,6 @@ export const getAllSeries = ( /** * 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[], 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 b3684217d137f..406c498c15bba 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 @@ -28,7 +28,7 @@ import { getPalette, AVAILABLE_PALETTES, NeutralPalette, - SPECIAL_TOKENS_STRING_CONVERTION, + SPECIAL_TOKENS_STRING_CONVERSION, } from '@kbn/coloring'; import { getColorCategories } from '@kbn/chart-expressions-common'; import { isDataLayer } from '../../common/utils/layer_types_guards'; @@ -53,10 +53,10 @@ type GetSeriesPropsFn = (config: { colorAssignments: ColorAssignments; columnToLabelMap: Record; paletteService: PaletteRegistry; - syncColors?: boolean; yAxis?: GroupsConfiguration[number]; xAxis?: GroupsConfiguration[number]; - timeZone?: string; + syncColors: boolean; + timeZone: string; emphasizeFitting?: boolean; fillOpacity?: number; formattedDatatableInfo: DatatableWithFormatInfo; @@ -324,7 +324,7 @@ const getColor: GetColorFn = ( series, { layer, colorAssignments, paletteService, syncColors, getSeriesNameFn }, uiState, - singleTable + isSingleTable ) => { const overwriteColor = getSeriesColor(layer, series.yAccessor as string); if (overwriteColor !== null) { @@ -333,7 +333,7 @@ const getColor: GetColorFn = ( const name = getSeriesNameFn(series)?.toString() || ''; - const overwriteColors: Record = uiState?.get ? uiState.get('vis.colors', {}) : {}; + const overwriteColors: Record = uiState?.get?.('vis.colors', {}) ?? {}; if (Object.keys(overwriteColors).includes(name)) { return overwriteColors[name]; @@ -344,7 +344,7 @@ const getColor: GetColorFn = ( { name, totalSeriesAtDepth: colorAssignment.totalSeriesCount, - rankAtDepth: colorAssignment.getRank(singleTable ? 'commonLayerId' : layer.layerId, name), + rankAtDepth: colorAssignment.getRank(isSingleTable ? 'commonLayerId' : layer.layerId, name), }, ]; return paletteService.get(layer.palette.name).getCategoricalColor( @@ -493,7 +493,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ // 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 + JSON.parse(layer.colorMapping), // the color mapping is at this point just a stringified JSON getPalette(AVAILABLE_PALETTES, NeutralPalette), isDarkMode, { @@ -501,7 +501,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ categories: getColorCategories(table.rows, splitColumnIds[0]), }, splitColumnIds[0], - SPECIAL_TOKENS_STRING_CONVERTION + SPECIAL_TOKENS_STRING_CONVERSION ) : (series) => getColor( diff --git a/src/plugins/charts/public/services/active_cursor/use_active_cursor.ts b/src/plugins/charts/public/services/active_cursor/use_active_cursor.ts index e06c6096664c8..aff01a5871ad6 100644 --- a/src/plugins/charts/public/services/active_cursor/use_active_cursor.ts +++ b/src/plugins/charts/public/services/active_cursor/use_active_cursor.ts @@ -11,7 +11,7 @@ import { animationFrameScheduler } from 'rxjs'; import { useCallback, useEffect, RefObject } from 'react'; import { filter, debounceTime } from 'rxjs'; -import type { Chart } from '@elastic/charts'; +import type { Chart, PointerUpdateListener } from '@elastic/charts'; import { parseSyncOptions } from './active_cursor_utils'; @@ -24,9 +24,9 @@ export const useActiveCursor = ( activeCursor: ActiveCursor, chartRef: RefObject, syncOptions: ActiveCursorSyncOption -) => { +): PointerUpdateListener => { const { accessors, isDateHistogram } = parseSyncOptions(syncOptions); - const handleCursorUpdate = useCallback( + const handleCursorUpdate = useCallback( (cursor) => { activeCursor.activeCursor$?.next({ cursor, diff --git a/src/plugins/charts/public/services/palettes/mock.ts b/src/plugins/charts/public/services/palettes/mock.ts index 8d7007f96529b..2d1ee87e385ca 100644 --- a/src/plugins/charts/public/services/palettes/mock.ts +++ b/src/plugins/charts/public/services/palettes/mock.ts @@ -74,9 +74,10 @@ export const getPaletteRegistry = () => { }; return { - get: (name: string) => - name === 'custom' ? mockPalette3 : name !== 'default' ? mockPalette2 : mockPalette1, - getAll: () => [mockPalette1, mockPalette2, mockPalette3], + get: jest.fn((name: string) => + name === 'custom' ? mockPalette3 : name !== 'default' ? mockPalette2 : mockPalette1 + ), + getAll: jest.fn(() => [mockPalette1, mockPalette2, mockPalette3]), }; }; diff --git a/src/plugins/console/common/constants/copy_as.ts b/src/plugins/console/common/constants/copy_as.ts new file mode 100644 index 0000000000000..a7b6c80685939 --- /dev/null +++ b/src/plugins/console/common/constants/copy_as.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. + */ + +// Default language for the language selector +export const DEFAULT_LANGUAGE = 'curl'; +// These values are the ones that should match the available languages from the +// `@elastic/request-converter` package but since it cannot run on client side, +// we hardcode the available languages in order to avoid having to make an extra +// request to fetch them. +export const AVAILABLE_LANGUAGES = [ + { value: 'curl', label: 'curl' }, + { value: 'javascript', label: 'JavaScript' }, + { value: 'python', label: 'Python' }, +]; diff --git a/src/plugins/console/common/constants/index.ts b/src/plugins/console/common/constants/index.ts index 4e0df53fdd513..209b47419fc3e 100644 --- a/src/plugins/console/common/constants/index.ts +++ b/src/plugins/console/common/constants/index.ts @@ -16,3 +16,4 @@ export { MANUAL_SUBFOLDER, } from './autocomplete_definitions'; export { DEFAULT_INPUT_VALUE } from './editor_input'; +export { DEFAULT_LANGUAGE, AVAILABLE_LANGUAGES } from './copy_as'; diff --git a/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/context_menu.tsx b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/context_menu.tsx new file mode 100644 index 0000000000000..acdbd03704866 --- /dev/null +++ b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/context_menu.tsx @@ -0,0 +1,264 @@ +/* + * 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 { + EuiIcon, + EuiContextMenuPanel, + EuiContextMenuItem, + EuiPopover, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiLoadingSpinner, +} from '@elastic/eui'; +import { NotificationsSetup } from '@kbn/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import { LanguageSelectorModal } from './language_selector_modal'; +import { convertRequestToLanguage } from '../../../../../../services'; +import type { EditorRequest } from '../../types'; + +import { useServicesContext } from '../../../../../contexts'; +import { StorageKeys } from '../../../../../../services'; +import { DEFAULT_LANGUAGE, AVAILABLE_LANGUAGES } from '../../../../../../../common/constants'; + +interface Props { + getRequests: () => Promise; + getDocumentation: () => Promise; + autoIndent: (ev: React.MouseEvent) => void; + notifications: NotificationsSetup; +} + +const DELAY_FOR_HIDING_SPINNER = 500; + +const getLanguageLabelByValue = (value: string) => { + return AVAILABLE_LANGUAGES.find((lang) => lang.value === value)?.label || DEFAULT_LANGUAGE; +}; + +export const ContextMenu = ({ + getRequests, + getDocumentation, + autoIndent, + notifications, +}: Props) => { + // Get default language from local storage + const { + services: { storage, esHostService }, + } = useServicesContext(); + const defaultLanguage = storage.get(StorageKeys.DEFAULT_LANGUAGE, DEFAULT_LANGUAGE); + + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const [isRequestConverterLoading, setRequestConverterLoading] = useState(false); + const [isLanguageSelectorVisible, setLanguageSelectorVisibility] = useState(false); + const [currentLanguage, setCurrentLanguage] = useState(defaultLanguage); + + const copyText = async (text: string) => { + if (window.navigator?.clipboard) { + await window.navigator.clipboard.writeText(text); + return; + } + throw new Error('Could not copy to clipboard!'); + }; + + // This function will convert all the selected requests to the language by + // calling convertRequestToLanguage and then copy the data to clipboard. + const copyAs = async (language?: string) => { + // Get the language we want to convert the requests to + const withLanguage = language || currentLanguage; + // Get all the selected requests + const requests = await getRequests(); + + const { data: requestsAsCode, error: requestError } = await convertRequestToLanguage({ + language: withLanguage, + esHost: esHostService.getHost(), + requests, + }); + + if (requestError) { + notifications.toasts.addDanger({ + title: i18n.translate('console.consoleMenu.copyAsFailedMessage', { + defaultMessage: + '{requestsCount, plural, one {Request} other {Requests}} could not be copied to clipboard', + values: { requestsCount: requests.length }, + }), + }); + + return; + } + + notifications.toasts.addSuccess({ + title: i18n.translate('console.consoleMenu.copyAsSuccessMessage', { + defaultMessage: + '{requestsCount, plural, one {Request} other {Requests}} copied to clipboard as {language}', + values: { language: getLanguageLabelByValue(withLanguage), requestsCount: requests.length }, + }), + }); + + await copyText(requestsAsCode); + }; + + const onCopyAsSubmit = async (language?: string) => { + const withLanguage = language || currentLanguage; + + // Close language selector modal + setLanguageSelectorVisibility(false); + // Show loading spinner + setRequestConverterLoading(true); + + // When copying as worked as expected, close the context menu popover + copyAs(withLanguage) + .then(() => { + setIsPopoverOpen(false); + }) + .finally(() => { + // Delay hiding the spinner to avoid flickering between the spinner and + // the change language button + setTimeout(() => { + setRequestConverterLoading(false); + }, DELAY_FOR_HIDING_SPINNER); + }); + }; + + const changeDefaultLanguage = (language: string) => { + if (currentLanguage !== language) { + storage.set(StorageKeys.DEFAULT_LANGUAGE, language); + } + + setCurrentLanguage(language); + }; + + const closePopover = () => { + setIsPopoverOpen(false); + }; + + const openDocs = async () => { + closePopover(); + const documentation = await getDocumentation(); + if (!documentation) { + notifications.toasts.addWarning({ + title: i18n.translate('console.consoleMenu.missingDocumentationPage', { + defaultMessage: 'Documentation page is not yet available for this API.', + }), + }); + return; + } + window.open(documentation, '_blank'); + }; + + const handleAutoIndent = (event: React.MouseEvent) => { + closePopover(); + autoIndent(event); + }; + + const button = ( + setIsPopoverOpen((prev) => !prev)} + data-test-subj="toggleConsoleMenu" + aria-label={i18n.translate('console.requestOptionsButtonAriaLabel', { + defaultMessage: 'Request options', + })} + > + + + ); + + const items = [ + { + e.preventDefault(); + const target = e.target as HTMLButtonElement; + + if (target.dataset.name === 'changeLanguage') { + setLanguageSelectorVisibility(true); + return; + } + + onCopyAsSubmit(); + }} + icon="copyClipboard" + > + + + + + + + + {getLanguageLabelByValue(currentLanguage)} + + + + + {isRequestConverterLoading ? ( + + ) : ( + // The EuiContextMenuItem renders itself as a button already, so we need to + // force the link to not be a button in order to prevent A11Y issues. + + Change + + )} + + + , + + + , + + + , + ]; + + return ( + <> + + + + {isLanguageSelectorVisible && ( + setLanguageSelectorVisibility(false)} + onSubmit={onCopyAsSubmit} + /> + )} + + ); +}; diff --git a/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/index.ts b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/index.ts new file mode 100644 index 0000000000000..6ef3a8fab51bf --- /dev/null +++ b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/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 { ContextMenu } from './context_menu'; diff --git a/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/language_selector_modal.tsx b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/language_selector_modal.tsx new file mode 100644 index 0000000000000..8ce76675b4336 --- /dev/null +++ b/src/plugins/console/public/application/containers/editor/monaco/components/context_menu/language_selector_modal.tsx @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState, useMemo } from 'react'; +import { + EuiButton, + EuiModal, + EuiModalBody, + EuiButtonEmpty, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + useGeneratedHtmlId, + EuiSelectable, + EuiSelectableOption, + EuiLink, + EuiTextColor, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { AVAILABLE_LANGUAGES } from '../../../../../../../common/constants'; + +interface Props { + closeModal: () => void; + onSubmit: (language: string) => void; + currentLanguage: string; + changeDefaultLanguage: (lang: string) => void; +} + +const DEFAULT_BADGE = ( + + + {i18n.translate('console.requestPanel.contextMenu.defaultSelectedLanguage', { + defaultMessage: 'Default', + })} + + +); + +export const LanguageSelectorModal = ({ + closeModal, + onSubmit, + currentLanguage, + changeDefaultLanguage, +}: Props) => { + const modalTitleId = useGeneratedHtmlId(); + const [selectedLanguage, setSelectedLanguage] = useState(currentLanguage); + const [options, setOptions] = useState( + AVAILABLE_LANGUAGES.map( + (lang): EuiSelectableOption => ({ + label: lang.label, + key: lang.value, + 'data-test-subj': `languageOption-${lang.value}`, + }) + ) + ); + + const noOptionsSelected = options.every((option) => !option.checked); + + const optionsList = useMemo(() => { + return options.map((option) => ({ + ...option, + ...(noOptionsSelected && option.key === selectedLanguage && { checked: 'on' }), + append: + option.key === selectedLanguage ? ( + DEFAULT_BADGE + ) : ( + setSelectedLanguage(option.key!)} + data-test-subj={`changeDefaultLanguageTo-${option.key}`} + > + {i18n.translate('console.requestPanel.contextMenu.defaultSelectedLanguage', { + defaultMessage: 'Set as default', + })} + + ), + })); + }, [options, selectedLanguage, noOptionsSelected]); + + const onCopyCode = () => { + const selectedOption = options.find((option) => option.checked); + const language = selectedOption?.key || selectedLanguage; + + // If the default language is changed, update the local storage setting + if (currentLanguage !== language) { + changeDefaultLanguage(selectedLanguage); + } + + onSubmit(language); + }; + + const onCloseModal = () => { + changeDefaultLanguage(selectedLanguage); + closeModal(); + }; + + return ( + + + + + + + + + setOptions(changedOptions)} + singleSelection="always" + listProps={{ + onFocusBadge: false, + isVirtualized: false, + }} + > + {(list) => list} + + + + + + + + + + + + + ); +}; diff --git a/src/plugins/console/public/application/containers/editor/monaco/components/index.ts b/src/plugins/console/public/application/containers/editor/monaco/components/index.ts new file mode 100644 index 0000000000000..6ef3a8fab51bf --- /dev/null +++ b/src/plugins/console/public/application/containers/editor/monaco/components/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 { ContextMenu } from './context_menu'; diff --git a/src/plugins/console/public/application/containers/editor/monaco/monaco_editor.tsx b/src/plugins/console/public/application/containers/editor/monaco/monaco_editor.tsx index d8fe60dc8c5e9..e1d72fa979b43 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/monaco_editor.tsx +++ b/src/plugins/console/public/application/containers/editor/monaco/monaco_editor.tsx @@ -13,7 +13,7 @@ import { CodeEditor } from '@kbn/code-editor'; import { CONSOLE_LANG_ID, CONSOLE_THEME_ID, monaco } from '@kbn/monaco'; import { i18n } from '@kbn/i18n'; import { useSetInputEditor } from '../../../hooks'; -import { ConsoleMenu } from '../../../components'; +import { ContextMenu } from './components'; import { useServicesContext, useEditorReadContext, @@ -26,6 +26,7 @@ import { useResizeCheckerUtils, useKeyboardCommandsUtils, } from './hooks'; +import type { EditorRequest } from './types'; import { MonacoEditorActionsProvider } from './monaco_editor_actions_provider'; import { getSuggestionProvider } from './monaco_editor_suggestion_provider'; @@ -36,7 +37,7 @@ export interface EditorProps { export const MonacoEditor = ({ initialTextValue }: EditorProps) => { const context = useServicesContext(); const { - services: { notifications, esHostService, settings: settingsService, autocompleteInfo }, + services: { notifications, settings: settingsService, autocompleteInfo }, docLinkVersion, config: { isDevMode }, } = context; @@ -55,10 +56,11 @@ export const MonacoEditor = ({ initialTextValue }: EditorProps) => { const [editorActionsCss, setEditorActionsCss] = useState({}); const setInputEditor = useSetInputEditor(); - const getCurlCallback = useCallback(async (): Promise => { - const curl = await actionsProvider.current?.getCurl(esHostService.getHost()); - return curl ?? ''; - }, [esHostService]); + + const getRequestsCallback = useCallback(async (): Promise => { + const requests = await actionsProvider.current?.getRequests(); + return requests ?? []; + }, []); const getDocumenationLink = useCallback(async () => { return actionsProvider.current!.getDocumentationLink(docLinkVersion); @@ -156,8 +158,8 @@ export const MonacoEditor = ({ initialTextValue }: EditorProps) => { - this.highlightRequests(), @@ -174,12 +176,12 @@ export class MonacoEditorActionsProvider { const selectedRequests: AdjustedParsedRequest[] = []; for (const [index, parsedRequest] of parsedRequests.entries()) { const requestStartLineNumber = getRequestStartLineNumber(parsedRequest, model); - const requestEndLineNumber = getRequestEndLineNumber( + const requestEndLineNumber = getRequestEndLineNumber({ parsedRequest, + nextRequest: parsedRequests.at(index + 1), model, - index, - parsedRequests - ); + startLineNumber, + }); if (requestStartLineNumber > endLineNumber) { // request is past the selection, no need to check further requests break; @@ -198,14 +200,32 @@ export class MonacoEditorActionsProvider { return selectedRequests; } - private async getRequests() { + public async getRequests() { + const model = this.editor.getModel(); + if (!model) { + return []; + } + const parsedRequests = await this.getSelectedParsedRequests(); - const stringifiedRequests = parsedRequests.map((parsedRequest) => - stringifyRequest(parsedRequest) - ); + const stringifiedRequests = parsedRequests.map((parsedRequest) => { + const { startLineNumber, endLineNumber } = parsedRequest; + const requestTextFromEditor = getRequestFromEditor(model, startLineNumber, endLineNumber); + if (requestTextFromEditor && requestTextFromEditor.data.length > 0) { + requestTextFromEditor.data = requestTextFromEditor.data.map((dataString) => { + if (containsComments(dataString)) { + // parse and stringify to remove comments + dataString = indentData(dataString); + } + return collapseLiteralStrings(dataString); + }); + } + return requestTextFromEditor; + }); // get variables values const variables = getStorage().get(StorageKeys.VARIABLES, DEFAULT_VARIABLES); - return stringifiedRequests.map((request) => replaceRequestVariables(request, variables)); + return stringifiedRequests + .filter(Boolean) + .map((request) => replaceRequestVariables(request!, variables)); } public async getCurl(elasticsearchBaseUrl: string): Promise { @@ -389,12 +409,6 @@ export class MonacoEditorActionsProvider { return null; } - // if the current request doesn't have a method, the request is not valid - // and shouldn't have an autocomplete type - if (!currentRequest.method) { - return null; - } - // if not on the 1st line of the request, suggest request body return AutocompleteType.BODY; } diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/autocomplete_utils.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/autocomplete_utils.ts index bbfa33d84e70e..5c6a9885c3627 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/autocomplete_utils.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/autocomplete_utils.ts @@ -58,7 +58,7 @@ export const getDocumentationLinkFromAutocomplete = ( * Helper function that filters out suggestions without a name. */ const filterTermsWithoutName = (terms: ResultTerm[]): ResultTerm[] => - terms.filter((term) => term.name !== undefined); + terms.filter((term) => term.name !== undefined && term.name !== ''); /* * This function returns an array of completion items for the request method diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/constants.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/constants.ts index 0f4664be48994..7e1ebbc85a50a 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/constants.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/constants.ts @@ -40,6 +40,10 @@ export const END_OF_URL_TOKEN = '__url_path_end__'; * In this case autocomplete suggestions should be triggered for an url. */ export const methodWhitespaceRegex = /^\s*(GET|POST|PUT|PATCH|DELETE)\s+$/i; +/* + * This regex matches a string that starts with a method (optional whitespace before the method) + */ +export const startsWithMethodRegex = /^\s*(GET|POST|PUT|PATCH|DELETE)/i; /* * This regex matches a string that has * a method and some parts of an url ending with a slash, a question mark or an equals sign, diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/index.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/index.ts index 0997aa682b630..bc402875633a0 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/index.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/index.ts @@ -18,11 +18,11 @@ export { export { getRequestStartLineNumber, getRequestEndLineNumber, - stringifyRequest, replaceRequestVariables, getCurlRequest, trackSentRequests, getAutoIndentedRequests, + getRequestFromEditor, } from './requests_utils'; export { getDocumentationLinkFromAutocomplete, diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.test.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.test.ts index 8704ae9e94eec..f028bfde48086 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.test.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.test.ts @@ -6,14 +6,16 @@ * Side Public License, v 1. */ +import { monaco, ParsedRequest } from '@kbn/monaco'; +import type { MetricsTracker } from '../../../../../types'; import { getAutoIndentedRequests, getCurlRequest, + getRequestEndLineNumber, replaceRequestVariables, - stringifyRequest, trackSentRequests, + getRequestFromEditor, } from './requests_utils'; -import { MetricsTracker } from '../../../../../types'; describe('requests_utils', () => { const dataObjects = [ @@ -26,35 +28,23 @@ describe('requests_utils', () => { test: 'test', }, ]; - describe('stringifyRequest', () => { - const request = { - startOffset: 0, - endOffset: 11, - method: 'get', - url: '_search some_text', - }; - it('calls the "removeTrailingWhitespaces" on the url', () => { - const stringifiedRequest = stringifyRequest(request); - expect(stringifiedRequest.url).toBe('_search'); - }); - - it('normalizes the method to upper case', () => { - const stringifiedRequest = stringifyRequest(request); - expect(stringifiedRequest.method).toBe('GET'); - }); - it('stringifies the request body', () => { - const result = stringifyRequest({ ...request, data: [dataObjects[0]] }); - expect(result.data.length).toBe(1); - expect(result.data[0]).toBe(JSON.stringify(dataObjects[0], null, 2)); - }); - - it('works for several request bodies', () => { - const result = stringifyRequest({ ...request, data: dataObjects }); - expect(result.data.length).toBe(2); - expect(result.data[0]).toBe(JSON.stringify(dataObjects[0], null, 2)); - expect(result.data[1]).toBe(JSON.stringify(dataObjects[1], null, 2)); - }); - }); + const inlineData = '{"query":"test"}'; + const multiLineData = '{\n "query": "test"\n}'; + const invalidData = '{\n "query":\n {'; + const getMockModel = (content: string[]) => { + return { + getLineContent: (lineNumber: number) => content[lineNumber - 1], + getValueInRange: ({ + startLineNumber, + endLineNumber, + }: { + startLineNumber: number; + endLineNumber: number; + }) => content.slice(startLineNumber - 1, endLineNumber).join('\n'), + getLineMaxColumn: (lineNumber: number) => content[lineNumber - 1].length, + getLineCount: () => content.length, + } as unknown as monaco.editor.ITextModel; + }; describe('replaceRequestVariables', () => { const variables = [ @@ -213,9 +203,6 @@ describe('requests_utils', () => { ]; const TEST_REQUEST_1 = { - method: 'GET', - url: '_search', - data: [{ query: { match_all: {} } }], // Offsets are with respect to the sample editor text startLineNumber: 2, endLineNumber: 7, @@ -224,9 +211,6 @@ describe('requests_utils', () => { }; const TEST_REQUEST_2 = { - method: 'GET', - url: '_all', - data: [], // Offsets are with respect to the sample editor text startLineNumber: 10, endLineNumber: 10, @@ -235,10 +219,6 @@ describe('requests_utils', () => { }; const TEST_REQUEST_3 = { - method: 'POST', - url: '/_bulk', - // Multi-data - data: [{ index: { _index: 'books' } }, { name: '1984' }, { name: 'Atomic habits' }], // Offsets are with respect to the sample editor text startLineNumber: 15, endLineNumber: 23, @@ -247,11 +227,8 @@ describe('requests_utils', () => { }; const TEST_REQUEST_4 = { - method: 'GET', - url: '_search', - data: [{ query: { match_all: {} } }], // Offsets are with respect to the sample editor text - startLineNumber: 24, + startLineNumber: 25, endLineNumber: 30, startOffset: 1, endOffset: 36, @@ -353,17 +330,131 @@ describe('requests_utils', () => { expect(formattedData).toBe(expectedResultLines.join('\n')); }); - it('does not auto-indent a request with comments', () => { - const requestText = sampleEditorTextLines - .slice(TEST_REQUEST_4.startLineNumber - 1, TEST_REQUEST_4.endLineNumber) + it(`auto-indents method line but doesn't auto-indent data with comments`, () => { + const methodLine = sampleEditorTextLines[TEST_REQUEST_4.startLineNumber - 1]; + const dataText = sampleEditorTextLines + .slice(TEST_REQUEST_4.startLineNumber, TEST_REQUEST_4.endLineNumber) .join('\n'); const formattedData = getAutoIndentedRequests( [TEST_REQUEST_4], - requestText, + `${methodLine}\n${dataText}`, sampleEditorTextLines.join('\n') ); - expect(formattedData).toBe(requestText); + expect(formattedData).toBe(`GET _search // test comment\n${dataText}`); + }); + }); + + describe('getRequestEndLineNumber', () => { + const parsedRequest: ParsedRequest = { + startOffset: 1, + }; + it('detects the end of the request when there is a line that starts with a method (next not parsed request)', () => { + /* + * Mocking the model to return these 6 lines of text + * 1. GET /_search + * 2. { + * 3. empty + * 4. empty + * 5. POST _search + * 6. empty + */ + const content = ['GET /_search', '{', '', '', 'POST _search', '']; + const model = { + ...getMockModel(content), + getPositionAt: () => ({ lineNumber: 1 }), + } as unknown as monaco.editor.ITextModel; + + const result = getRequestEndLineNumber({ + parsedRequest, + model, + startLineNumber: 1, + }); + expect(result).toEqual(2); + }); + + it('detects the end of the request when the text ends', () => { + /* + * Mocking the model to return these 4 lines of text + * 1. GET /_search + * 2. { + * 3. { + * 4. empty + */ + const content = ['GET _search', '{', ' {', '']; + const model = { + ...getMockModel(content), + getPositionAt: () => ({ lineNumber: 1 }), + } as unknown as monaco.editor.ITextModel; + + const result = getRequestEndLineNumber({ + parsedRequest, + model, + startLineNumber: 1, + }); + expect(result).toEqual(3); + }); + }); + + describe('getRequestFromEditor', () => { + it('cleans up any text following the url', () => { + const content = ['GET _search // inline comment']; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 1); + expect(request).toEqual({ method: 'GET', url: '_search', data: [] }); + }); + + it(`doesn't incorrectly removes parts of url params that include whitespaces`, () => { + const content = ['GET _search?query="test test"']; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 1); + expect(request).toEqual({ method: 'GET', url: '_search?query="test test"', data: [] }); + }); + + it(`normalizes method to upper case`, () => { + const content = ['get _search']; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 1); + expect(request).toEqual({ method: 'GET', url: '_search', data: [] }); + }); + + it('correctly includes the request body', () => { + const content = ['GET _search', '{', ' "query": {}', '}']; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 4); + expect(request).toEqual({ method: 'GET', url: '_search', data: ['{\n "query": {}\n}'] }); + }); + + it('works for several request bodies', () => { + const content = ['GET _search', '{', ' "query": {}', '}', '{', ' "query": {}', '}']; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 7); + expect(request).toEqual({ + method: 'GET', + url: '_search', + data: ['{\n "query": {}\n}', '{\n "query": {}\n}'], + }); + }); + + it('splits several json objects', () => { + const content = ['GET _search', inlineData, ...multiLineData.split('\n'), inlineData]; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 6); + expect(request).toEqual({ + method: 'GET', + url: '_search', + data: [inlineData, multiLineData, inlineData], + }); + }); + it('works for invalid json objects', () => { + const content = ['GET _search', inlineData, ...invalidData.split('\n')]; + const model = getMockModel(content); + const request = getRequestFromEditor(model, 1, 5); + expect(request).toEqual({ + method: 'GET', + url: '_search', + data: [inlineData, invalidData], + }); }); }); }); diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.ts index 8f791751bba67..b6f5921e920a4 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/requests_utils.ts @@ -7,26 +7,17 @@ */ import { monaco, ParsedRequest } from '@kbn/monaco'; +import { parse } from 'hjson'; import { constructUrl } from '../../../../../lib/es'; -import { MetricsTracker } from '../../../../../types'; +import type { MetricsTracker } from '../../../../../types'; import type { DevToolsVariable } from '../../../../components'; -import type { EditorRequest } from '../types'; -import { urlVariableTemplateRegex, dataVariableTemplateRegex } from './constants'; -import { removeTrailingWhitespaces } from './tokens_utils'; -import { AdjustedParsedRequest } from '../types'; - -/* - * This function stringifies and normalizes the parsed request: - * - the method is converted to upper case - * - any trailing comments are removed from the url - * - the request body is stringified from an object using JSON.stringify - */ -export const stringifyRequest = (parsedRequest: ParsedRequest): EditorRequest => { - const url = parsedRequest.url ? removeTrailingWhitespaces(parsedRequest.url) : ''; - const method = parsedRequest.method?.toUpperCase() ?? ''; - const data = parsedRequest.data?.map((parsedData) => JSON.stringify(parsedData, null, 2)); - return { url, method, data: data ?? [] }; -}; +import type { EditorRequest, AdjustedParsedRequest } from '../types'; +import { + urlVariableTemplateRegex, + dataVariableTemplateRegex, + startsWithMethodRegex, +} from './constants'; +import { parseLine } from './tokens_utils'; /* * This function replaces any variables with its values stored in localStorage. @@ -52,9 +43,13 @@ export const getCurlRequest = ( ): string => { const curlUrl = constructUrl(elasticsearchBaseUrl, url); let curlRequest = `curl -X${method} "${curlUrl}" -H "kbn-xsrf: reporting"`; - if (data.length > 0) { + if (data && data.length) { + const joinedData = data.join('\n'); + curlRequest += ` -H "Content-Type: application/json" -d'\n`; - curlRequest += data.join('\n'); + + // We escape single quoted strings that are wrapped in single quoted strings + curlRequest += joinedData.replace(/'/g, "'\\''"); curlRequest += "'"; } return curlRequest; @@ -88,25 +83,42 @@ export const getRequestStartLineNumber = ( * If there is no end offset (the parser was not able to parse this request completely), * then the last non-empty line is returned or the line before the next request. */ -export const getRequestEndLineNumber = ( - parsedRequest: ParsedRequest, - model: monaco.editor.ITextModel, - index: number, - parsedRequests: ParsedRequest[] -): number => { +export const getRequestEndLineNumber = ({ + parsedRequest, + nextRequest, + model, + startLineNumber, +}: { + parsedRequest: ParsedRequest; + nextRequest?: ParsedRequest; + model: monaco.editor.ITextModel; + startLineNumber: number; +}): number => { let endLineNumber: number; if (parsedRequest.endOffset) { // if the parser set an end offset for this request, then find the line number for it endLineNumber = model.getPositionAt(parsedRequest.endOffset).lineNumber; } else { // if no end offset, try to find the line before the next request starts - const nextRequest = parsedRequests.at(index + 1); if (nextRequest) { const nextRequestStartLine = model.getPositionAt(nextRequest.startOffset).lineNumber; - endLineNumber = nextRequestStartLine - 1; + endLineNumber = + nextRequestStartLine > startLineNumber ? nextRequestStartLine - 1 : startLineNumber; } else { - // if there is no next request, take the last line of the model - endLineNumber = model.getLineCount(); + // if there is no next request, find the end of the text or the line that starts with a method + let nextLineNumber = model.getPositionAt(parsedRequest.startOffset).lineNumber + 1; + let nextLineContent: string; + while (nextLineNumber <= model.getLineCount()) { + nextLineContent = model.getLineContent(nextLineNumber).trim(); + if (nextLineContent.match(startsWithMethodRegex)) { + // found a line that starts with a method, stop iterating + break; + } + nextLineNumber++; + } + // nextLineNumber is now either the line with a method or 1 line after the end of the text + // set the end line for this request to the line before nextLineNumber + endLineNumber = nextLineNumber > startLineNumber ? nextLineNumber - 1 : startLineNumber; } } // if the end line is empty, go up to find the first non-empty line @@ -118,44 +130,6 @@ export const getRequestEndLineNumber = ( return endLineNumber; }; -const isJsonString = (str: string) => { - try { - JSON.parse(str); - } catch (e) { - return false; - } - return true; -}; - -/* - * Internal helpers - */ -const replaceVariables = ( - text: string, - variables: DevToolsVariable[], - isDataVariable: boolean -): string => { - const variableRegex = isDataVariable ? dataVariableTemplateRegex : urlVariableTemplateRegex; - if (variableRegex.test(text)) { - text = text.replaceAll(variableRegex, (match, key) => { - const variable = variables.find(({ name }) => name === key); - const value = variable?.value; - - if (isDataVariable && value) { - // If the variable value is an object, add it as it is. Otherwise, surround it with quotes. - return isJsonString(value) ? value : `"${value}"`; - } - - return value ?? match; - }); - } - return text; -}; - -const containsComments = (text: string) => { - return text.indexOf('//') >= 0 || text.indexOf('/*') >= 0; -}; - /** * This function takes a string containing unformatted Console requests and * returns a text in which the requests are auto-indented. @@ -184,19 +158,19 @@ export const getAutoIndentedRequests = ( ) { // Start of a request const requestLines = allTextLines.slice(request.startLineNumber - 1, request.endLineNumber); - - if (requestLines.some((line) => containsComments(line))) { - // If request has comments, add it as it is - without formatting - // TODO: Format requests with comments - formattedTextLines.push(...requestLines); + const firstLine = cleanUpWhitespaces(requestLines[0]); + formattedTextLines.push(firstLine); + const dataLines = requestLines.slice(1); + if (dataLines.some((line) => containsComments(line))) { + // If data has comments, add it as it is - without formatting + // TODO: Format requests with comments https://github.com/elastic/kibana/issues/182138 + formattedTextLines.push(...dataLines); } else { - // If no comments, add stringified parsed request - const stringifiedRequest = stringifyRequest(request); - const firstLine = stringifiedRequest.method + ' ' + stringifiedRequest.url; - formattedTextLines.push(firstLine); - - if (stringifiedRequest.data && stringifiedRequest.data.length > 0) { - formattedTextLines.push(...stringifiedRequest.data); + // If no comments, indent data + if (requestLines.length > 1) { + const dataString = dataLines.join('\n'); + const dataJsons = splitDataIntoJsonObjects(dataString); + formattedTextLines.push(...dataJsons.map(indentData)); } } @@ -205,10 +179,116 @@ export const getAutoIndentedRequests = ( } else { // Current line is a comment or whitespaces // Trim white spaces and add it to the formatted text - formattedTextLines.push(selectedTextLines[currentLineIndex].trim()); + formattedTextLines.push(cleanUpWhitespaces(selectedTextLines[currentLineIndex])); currentLineIndex++; } } return formattedTextLines.join('\n'); }; + +/* + * This function extracts a normalized method and url from the editor and + * the "raw" text of the request body without any changes to it. The only normalization + * for request body is to split several json objects into an array of strings. + */ +export const getRequestFromEditor = ( + model: monaco.editor.ITextModel, + startLineNumber: number, + endLineNumber: number +): EditorRequest | null => { + const methodUrlLine = model.getLineContent(startLineNumber).trim(); + if (!methodUrlLine) { + return null; + } + const { method, url } = parseLine(methodUrlLine, false); + if (!method || !url) { + return null; + } + const upperCaseMethod = method.toUpperCase(); + + if (endLineNumber <= startLineNumber) { + return { method: upperCaseMethod, url, data: [] }; + } + const dataString = model + .getValueInRange({ + startLineNumber: startLineNumber + 1, + startColumn: 1, + endLineNumber, + endColumn: model.getLineMaxColumn(endLineNumber), + }) + .trim(); + const data = splitDataIntoJsonObjects(dataString); + + return { method: upperCaseMethod, url, data }; +}; + +export const containsComments = (text: string) => { + return text.indexOf('//') >= 0 || text.indexOf('/*') >= 0; +}; + +export const indentData = (dataString: string): string => { + try { + const parsedData = parse(dataString); + + return JSON.stringify(parsedData, null, 2); + } catch (e) { + return dataString; + } +}; + +// ---------------------------------- Internal helpers ---------------------------------- + +const isJsonString = (str: string) => { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; +}; + +const replaceVariables = ( + text: string, + variables: DevToolsVariable[], + isDataVariable: boolean +): string => { + const variableRegex = isDataVariable ? dataVariableTemplateRegex : urlVariableTemplateRegex; + if (variableRegex.test(text)) { + text = text.replaceAll(variableRegex, (match, key) => { + const variable = variables.find(({ name }) => name === key); + const value = variable?.value; + + if (isDataVariable && value) { + // If the variable value is an object, add it as it is. Otherwise, surround it with quotes. + return isJsonString(value) ? value : `"${value}"`; + } + + return value ?? match; + }); + } + return text; +}; + +const splitDataIntoJsonObjects = (dataString: string): string[] => { + const jsonSplitRegex = /}\s*{/; + if (dataString.match(jsonSplitRegex)) { + return dataString.split(jsonSplitRegex).map((part, index, parts) => { + let restoredBracketsString = part; + // add an opening bracket to all parts except the 1st + if (index > 0) { + restoredBracketsString = `{${restoredBracketsString}`; + } + // add a closing bracket to all parts except the last + if (index < parts.length - 1) { + restoredBracketsString = `${restoredBracketsString}}`; + } + return restoredBracketsString; + }); + } + return [dataString]; +}; + +const cleanUpWhitespaces = (line: string): string => { + return line.trim().replaceAll(/\s+/g, ' '); +}; diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.test.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.test.ts index 702b9a589e662..4e7a383ceebf3 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.test.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { parseBody, removeTrailingWhitespaces, parseUrl } from './tokens_utils'; +import { parseBody, removeTrailingWhitespaces, parseUrl, parseLine } from './tokens_utils'; describe('tokens_utils', () => { describe('removeTrailingWhitespaces', () => { @@ -32,6 +32,53 @@ describe('tokens_utils', () => { }); }); + describe('parseLine', () => { + it('works with a comment', () => { + const { method, url } = parseLine('GET _search // a comment'); + expect(method).toBe('GET'); + expect(url).toBe('_search'); + }); + it('works with a url param', () => { + const { method, url, urlPathTokens, urlParamsTokens } = parseLine( + 'GET _search?query="test1 test2 test3" // comment' + ); + expect(method).toBe('GET'); + expect(url).toBe('_search?query="test1 test2 test3"'); + expect(urlPathTokens).toEqual(['_search']); + expect(urlParamsTokens[0]).toEqual(['query', '"test1 test2 test3"']); + }); + it('works with multiple whitespaces', () => { + const { method, url, urlPathTokens, urlParamsTokens } = parseLine( + ' GET _search?query="test1 test2 test3" // comment' + ); + expect(method).toBe('GET'); + expect(url).toBe('_search?query="test1 test2 test3"'); + expect(urlPathTokens).toEqual(['_search']); + expect(urlParamsTokens[0]).toEqual(['query', '"test1 test2 test3"']); + }); + it('normalizes the method to upper case', () => { + const { method, url, urlPathTokens, urlParamsTokens } = parseLine('Get _'); + expect(method).toBe('GET'); + expect(url).toBe('_'); + expect(urlPathTokens).toEqual(['_']); + expect(urlParamsTokens).toEqual([]); + }); + it('correctly parses the line when the url is empty, no whitespace', () => { + const { method, url, urlPathTokens, urlParamsTokens } = parseLine('GET'); + expect(method).toBe('GET'); + expect(url).toBe(''); + expect(urlPathTokens).toEqual([]); + expect(urlParamsTokens).toEqual([]); + }); + it('correctly parses the line when the url is empty, with whitespace', () => { + const { method, url, urlPathTokens, urlParamsTokens } = parseLine('GET '); + expect(method).toBe('GET'); + expect(url).toBe(''); + expect(urlPathTokens).toEqual([]); + expect(urlParamsTokens).toEqual([]); + }); + }); + describe('parseBody', () => { const testCases: Array<{ value: string; tokens: string[] }> = [ { diff --git a/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.ts b/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.ts index 2615bd2c45d74..8e9c723c8f7a2 100644 --- a/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.ts +++ b/src/plugins/console/public/application/containers/editor/monaco/utils/tokens_utils.ts @@ -19,18 +19,25 @@ import { /* * This function parses a line with the method and url. * The url is parsed into path and params, each parsed into tokens. - * Returns method, urlPathTokens and urlParamsTokens which are arrays of strings. + * Returns method, url, urlPathTokens and urlParamsTokens which are arrays of strings. */ -export const parseLine = (line: string): ParsedLineTokens => { - // try to parse into method and url (split on whitespace) - const parts = line.split(whitespacesRegex); +export const parseLine = (line: string, parseUrlIntoTokens: boolean = true): ParsedLineTokens => { + line = line.trim(); + const firstWhitespaceIndex = line.indexOf(' '); + if (firstWhitespaceIndex < 0) { + // there is no url, only method + return { method: line, url: '', urlPathTokens: [], urlParamsTokens: [] }; + } // 1st part is the method - const method = parts[0].toUpperCase(); + const method = line.slice(0, firstWhitespaceIndex).trim().toUpperCase(); // 2nd part is the url - const url = parts[1]; - // try to parse into url path and url params (split on question mark) - const { urlPathTokens, urlParamsTokens } = parseUrl(url); - return { method, urlPathTokens, urlParamsTokens }; + const url = removeTrailingWhitespaces(line.slice(firstWhitespaceIndex).trim()); + if (parseUrlIntoTokens) { + // try to parse into url path and url params (split on question mark) + const { urlPathTokens, urlParamsTokens } = parseUrl(url); + return { method, url, urlPathTokens, urlParamsTokens }; + } + return { method, url, urlPathTokens: [], urlParamsTokens: [] }; }; /* @@ -444,6 +451,7 @@ export const containsUrlParams = (lineContent: string): boolean => { */ interface ParsedLineTokens { method: string; + url: string; urlPathTokens: string[]; urlParamsTokens: string[][]; } diff --git a/src/plugins/console/public/plugin.ts b/src/plugins/console/public/plugin.ts index 2728629d288b8..27b8fc1af8ccf 100644 --- a/src/plugins/console/public/plugin.ts +++ b/src/plugins/console/public/plugin.ts @@ -26,6 +26,7 @@ import { EmbeddableConsoleInfo, createStorage, setStorage, + httpService, } from './services'; export class ConsoleUIPlugin @@ -52,6 +53,7 @@ export class ConsoleUIPlugin dev: { enableMonaco: isMonacoEnabled }, } = this.ctx.config.get(); + httpService.setup(http); this.autocompleteInfo.setup(http); setAutocompleteInfo(this.autocompleteInfo); diff --git a/src/plugins/console/public/services/api.ts b/src/plugins/console/public/services/api.ts new file mode 100644 index 0000000000000..77b84b1483c8a --- /dev/null +++ b/src/plugins/console/public/services/api.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { sendRequest } from './use_request'; +import type { EditorRequest } from '../application/containers/editor/monaco/types'; + +export async function convertRequestToLanguage({ + requests, + language, + esHost, +}: { + language: string; + esHost: string; + requests: EditorRequest[]; +}) { + return sendRequest({ + path: `/api/console/convert_request_to_language`, + method: 'post', + query: { language, esHost }, + body: requests, + }); +} diff --git a/src/plugins/console/public/services/http.ts b/src/plugins/console/public/services/http.ts new file mode 100644 index 0000000000000..afcf5595c55cf --- /dev/null +++ b/src/plugins/console/public/services/http.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 { HttpSetup } from '@kbn/core/public'; + +export class HttpService { + private client: any; + + public setup(httpClient: HttpSetup): void { + this.client = httpClient; + } + + public get httpClient(): HttpSetup { + return this.client; + } +} + +export const httpService = new HttpService(); diff --git a/src/plugins/console/public/services/index.ts b/src/plugins/console/public/services/index.ts index 669ed890729dc..43b603b82b3d6 100644 --- a/src/plugins/console/public/services/index.ts +++ b/src/plugins/console/public/services/index.ts @@ -17,3 +17,6 @@ export { ENTITIES, } from './autocomplete'; export { EmbeddableConsoleInfo } from './embeddable_console'; +export { httpService } from './http'; + +export { convertRequestToLanguage } from './api'; diff --git a/src/plugins/console/public/services/storage.ts b/src/plugins/console/public/services/storage.ts index b38cc2925dfb1..b211724e08872 100644 --- a/src/plugins/console/public/services/storage.ts +++ b/src/plugins/console/public/services/storage.ts @@ -15,6 +15,7 @@ export enum StorageKeys { WIDTH = 'widths', FOLDS = 'folds', VARIABLES = 'variables', + DEFAULT_LANGUAGE = 'defaultLanguage', } export class Storage { diff --git a/src/plugins/console/public/services/use_request.ts b/src/plugins/console/public/services/use_request.ts new file mode 100644 index 0000000000000..bb8926ef04454 --- /dev/null +++ b/src/plugins/console/public/services/use_request.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 { + SendRequestConfig, + SendRequestResponse, + sendRequest as _sendRequest, + Error, +} from '../shared_imports'; + +import { httpService } from './http'; + +export const sendRequest = ( + config: SendRequestConfig +): Promise> => { + return _sendRequest(httpService.httpClient, config); +}; diff --git a/src/plugins/console/public/shared_imports.ts b/src/plugins/console/public/shared_imports.ts index 779a2b9ee1c0a..88c162bbbf48c 100644 --- a/src/plugins/console/public/shared_imports.ts +++ b/src/plugins/console/public/shared_imports.ts @@ -15,3 +15,9 @@ export { sendRequest, collapseLiteralStrings, expandLiteralStrings }; export { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; export { toMountPoint } from '@kbn/react-kibana-mount'; + +export type { + SendRequestConfig, + SendRequestResponse, + Error, +} from '@kbn/es-ui-shared-plugin/public'; diff --git a/src/plugins/console/server/routes/api/__mocks__/request.mock.ts b/src/plugins/console/server/routes/api/__mocks__/request.mock.ts new file mode 100644 index 0000000000000..b3809ce432ce3 --- /dev/null +++ b/src/plugins/console/server/routes/api/__mocks__/request.mock.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. + */ + +export const createRequestMock = (opts?: { + headers?: any; + params?: Record; + query?: Record; + body?: Record; +}) => { + return Object.assign({ headers: {} }, opts || {}); +}; diff --git a/src/plugins/console/server/routes/api/__mocks__/routes.mock.ts b/src/plugins/console/server/routes/api/__mocks__/routes.mock.ts new file mode 100644 index 0000000000000..9aeff818b6715 --- /dev/null +++ b/src/plugins/console/server/routes/api/__mocks__/routes.mock.ts @@ -0,0 +1,52 @@ +/* + * 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 { AwaitedProperties } from '@kbn/utility-types'; +import { RequestHandler, RequestHandlerContext } from '@kbn/core/server'; +import { + elasticsearchServiceMock, + savedObjectsClientMock, + deprecationsServiceMock, +} from '@kbn/core/server/mocks'; + +export const savedObjectsClient = savedObjectsClientMock.create(); +export const routeHandlerContextMock = { + core: { + elasticsearch: { + client: elasticsearchServiceMock.createScopedClusterClient(), + }, + savedObjects: { getClient: () => savedObjectsClient }, + deprecations: { client: deprecationsServiceMock.createClient() }, + }, +} as unknown as AwaitedProperties; + +export const createMockRouter = () => { + const paths: Record>> = {}; + + const assign = + (method: string) => + ({ path }: { path: string }, handler: RequestHandler) => { + paths[method] = { + ...(paths[method] || {}), + ...{ [path]: handler }, + }; + }; + + return { + getHandler({ method, pathPattern }: { method: string; pathPattern: string }) { + return paths[method][pathPattern]; + }, + get: assign('get'), + post: assign('post'), + put: assign('put'), + patch: assign('patch'), + delete: assign('delete'), + }; +}; + +export type MockRouter = ReturnType; diff --git a/src/plugins/console/server/routes/api/console/convert_request_to_language/convert_request_handler.test.ts b/src/plugins/console/server/routes/api/console/convert_request_to_language/convert_request_handler.test.ts new file mode 100644 index 0000000000000..ec567c8e20f82 --- /dev/null +++ b/src/plugins/console/server/routes/api/console/convert_request_to_language/convert_request_handler.test.ts @@ -0,0 +1,90 @@ +/* + * 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 { kibanaResponseFactory } from '@kbn/core/server'; +import { createMockRouter, MockRouter, routeHandlerContextMock } from '../../__mocks__/routes.mock'; +import { createRequestMock } from '../../__mocks__/request.mock'; +import { handleEsError } from '../../../../shared_imports'; + +import { registerConvertRequestRoute } from '.'; + +jest.mock('@elastic/request-converter', () => ({ + convertRequests: (request: string, language: string, options: any) => { + return Promise.resolve({ + converted: true, + meta: { + request, + language, + options, + }, + }); + }, +})); + +describe('Console convert request to language route', () => { + let mockRouter: MockRouter; + let routeDependencies: any; + + beforeEach(() => { + mockRouter = createMockRouter(); + routeDependencies = { + router: mockRouter, + lib: { handleEsError }, + }; + registerConvertRequestRoute(routeDependencies); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe('GET /api/console/convert_request_to_language', () => { + it('Correctly validates url validation config', async () => { + const resp = await routeDependencies.router.getHandler({ + method: 'post', + pathPattern: '/api/console/convert_request_to_language', + })( + routeHandlerContextMock, + createRequestMock({ + query: { + method: 'PUT', + path: '_ingest/geoip/database/geoip2_enterprise', + language: 'javascript', + esHost: 'http://localhost:9200', + }, + body: [ + '{\n "name": "GeoIP2-Enterprise",\n "maxmind": {\n "account_id": "1234567"\n }\n}', + ], + }), + kibanaResponseFactory + ); + + expect(resp.status).toEqual(200); + expect(resp.payload.converted).toBe(true); + }); + + it('Throws error if some params are missing', async () => { + const resp = await routeDependencies.router.getHandler({ + method: 'post', + pathPattern: '/api/console/convert_request_to_language', + })( + routeHandlerContextMock, + createRequestMock({ + query: { + method: 'GET', + path: '_ingest/geoip/database/geoip2_enterprise', + esHost: 'http://localhost:9200', + }, + }), + kibanaResponseFactory + ); + + expect(resp.status).toEqual(200); + }); + }); +}); diff --git a/src/plugins/console/server/routes/api/console/convert_request_to_language/index.ts b/src/plugins/console/server/routes/api/console/convert_request_to_language/index.ts new file mode 100644 index 0000000000000..5dac3eb15d668 --- /dev/null +++ b/src/plugins/console/server/routes/api/console/convert_request_to_language/index.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 { RequestHandler } from '@kbn/core/server'; +import { schema, TypeOf } from '@kbn/config-schema'; +import { convertRequests } from '@elastic/request-converter'; +import { RouteDependencies } from '../../..'; + +import { acceptedHttpVerb, nonEmptyString } from '../proxy/validation_config'; + +const routeValidationConfig = { + query: schema.object({ + language: schema.string(), + esHost: schema.string(), + }), + body: schema.maybe( + schema.arrayOf( + schema.object({ + method: acceptedHttpVerb, + url: nonEmptyString, + data: schema.arrayOf(schema.string()), + }) + ) + ), +}; + +export type Query = TypeOf; +export type Body = TypeOf; + +export const registerConvertRequestRoute = ({ + router, + lib: { handleEsError }, +}: RouteDependencies) => { + const handler: RequestHandler = async (ctx, req, response) => { + const { body, query } = req; + const { language, esHost } = query; + + try { + // Iterate over each request and build all the requests into a single string + // that can be passed to the request-converter library + let devtoolsScript = ''; + (body || []).forEach((request) => { + devtoolsScript += `${request.method} ${request.url}\n` as string; + if (request.data && request.data.length > 0) { + // We dont care about newlines in the data passed to the request-converter + // since the library will format the data anyway. + // This is specifically important as they rely requests using the ndjson format. + devtoolsScript += request.data.map((data) => data.replaceAll('\n', ' ')).join('\n'); + } + }); + + const codeSnippet = await convertRequests(devtoolsScript, language, { + checkOnly: false, + printResponse: true, + complete: true, + elasticsearchUrl: esHost, + }); + + return response.ok({ + body: codeSnippet as string, + }); + } catch (error) { + return handleEsError({ error, response }); + } + }; + + router.post( + { + path: '/api/console/convert_request_to_language', + validate: routeValidationConfig, + }, + handler + ); +}; diff --git a/src/plugins/console/server/routes/api/console/proxy/validation_config.ts b/src/plugins/console/server/routes/api/console/proxy/validation_config.ts index 9a3ee2efd66c1..129ff1df7f691 100644 --- a/src/plugins/console/server/routes/api/console/proxy/validation_config.ts +++ b/src/plugins/console/server/routes/api/console/proxy/validation_config.ts @@ -11,7 +11,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export type Query = TypeOf; export type Body = TypeOf; -const acceptedHttpVerb = schema.string({ +export const acceptedHttpVerb = schema.string({ validate: (method) => { return ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH'].some( (verb) => verb.toLowerCase() === method.toLowerCase() @@ -21,7 +21,7 @@ const acceptedHttpVerb = schema.string({ }, }); -const nonEmptyString = schema.string({ +export const nonEmptyString = schema.string({ validate: (s) => (s === '' ? 'Expected non-empty string' : undefined), }); diff --git a/src/plugins/console/server/routes/index.ts b/src/plugins/console/server/routes/index.ts index e1a036f55a62c..033659a62e441 100644 --- a/src/plugins/console/server/routes/index.ts +++ b/src/plugins/console/server/routes/index.ts @@ -18,6 +18,7 @@ import { registerEsConfigRoute } from './api/console/es_config'; import { registerProxyRoute } from './api/console/proxy'; import { registerSpecDefinitionsRoute } from './api/console/spec_definitions'; import { registerAutocompleteEntitiesRoute } from './api/console/autocomplete_entities'; +import { registerConvertRequestRoute } from './api/console/convert_request_to_language'; export interface ProxyDependencies { readLegacyESConfig: () => Promise; @@ -44,4 +45,5 @@ export const registerRoutes = (dependencies: RouteDependencies) => { registerProxyRoute(dependencies); registerSpecDefinitionsRoute(dependencies); registerAutocompleteEntitiesRoute(dependencies); + registerConvertRequestRoute(dependencies); }; diff --git a/src/plugins/content_management/common/rpc/constants.ts b/src/plugins/content_management/common/rpc/constants.ts index 0a04ae308899b..08bc8dcb45152 100644 --- a/src/plugins/content_management/common/rpc/constants.ts +++ b/src/plugins/content_management/common/rpc/constants.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; export const procedureNames = [ 'get', diff --git a/src/plugins/content_management/kibana.jsonc b/src/plugins/content_management/kibana.jsonc index 73878817d9d20..7ebfe75180658 100644 --- a/src/plugins/content_management/kibana.jsonc +++ b/src/plugins/content_management/kibana.jsonc @@ -6,6 +6,9 @@ "plugin": { "id": "contentManagement", "server": true, - "browser": true + "browser": true, + "optionalPlugins": [ + "usageCollection" + ] } } diff --git a/src/plugins/content_management/public/content_client/content_client.tsx b/src/plugins/content_management/public/content_client/content_client.tsx index caf7181472f03..e4c4323ff2e9e 100644 --- a/src/plugins/content_management/public/content_client/content_client.tsx +++ b/src/plugins/content_management/public/content_client/content_client.tsx @@ -7,7 +7,7 @@ */ import { QueryClient } from '@tanstack/react-query'; -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; import type { Version } from '@kbn/object-versioning'; import { createQueryObservable } from './query_observable'; import type { CrudClient } from '../crud_client'; diff --git a/src/plugins/content_management/public/registry/registry.ts b/src/plugins/content_management/public/registry/registry.ts index 97020f205843f..8f44c7fc42ddc 100644 --- a/src/plugins/content_management/public/registry/registry.ts +++ b/src/plugins/content_management/public/registry/registry.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; import type { ContentTypeDefinition } from './content_type_definition'; import { ContentType } from './content_type'; diff --git a/src/plugins/content_management/server/plugin.test.ts b/src/plugins/content_management/server/plugin.test.ts index d79bb7e827553..4c0e15553b6c8 100644 --- a/src/plugins/content_management/server/plugin.test.ts +++ b/src/plugins/content_management/server/plugin.test.ts @@ -80,14 +80,15 @@ const setup = () => { ...coreSetup, http, }, + pluginsSetup: {}, }; }; describe('ContentManagementPlugin', () => { describe('setup()', () => { test('should expose the core API', () => { - const { plugin, coreSetup } = setup(); - const api = plugin.setup(coreSetup); + const { plugin, coreSetup, pluginsSetup } = setup(); + const api = plugin.setup(coreSetup, pluginsSetup); expect(Object.keys(api).sort()).toEqual(['crud', 'eventBus', 'register']); expect(api.crud('')).toBe('mockedCrud'); @@ -97,8 +98,8 @@ describe('ContentManagementPlugin', () => { describe('RPC', () => { test('should create a rpc POST HTTP route on the router', () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [routeConfig]: Parameters = (router.post as jest.Mock).mock.calls[0]; @@ -106,8 +107,8 @@ describe('ContentManagementPlugin', () => { }); test('should register all the procedures in the RPC service and the route handler must send to each procedure the core request context + the request body as input', async () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [_, handler]: Parameters = (router.post as jest.Mock).mock.calls[0]; @@ -150,8 +151,8 @@ describe('ContentManagementPlugin', () => { }); test('should return error in custom error format', async () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [_, handler]: Parameters = (router.post as jest.Mock).mock.calls[0]; diff --git a/src/plugins/content_management/server/plugin.ts b/src/plugins/content_management/server/plugin.ts index de56805ed50de..db8a15f84a51c 100755 --- a/src/plugins/content_management/server/plugin.ts +++ b/src/plugins/content_management/server/plugin.ts @@ -59,7 +59,7 @@ export class ContentManagementPlugin }); } - public setup(core: CoreSetup) { + public setup(core: CoreSetup, plugins: ContentManagementServerSetupDependencies) { if (this.#eventStream) { this.#eventStream.setup({ core }); } @@ -75,7 +75,7 @@ export class ContentManagementPlugin contentRegistry, }); - registerFavorites({ core, logger: this.logger }); + registerFavorites({ core, logger: this.logger, usageCollection: plugins.usageCollection }); return { ...coreApi, diff --git a/src/plugins/content_management/server/types.ts b/src/plugins/content_management/server/types.ts index dbc401807975d..3209b6616d1c8 100644 --- a/src/plugins/content_management/server/types.ts +++ b/src/plugins/content_management/server/types.ts @@ -7,10 +7,12 @@ */ import type { Version } from '@kbn/object-versioning'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import type { CoreApi, StorageContextGetTransformFn } from './core'; -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ContentManagementServerSetupDependencies {} +export interface ContentManagementServerSetupDependencies { + usageCollection?: UsageCollectionSetup; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ContentManagementServerStartDependencies {} diff --git a/src/plugins/content_management/tsconfig.json b/src/plugins/content_management/tsconfig.json index fbbe897292ded..bba887cd887b1 100644 --- a/src/plugins/content_management/tsconfig.json +++ b/src/plugins/content_management/tsconfig.json @@ -17,6 +17,8 @@ "@kbn/saved-objects-settings", "@kbn/core-http-server", "@kbn/content-management-favorites-server", + "@kbn/usage-collection-plugin", + "@kbn/object-versioning-utils", ], "exclude": [ "target/**/*", diff --git a/src/plugins/controls/common/options_list/types.ts b/src/plugins/controls/common/options_list/types.ts index 4192cc6aac26d..f84b1a85f857f 100644 --- a/src/plugins/controls/common/options_list/types.ts +++ b/src/plugins/controls/common/options_list/types.ts @@ -81,6 +81,7 @@ export interface OptionsListRequestBody > { runtimeFieldMap?: Record; allowExpensiveQueries: boolean; + ignoreValidations?: boolean; filters?: Array<{ bool: BoolQuery }>; runPastTimeout?: boolean; searchString?: string; diff --git a/src/plugins/controls/public/index.ts b/src/plugins/controls/public/index.ts index 310ded6083cfe..d6aace06d527e 100644 --- a/src/plugins/controls/public/index.ts +++ b/src/plugins/controls/public/index.ts @@ -19,6 +19,7 @@ export type { DataControlFactory, DataControlServices, } from './react_controls/controls/data_controls/types'; +export { controlGroupStateBuilder } from './react_controls/control_group/control_group_state_builder'; /** * TODO: remove all exports below this when control group embeddable is removed diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx index 486978b63ec5e..f0398d1bf60fd 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx @@ -157,7 +157,7 @@ export const OptionsListPopoverSuggestions = ({ }, [loadMoreSuggestions, totalCardinality]); const renderOption = useCallback( - (option, searchStringValue) => { + (option: EuiSelectableOption, searchStringValue: string) => { if (!allowExpensiveQueries || searchTechnique === 'exact') return option.label; return ( diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx index 72c891444081a..c825e9021b48d 100644 --- a/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx +++ b/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx @@ -7,6 +7,7 @@ */ import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { css } from '@emotion/react'; import { BehaviorSubject } from 'rxjs'; import { DndContext, @@ -24,14 +25,7 @@ import { SortableContext, sortableKeyboardCoordinates, } from '@dnd-kit/sortable'; -import { - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiLoadingChart, - EuiPanel, - EuiToolTip, -} from '@elastic/eui'; +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiToolTip } from '@elastic/eui'; import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; import { ControlStyle } from '../../..'; import { ControlsInOrder } from '../init_controls_manager'; @@ -114,8 +108,15 @@ export function ControlGroup({ ); }, [hasUnappliedSelections, applySelections]); + if (controlsInOrder.length === 0) { + return null; + } + return ( - {!isInitialized && } setDraggingId(`${active.id}`)} @@ -167,7 +167,7 @@ export function ControlGroup({ - {isInitialized && !autoApplySelections && ( + {!autoApplySelections && ( {hasUnappliedSelections ? ( ApplyButtonComponent diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_group_editor.test.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_group_editor.test.tsx new file mode 100644 index 0000000000000..99feed42d0857 --- /dev/null +++ b/src/plugins/controls/public/react_controls/control_group/components/control_group_editor.test.tsx @@ -0,0 +1,50 @@ +/* + * 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 { BehaviorSubject } from 'rxjs'; +import { render } from '@testing-library/react'; +import { ControlGroupEditor } from './control_group_editor'; +import { ControlGroupApi, ControlStyle, ParentIgnoreSettings } from '../../..'; +import { ControlGroupChainingSystem, DEFAULT_CONTROL_STYLE } from '../../../../common'; +import { DefaultControlApi } from '../../controls/types'; + +describe('render', () => { + const children$ = new BehaviorSubject<{ [key: string]: DefaultControlApi }>({}); + const props = { + api: { + children$, + } as unknown as ControlGroupApi, + onCancel: () => {}, + onSave: () => {}, + onDeleteAll: () => {}, + stateManager: { + chainingSystem: new BehaviorSubject('HIERARCHICAL'), + labelPosition: new BehaviorSubject(DEFAULT_CONTROL_STYLE), + autoApplySelections: new BehaviorSubject(true), + ignoreParentSettings: new BehaviorSubject(undefined), + }, + }; + + beforeEach(() => { + children$.next({}); + }); + + test('should not display delete all controls button when there are no controls', () => { + const editor = render(); + expect(editor.queryByTestId('delete-all-controls-button')).not.toBeInTheDocument(); + }); + + test('should display delete all controls button when there are controls', () => { + children$.next({ + alpha: {} as unknown as DefaultControlApi, + }); + const editor = render(); + expect(editor.queryByTestId('delete-all-controls-button')).toBeInTheDocument(); + }); +}); diff --git a/src/plugins/controls/public/react_controls/control_group/control_group_editor.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_group_editor.tsx similarity index 95% rename from src/plugins/controls/public/react_controls/control_group/control_group_editor.tsx rename to src/plugins/controls/public/react_controls/control_group/components/control_group_editor.tsx index 9c8ca5b52b0ae..a65c8c1ac5bba 100644 --- a/src/plugins/controls/public/react_controls/control_group/control_group_editor.tsx +++ b/src/plugins/controls/public/react_controls/control_group/components/control_group_editor.tsx @@ -27,11 +27,11 @@ import { } from '@elastic/eui'; import { css } from '@emotion/react'; import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; -import { ControlStyle, ParentIgnoreSettings } from '../..'; +import { ControlStyle, ParentIgnoreSettings } from '../../..'; -import { ControlStateManager } from '../controls/types'; -import { ControlGroupStrings } from './control_group_strings'; -import { ControlGroupApi, ControlGroupEditorState } from './types'; +import { ControlStateManager } from '../../controls/types'; +import { ControlGroupStrings } from '../control_group_strings'; +import { ControlGroupApi, ControlGroupEditorState } from '../types'; const CONTROL_LAYOUT_OPTIONS = [ { @@ -46,7 +46,7 @@ const CONTROL_LAYOUT_OPTIONS = [ }, ]; -interface EditControlGroupProps { +interface Props { onCancel: () => void; onSave: () => void; onDeleteAll: () => void; @@ -54,13 +54,7 @@ interface EditControlGroupProps { api: ControlGroupApi; // controls must always have a parent API } -export const ControlGroupEditor = ({ - onCancel, - onSave, - onDeleteAll, - stateManager, - api, -}: EditControlGroupProps) => { +export const ControlGroupEditor = ({ onCancel, onSave, onDeleteAll, stateManager, api }: Props) => { const [ children, selectedLabelPosition, diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_panel.test.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_panel.test.tsx new file mode 100644 index 0000000000000..34d3f344b1a81 --- /dev/null +++ b/src/plugins/controls/public/react_controls/control_group/components/control_panel.test.tsx @@ -0,0 +1,106 @@ +/* + * 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, { useImperativeHandle } from 'react'; +import { BehaviorSubject } from 'rxjs'; +import { render, waitFor } from '@testing-library/react'; +import { ControlPanel } from './control_panel'; +import { registry as presentationUtilServicesRegistry } from '@kbn/presentation-util-plugin/public/services/plugin_services.story'; +import { pluginServices as presentationUtilPluginServices } from '@kbn/presentation-util-plugin/public/services'; +import { ControlStyle, ControlWidth } from '../../..'; + +describe('render', () => { + let mockApi = {}; + const Component = React.forwardRef((_, ref) => { + // expose the api into the imperative handle + useImperativeHandle(ref, () => mockApi, []); + + return
; + }) as any; + + beforeAll(() => { + presentationUtilServicesRegistry.start({}); + presentationUtilPluginServices.setRegistry(presentationUtilServicesRegistry); + presentationUtilPluginServices.getServices().uiActions.getTriggerCompatibleActions = jest + .fn() + .mockImplementation(() => { + return [ + { + isCompatible: jest.fn().mockResolvedValue(true), + id: 'testAction', + MenuItem: () =>
test1
, + }, + ]; + }); + }); + + beforeEach(() => { + mockApi = {}; + }); + + describe('control width', () => { + test('defaults to medium and grow enabled', async () => { + const controlPanel = render(); + await waitFor(() => { + const controlFrame = controlPanel.getByTestId('control-frame'); + expect(controlFrame.getAttribute('class')).toContain('controlFrameWrapper--medium'); + expect(controlFrame.getAttribute('class')).toContain('controlFrameWrapper--grow'); + }); + }); + + test('should use small class when using small width', async () => { + mockApi = { + uuid: 'control1', + width: new BehaviorSubject('small'), + }; + const controlPanel = render(); + await waitFor(() => { + const controlFrame = controlPanel.getByTestId('control-frame'); + expect(controlFrame.getAttribute('class')).toContain('controlFrameWrapper--small'); + }); + }); + }); + + describe('label position', () => { + test('should use one line layout class when using one line layout', async () => { + mockApi = { + uuid: 'control1', + parentApi: { + labelPosition: new BehaviorSubject('oneLine'), + }, + }; + const controlPanel = render(); + await waitFor(() => { + const floatingActions = controlPanel.getByTestId( + 'presentationUtil__floatingActions__control1' + ); + expect(floatingActions.getAttribute('class')).toContain( + 'controlFrameFloatingActions--oneLine' + ); + }); + }); + + test('should use two line layout class when using two line layout', async () => { + mockApi = { + uuid: 'control1', + parentApi: { + labelPosition: new BehaviorSubject('twoLine'), + }, + }; + const controlPanel = render(); + await waitFor(() => { + const floatingActions = controlPanel.getByTestId( + 'presentationUtil__floatingActions__control1' + ); + expect(floatingActions.getAttribute('class')).toContain( + 'controlFrameFloatingActions--twoLine' + ); + }); + }); + }); +}); diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx index b83b0b464b5c5..9ed24904f25cd 100644 --- a/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx +++ b/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx @@ -27,7 +27,7 @@ import { useBatchedOptionalPublishingSubjects, } from '@kbn/presentation-publishing'; import { FloatingActions } from '@kbn/presentation-util-plugin/public'; -import { DEFAULT_CONTROL_WIDTH } from '../../../../common'; +import { DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH } from '../../../../common'; import { ControlPanelProps, DefaultControlApi } from '../../controls/types'; import { ControlError } from './control_error'; @@ -121,17 +121,18 @@ export const ControlPanel = , + controlState: DefaultDataControlState, + controlId?: string + ) => { + controlGroupState.initialChildControlState = { + ...(controlGroupState.initialChildControlState ?? {}), + [controlId ?? uuidv4()]: { + type: await getCompatibleControlType(controlState.dataViewId, controlState.fieldName), + order: getNextControlOrder(controlGroupState.initialChildControlState), + ...controlState, + }, + }; + }, + addOptionsListControl: ( + controlGroupState: Partial, + controlState: OptionsListControlState, + controlId?: string + ) => { + controlGroupState.initialChildControlState = { + ...(controlGroupState.initialChildControlState ?? {}), + [controlId ?? uuidv4()]: { + type: OPTIONS_LIST_CONTROL, + order: getNextControlOrder(controlGroupState.initialChildControlState), + ...controlState, + }, + }; + }, + addRangeSliderControl: ( + controlGroupState: Partial, + controlState: RangesliderControlState, + controlId?: string + ) => { + controlGroupState.initialChildControlState = { + ...(controlGroupState.initialChildControlState ?? {}), + [controlId ?? uuidv4()]: { + type: RANGE_SLIDER_CONTROL, + order: getNextControlOrder(controlGroupState.initialChildControlState), + ...controlState, + }, + }; + }, + addTimeSliderControl: ( + controlGroupState: Partial, + controlId?: string + ) => { + controlGroupState.initialChildControlState = { + ...(controlGroupState.initialChildControlState ?? {}), + [controlId ?? uuidv4()]: { + type: TIME_SLIDER_CONTROL, + order: getNextControlOrder(controlGroupState.initialChildControlState), + width: 'large', + }, + }; + }, +}; + +async function getCompatibleControlType(dataViewId: string, fieldName: string) { + const dataView = await pluginServices.getServices().dataViews.get(dataViewId); + const fieldRegistry = await getDataControlFieldRegistry(dataView); + const field = fieldRegistry[fieldName]; + if (field.compatibleControlTypes.length === 0) { + throw new Error(`No compatible control type found for field: ${fieldName}`); + } + return field.compatibleControlTypes[0]; +} + +function getNextControlOrder(controlPanelsState?: ControlPanelsState) { + if (!controlPanelsState) { + return 0; + } + + const values = Object.values(controlPanelsState); + + if (values.length === 0) { + return 0; + } + + let highestOrder = 0; + values.forEach((controlPanelState) => { + if (controlPanelState.order > highestOrder) { + highestOrder = controlPanelState.order; + } + }); + return highestOrder + 1; +} diff --git a/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx b/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx index 00a1978bb2679..45802689e81a1 100644 --- a/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx +++ b/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx @@ -27,11 +27,8 @@ import { apiPublishesReload } from '@kbn/presentation-publishing/interfaces/fetc import { ControlStyle, ParentIgnoreSettings } from '../..'; import { ControlGroupChainingSystem, - ControlWidth, CONTROL_GROUP_TYPE, - DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_STYLE, - DEFAULT_CONTROL_WIDTH, } from '../../../common'; import { chaining$, controlFetch$, controlGroupFetch$ } from './control_fetch'; import { initControlsManager } from './init_controls_manager'; @@ -64,8 +61,6 @@ export const getControlGroupEmbeddableFactory = (services: { ) => { const { initialChildControlState, - defaultControlGrow, - defaultControlWidth, labelPosition: initialLabelPosition, chainingSystem, autoApplySelections, @@ -73,7 +68,13 @@ export const getControlGroupEmbeddableFactory = (services: { } = initialRuntimeState; const autoApplySelections$ = new BehaviorSubject(autoApplySelections); - const controlsManager = initControlsManager(initialChildControlState); + const parentDataViewId = apiPublishesDataViews(parentApi) + ? parentApi.dataViews.value?.[0]?.id + : undefined; + const controlsManager = initControlsManager( + initialChildControlState, + parentDataViewId ?? (await services.dataViews.getDefaultId()) + ); const selectionsManager = initSelectionsManager({ ...controlsManager.api, autoApplySelections$, @@ -83,12 +84,6 @@ export const getControlGroupEmbeddableFactory = (services: { const ignoreParentSettings$ = new BehaviorSubject( ignoreParentSettings ); - const grow = new BehaviorSubject( - defaultControlGrow === undefined ? DEFAULT_CONTROL_GROW : defaultControlGrow - ); - const width = new BehaviorSubject( - defaultControlWidth ?? DEFAULT_CONTROL_WIDTH - ); const labelPosition$ = new BehaviorSubject( // TODO: Rename `ControlStyle` initialLabelPosition ?? DEFAULT_CONTROL_STYLE // TODO: Rename `DEFAULT_CONTROL_STYLE` ); @@ -169,12 +164,9 @@ export const getControlGroupEmbeddableFactory = (services: { controlInputTransform: (state) => state, }; openDataControlEditor({ - initialState: { - grow: api.grow.getValue(), - width: api.width.getValue(), - }, + initialState: controlsManager.getNewControlState(), onSave: ({ type: controlType, state: initialState }) => { - api.addNewPanel({ + controlsManager.api.addNewPanel({ panelType: controlType, initialState: controlInputTransform!( initialState as Partial, @@ -199,8 +191,6 @@ export const getControlGroupEmbeddableFactory = (services: { references, }; }, - grow, - width, dataViews, labelPosition: labelPosition$, saveNotification$: apiHasSaveNotification(parentApi) diff --git a/src/plugins/controls/public/react_controls/control_group/init_controls_manager.test.ts b/src/plugins/controls/public/react_controls/control_group/init_controls_manager.test.ts index 451681fe5b3fd..3e381123ecd9a 100644 --- a/src/plugins/controls/public/react_controls/control_group/init_controls_manager.test.ts +++ b/src/plugins/controls/public/react_controls/control_group/init_controls_manager.test.ts @@ -6,20 +6,27 @@ * Side Public License, v 1. */ +import { DefaultDataControlState } from '../controls/data_controls/types'; import { DefaultControlApi } from '../controls/types'; -import { initControlsManager } from './init_controls_manager'; +import { initControlsManager, getLastUsedDataViewId } from './init_controls_manager'; +import { ControlPanelState } from './types'; jest.mock('uuid', () => ({ v4: jest.fn().mockReturnValue('delta'), })); +const DEFAULT_DATA_VIEW_ID = 'myDataView'; + describe('PresentationContainer api', () => { test('addNewPanel should add control at end of controls', async () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 0 }, - bravo: { type: 'testControl', order: 1 }, - charlie: { type: 'testControl', order: 2 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 0 }, + bravo: { type: 'testControl', order: 1 }, + charlie: { type: 'testControl', order: 2 }, + }, + DEFAULT_DATA_VIEW_ID + ); const addNewPanelPromise = controlsManager.api.addNewPanel({ panelType: 'testControl', initialState: {}, @@ -35,11 +42,14 @@ describe('PresentationContainer api', () => { }); test('removePanel should remove control', () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 0 }, - bravo: { type: 'testControl', order: 1 }, - charlie: { type: 'testControl', order: 2 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 0 }, + bravo: { type: 'testControl', order: 1 }, + charlie: { type: 'testControl', order: 2 }, + }, + DEFAULT_DATA_VIEW_ID + ); controlsManager.api.removePanel('bravo'); expect(controlsManager.controlsInOrder$.value.map((element) => element.id)).toEqual([ 'alpha', @@ -48,11 +58,14 @@ describe('PresentationContainer api', () => { }); test('replacePanel should replace control', async () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 0 }, - bravo: { type: 'testControl', order: 1 }, - charlie: { type: 'testControl', order: 2 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 0 }, + bravo: { type: 'testControl', order: 1 }, + charlie: { type: 'testControl', order: 2 }, + }, + DEFAULT_DATA_VIEW_ID + ); const replacePanelPromise = controlsManager.api.replacePanel('bravo', { panelType: 'testControl', initialState: {}, @@ -68,10 +81,13 @@ describe('PresentationContainer api', () => { describe('untilInitialized', () => { test('should not resolve until all controls are initialized', async () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 0 }, - bravo: { type: 'testControl', order: 1 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 0 }, + bravo: { type: 'testControl', order: 1 }, + }, + DEFAULT_DATA_VIEW_ID + ); let isDone = false; controlsManager.api.untilInitialized().then(() => { isDone = true; @@ -89,10 +105,13 @@ describe('PresentationContainer api', () => { }); test('should resolve when all control already initialized ', async () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 0 }, - bravo: { type: 'testControl', order: 1 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 0 }, + bravo: { type: 'testControl', order: 1 }, + }, + DEFAULT_DATA_VIEW_ID + ); controlsManager.setControlApi('alpha', {} as unknown as DefaultControlApi); controlsManager.setControlApi('bravo', {} as unknown as DefaultControlApi); @@ -109,10 +128,13 @@ describe('PresentationContainer api', () => { describe('snapshotControlsRuntimeState', () => { test('should snapshot runtime state for all controls', async () => { - const controlsManager = initControlsManager({ - alpha: { type: 'testControl', order: 1 }, - bravo: { type: 'testControl', order: 0 }, - }); + const controlsManager = initControlsManager( + { + alpha: { type: 'testControl', order: 1 }, + bravo: { type: 'testControl', order: 0 }, + }, + DEFAULT_DATA_VIEW_ID + ); controlsManager.setControlApi('alpha', { snapshotRuntimeState: () => { return { key1: 'alpha value' }; @@ -137,3 +159,81 @@ describe('snapshotControlsRuntimeState', () => { }); }); }); + +describe('getLastUsedDataViewId', () => { + test('should return last used data view id', () => { + const dataViewId = getLastUsedDataViewId( + [ + { id: 'alpha', type: 'testControl' }, + { id: 'bravo', type: 'testControl' }, + { id: 'charlie', type: 'testControl' }, + ], + { + alpha: { dataViewId: '1', type: 'testControl', order: 0 }, + bravo: { dataViewId: '2', type: 'testControl', order: 1 }, + charlie: { type: 'testControl', order: 2 }, + } + ); + expect(dataViewId).toBe('2'); + }); + + test('should return undefined when there are no controls', () => { + const dataViewId = getLastUsedDataViewId([], {}); + expect(dataViewId).toBeUndefined(); + }); + + test('should return undefined when there are no controls with data views', () => { + const dataViewId = getLastUsedDataViewId([{ id: 'alpha', type: 'testControl' }], { + alpha: { type: 'testControl', order: 0 }, + }); + expect(dataViewId).toBeUndefined(); + }); +}); + +describe('getNewControlState', () => { + test('should contain defaults when there are no existing controls', () => { + const controlsManager = initControlsManager({}, DEFAULT_DATA_VIEW_ID); + expect(controlsManager.getNewControlState()).toEqual({ + grow: true, + width: 'medium', + dataViewId: DEFAULT_DATA_VIEW_ID, + }); + }); + + test('should start with defaults if there are existing controls', () => { + const controlsManager = initControlsManager( + { + alpha: { + type: 'testControl', + order: 1, + dataViewId: 'myOtherDataViewId', + width: 'small', + grow: false, + } as ControlPanelState & Pick, + }, + DEFAULT_DATA_VIEW_ID + ); + expect(controlsManager.getNewControlState()).toEqual({ + grow: true, + width: 'medium', + dataViewId: 'myOtherDataViewId', + }); + }); + + test('should contain values of last added control', () => { + const controlsManager = initControlsManager({}, DEFAULT_DATA_VIEW_ID); + controlsManager.api.addNewPanel({ + panelType: 'testControl', + initialState: { + grow: false, + width: 'small', + dataViewId: 'myOtherDataViewId', + }, + }); + expect(controlsManager.getNewControlState()).toEqual({ + grow: false, + width: 'small', + dataViewId: 'myOtherDataViewId', + }); + }); +}); diff --git a/src/plugins/controls/public/react_controls/control_group/init_controls_manager.ts b/src/plugins/controls/public/react_controls/control_group/init_controls_manager.ts index d9eccfa126a8a..07b533f329631 100644 --- a/src/plugins/controls/public/react_controls/control_group/init_controls_manager.ts +++ b/src/plugins/controls/public/react_controls/control_group/init_controls_manager.ts @@ -18,9 +18,11 @@ import { BehaviorSubject, first, merge } from 'rxjs'; import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing'; import { omit } from 'lodash'; import { apiHasSnapshottableState } from '@kbn/presentation-containers/interfaces/serialized_state'; -import { ControlPanelsState, ControlPanelState } from './types'; +import { ControlGroupApi, ControlPanelsState, ControlPanelState } from './types'; import { DefaultControlApi, DefaultControlState } from '../controls/types'; import { ControlGroupComparatorState } from './control_group_unsaved_changes_api'; +import { DefaultDataControlState } from '../controls/data_controls/types'; +import { ControlWidth, DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH } from '../../../common'; export type ControlsInOrder = Array<{ id: string; type: string }>; @@ -35,7 +37,10 @@ export function getControlsInOrder(initialControlPanelsState: ControlPanelsState .map(({ id, type }) => ({ id, type })); // filter out `order` } -export function initControlsManager(initialControlPanelsState: ControlPanelsState) { +export function initControlsManager( + initialControlPanelsState: ControlPanelsState, + defaultDataViewId: string | null +) { const lastSavedControlsPanelState$ = new BehaviorSubject(initialControlPanelsState); const initialControlIds = Object.keys(initialControlPanelsState); const children$ = new BehaviorSubject<{ [key: string]: DefaultControlApi }>({}); @@ -45,6 +50,13 @@ export function initControlsManager(initialControlPanelsState: ControlPanelsStat const controlsInOrder$ = new BehaviorSubject( getControlsInOrder(initialControlPanelsState) ); + const lastUsedDataViewId$ = new BehaviorSubject( + getLastUsedDataViewId(controlsInOrder$.value, initialControlPanelsState) ?? + defaultDataViewId ?? + undefined + ); + const lastUsedWidth$ = new BehaviorSubject(DEFAULT_CONTROL_WIDTH); + const lastUsedGrow$ = new BehaviorSubject(DEFAULT_CONTROL_GROW); function untilControlLoaded( id: string @@ -79,6 +91,16 @@ export function initControlsManager(initialControlPanelsState: ControlPanelsStat { panelType, initialState }: PanelPackage, index: number ) { + if ((initialState as DefaultDataControlState)?.dataViewId) { + lastUsedDataViewId$.next((initialState as DefaultDataControlState).dataViewId); + } + if (initialState?.width) { + lastUsedWidth$.next(initialState.width); + } + if (typeof initialState?.grow === 'boolean') { + lastUsedGrow$.next(initialState.grow); + } + const id = generateId(); const nextControlsInOrder = [...controlsInOrder$.value]; nextControlsInOrder.splice(index, 0, { @@ -98,6 +120,13 @@ export function initControlsManager(initialControlPanelsState: ControlPanelsStat return { controlsInOrder$, + getNewControlState: () => { + return { + grow: lastUsedGrow$.value, + width: lastUsedWidth$.value, + dataViewId: lastUsedDataViewId$.value, + }; + }, getControlApi, setControlApi: (uuid: string, controlApi: DefaultControlApi) => { children$.next({ @@ -196,7 +225,8 @@ export function initControlsManager(initialControlPanelsState: ControlPanelsStat }); }, } as PresentationContainer & - HasSerializedChildState & { untilInitialized: () => Promise }, + HasSerializedChildState & + Pick, comparators: { controlsInOrder: [ controlsInOrder$, @@ -222,3 +252,21 @@ export function initControlsManager(initialControlPanelsState: ControlPanelsStat >, }; } + +export function getLastUsedDataViewId( + controlsInOrder: ControlsInOrder, + initialControlPanelsState: ControlPanelsState< + ControlPanelState & Partial + > +) { + let dataViewId: string | undefined; + for (let i = controlsInOrder.length - 1; i >= 0; i--) { + const controlId = controlsInOrder[i].id; + const controlState = initialControlPanelsState[controlId]; + if (controlState?.dataViewId) { + dataViewId = controlState.dataViewId; + break; + } + } + return dataViewId; +} diff --git a/src/plugins/controls/public/react_controls/control_group/open_edit_control_group_flyout.tsx b/src/plugins/controls/public/react_controls/control_group/open_edit_control_group_flyout.tsx index 06ab4c063b5c0..c636d37ade6b2 100644 --- a/src/plugins/controls/public/react_controls/control_group/open_edit_control_group_flyout.tsx +++ b/src/plugins/controls/public/react_controls/control_group/open_edit_control_group_flyout.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { BehaviorSubject } from 'rxjs'; import { ControlStateManager } from '../controls/types'; -import { ControlGroupEditor } from './control_group_editor'; +import { ControlGroupEditor } from './components/control_group_editor'; import { ControlGroupApi, ControlGroupEditorState } from './types'; export const openEditControlGroupFlyout = ( diff --git a/src/plugins/controls/public/react_controls/control_group/serialization_utils.ts b/src/plugins/controls/public/react_controls/control_group/serialization_utils.ts index f57fbd801804f..eb3706c3913a1 100644 --- a/src/plugins/controls/public/react_controls/control_group/serialization_utils.ts +++ b/src/plugins/controls/public/react_controls/control_group/serialization_utils.ts @@ -8,7 +8,6 @@ import { SerializedPanelState } from '@kbn/presentation-containers'; import { omit } from 'lodash'; -import { DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH } from '../../../common'; import { ControlGroupRuntimeState, ControlGroupSerializedState } from './types'; export const deserializeControlGroup = ( @@ -46,7 +45,5 @@ export const deserializeControlGroup = ( ? !state.rawState.showApplySelections : false, // Rename "showApplySelections" to "autoApplySelections" labelPosition: state.rawState.controlStyle, // Rename "controlStyle" to "labelPosition" - defaultControlGrow: DEFAULT_CONTROL_GROW, - defaultControlWidth: DEFAULT_CONTROL_WIDTH, }; }; diff --git a/src/plugins/controls/public/react_controls/control_group/types.ts b/src/plugins/controls/public/react_controls/control_group/types.ts index 0ff6e31faeee6..d009712e52a5b 100644 --- a/src/plugins/controls/public/react_controls/control_group/types.ts +++ b/src/plugins/controls/public/react_controls/control_group/types.ts @@ -31,21 +31,17 @@ import { PublishesReload } from '@kbn/presentation-publishing/interfaces/fetch/p import { ParentIgnoreSettings } from '../..'; import { ControlInputTransform } from '../../../common'; import { ControlGroupChainingSystem } from '../../../common/control_group/types'; -import { ControlStyle, ControlWidth } from '../../types'; -import { DefaultControlState, PublishesControlDisplaySettings } from '../controls/types'; +import { ControlStyle } from '../../types'; +import { DefaultControlState } from '../controls/types'; import { ControlFetchContext } from './control_fetch/control_fetch'; -/** The control display settings published by the control group are the "default" */ -type PublishesControlGroupDisplaySettings = PublishesControlDisplaySettings & { - labelPosition: PublishingSubject; -}; export interface ControlPanelsState { [panelId: string]: ControlState; } export type ControlGroupUnsavedChanges = Omit< ControlGroupRuntimeState, - 'initialChildControlState' | 'defaultControlGrow' | 'defaultControlWidth' + 'initialChildControlState' > & { filters: Filter[] | undefined; }; @@ -60,7 +56,6 @@ export type ControlGroupApi = PresentationContainer & HasEditCapabilities & PublishesDataLoading & Pick & - PublishesControlGroupDisplaySettings & PublishesTimeslice & Partial & HasSaveNotification & PublishesReload> & { asyncResetUnsavedChanges: () => Promise; @@ -73,12 +68,11 @@ export type ControlGroupApi = PresentationContainer & openAddDataControlFlyout: (settings?: { controlInputTransform?: ControlInputTransform; }) => void; + labelPosition: PublishingSubject; }; export interface ControlGroupRuntimeState { chainingSystem: ControlGroupChainingSystem; - defaultControlGrow?: boolean; - defaultControlWidth?: ControlWidth; labelPosition: ControlStyle; // TODO: Rename this type to ControlLabelPosition autoApplySelections: boolean; ignoreParentSettings?: ParentIgnoreSettings; diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.test.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.test.tsx index 9b5798efdc220..58715f6b2305e 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.test.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.test.tsx @@ -25,7 +25,6 @@ jest.mock('../../control_factory_registry', () => ({ import { DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH } from '../../../../common'; import { ControlGroupApi } from '../../control_group/types'; import { DataControlEditor } from './data_control_editor'; -import { DataControlEditorState } from './open_data_control_editor'; import { getMockedOptionsListControlFactory, getMockedRangeSliderControlFactory, @@ -57,7 +56,6 @@ mockDataViews.get = jest.fn().mockResolvedValue(mockDataView); const dashboardApi = { timeRange$: new BehaviorSubject(undefined), - lastUsedDataViewId$: new BehaviorSubject(mockDataView.id!), }; const controlGroupApi = { parentApi: dashboardApi, @@ -68,8 +66,14 @@ const controlGroupApi = { describe('Data control editor', () => { const mountComponent = async ({ initialState, + controlId, + controlType, + initialDefaultPanelTitle, }: { - initialState?: Partial; + initialState?: Partial; + controlId?: string; + controlType?: string; + initialDefaultPanelTitle?: string; }) => { mockDataViews.get = jest.fn().mockResolvedValue(mockDataView); @@ -78,11 +82,14 @@ describe('Data control editor', () => { {}} onSave={() => {}} - parentApi={controlGroupApi} + controlGroupApi={controlGroupApi} initialState={{ - dataViewId: dashboardApi.lastUsedDataViewId$.getValue(), + dataViewId: mockDataView.id, ...initialState, }} + controlId={controlId} + controlType={controlType} + initialDefaultPanelTitle={initialDefaultPanelTitle} services={{ dataViews: mockDataViews }} /> @@ -238,11 +245,11 @@ describe('Data control editor', () => { test('auto-fills input with the default title', async () => { const controlEditor = await mountComponent({ initialState: { - controlType: 'optionsList', - controlId: 'testId', fieldName: 'machine.os.raw', - defaultPanelTitle: 'OS', }, + controlType: 'optionsList', + controlId: 'testId', + initialDefaultPanelTitle: 'OS', }); const titleInput = await controlEditor.findByTestId('control-editor-title-input'); expect(titleInput.getAttribute('value')).toBe('OS'); @@ -252,11 +259,11 @@ describe('Data control editor', () => { test('auto-fills input with the custom title', async () => { const controlEditor = await mountComponent({ initialState: { - controlType: 'optionsList', - controlId: 'testId', fieldName: 'machine.os.raw', title: 'Custom title', }, + controlType: 'optionsList', + controlId: 'testId', }); const titleInput = await controlEditor.findByTestId('control-editor-title-input'); expect(titleInput.getAttribute('value')).toBe('Custom title'); @@ -267,10 +274,10 @@ describe('Data control editor', () => { test('selects the provided control type', async () => { const controlEditor = await mountComponent({ initialState: { - controlType: 'rangeSlider', - controlId: 'testId', fieldName: 'bytes', }, + controlType: 'rangeSlider', + controlId: 'testId', }); expect(controlEditor.getByTestId('create__optionsList')).toBeEnabled(); diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.tsx index 701d8c1d85391..d26d156d1e09a 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/data_control_editor.tsx @@ -32,7 +32,6 @@ import { } from '@elastic/eui'; import { DataViewField } from '@kbn/data-views-plugin/common'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; import { LazyDataViewPicker, LazyFieldPicker, @@ -46,14 +45,18 @@ import { getAllControlTypes, getControlFactory } from '../../control_factory_reg import { ControlGroupApi } from '../../control_group/types'; import { DataControlEditorStrings } from './data_control_constants'; import { getDataControlFieldRegistry } from './data_control_editor_utils'; -import { DataControlEditorState } from './open_data_control_editor'; import { DataControlFactory, DefaultDataControlState, isDataControlFactory } from './types'; -export interface ControlEditorProps { - initialState: State; - parentApi: ControlGroupApi; // controls must always have a parent API - onCancel: (newState: State) => void; - onSave: (newState: State, type: string) => void; +export interface ControlEditorProps< + State extends DefaultDataControlState = DefaultDataControlState +> { + initialState: Partial; + controlType?: string; + controlId?: string; + initialDefaultPanelTitle?: string; + controlGroupApi: ControlGroupApi; // controls must always have a parent API + onCancel: (newState: Partial) => void; + onSave: (newState: Partial, type: string) => void; services: { dataViews: DataViewsPublicPluginStart; }; @@ -130,27 +133,23 @@ const CompatibleControlTypesComponent = ({ ); }; -export const DataControlEditor = ({ +export const DataControlEditor = ({ initialState, + controlId, + controlType, + initialDefaultPanelTitle, onSave, onCancel, - parentApi: controlGroup, + controlGroupApi, /** TODO: These should not be props */ services: { dataViews: dataViewService }, }: ControlEditorProps) => { - const [defaultGrow, defaultWidth] = useBatchedPublishingSubjects( - controlGroup.grow, - controlGroup.width - // controlGroup.parentApi?.lastUsedDataViewId, // TODO: Make this work - ); - const [editorState, setEditorState] = useState(initialState); + const [editorState, setEditorState] = useState>(initialState); const [defaultPanelTitle, setDefaultPanelTitle] = useState( - initialState.defaultPanelTitle ?? initialState.fieldName ?? '' + initialDefaultPanelTitle ?? initialState.fieldName ?? '' ); const [panelTitle, setPanelTitle] = useState(initialState.title ?? defaultPanelTitle); - const [selectedControlType, setSelectedControlType] = useState( - initialState.controlType - ); + const [selectedControlType, setSelectedControlType] = useState(controlType); const [controlOptionsValid, setControlOptionsValid] = useState(true); /** TODO: Make `editorConfig` work when refactoring the `ControlGroupRenderer` */ @@ -209,22 +208,22 @@ export const DataControlEditor = setEditorState({ ...editorState, ...newState })} setControlEditorValid={setControlOptionsValid} - parentApi={controlGroup} + controlGroupApi={controlGroupApi} /> ); - }, [fieldRegistry, selectedControlType, initialState, editorState, controlGroup]); + }, [fieldRegistry, selectedControlType, initialState, editorState, controlGroupApi]); return ( <>

- {!initialState.controlId // if no ID, then we are creating a new control + {!controlId // if no ID, then we are creating a new control ? DataControlEditorStrings.manageControl.getFlyoutCreateTitle() : DataControlEditorStrings.manageControl.getFlyoutEditTitle()}

@@ -364,7 +363,7 @@ export const DataControlEditor = setEditorState({ ...editorState, width: newWidth as ControlWidth }) } @@ -373,10 +372,7 @@ export const DataControlEditor = setEditorState({ ...editorState, grow: !editorState.grow })} data-test-subj="control-editor-grow-switch" /> @@ -385,7 +381,7 @@ export const DataControlEditor = {CustomSettingsComponent} - {initialState.controlId && ( + {controlId && ( <> { onCancel(initialState); // don't want to show "lost changes" warning - controlGroup.removePanel(initialState.controlId!); + controlGroupApi.removePanel(controlId!); }} > {DataControlEditorStrings.manageControl.getDeleteButtonTitle()} diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/initialize_data_control.ts b/src/plugins/controls/public/react_controls/controls/data_controls/initialize_data_control.ts index 12bfba658c9f5..312701dd22c32 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/initialize_data_control.ts +++ b/src/plugins/controls/public/react_controls/controls/data_controls/initialize_data_control.ts @@ -36,7 +36,7 @@ export const initializeDataControl = ( * responsible for managing */ editorStateManager: ControlStateManager, - controlGroup: ControlGroupApi, + controlGroupApi: ControlGroupApi, services: { core: CoreStart; dataViews: DataViewsPublicPluginStart; @@ -159,22 +159,24 @@ export const initializeDataControl = ( (Object.keys(initialState) as Array).forEach( (key) => { if (!isEqual(mergedStateManager[key].getValue(), newState[key])) { - mergedStateManager[key].next(newState[key]); + mergedStateManager[key].next( + newState[key] as DefaultDataControlState & EditorState[typeof key] + ); } } ); } else { // replace the control with a new one of the updated type - controlGroup.replacePanel(controlId, { panelType: newType, initialState: newState }); + controlGroupApi.replacePanel(controlId, { panelType: newType, initialState: newState }); } }, initialState: { ...initialState, - controlType, - controlId, - defaultPanelTitle: defaultPanelTitle.getValue(), }, - controlGroupApi: controlGroup, + controlType, + controlId, + initialDefaultPanelTitle: defaultPanelTitle.getValue(), + controlGroupApi, }); }; diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/open_data_control_editor.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/open_data_control_editor.tsx index fbddf0e7af831..4aadfbb78deff 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/open_data_control_editor.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/open_data_control_editor.tsx @@ -20,23 +20,22 @@ import { ControlGroupApi } from '../../control_group/types'; import { DataControlEditor } from './data_control_editor'; import { DefaultDataControlState } from './types'; -export type DataControlEditorState = Partial & { - fieldName?: string; - controlType?: string; - controlId?: string; - defaultPanelTitle?: string; -}; - export const openDataControlEditor = < - State extends DataControlEditorState = DataControlEditorState + State extends DefaultDataControlState = DefaultDataControlState >({ initialState, + controlType, + controlId, + initialDefaultPanelTitle, onSave, controlGroupApi, services, }: { - initialState: State; - onSave: ({ type, state }: { type: string; state: State }) => void; + initialState: Partial; + controlType?: string; + controlId?: string; + initialDefaultPanelTitle?: string; + onSave: ({ type, state }: { type: string; state: Partial }) => void; controlGroupApi: ControlGroupApi; services: { core: CoreStart; @@ -50,7 +49,7 @@ export const openDataControlEditor = < overlayRef.close(); }; - const onCancel = (newState: State, overlay: OverlayRef) => { + const onCancel = (newState: Partial, overlay: OverlayRef) => { if (deepEqual(initialState, newState)) { closeOverlay(overlay); return; @@ -83,8 +82,11 @@ export const openDataControlEditor = < const overlay = services.core.overlays.openFlyout( toMountPoint( - parentApi={controlGroupApi} + controlGroupApi={controlGroupApi} initialState={initialState} + controlType={controlType} + controlId={controlId} + initialDefaultPanelTitle={initialDefaultPanelTitle} onCancel={(state) => { onCancel(state, overlay); }} diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.test.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.test.tsx index f463400b351c8..a8cd948c511c4 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.test.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.test.tsx @@ -34,9 +34,9 @@ describe('Options list sorting button', () => { const mountComponent = ({ initialState, field, - parentApi = getMockedControlGroupApi(), + controlGroupApi = getMockedControlGroupApi(), }: Pick & { - parentApi?: ControlGroupApi; + controlGroupApi?: ControlGroupApi; }) => { const component = render( { field={field} updateState={updateState} setControlEditorValid={jest.fn()} - parentApi={parentApi} + controlGroupApi={controlGroupApi} /> ); return component; @@ -85,7 +85,7 @@ describe('Options list sorting button', () => { const component = mountComponent({ initialState: getMockedState(), field: { type: 'string' } as DataViewField, - parentApi: controlGroupApi, + controlGroupApi, }); expect( component.queryByTestId('optionsListControl__searchOptionsRadioGroup') @@ -152,14 +152,14 @@ describe('Options list sorting button', () => { describe('responds to field type changing', () => { test('reset back to initial state when valid', async () => { const initialState = getMockedState({ searchTechnique: 'exact' }); - const parentApi = getMockedControlGroupApi(); + const controlGroupApi = getMockedControlGroupApi(); const component = render( ); @@ -175,7 +175,7 @@ describe('Options list sorting button', () => { field={{ type: 'ip' } as DataViewField} // initial search technique IS valid updateState={jest.fn()} setControlEditorValid={jest.fn()} - parentApi={parentApi} + controlGroupApi={controlGroupApi} /> ); @@ -187,14 +187,14 @@ describe('Options list sorting button', () => { test('if the current selection is valid, send that to the parent editor state', async () => { const initialState = getMockedState(); - const parentApi = getMockedControlGroupApi(); + const controlGroupApi = getMockedControlGroupApi(); const component = render( ); @@ -218,7 +218,7 @@ describe('Options list sorting button', () => { field={{ type: 'number' } as DataViewField} // current selected search technique IS valid, initial state is not updateState={jest.fn()} setControlEditorValid={jest.fn()} - parentApi={parentApi} + controlGroupApi={controlGroupApi} /> ); @@ -227,14 +227,14 @@ describe('Options list sorting button', () => { test('if neither the initial or current search technique is valid, revert to the default', async () => { const initialState = getMockedState({ searchTechnique: 'wildcard' }); - const parentApi = getMockedControlGroupApi(); + const controlGroupApi = getMockedControlGroupApi(); const component = render( ); @@ -250,7 +250,7 @@ describe('Options list sorting button', () => { field={{ type: 'number' } as DataViewField} // neither initial nor current search technique is valid updateState={jest.fn()} setControlEditorValid={jest.fn()} - parentApi={parentApi} + controlGroupApi={controlGroupApi} /> ); diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.tsx index e749973c99f74..48ac94c46236c 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_editor_options.tsx @@ -71,9 +71,11 @@ export const OptionsListEditorOptions = ({ initialState, field, updateState, - parentApi, + controlGroupApi, }: CustomOptionsComponentProps) => { - const allowExpensiveQueries = useStateFromPublishingSubject(parentApi.allowExpensiveQueries$); + const allowExpensiveQueries = useStateFromPublishingSubject( + controlGroupApi.allowExpensiveQueries$ + ); const [singleSelect, setSingleSelect] = useState(initialState.singleSelect ?? false); const [runPastTimeout, setRunPastTimeout] = useState( diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/fetch_and_validate.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/fetch_and_validate.tsx index f3633b13d3d1a..c03acb4fceafa 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/fetch_and_validate.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/fetch_and_validate.tsx @@ -55,6 +55,7 @@ export function fetchAndValidate$({ api.field$, api.controlFetch$, api.parentApi.allowExpensiveQueries$, + api.parentApi.ignoreParentSettings$, api.debouncedSearchString, stateManager.sort, stateManager.searchTechnique, @@ -86,6 +87,7 @@ export function fetchAndValidate$({ field, controlFetchContext, allowExpensiveQueries, + ignoreParentSettings, searchString, sort, searchTechnique, @@ -116,6 +118,7 @@ export function fetchAndValidate$({ field: field.toSpec(), size: requestSize, allowExpensiveQueries, + ignoreValidations: ignoreParentSettings?.ignoreValidations, ...controlFetchContext, }; diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/options_list_fetch_cache.ts b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/options_list_fetch_cache.ts index 6a4bc779a61a2..4e6e0aa779b48 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/options_list_fetch_cache.ts +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/options_list_fetch_cache.ts @@ -51,6 +51,7 @@ export class OptionsListFetchCache { runPastTimeout, selectedOptions, searchTechnique, + ignoreValidations, field: { name: fieldName }, dataView: { title: dataViewTitle }, } = request; @@ -67,6 +68,7 @@ export class OptionsListFetchCache { query, sort, searchTechnique, + ignoreValidations, runPastTimeout, dataViewTitle, searchString: searchString ?? '', diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx index 110de033520de..72a754c4fabf4 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx @@ -243,7 +243,7 @@ describe('RangesliderControlApi', () => { field={{} as DataViewField} updateState={jest.fn()} setControlEditorValid={jest.fn()} - parentApi={controlGroupApi} + controlGroupApi={controlGroupApi} /> ); expect( @@ -260,7 +260,7 @@ describe('RangesliderControlApi', () => { field={{} as DataViewField} updateState={jest.fn()} setControlEditorValid={setControlEditorValid} - parentApi={controlGroupApi} + controlGroupApi={controlGroupApi} /> ); diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/types.ts b/src/plugins/controls/public/react_controls/controls/data_controls/types.ts index 07025d6380071..5bff65081441f 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/types.ts +++ b/src/plugins/controls/public/react_controls/controls/data_controls/types.ts @@ -38,11 +38,11 @@ export type DataControlApi = DefaultControlApi & export interface CustomOptionsComponentProps< State extends DefaultDataControlState = DefaultDataControlState > { - initialState: Omit; + initialState: Partial; field: DataViewField; updateState: (newState: Partial) => void; setControlEditorValid: (valid: boolean) => void; - parentApi: ControlGroupApi; + controlGroupApi: ControlGroupApi; } export interface DataControlFactory< diff --git a/src/plugins/controls/public/react_controls/controls/types.ts b/src/plugins/controls/public/react_controls/controls/types.ts index d89db77e1f53b..2d71ae0dd1298 100644 --- a/src/plugins/controls/public/react_controls/controls/types.ts +++ b/src/plugins/controls/public/react_controls/controls/types.ts @@ -26,11 +26,6 @@ import { CanClearSelections, ControlWidth } from '../../types'; import { ControlGroupApi } from '../control_group/types'; -export interface PublishesControlDisplaySettings { - grow: PublishingSubject; - width: PublishingSubject; -} - export interface HasCustomPrepend { CustomPrependComponent: React.FC<{}>; } @@ -38,7 +33,6 @@ export interface HasCustomPrepend { export type DefaultControlApi = PublishesDataLoading & PublishesBlockingError & PublishesUnsavedChanges & - PublishesControlDisplaySettings & Partial & CanClearSelections & HasType & @@ -51,6 +45,8 @@ export type DefaultControlApi = PublishesDataLoading & /** TODO: Make these non-public as part of https://github.com/elastic/kibana/issues/174961 */ setDataLoading: (loading: boolean) => void; setBlockingError: (error: Error | undefined) => void; + grow: PublishingSubject; + width: PublishingSubject; }; export interface DefaultControlState { diff --git a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts index b31c4feb6bf0f..abe6cb536289b 100644 --- a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts +++ b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts @@ -48,6 +48,7 @@ export const setupOptionsListSuggestionsRoute = ( filters: schema.maybe(schema.any()), fieldSpec: schema.maybe(schema.any()), allowExpensiveQueries: schema.boolean(), + ignoreValidations: schema.maybe(schema.boolean()), searchString: schema.maybe(schema.string()), searchTechnique: schema.maybe( schema.oneOf([ @@ -102,7 +103,7 @@ export const setupOptionsListSuggestionsRoute = ( /** * Build ES Query */ - const { runPastTimeout, filters, runtimeFieldMap } = request; + const { runPastTimeout, filters, runtimeFieldMap, ignoreValidations } = request; const { terminateAfter, timeout } = getAutocompleteSettings(); const timeoutSettings = runPastTimeout ? {} @@ -112,7 +113,9 @@ export const setupOptionsListSuggestionsRoute = ( const validationBuilder = getValidationAggregationBuilder(); const suggestionAggregation: any = suggestionBuilder.buildAggregation(request) ?? {}; - const validationAggregation: any = validationBuilder.buildAggregation(request); + const validationAggregation: any = ignoreValidations + ? {} + : validationBuilder.buildAggregation(request); const body: SearchRequest['body'] = { size: 0, @@ -141,7 +144,9 @@ export const setupOptionsListSuggestionsRoute = ( */ const results = suggestionBuilder.parse(rawEsResult, request); const totalCardinality = results.totalCardinality; - const invalidSelections = validationBuilder.parse(rawEsResult, request); + const invalidSelections = ignoreValidations + ? [] + : validationBuilder.parse(rawEsResult, request); return { suggestions: results.suggestions, diff --git a/src/plugins/dashboard/common/content_management/v1/index.ts b/src/plugins/dashboard/common/content_management/v1/index.ts index 4fb96a584691e..72271a64a3e57 100644 --- a/src/plugins/dashboard/common/content_management/v1/index.ts +++ b/src/plugins/dashboard/common/content_management/v1/index.ts @@ -13,10 +13,3 @@ export type { DashboardAttributes, SavedDashboardPanel, } from './types'; - -export { - serviceDefinition, - dashboardSavedObjectSchema, - controlGroupInputSchema, - dashboardAttributesSchema, -} from './cm_services'; diff --git a/src/plugins/dashboard/common/content_management/v2/index.ts b/src/plugins/dashboard/common/content_management/v2/index.ts index 15105c60d5aba..27ba4a2c2ef61 100644 --- a/src/plugins/dashboard/common/content_management/v2/index.ts +++ b/src/plugins/dashboard/common/content_management/v2/index.ts @@ -6,11 +6,5 @@ * Side Public License, v 1. */ -export { - serviceDefinition, - dashboardSavedObjectSchema, - dashboardAttributesSchema, -} from './cm_services'; - export type { GridData, DashboardItem, SavedDashboardPanel } from '../v1/types'; // no changes made to types from v1 to v2 export type { DashboardCrudTypes, DashboardAttributes } from './types'; diff --git a/src/plugins/dashboard/common/content_management/v2/types.ts b/src/plugins/dashboard/common/content_management/v2/types.ts index dcb45f9b44c54..3ecee5fe8f43e 100644 --- a/src/plugins/dashboard/common/content_management/v2/types.ts +++ b/src/plugins/dashboard/common/content_management/v2/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { +import type { ContentManagementCrudTypes, SavedObjectCreateOptions, SavedObjectUpdateOptions, diff --git a/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts b/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts index c58fa0cf828df..80e5208d63ea9 100644 --- a/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts +++ b/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts @@ -26,9 +26,13 @@ export const dashboardReadonlyBadge = { }; export const dashboardManagedBadge = { - getTooltip: () => - i18n.translate('dashboard.badge.managed.tooltip', { - defaultMessage: 'Elastic manages this dashboard. Clone it to make changes.', + getDuplicateButtonAriaLabel: () => + i18n.translate('dashboard.managedContentPopoverFooterText', { + defaultMessage: 'Click here to duplicate this dashboard', + }), + getBadgeAriaLabel: () => + i18n.translate('dashboard.managedContentBadge.ariaLabel', { + defaultMessage: 'Elastic manages this dashboard. Duplicate it to make changes.', }), }; diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx index 066ee2a018221..1bcea2b0c4ee1 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx @@ -18,19 +18,18 @@ import { topNavStrings } from '../_dashboard_app_strings'; import { ShowShareModal } from './share/show_share_modal'; import { pluginServices } from '../../services/plugin_services'; import { CHANGE_CHECK_DEBOUNCE } from '../../dashboard_constants'; -import { DashboardRedirect } from '../../dashboard_container/types'; -import { SaveDashboardReturn } from '../../services/dashboard_content_management/types'; import { confirmDiscardUnsavedChanges } from '../../dashboard_listing/confirm_overlays'; +import { SaveDashboardReturn } from '../../services/dashboard_content_management/types'; export const useDashboardMenuItems = ({ - redirectTo, isLabsShown, setIsLabsShown, + maybeRedirect, showResetChange, }: { - redirectTo: DashboardRedirect; isLabsShown: boolean; setIsLabsShown: Dispatch>; + maybeRedirect: (result?: SaveDashboardReturn) => void; showResetChange?: boolean; }) => { const [isSaveInProgress, setIsSaveInProgress] = useState(false); @@ -78,22 +77,6 @@ export const useDashboardMenuItems = ({ [dashboardTitle, hasUnsavedChanges, lastSavedId, dashboard] ); - const maybeRedirect = useCallback( - (result?: SaveDashboardReturn) => { - if (!result) return; - const { redirectRequired, id } = result; - if (redirectRequired) { - redirectTo({ - id, - editMode: true, - useReplace: true, - destination: 'dashboard', - }); - } - }, - [redirectTo] - ); - /** * Save the dashboard without any UI or popups. */ diff --git a/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx b/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx index 339d4d4bda10b..750056691cfb5 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx @@ -24,6 +24,8 @@ import { EuiTitle, EuiCallOut, EuiSwitch, + EuiText, + EuiIconTip, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { DashboardContainerInput } from '../../../../common'; @@ -269,12 +271,47 @@ export const DashboardSettings = ({ onClose }: DashboardSettingsProps) => { <> + {i18n.translate( + 'dashboard.embeddableApi.showSettings.flyout.form.syncColorsBetweenPanelsSwitchLabel', + { + defaultMessage: 'Sync color palettes across panels', + } + )}{' '} + + {i18n.translate('dashboard.palettes.defaultPaletteLabel', { + defaultMessage: 'Default', + })} + + ), + compatibility: ( + + {i18n.translate('dashboard.palettes.kibanaPaletteLabel', { + defaultMessage: 'Compatibility', + })} + + ), + }} + /> + } + iconProps={{ + className: 'eui-alignTop', + }} + position="top" + size="s" + type="questionInCircle" + /> + + } checked={dashboardSettingsState.syncColors} onChange={(event) => updateDashboardSetting({ syncColors: event.target.checked })} data-test-subj="dashboardSyncColorsCheckbox" diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/run_save_functions.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/api/run_save_functions.tsx index df246be4e5d99..215c3e7b99e7d 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/run_save_functions.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/api/run_save_functions.tsx @@ -261,6 +261,7 @@ export async function runInteractiveSave(this: DashboardContainer, interactionMo this.saveNotification$.next(); resolve(saveResult); + return saveResult; } catch (error) { reject(error); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts index 708e3c8aac809..158fc638adc3d 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts @@ -178,6 +178,7 @@ export const initializeDashboard = async ({ query: queryService, search: { session }, }, + dashboardContentInsights, } = pluginServices.getServices(); const { queryString, @@ -635,5 +636,13 @@ export const initializeDashboard = async ({ }); } + if (loadDashboardReturn.dashboardId && !incomingEmbeddable) { + // We count a new view every time a user opens a dashboard, both in view or edit mode + // We don't count views when a user is editing a dashboard and is returning from an editor after saving + // however, there is an edge case that we now count a new view when a user is editing a dashboard and is returning from an editor by canceling + // TODO: this should be revisited by making embeddable transfer support canceling logic https://github.com/elastic/kibana/issues/190485 + dashboardContentInsights.trackDashboardView(loadDashboardReturn.dashboardId); + } + return { input: initialDashboardInput, searchSessionId: initialSearchSessionId }; }; diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx index 162b80306ed4f..585e0ff0b1ff6 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx @@ -440,7 +440,6 @@ export class DashboardContainer // ------------------------------------------------------------------------------------------------------ // Dashboard API // ------------------------------------------------------------------------------------------------------ - public runInteractiveSave = runInteractiveSave; public runQuickSave = runQuickSave; diff --git a/src/plugins/dashboard/public/dashboard_listing/dashboard_listing.tsx b/src/plugins/dashboard/public/dashboard_listing/dashboard_listing.tsx index 2904eb4648df1..1e0de2b72b2b5 100644 --- a/src/plugins/dashboard/public/dashboard_listing/dashboard_listing.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/dashboard_listing.tsx @@ -45,6 +45,7 @@ export const DashboardListing = ({ savedObjectsTagging, coreContext: { executionContext }, userProfile, + dashboardContentInsights: { contentInsightsClient }, dashboardFavorites, } = pluginServices.getServices(); @@ -86,6 +87,7 @@ export const DashboardListing = ({ savedObjectsTagging: savedObjectsTaggingFakePlugin, FormattedRelative, favorites: dashboardFavorites, + contentInsightsClient, }} > {...tableListViewTableProps}> diff --git a/src/plugins/dashboard/public/dashboard_listing/dashboard_listing_table.tsx b/src/plugins/dashboard/public/dashboard_listing/dashboard_listing_table.tsx index 07ce8eeea771f..5a0f8caee1a9b 100644 --- a/src/plugins/dashboard/public/dashboard_listing/dashboard_listing_table.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/dashboard_listing_table.tsx @@ -47,6 +47,7 @@ export const DashboardListingTable = ({ coreContext: { executionContext }, chrome: { theme }, userProfile, + dashboardContentInsights: { contentInsightsClient }, } = pluginServices.getServices(); useExecutionContext(executionContext, { @@ -98,6 +99,7 @@ export const DashboardListingTable = ({ core={core} savedObjectsTagging={savedObjectsTaggingFakePlugin} FormattedRelative={FormattedRelative} + contentInsightsClient={contentInsightsClient} > <> { onSave: expect.any(Function), isReadonly: false, customValidators: expect.any(Object), - showActivityView: true, }, createdByEnabled: true, recentlyAccessed: expect.objectContaining({ get: expect.any(Function) }), diff --git a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx index 097fc5ea6d866..d3afbc61d2607 100644 --- a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx @@ -283,7 +283,6 @@ export const useDashboardListingTable = ({ isReadonly: !showWriteControls, onSave: updateItemMeta, customValidators: contentEditorValidators, - showActivityView: true, }, createItem: !showWriteControls || !showCreateDashboardButton ? undefined : createItem, deleteItems: !showWriteControls ? undefined : deleteItems, diff --git a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.test.tsx b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.test.tsx new file mode 100644 index 0000000000000..22aacec0946af --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.test.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 { render } from '@testing-library/react'; +import { buildMockDashboard } from '../mocks'; +import { InternalDashboardTopNav } from './internal_dashboard_top_nav'; +import { setMockedPresentationUtilServices } from '@kbn/presentation-util-plugin/public/mocks'; +import { pluginServices } from '../services/plugin_services'; +import { DashboardAPIContext } from '../dashboard_app/dashboard_app'; +import { TopNavMenuProps } from '@kbn/navigation-plugin/public'; + +describe('Internal dashboard top nav', () => { + const mockTopNav = (badges: TopNavMenuProps['badges'] | undefined[]) => { + if (badges) { + return badges?.map((badge, index) => ( +
+ {badge?.badgeText} +
+ )); + } else { + return <>; + } + }; + + beforeEach(() => { + setMockedPresentationUtilServices(); + pluginServices.getServices().data.query.filterManager.getFilters = jest + .fn() + .mockReturnValue([]); + // topNavMenu is mocked as a jest.fn() so we want to mock it with a component + // @ts-ignore type issue with the mockTopNav for this test suite + pluginServices.getServices().navigation.TopNavMenu = ({ badges }: TopNavMenuProps) => + mockTopNav(badges); + }); + + it('should not render the managed badge by default', async () => { + const component = render( + + + + ); + + expect(component.queryByText('Managed')).toBeNull(); + }); + + it('should render the managed badge when the dashboard is managed', async () => { + const container = buildMockDashboard(); + container.dispatch.setManaged(true); + const component = render( + + + + ); + + expect(component.getByText('Managed')).toBeInTheDocument(); + }); +}); diff --git a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx index eba228229f066..5f6edc138aa13 100644 --- a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx @@ -7,20 +7,28 @@ */ import UseUnmount from 'react-use/lib/useUnmount'; -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { withSuspense, LazyLabsFlyout, getContextProvider as getPresentationUtilContextProvider, } from '@kbn/presentation-util-plugin/public'; -import { getManagedContentBadge } from '@kbn/managed-content-badge'; import { ViewMode } from '@kbn/embeddable-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; -import { TopNavMenuProps } from '@kbn/navigation-plugin/public'; -import { EuiHorizontalRule, EuiIcon, EuiToolTipProps } from '@elastic/eui'; -import type { EuiBreadcrumb } from '@elastic/eui'; +import { TopNavMenuBadgeProps, TopNavMenuProps } from '@kbn/navigation-plugin/public'; +import { + EuiBreadcrumb, + EuiHorizontalRule, + EuiIcon, + EuiToolTipProps, + EuiPopover, + EuiBadge, + EuiLink, +} from '@elastic/eui'; import { MountPoint } from '@kbn/core/public'; +import { getManagedContentBadge } from '@kbn/managed-content-badge'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDashboardTitle, leaveConfirmStrings, @@ -38,6 +46,7 @@ import { useDashboardMountContext } from '../dashboard_app/hooks/dashboard_mount import { getFullEditPath, LEGACY_DASHBOARD_APP_ID } from '../dashboard_constants'; import './_dashboard_top_nav.scss'; import { DashboardRedirect } from '../dashboard_container/types'; +import { SaveDashboardReturn } from '../services/dashboard_content_management/types'; export interface InternalDashboardTopNavProps { customLeadingBreadCrumbs?: EuiBreadcrumb[]; @@ -90,7 +99,6 @@ export function InternalDashboardTopNav({ const dashboard = useDashboardAPI(); const PresentationUtilContextProvider = getPresentationUtilContextProvider(); - const hasRunMigrations = dashboard.select( (state) => state.componentState.hasRunClientsideMigrations ); @@ -107,6 +115,7 @@ export function InternalDashboardTopNav({ // store data views in state & subscribe to dashboard data view changes. const [allDataViews, setAllDataViews] = useState([]); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); useEffect(() => { setAllDataViews(dashboard.getAllDataViews()); const subscription = dashboard.onDataViewsUpdate$.subscribe((dataViews) => @@ -274,10 +283,26 @@ export function InternalDashboardTopNav({ viewMode, ]); + const maybeRedirect = useCallback( + (result?: SaveDashboardReturn) => { + if (!result) return; + const { redirectRequired, id } = result; + if (redirectRequired) { + redirectTo({ + id, + editMode: true, + useReplace: true, + destination: 'dashboard', + }); + } + }, + [redirectTo] + ); + const { viewModeTopNavConfig, editModeTopNavConfig } = useDashboardMenuItems({ - redirectTo, isLabsShown, setIsLabsShown, + maybeRedirect, showResetChange, }); @@ -313,10 +338,63 @@ export function InternalDashboardTopNav({ }); } if (showWriteControls && managed) { - allBadges.push(getManagedContentBadge(dashboardManagedBadge.getTooltip())); + const badgeProps = { + ...getManagedContentBadge(dashboardManagedBadge.getBadgeAriaLabel()), + onClick: () => setIsPopoverOpen(!isPopoverOpen), + onClickAriaLabel: dashboardManagedBadge.getBadgeAriaLabel(), + iconOnClick: () => setIsPopoverOpen(!isPopoverOpen), + iconOnClickAriaLabel: dashboardManagedBadge.getBadgeAriaLabel(), + } as TopNavMenuBadgeProps; + + allBadges.push({ + renderCustomBadge: ({ badgeText }) => { + const badgeButton = {badgeText}; + return ( + setIsPopoverOpen(false)} + panelStyle={{ maxWidth: 250 }} + > + { + dashboard + .runInteractiveSave(viewMode) + .then((result) => maybeRedirect(result)); + }} + aria-label={dashboardManagedBadge.getDuplicateButtonAriaLabel()} + > + + + ), + }} + /> + + ); + }, + badgeText: badgeProps.badgeText, + }); } return allBadges; - }, [hasUnsavedChanges, viewMode, hasRunMigrations, showWriteControls, managed]); + }, [ + hasUnsavedChanges, + viewMode, + hasRunMigrations, + showWriteControls, + managed, + isPopoverOpen, + dashboard, + maybeRedirect, + ]); return (
diff --git a/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights.stub.ts b/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights.stub.ts new file mode 100644 index 0000000000000..26abd7f65c768 --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights.stub.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 { PluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import type { DashboardContentInsightsService } from './types'; + +type DashboardContentInsightsServiceFactory = PluginServiceFactory; + +export const dashboardContentInsightsServiceFactory: DashboardContentInsightsServiceFactory = + () => { + return { + trackDashboardView: jest.fn(), + contentInsightsClient: { + track: jest.fn(), + getStats: jest.fn(), + }, + }; + }; diff --git a/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights_service.ts b/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights_service.ts new file mode 100644 index 0000000000000..8877589d036ea --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_content_insights/dashboard_content_insights_service.ts @@ -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 { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import { ContentInsightsClient } from '@kbn/content-management-content-insights-public'; +import { DashboardStartDependencies } from '../../plugin'; +import { DashboardContentInsightsService } from './types'; + +export type DashboardContentInsightsServiceFactory = KibanaPluginServiceFactory< + DashboardContentInsightsService, + DashboardStartDependencies +>; + +export const dashboardContentInsightsServiceFactory: DashboardContentInsightsServiceFactory = ( + params +) => { + const contentInsightsClient = new ContentInsightsClient( + { http: params.coreStart.http }, + { domainId: 'dashboard' } + ); + + return { + trackDashboardView: (dashboardId: string) => { + contentInsightsClient.track(dashboardId, 'viewed'); + }, + contentInsightsClient, + }; +}; diff --git a/src/plugins/dashboard/public/services/dashboard_content_insights/types.ts b/src/plugins/dashboard/public/services/dashboard_content_insights/types.ts new file mode 100644 index 0000000000000..ac709c725f879 --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_content_insights/types.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 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 { ContentInsightsClientPublic } from '@kbn/content-management-content-insights-public'; + +export interface DashboardContentInsightsService { + trackDashboardView: (dashboardId: string) => void; + contentInsightsClient: ContentInsightsClientPublic; +} diff --git a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts index 57bc91e1fa973..1dba6e25df12c 100644 --- a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts +++ b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts @@ -14,5 +14,7 @@ import { DashboardFavoritesService } from './types'; export type DashboardFavoritesServiceFactory = PluginServiceFactory; export const dashboardFavoritesServiceFactory: DashboardFavoritesServiceFactory = () => { - return new FavoritesClient('dashboard', { http: httpServiceMock.createStartContract() }); + return new FavoritesClient('dashboards', 'dashboard', { + http: httpServiceMock.createStartContract(), + }); }; diff --git a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts index 30342399a7f82..71f986bf4cffa 100644 --- a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts +++ b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts @@ -10,6 +10,7 @@ import { FavoritesClient } from '@kbn/content-management-favorites-public'; import { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; import { DashboardStartDependencies } from '../../plugin'; import { DashboardFavoritesService } from './types'; +import { DASHBOARD_APP_ID, DASHBOARD_CONTENT_ID } from '../../dashboard_constants'; export type DashboardFavoritesServiceFactory = KibanaPluginServiceFactory< DashboardFavoritesService, @@ -18,6 +19,10 @@ export type DashboardFavoritesServiceFactory = KibanaPluginServiceFactory< export const dashboardFavoritesServiceFactory: DashboardFavoritesServiceFactory = ({ coreStart, + startPlugins, }) => { - return new FavoritesClient('dashboard', { http: coreStart.http }); + return new FavoritesClient(DASHBOARD_APP_ID, DASHBOARD_CONTENT_ID, { + http: coreStart.http, + usageCollection: startPlugins.usageCollection, + }); }; diff --git a/src/plugins/dashboard/public/services/plugin_services.stub.ts b/src/plugins/dashboard/public/services/plugin_services.stub.ts index 247a3f29e35aa..1bd37c98d6ece 100644 --- a/src/plugins/dashboard/public/services/plugin_services.stub.ts +++ b/src/plugins/dashboard/public/services/plugin_services.stub.ts @@ -49,6 +49,7 @@ import { noDataPageServiceFactory } from './no_data_page/no_data_page_service.st import { uiActionsServiceFactory } from './ui_actions/ui_actions_service.stub'; import { dashboardRecentlyAccessedServiceFactory } from './dashboard_recently_accessed/dashboard_recently_accessed.stub'; import { dashboardFavoritesServiceFactory } from './dashboard_favorites/dashboard_favorites_service.stub'; +import { dashboardContentInsightsServiceFactory } from './dashboard_content_insights/dashboard_content_insights.stub'; export const providers: PluginServiceProviders = { dashboardContentManagement: new PluginServiceProvider(dashboardContentManagementServiceFactory), @@ -85,6 +86,7 @@ export const providers: PluginServiceProviders = { userProfile: new PluginServiceProvider(userProfileServiceFactory), observabilityAIAssistant: new PluginServiceProvider(observabilityAIAssistantServiceStubFactory), dashboardRecentlyAccessed: new PluginServiceProvider(dashboardRecentlyAccessedServiceFactory), + dashboardContentInsights: new PluginServiceProvider(dashboardContentInsightsServiceFactory), dashboardFavorites: new PluginServiceProvider(dashboardFavoritesServiceFactory), }; diff --git a/src/plugins/dashboard/public/services/plugin_services.ts b/src/plugins/dashboard/public/services/plugin_services.ts index 8f554d33aeea4..592b494634432 100644 --- a/src/plugins/dashboard/public/services/plugin_services.ts +++ b/src/plugins/dashboard/public/services/plugin_services.ts @@ -50,6 +50,7 @@ import { observabilityAIAssistantServiceFactory } from './observability_ai_assis import { userProfileServiceFactory } from './user_profile/user_profile_service'; import { dashboardRecentlyAccessedFactory } from './dashboard_recently_accessed/dashboard_recently_accessed'; import { dashboardFavoritesServiceFactory } from './dashboard_favorites/dashboard_favorites_service'; +import { dashboardContentInsightsServiceFactory } from './dashboard_content_insights/dashboard_content_insights_service'; const providers: PluginServiceProviders = { dashboardContentManagement: new PluginServiceProvider(dashboardContentManagementServiceFactory, [ @@ -99,6 +100,7 @@ const providers: PluginServiceProviders & { @@ -85,5 +86,6 @@ export interface DashboardServices { observabilityAIAssistant: ObservabilityAIAssistantService; // TODO: make this optional in follow up userProfile: DashboardUserProfileService; dashboardRecentlyAccessed: DashboardRecentlyAccessedService; + dashboardContentInsights: DashboardContentInsightsService; dashboardFavorites: DashboardFavoritesService; } diff --git a/src/plugins/dashboard/server/content_management/dashboard_storage.ts b/src/plugins/dashboard/server/content_management/dashboard_storage.ts index 4391aeaa90563..e9b5479dea90c 100644 --- a/src/plugins/dashboard/server/content_management/dashboard_storage.ts +++ b/src/plugins/dashboard/server/content_management/dashboard_storage.ts @@ -11,7 +11,7 @@ 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'; +import { cmServicesDefinition } from './schema/cm_services'; import type { DashboardCrudTypes } from '../../common/content_management'; const searchArgsToSOFindOptions = ( diff --git a/src/plugins/dashboard/common/content_management/cm_services.ts b/src/plugins/dashboard/server/content_management/schema/cm_services.ts similarity index 100% rename from src/plugins/dashboard/common/content_management/cm_services.ts rename to src/plugins/dashboard/server/content_management/schema/cm_services.ts diff --git a/src/plugins/dashboard/common/content_management/v1/cm_services.ts b/src/plugins/dashboard/server/content_management/schema/v1/cm_services.ts similarity index 100% rename from src/plugins/dashboard/common/content_management/v1/cm_services.ts rename to src/plugins/dashboard/server/content_management/schema/v1/cm_services.ts diff --git a/src/plugins/dashboard/server/content_management/schema/v1/index.ts b/src/plugins/dashboard/server/content_management/schema/v1/index.ts new file mode 100644 index 0000000000000..3e4684ab64cfb --- /dev/null +++ b/src/plugins/dashboard/server/content_management/schema/v1/index.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 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 { + serviceDefinition, + dashboardSavedObjectSchema, + controlGroupInputSchema, + dashboardAttributesSchema, +} from './cm_services'; diff --git a/src/plugins/dashboard/common/content_management/v2/cm_services.ts b/src/plugins/dashboard/server/content_management/schema/v2/cm_services.ts similarity index 100% rename from src/plugins/dashboard/common/content_management/v2/cm_services.ts rename to src/plugins/dashboard/server/content_management/schema/v2/cm_services.ts diff --git a/src/plugins/dashboard/server/content_management/schema/v2/index.ts b/src/plugins/dashboard/server/content_management/schema/v2/index.ts new file mode 100644 index 0000000000000..b20dfef423801 --- /dev/null +++ b/src/plugins/dashboard/server/content_management/schema/v2/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + serviceDefinition, + dashboardSavedObjectSchema, + dashboardAttributesSchema, +} from './cm_services'; diff --git a/src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts b/src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts index 2cf913919b912..688dce1d0687d 100644 --- a/src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts +++ b/src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts @@ -9,8 +9,8 @@ import { ANALYTICS_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { SavedObjectsType } from '@kbn/core/server'; -import { dashboardAttributesSchema as dashboardAttributesSchemaV1 } from '../../common/content_management/v1'; -import { dashboardAttributesSchema as dashboardAttributesSchemaV2 } from '../../common/content_management/v2'; +import { dashboardAttributesSchema as dashboardAttributesSchemaV1 } from '../content_management/schema/v1'; +import { dashboardAttributesSchema as dashboardAttributesSchemaV2 } from '../content_management/schema/v2'; import { createDashboardSavedObjectTypeMigrations, DashboardSavedObjectTypeMigrationsDeps, diff --git a/src/plugins/dashboard/server/plugin.ts b/src/plugins/dashboard/server/plugin.ts index e1626c2e72108..27747ca71bb8d 100644 --- a/src/plugins/dashboard/server/plugin.ts +++ b/src/plugins/dashboard/server/plugin.ts @@ -11,9 +11,10 @@ import { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { EmbeddableSetup } from '@kbn/embeddable-plugin/server'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/server'; import { ContentManagementServerSetup } from '@kbn/content-management-plugin/server'; import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; +import { registerContentInsights } from '@kbn/content-management-content-insights-server'; import { initializeDashboardTelemetryTask, @@ -31,13 +32,14 @@ import { dashboardPersistableStateServiceFactory } from './dashboard_container/d interface SetupDeps { embeddable: EmbeddableSetup; - usageCollection: UsageCollectionSetup; + usageCollection?: UsageCollectionSetup; taskManager: TaskManagerSetupContract; contentManagement: ContentManagementServerSetup; } interface StartDeps { taskManager: TaskManagerStartContract; + usageCollection?: UsageCollectionStart; } export class DashboardPlugin @@ -83,6 +85,25 @@ export class DashboardPlugin ); } + if (plugins.usageCollection) { + // Registers routes for tracking and fetching dashboard views + registerContentInsights( + { + usageCollection: plugins.usageCollection, + http: core.http, + getStartServices: () => + core.getStartServices().then(([_, start]) => ({ + usageCollection: start.usageCollection!, + })), + }, + { + domainId: 'dashboard', + // makes sure that only users with read/all access to dashboard app can access the routes + routeTags: ['access:dashboardUsageStats'], + } + ); + } + plugins.embeddable.registerEmbeddableFactory( dashboardPersistableStateServiceFactory(plugins.embeddable) ); diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 85b279490166f..f289f4f725fe5 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -73,7 +73,6 @@ "@kbn/presentation-panel-plugin", "@kbn/content-management-table-list-view-common", "@kbn/shared-ux-utility", - "@kbn/managed-content-badge", "@kbn/core-test-helpers-model-versions", "@kbn/deeplinks-analytics", "@kbn/core-user-profile-browser-mocks", @@ -84,6 +83,9 @@ "@kbn/lens-embeddable-utils", "@kbn/lens-plugin", "@kbn/recently-accessed", + "@kbn/content-management-content-insights-public", + "@kbn/content-management-content-insights-server", + "@kbn/managed-content-badge", "@kbn/content-management-favorites-public", "@kbn/core-http-browser-mocks", ], diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index d7af8ac5ffed1..cc5bb94131a60 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -9,22 +9,37 @@ import type { KibanaRequest } from '@kbn/core/server'; import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; import { i18n } from '@kbn/i18n'; -import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +import type { + IKibanaSearchRequest, + IKibanaSearchResponse, + ISearchGeneric, +} from '@kbn/search-types'; import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { getStartEndParams } from '@kbn/esql-utils'; - import { zipObject } from 'lodash'; -import { Observable, defer, throwError } from 'rxjs'; -import { catchError, map, switchMap, tap } from 'rxjs'; -import { buildEsQuery } from '@kbn/es-query'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; +import { catchError, defer, map, Observable, switchMap, tap, throwError } from 'rxjs'; +import { buildEsQuery, type Filter } from '@kbn/es-query'; +import type { ESQLSearchParams, ESQLSearchResponse } from '@kbn/es-types'; import { getEsQueryConfig } from '../../es_query'; import { getTime } from '../../query'; -import { ESQL_ASYNC_SEARCH_STRATEGY, KibanaContext, ESQL_TABLE_TYPE } from '..'; +import { + ESQL_ASYNC_SEARCH_STRATEGY, + ESQL_TABLE_TYPE, + isRunningResponse, + type KibanaContext, +} from '..'; import { UiSettingsCommon } from '../..'; +declare global { + interface Window { + /** + * Debug setting to make requests complete slower than normal. Only available on snapshots where `error_query` is enabled in ES. + */ + ELASTIC_ESQL_DELAY_SECONDS?: number; + } +} + type Input = KibanaContext | null; type Output = Observable; @@ -166,12 +181,31 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { fieldName: timeField, }); - params.filter = buildEsQuery( - undefined, - input.query || [], - [...(input.filters ?? []), ...(timeFilter ? [timeFilter] : [])], - esQueryConfigs - ); + // Used for debugging & inside automated tests to simulate a slow query + const delayFilter: Filter | undefined = window.ELASTIC_ESQL_DELAY_SECONDS + ? { + meta: {}, + query: { + error_query: { + indices: [ + { + name: '*', + error_type: 'warning', + stall_time_seconds: window.ELASTIC_ESQL_DELAY_SECONDS, + }, + ], + }, + }, + } + : undefined; + + const filters = [ + ...(input.filters ?? []), + ...(timeFilter ? [timeFilter] : []), + ...(delayFilter ? [delayFilter] : []), + ]; + + params.filter = buildEsQuery(undefined, input.query || [], filters, esQueryConfigs); } let startTime = Date.now(); @@ -222,7 +256,9 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { return throwError(() => error); }), tap({ - next({ rawResponse, requestParams }) { + next(response) { + if (isRunningResponse(response)) return; + const { rawResponse, requestParams } = response; logInspectorRequest() .stats({ hits: { diff --git a/src/plugins/data/config.ts b/src/plugins/data/config.ts index b6adfdede2469..5b9f15dbce3e5 100644 --- a/src/plugins/data/config.ts +++ b/src/plugins/data/config.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema'; export const searchSessionsConfigSchema = schema.object({ /** @@ -84,7 +84,23 @@ export const searchConfigSchema = schema.object({ sessions: searchSessionsConfigSchema, }); +export const queryConfigSchema = schema.object({ + /** + * Config for timefilter + */ + timefilter: schema.object({ + /** + * Lower limit of refresh interval (in milliseconds) + */ + minRefreshInterval: offeringBasedSchema({ + serverless: schema.number({ min: 1000, defaultValue: 5000 }), + traditional: schema.number({ min: 1000, defaultValue: 1000 }), + }), + }), +}); + export const configSchema = schema.object({ + query: queryConfigSchema, search: searchConfigSchema, /** * Turns on/off limit validations for the registered uiSettings. @@ -96,4 +112,6 @@ export type ConfigSchema = TypeOf; export type SearchConfigSchema = TypeOf; +export type QueryConfigSchema = TypeOf; + export type SearchSessionsConfigSchema = TypeOf; diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 32e321bd98a43..530cbe978c3d1 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -59,7 +59,9 @@ export class DataPublicPlugin constructor(initializerContext: PluginInitializerContext) { this.searchService = new SearchService(initializerContext); - this.queryService = new QueryService(); + this.queryService = new QueryService( + initializerContext.config.get().query.timefilter.minRefreshInterval + ); this.storage = new Storage(window.localStorage); this.nowProvider = new NowProvider(); diff --git a/src/plugins/data/public/query/query_service.test.ts b/src/plugins/data/public/query/query_service.test.ts index 6ddde2d18f74f..b95e02dadf356 100644 --- a/src/plugins/data/public/query/query_service.test.ts +++ b/src/plugins/data/public/query/query_service.test.ts @@ -18,6 +18,8 @@ import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { TimefilterContract } from './timefilter'; import { createNowProviderMock } from '../now_provider/mocks'; +const minRefreshIntervalDefault = 1000; + const setupMock = coreMock.createSetup(); const startMock = coreMock.createStart(); @@ -48,6 +50,7 @@ describe('query_service', () => { uiSettings: setupMock.uiSettings, storage: new Storage(new StubBrowserStorage()), nowProvider: createNowProviderMock(), + minRefreshInterval: minRefreshIntervalDefault, }); queryServiceStart = queryService.start({ uiSettings: setupMock.uiSettings, @@ -82,7 +85,7 @@ describe('query_service', () => { const filters = [getFilter(FilterStateStore.GLOBAL_STATE, true, true, 'key1', 'value1')]; const query = { language: 'kql', query: 'query' }; const time = { from: new Date().toISOString(), to: new Date().toISOString() }; - const refreshInterval = { pause: false, value: 10 }; + const refreshInterval = { pause: false, value: 2000 }; filterManager.setFilters(filters); queryStringManager.setQuery(query); diff --git a/src/plugins/data/public/query/query_service.ts b/src/plugins/data/public/query/query_service.ts index 72943d6b0f59b..776f7e93273a2 100644 --- a/src/plugins/data/public/query/query_service.ts +++ b/src/plugins/data/public/query/query_service.ts @@ -39,6 +39,7 @@ interface QueryServiceSetupDependencies { storage: IStorageWrapper; uiSettings: IUiSettingsClient; nowProvider: NowProviderInternalContract; + minRefreshInterval?: number; } interface QueryServiceStartDependencies { @@ -81,13 +82,21 @@ export class QueryService implements PersistableStateService { state$!: QueryState$; - public setup({ storage, uiSettings, nowProvider }: QueryServiceSetupDependencies): QuerySetup { + constructor(private minRefreshInterval: number = 5000) {} + + public setup({ + storage, + uiSettings, + nowProvider, + minRefreshInterval = this.minRefreshInterval, + }: QueryServiceSetupDependencies): QuerySetup { this.filterManager = new FilterManager(uiSettings); const timefilterService = new TimefilterService(nowProvider); this.timefilter = timefilterService.setup({ uiSettings, storage, + minRefreshInterval, }); this.queryStringManager = new QueryStringManager(storage, uiSettings); diff --git a/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts b/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts index 515cc38783cbd..21a8c6a0661ed 100644 --- a/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts +++ b/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts @@ -66,7 +66,7 @@ describe('connect_to_global_state', () => { let aF2: Filter; beforeEach(() => { - const queryService = new QueryService(); + const queryService = new QueryService(1000); queryService.setup({ uiSettings: setupMock.uiSettings, storage: new Storage(new StubBrowserStorage()), @@ -120,11 +120,21 @@ describe('connect_to_global_state', () => { }); test('when refresh interval changes, state container contains updated refresh interval', () => { + const stop = connectToQueryGlobalState(queryServiceStart, globalState); + timeFilter.setRefreshInterval({ pause: true, value: 5000 }); + expect(globalState.get().refreshInterval).toEqual({ + pause: true, + value: 5000, + }); + stop(); + }); + + test('when refresh interval is set below min, state container contains min refresh interval', () => { const stop = connectToQueryGlobalState(queryServiceStart, globalState); timeFilter.setRefreshInterval({ pause: true, value: 100 }); expect(globalState.get().refreshInterval).toEqual({ pause: true, - value: 100, + value: 1000, }); stop(); }); @@ -135,14 +145,14 @@ describe('connect_to_global_state', () => { globalState.set({ ...globalState.get(), filters: [gF1, gF2], - refreshInterval: { pause: true, value: 100 }, + refreshInterval: { pause: true, value: 5000 }, time: { from: 'now-30m', to: 'now' }, }); expect(globalStateChangeTriggered).toBeCalledTimes(1); expect(filterManager.getGlobalFilters()).toHaveLength(2); - expect(timeFilter.getRefreshInterval()).toEqual({ pause: true, value: 100 }); + expect(timeFilter.getRefreshInterval()).toEqual({ pause: true, value: 5000 }); expect(timeFilter.getTime()).toEqual({ from: 'now-30m', to: 'now' }); stop(); }); diff --git a/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts b/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts index 10cbe1bd25c5b..e6ed0119d80b8 100644 --- a/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts +++ b/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts @@ -25,6 +25,8 @@ import { syncQueryStateWithUrl } from './sync_state_with_url'; import { GlobalQueryStateFromUrl } from './types'; import { createNowProviderMock } from '../../now_provider/mocks'; +const minRefreshIntervalDefault = 1000; + const setupMock = coreMock.createSetup(); const startMock = coreMock.createStart(); @@ -65,6 +67,7 @@ describe('sync_query_state_with_url', () => { uiSettings: setupMock.uiSettings, storage: new Storage(new StubBrowserStorage()), nowProvider: createNowProviderMock(), + minRefreshInterval: minRefreshIntervalDefault, }); queryServiceStart = queryService.start({ uiSettings: startMock.uiSettings, @@ -93,7 +96,7 @@ describe('sync_query_state_with_url', () => { filterManager.setFilters([gF, aF]); kbnUrlStateStorage.kbnUrlControls.flush(); // sync force location change expect(history.location.hash).toMatchInlineSnapshot( - `"#?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!t,index:'logstash-*',key:query,negate:!t,type:custom,value:'%7B%22match%22:%7B%22key1%22:%22value1%22%7D%7D'),query:(match:(key1:value1)))),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))"` + `"#?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!t,index:'logstash-*',key:query,negate:!t,type:custom,value:'%7B%22match%22:%7B%22key1%22:%22value1%22%7D%7D'),query:(match:(key1:value1)))),refreshInterval:(pause:!t,value:1000),time:(from:now-15m,to:now))"` ); stop(); }); @@ -116,11 +119,21 @@ describe('sync_query_state_with_url', () => { }); test('when refresh interval changes, refresh interval is synced to urlStorage', () => { + const { stop } = syncQueryStateWithUrl(queryServiceStart, kbnUrlStateStorage); + timefilter.setRefreshInterval({ pause: true, value: 5000 }); + expect(kbnUrlStateStorage.get('_g')?.refreshInterval).toEqual({ + pause: true, + value: 5000, + }); + stop(); + }); + + test('when refresh interval is set below min, refresh interval is not synced to urlStorage', () => { const { stop } = syncQueryStateWithUrl(queryServiceStart, kbnUrlStateStorage); timefilter.setRefreshInterval({ pause: true, value: 100 }); expect(kbnUrlStateStorage.get('_g')?.refreshInterval).toEqual({ pause: true, - value: 100, + value: minRefreshIntervalDefault, }); stop(); }); diff --git a/src/plugins/data/public/query/timefilter/timefilter.test.ts b/src/plugins/data/public/query/timefilter/timefilter.test.ts index 1a4023644ed43..9aef9870541ce 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.test.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.test.ts @@ -17,15 +17,23 @@ import { RefreshInterval } from '../../../common'; import { createNowProviderMock } from '../../now_provider/mocks'; import { timefilterServiceMock } from './timefilter_service.mock'; +import { TimefilterConfig } from './types'; + const timefilterSetupMock = timefilterServiceMock.createSetupContract(); +const minRefreshIntervalDefault = 1000; -const timefilterConfig = { +const defaultTimefilterConfig: TimefilterConfig = { timeDefaults: { from: 'now-15m', to: 'now' }, - refreshIntervalDefaults: { pause: false, value: 0 }, + refreshIntervalDefaults: { pause: false, value: minRefreshIntervalDefault }, + minRefreshIntervalDefault, }; const nowProviderMock = createNowProviderMock(); -const timefilter = new Timefilter(timefilterConfig, timefilterSetupMock.history, nowProviderMock); +let timefilter = new Timefilter( + defaultTimefilterConfig, + timefilterSetupMock.history, + nowProviderMock +); function stubNowTime(nowTime: any) { nowProviderMock.get.mockImplementation(() => (nowTime ? new Date(nowTime) : new Date())); @@ -118,21 +126,28 @@ describe('setRefreshInterval', () => { let fetchSub: Subscription; let refreshSub: Subscription; let autoRefreshSub: Subscription; + let prevTimefilter = timefilter; - beforeEach(() => { + function setup() { update = sinon.spy(); fetch = sinon.spy(); autoRefreshFetch = sinon.spy((done) => done()); timefilter.setRefreshInterval({ pause: false, - value: 0, + value: minRefreshIntervalDefault, }); refreshSub = timefilter.getRefreshIntervalUpdate$().subscribe(update); fetchSub = timefilter.getFetch$().subscribe(fetch); autoRefreshSub = timefilter.getAutoRefreshFetch$().subscribe(autoRefreshFetch); + } + + beforeEach(() => { + prevTimefilter = timefilter; + setup(); }); afterEach(() => { + timefilter = prevTimefilter; refreshSub.unsubscribe(); fetchSub.unsubscribe(); autoRefreshSub.unsubscribe(); @@ -142,16 +157,50 @@ describe('setRefreshInterval', () => { expect(timefilter.isRefreshIntervalTouched()).toBe(false); }); + test('should limit initial default value to minRefreshIntervalDefault', () => { + timefilter = new Timefilter( + { + ...defaultTimefilterConfig, + refreshIntervalDefaults: { pause: false, value: minRefreshIntervalDefault - 100 }, + }, + timefilterSetupMock.history, + nowProviderMock + ); + setup(); + + expect(timefilter.isRefreshIntervalTouched()).toBe(false); + expect(timefilter.getRefreshInterval()).toEqual({ + pause: false, + value: minRefreshIntervalDefault, + }); + }); + + test('should pause if initial value is set to 0 regardless of minRefreshInterval', () => { + timefilter = new Timefilter( + { + ...defaultTimefilterConfig, + refreshIntervalDefaults: { pause: false, value: 0 }, + }, + timefilterSetupMock.history, + nowProviderMock + ); + + expect(timefilter.getRefreshInterval()).toEqual({ + pause: true, + value: minRefreshIntervalDefault, + }); + }); + test('should register changes to the initial interval', () => { - timefilter.setRefreshInterval(timefilterConfig.refreshIntervalDefaults); + timefilter.setRefreshInterval(defaultTimefilterConfig.refreshIntervalDefaults); expect(timefilter.isRefreshIntervalTouched()).toBe(false); - timefilter.setRefreshInterval({ pause: false, value: 1000 }); + timefilter.setRefreshInterval({ pause: false, value: 5000 }); expect(timefilter.isRefreshIntervalTouched()).toBe(true); }); test('should update refresh interval', () => { - timefilter.setRefreshInterval({ pause: true, value: 10 }); - expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 10 }); + timefilter.setRefreshInterval({ pause: true, value: 5000 }); + expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 5000 }); }); test('should not add unexpected object keys to refreshInterval state', () => { @@ -165,23 +214,40 @@ describe('setRefreshInterval', () => { }); test('should allow partial updates to refresh interval', () => { - timefilter.setRefreshInterval({ value: 10 }); - expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 10 }); + const { pause } = timefilter.getRefreshInterval(); + timefilter.setRefreshInterval({ value: 5000 }); + expect(timefilter.getRefreshInterval()).toEqual({ pause, value: 5000 }); }); test('should not allow negative intervals', () => { timefilter.setRefreshInterval({ value: -10 }); - expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 0 }); + expect(timefilter.getRefreshInterval()).toEqual({ pause: false, value: 1000 }); }); test('should set pause to true when interval is changed to zero from non-zero', () => { + timefilter = new Timefilter( + { + ...defaultTimefilterConfig, + minRefreshIntervalDefault: 0, + }, + timefilterSetupMock.history, + nowProviderMock + ); + setup(); + timefilter.setRefreshInterval({ value: 1000, pause: false }); timefilter.setRefreshInterval({ value: 0, pause: false }); expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 0 }); }); + test('should pause when interval is set to zero regardless of minRefreshInterval', () => { + timefilter.setRefreshInterval({ value: 5000, pause: false }); + timefilter.setRefreshInterval({ value: 0 }); + expect(timefilter.getRefreshInterval()).toEqual({ pause: true, value: 1000 }); + }); + test('not emit anything if nothing has changed', () => { - timefilter.setRefreshInterval({ pause: false, value: 0 }); + timefilter.setRefreshInterval(timefilter.getRefreshInterval()); expect(update.called).toBe(false); expect(fetch.called).toBe(false); }); @@ -192,7 +258,25 @@ describe('setRefreshInterval', () => { expect(fetch.called).toBe(false); }); + test('should not emit update, nor fetch, when setting interval below min', () => { + const prevInterval = timefilter.getRefreshInterval(); + timefilter.setRefreshInterval({ value: minRefreshIntervalDefault - 100 }); + expect(update.called).toBe(false); + expect(fetch.called).toBe(false); + expect(timefilter.getRefreshInterval()).toEqual(prevInterval); + }); + test('emit update, not fetch, when switching to value: 0', () => { + timefilter = new Timefilter( + { + ...defaultTimefilterConfig, + minRefreshIntervalDefault: 0, + }, + timefilterSetupMock.history, + nowProviderMock + ); + setup(); + timefilter.setRefreshInterval({ pause: false, value: 5000 }); expect(update.calledOnce).toBe(true); expect(fetch.calledOnce).toBe(true); diff --git a/src/plugins/data/public/query/timefilter/timefilter.ts b/src/plugins/data/public/query/timefilter/timefilter.ts index 11c44bd296640..19ed99173411a 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.ts @@ -27,7 +27,6 @@ import { createAutoRefreshLoop, AutoRefreshDoneFn } from './lib/auto_refresh_loo export type { AutoRefreshDoneFn }; -// TODO: remove! export class Timefilter { // Fired when isTimeRangeSelectorEnabled \ isAutoRefreshSelectorEnabled are toggled private enabledUpdated$ = new BehaviorSubject(false); @@ -41,6 +40,7 @@ export class Timefilter { // Denotes whether setTime has been called, can be used to determine if the constructor defaults are being used. private _isTimeTouched: boolean = false; private _refreshInterval!: RefreshInterval; + private _minRefreshInterval: number; // Denotes whether the refresh interval defaults were overriden. private _isRefreshIntervalTouched: boolean = false; private _history: TimeHistoryContract; @@ -61,7 +61,15 @@ export class Timefilter { ) { this._history = timeHistory; this.timeDefaults = config.timeDefaults; - this.refreshIntervalDefaults = config.refreshIntervalDefaults; + + // Initialize 0ms intervals with pause set to true and min value + this.refreshIntervalDefaults = { + pause: + config.refreshIntervalDefaults.value === 0 ? true : config.refreshIntervalDefaults.pause, + value: Math.max(config.refreshIntervalDefaults.value, config.minRefreshIntervalDefault), + }; + + this._minRefreshInterval = config.minRefreshIntervalDefault; this._time = config.timeDefaults; this.setRefreshInterval(config.refreshIntervalDefaults); } @@ -148,6 +156,10 @@ export class Timefilter { return _.clone(this._refreshInterval); }; + public getMinRefreshInterval = () => { + return this._minRefreshInterval; + }; + /** * Set timefilter refresh interval. * @param {Object} refreshInterval @@ -157,6 +169,16 @@ export class Timefilter { public setRefreshInterval = (refreshInterval: Partial) => { const prevRefreshInterval = this.getRefreshInterval(); const newRefreshInterval = { ...prevRefreshInterval, ...refreshInterval }; + + if (newRefreshInterval.value === 0) { + // override only when explicitly set to 0 + newRefreshInterval.pause = true; + } + + if (newRefreshInterval.value < this._minRefreshInterval) { + newRefreshInterval.value = this._minRefreshInterval; + } + let shouldUnpauseRefreshLoop = newRefreshInterval.pause === false && prevRefreshInterval != null; if (prevRefreshInterval?.value > 0 && newRefreshInterval.value <= 0) { diff --git a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts index 03e7bed0545d1..27b25ddee9635 100644 --- a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts +++ b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts @@ -28,6 +28,7 @@ const createSetupContractMock = () => { setTime: jest.fn(), setRefreshInterval: jest.fn(), getRefreshInterval: jest.fn(), + getMinRefreshInterval: jest.fn().mockReturnValue(1000), getActiveBounds: jest.fn(), disableAutoRefreshSelector: jest.fn(), disableTimeRangeSelector: jest.fn(), diff --git a/src/plugins/data/public/query/timefilter/timefilter_service.ts b/src/plugins/data/public/query/timefilter/timefilter_service.ts index a8c9b7a759e9e..d9c026c956165 100644 --- a/src/plugins/data/public/query/timefilter/timefilter_service.ts +++ b/src/plugins/data/public/query/timefilter/timefilter_service.ts @@ -8,27 +8,38 @@ import { IUiSettingsClient } from '@kbn/core/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import { TimeHistory, Timefilter, TimeHistoryContract, TimefilterContract } from '.'; +import { + TimeHistory, + Timefilter, + TimeHistoryContract, + TimefilterContract, + TimefilterConfig, +} from '.'; import { UI_SETTINGS } from '../../../common'; import { NowProviderInternalContract } from '../../now_provider'; -/** - * Filter Service - * @internal - */ - export interface TimeFilterServiceDependencies { uiSettings: IUiSettingsClient; storage: IStorageWrapper; + minRefreshInterval: number; } +/** + * Filter Service + * @internal + */ export class TimefilterService { constructor(private readonly nowProvider: NowProviderInternalContract) {} - public setup({ uiSettings, storage }: TimeFilterServiceDependencies): TimefilterSetup { - const timefilterConfig = { + public setup({ + uiSettings, + storage, + minRefreshInterval, + }: TimeFilterServiceDependencies): TimefilterSetup { + const timefilterConfig: TimefilterConfig = { timeDefaults: uiSettings.get(UI_SETTINGS.TIMEPICKER_TIME_DEFAULTS), refreshIntervalDefaults: uiSettings.get(UI_SETTINGS.TIMEPICKER_REFRESH_INTERVAL_DEFAULTS), + minRefreshIntervalDefault: minRefreshInterval, }; const history = new TimeHistory(storage); const timefilter = new Timefilter(timefilterConfig, history, this.nowProvider); diff --git a/src/plugins/data/public/query/timefilter/types.ts b/src/plugins/data/public/query/timefilter/types.ts index 1392022768fa7..f3cc8f5869a19 100644 --- a/src/plugins/data/public/query/timefilter/types.ts +++ b/src/plugins/data/public/query/timefilter/types.ts @@ -14,6 +14,7 @@ import { RefreshInterval } from '../../../common'; export interface TimefilterConfig { timeDefaults: TimeRange; refreshIntervalDefaults: RefreshInterval; + minRefreshIntervalDefault: number; } // Timefilter accepts moment input but always returns string output diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index e1d2080b6c59f..7a41c20094d6e 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -107,6 +107,7 @@ export const config: PluginConfigDescriptor = { deprecations: configDeprecationProvider, exposeToBrowser: { search: true, + query: true, }, schema: configSchema, }; diff --git a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx index 98897ed4472de..22ed26e702eb4 100644 --- a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx @@ -196,7 +196,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ const getRollupIndices = (rollupCaps: RollupIndicesCapsResponse) => Object.keys(rollupCaps); const onTypeChange = useCallback( - (newType) => { + (newType: INDEX_PATTERN_TYPE) => { form.setFieldValue('title', ''); form.setFieldValue('name', ''); form.setFieldValue('timestampField', ''); diff --git a/src/plugins/data_views/common/content_management/v1/cm_services.ts b/src/plugins/data_views/common/content_management/v1/cm_services.ts deleted file mode 100644 index 7b70a4c103457..0000000000000 --- a/src/plugins/data_views/common/content_management/v1/cm_services.ts +++ /dev/null @@ -1,129 +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 { schema } from '@kbn/config-schema'; -import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; -import { - savedObjectSchema, - objectTypeToGetResultSchema, - createOptionsSchemas, - updateOptionsSchema, - createResultSchema, - searchOptionsSchemas, -} from '@kbn/content-management-utils'; -import { DataViewType } from '../..'; -import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from '../../constants'; -import { serializedFieldFormatSchema, fieldSpecSchema } from '../../schemas'; - -const dataViewAttributesSchema = schema.object( - { - title: schema.string(), - type: schema.maybe(schema.literal(DataViewType.ROLLUP)), - timeFieldName: schema.maybe(schema.string()), - sourceFilters: schema.maybe( - schema.arrayOf( - schema.object({ - value: schema.string(), - clientId: schema.maybe(schema.oneOf([schema.string(), schema.number()])), - }) - ) - ), - fields: schema.maybe(schema.arrayOf(fieldSpecSchema)), - typeMeta: schema.maybe(schema.object({}, { unknowns: 'allow' })), - fieldFormatMap: schema.maybe(schema.recordOf(schema.string(), serializedFieldFormatSchema)), - fieldAttrs: schema.maybe( - schema.recordOf( - schema.string(), - schema.object({ - customLabel: schema.maybe(schema.string()), - customDescription: schema.maybe( - schema.string({ - maxLength: MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, - }) - ), - count: schema.maybe(schema.number()), - }) - ) - ), - allowNoIndex: schema.maybe(schema.boolean()), - runtimeFieldMap: schema.maybe(schema.any()), - name: schema.maybe(schema.string()), - allowHidden: schema.maybe(schema.boolean()), - }, - { unknowns: 'forbid' } -); - -const dataViewSavedObjectSchema = savedObjectSchema(dataViewAttributesSchema); - -const dataViewCreateOptionsSchema = schema.object({ - id: createOptionsSchemas.id, - initialNamespaces: createOptionsSchemas.initialNamespaces, - overwrite: schema.maybe(createOptionsSchemas.overwrite), -}); - -const dataViewSearchOptionsSchema = schema.object({ - searchFields: searchOptionsSchemas.searchFields, - fields: searchOptionsSchemas.fields, -}); - -const dataViewUpdateOptionsSchema = schema.object({ - version: updateOptionsSchema.version, - refresh: updateOptionsSchema.refresh, - retryOnConflict: updateOptionsSchema.retryOnConflict, -}); - -// Content management service definition. -// We need it for BWC support between different versions of the content -export const serviceDefinition: ServicesDefinition = { - get: { - out: { - result: { - schema: objectTypeToGetResultSchema(dataViewSavedObjectSchema), - }, - }, - }, - create: { - in: { - options: { - schema: dataViewCreateOptionsSchema, - }, - data: { - schema: dataViewAttributesSchema, - }, - }, - out: { - result: { - schema: createResultSchema(dataViewSavedObjectSchema), - }, - }, - }, - update: { - in: { - options: { - schema: dataViewUpdateOptionsSchema, - }, - data: { - schema: dataViewAttributesSchema, - }, - }, - }, - search: { - in: { - options: { - schema: dataViewSearchOptionsSchema, - }, - }, - }, - mSearch: { - out: { - result: { - schema: dataViewSavedObjectSchema, - }, - }, - }, -}; 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 bb01064d59956..c0f7f287a7f92 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 @@ -11,7 +11,7 @@ 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'; +import { cmServicesDefinition } from './schema/cm_services'; export class DataViewsStorage extends SOContentStorage { constructor({ diff --git a/src/plugins/data_views/common/content_management/cm_services.ts b/src/plugins/data_views/server/content_management/schema/cm_services.ts similarity index 100% rename from src/plugins/data_views/common/content_management/cm_services.ts rename to src/plugins/data_views/server/content_management/schema/cm_services.ts diff --git a/src/plugins/data_views/server/content_management/schema/v1/cm_services.ts b/src/plugins/data_views/server/content_management/schema/v1/cm_services.ts new file mode 100644 index 0000000000000..71e73135b5e59 --- /dev/null +++ b/src/plugins/data_views/server/content_management/schema/v1/cm_services.ts @@ -0,0 +1,129 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; +import { + savedObjectSchema, + objectTypeToGetResultSchema, + createOptionsSchemas, + updateOptionsSchema, + createResultSchema, + searchOptionsSchemas, +} from '@kbn/content-management-utils'; +import { DataViewType } from '../../../../common'; +import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from '../../../../common/constants'; +import { serializedFieldFormatSchema, fieldSpecSchema } from '../../../schemas'; + +const dataViewAttributesSchema = schema.object( + { + title: schema.string(), + type: schema.maybe(schema.literal(DataViewType.ROLLUP)), + timeFieldName: schema.maybe(schema.string()), + sourceFilters: schema.maybe( + schema.arrayOf( + schema.object({ + value: schema.string(), + clientId: schema.maybe(schema.oneOf([schema.string(), schema.number()])), + }) + ) + ), + fields: schema.maybe(schema.arrayOf(fieldSpecSchema)), + typeMeta: schema.maybe(schema.object({}, { unknowns: 'allow' })), + fieldFormatMap: schema.maybe(schema.recordOf(schema.string(), serializedFieldFormatSchema)), + fieldAttrs: schema.maybe( + schema.recordOf( + schema.string(), + schema.object({ + customLabel: schema.maybe(schema.string()), + customDescription: schema.maybe( + schema.string({ + maxLength: MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, + }) + ), + count: schema.maybe(schema.number()), + }) + ) + ), + allowNoIndex: schema.maybe(schema.boolean()), + runtimeFieldMap: schema.maybe(schema.any()), + name: schema.maybe(schema.string()), + allowHidden: schema.maybe(schema.boolean()), + }, + { unknowns: 'forbid' } +); + +const dataViewSavedObjectSchema = savedObjectSchema(dataViewAttributesSchema); + +const dataViewCreateOptionsSchema = schema.object({ + id: createOptionsSchemas.id, + initialNamespaces: createOptionsSchemas.initialNamespaces, + overwrite: schema.maybe(createOptionsSchemas.overwrite), +}); + +const dataViewSearchOptionsSchema = schema.object({ + searchFields: searchOptionsSchemas.searchFields, + fields: searchOptionsSchemas.fields, +}); + +const dataViewUpdateOptionsSchema = schema.object({ + version: updateOptionsSchema.version, + refresh: updateOptionsSchema.refresh, + retryOnConflict: updateOptionsSchema.retryOnConflict, +}); + +// Content management service definition. +// We need it for BWC support between different versions of the content +export const serviceDefinition: ServicesDefinition = { + get: { + out: { + result: { + schema: objectTypeToGetResultSchema(dataViewSavedObjectSchema), + }, + }, + }, + create: { + in: { + options: { + schema: dataViewCreateOptionsSchema, + }, + data: { + schema: dataViewAttributesSchema, + }, + }, + out: { + result: { + schema: createResultSchema(dataViewSavedObjectSchema), + }, + }, + }, + update: { + in: { + options: { + schema: dataViewUpdateOptionsSchema, + }, + data: { + schema: dataViewAttributesSchema, + }, + }, + }, + search: { + in: { + options: { + schema: dataViewSearchOptionsSchema, + }, + }, + }, + mSearch: { + out: { + result: { + schema: dataViewSavedObjectSchema, + }, + }, + }, +}; diff --git a/src/plugins/data_views/server/rest_api_routes/public/fields/update_fields.ts b/src/plugins/data_views/server/rest_api_routes/public/fields/update_fields.ts index a8d2e7d0a5247..2ef80e8cbf68d 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/fields/update_fields.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/fields/update_fields.ts @@ -12,7 +12,7 @@ import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; import { DataViewsService } from '../../../../common'; import { handleErrors } from '../util/handle_errors'; -import { serializedFieldFormatSchema } from '../../../../common/schemas'; +import { serializedFieldFormatSchema } from '../../../schemas'; import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from '../../../../common/constants'; import { dataViewSpecSchema } from '../../schema'; import { DataViewSpecRestResponse } from '../../route_types'; diff --git a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/create_runtime_field.ts b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/create_runtime_field.ts index ff446f76c885a..49f928dd863a5 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/create_runtime_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/create_runtime_field.ts @@ -12,7 +12,7 @@ import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { DataViewsService } from '../../../../common/data_views'; import { RuntimeField } from '../../../../common/types'; import { handleErrors } from '../util/handle_errors'; -import { runtimeFieldSchema } from '../../../../common/schemas'; +import { runtimeFieldSchema } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/put_runtime_field.ts b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/put_runtime_field.ts index 7105d8ea8413b..30076183ce6e8 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/put_runtime_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/put_runtime_field.ts @@ -12,7 +12,7 @@ import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { DataViewsService } from '../../../../common/data_views'; import { RuntimeField } from '../../../../common/types'; import { handleErrors } from '../util/handle_errors'; -import { runtimeFieldSchema } from '../../../../common/schemas'; +import { runtimeFieldSchema } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/update_runtime_field.ts b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/update_runtime_field.ts index 485551c866eef..85887582804ad 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/update_runtime_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/runtime_fields/update_runtime_field.ts @@ -13,7 +13,7 @@ import { DataViewsService } from '../../../../common/data_views'; import { RuntimeField } from '../../../../common/types'; import { ErrorIndexPatternFieldNotFound } from '../../../error'; import { handleErrors } from '../util/handle_errors'; -import { runtimeFieldSchemaUpdate } from '../../../../common/schemas'; +import { runtimeFieldSchemaUpdate } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/create_scripted_field.ts b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/create_scripted_field.ts index ed6716b1684ba..6ed3bbf5e84d0 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/create_scripted_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/create_scripted_field.ts @@ -9,7 +9,7 @@ import { schema } from '@kbn/config-schema'; import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { handleErrors } from '../util/handle_errors'; -import { fieldSpecSchema } from '../../../../common/schemas'; +import { fieldSpecSchema } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/get_scripted_field.ts b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/get_scripted_field.ts index 7023fba31b589..d5083b01070ba 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/get_scripted_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/get_scripted_field.ts @@ -15,7 +15,7 @@ import type { DataViewsServerPluginStartDependencies, } from '../../../types'; import { INITIAL_REST_VERSION } from '../../../constants'; -import { fieldSpecSchemaFields } from '../../../../common/schemas'; +import { fieldSpecSchemaFields } from '../../../schemas'; import { FieldSpecRestResponse } from '../../route_types'; export const registerGetScriptedFieldRoute = ( diff --git a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/put_scripted_field.ts b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/put_scripted_field.ts index 20e828009f2a1..00875773a8049 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/put_scripted_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/put_scripted_field.ts @@ -9,7 +9,7 @@ import { schema } from '@kbn/config-schema'; import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { handleErrors } from '../util/handle_errors'; -import { fieldSpecSchema } from '../../../../common/schemas'; +import { fieldSpecSchema } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/update_scripted_field.ts b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/update_scripted_field.ts index 53e9d165814b5..9589c1c9e7a8d 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/update_scripted_field.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/scripted_fields/update_scripted_field.ts @@ -11,7 +11,7 @@ import { IRouter, StartServicesAccessor } from '@kbn/core/server'; import { FieldSpec } from '../../../../common'; import { ErrorIndexPatternFieldNotFound } from '../../../error'; import { handleErrors } from '../util/handle_errors'; -import { fieldSpecSchemaFields } from '../../../../common/schemas'; +import { fieldSpecSchemaFields } from '../../../schemas'; import type { DataViewsServerPluginStart, DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts b/src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts index 0c7c66a0a1fec..ad830c7c809f2 100644 --- a/src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts +++ b/src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts @@ -13,11 +13,7 @@ import { DataViewSpecRestResponse } from '../route_types'; import { DataViewsService } from '../../../common/data_views'; import { DataViewSpec } from '../../../common/types'; import { handleErrors } from './util/handle_errors'; -import { - fieldSpecSchema, - runtimeFieldSchema, - serializedFieldFormatSchema, -} from '../../../common/schemas'; +import { fieldSpecSchema, runtimeFieldSchema, serializedFieldFormatSchema } from '../../schemas'; import { dataViewSpecSchema } from '../schema'; import type { DataViewsServerPluginStartDependencies, diff --git a/src/plugins/data_views/server/rest_api_routes/schema.ts b/src/plugins/data_views/server/rest_api_routes/schema.ts index c4f4a4c70b826..f9518ca8099b2 100644 --- a/src/plugins/data_views/server/rest_api_routes/schema.ts +++ b/src/plugins/data_views/server/rest_api_routes/schema.ts @@ -14,7 +14,7 @@ import { runtimeFieldSchema, serializedFieldFormatSchema, fieldSpecSchemaFields, -} from '../../common/schemas'; +} from '../schemas'; import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from '../../common/constants'; export const dataViewSpecSchema = schema.object({ diff --git a/src/plugins/data_views/common/schemas.ts b/src/plugins/data_views/server/schemas.ts similarity index 97% rename from src/plugins/data_views/common/schemas.ts rename to src/plugins/data_views/server/schemas.ts index b780118414044..1eae6d09ee7de 100644 --- a/src/plugins/data_views/common/schemas.ts +++ b/src/plugins/data_views/server/schemas.ts @@ -7,8 +7,8 @@ */ import { schema, Type } from '@kbn/config-schema'; -import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from './constants'; -import { RuntimeType } from '.'; +import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH } from '../common/constants'; +import { RuntimeType } from '../common'; export const serializedFieldFormatSchema = schema.object({ id: schema.maybe(schema.string()), diff --git a/src/plugins/discover/public/application/context/context_app.tsx b/src/plugins/discover/public/application/context/context_app.tsx index dc22a77fecede..6f750df367c09 100644 --- a/src/plugins/discover/public/application/context/context_app.tsx +++ b/src/plugins/discover/public/application/context/context_app.tsx @@ -23,8 +23,9 @@ import { SEARCH_FIELDS_FROM_SOURCE, SORT_DEFAULT_ORDER_SETTING, } from '@kbn/discover-utils'; -import { popularizeField, useColumns } from '@kbn/unified-data-table'; +import { UseColumnsProps, popularizeField, useColumns } from '@kbn/unified-data-table'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; +import { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import { ContextErrorMessage } from './components/context_error_message'; import { LoadingStatus } from './services/context_query_state'; import { AppState, GlobalState, isEqualFilters } from './services/context_state'; @@ -69,15 +70,23 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) => const prevAppState = useRef(); const prevGlobalState = useRef({ filters: [] }); + const setAppState = useCallback( + ({ settings, ...rest }) => { + stateContainer.setAppState({ ...rest, grid: settings as DiscoverGridSettings }); + }, + [stateContainer] + ); + const { columns, onAddColumn, onRemoveColumn, onSetColumns } = useColumns({ capabilities, defaultOrder: uiSettings.get(SORT_DEFAULT_ORDER_SETTING), dataView, dataViews, useNewFieldsApi, - setAppState: stateContainer.setAppState, + setAppState, columns: appState.columns, sort: appState.sort, + settings: appState.grid, }); useEffect(() => { @@ -260,6 +269,7 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) => useNewFieldsApi={useNewFieldsApi} isLegacy={isLegacy} columns={columns} + grid={appState.grid} onAddColumn={onAddColumn} onRemoveColumn={onRemoveColumn} onSetColumns={onSetColumns} diff --git a/src/plugins/discover/public/application/context/context_app_content.tsx b/src/plugins/discover/public/application/context/context_app_content.tsx index 6c82a9408d003..e0f0dbbd820cb 100644 --- a/src/plugins/discover/public/application/context/context_app_content.tsx +++ b/src/plugins/discover/public/application/context/context_app_content.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { Fragment, useCallback, useMemo, useState, FC, PropsWithChildren } from 'react'; +import React, { Fragment, useCallback, useMemo, useState, FC } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiText, useEuiPaddingSize } from '@elastic/eui'; import { css } from '@emotion/react'; @@ -27,7 +27,7 @@ import { ROW_HEIGHT_OPTION, SHOW_MULTIFIELDS, } from '@kbn/discover-utils'; -import { DataLoadingState } from '@kbn/unified-data-table'; +import { DataLoadingState, UnifiedDataTableProps } from '@kbn/unified-data-table'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { DiscoverGrid } from '../../components/discover_grid'; import { getDefaultRowsPerPage } from '../../../common/constants'; @@ -43,6 +43,7 @@ import { onResizeGridColumn } from '../../utils/on_resize_grid_column'; export interface ContextAppContentProps { columns: string[]; + grid?: DiscoverGridSettings; onAddColumn: (columnsName: string) => void; onRemoveColumn: (columnsName: string) => void; onSetColumns: (columnsNames: string[], hideTimeColumn: boolean) => void; @@ -74,6 +75,7 @@ const ActionBarMemoized = React.memo(ActionBar); export function ContextAppContent({ columns, + grid, onAddColumn, onRemoveColumn, onSetColumns, @@ -94,7 +96,6 @@ export function ContextAppContent({ }: ContextAppContentProps) { const { uiSettings: config, uiActions } = useDiscoverServices(); const services = useDiscoverServices(); - const [gridSettings, setGridSettings] = useState(); const [expandedDoc, setExpandedDoc] = useState(); const isAnchorLoading = @@ -151,13 +152,11 @@ export function ContextAppContent({ [addFilter, dataView, onAddColumn, onRemoveColumn] ); - const onResize = useCallback( + const onResize = useCallback>( (colSettings) => { - setGridSettings((currentGridSettings) => - onResizeGridColumn(colSettings, currentGridSettings) - ); + setAppState({ grid: onResizeGridColumn(colSettings, grid) }); }, - [setGridSettings] + [grid, setAppState] ); return ( @@ -221,7 +220,7 @@ export function ContextAppContent({ renderDocumentView={renderDocumentView} services={services} configHeaderRowHeight={3} - settings={gridSettings} + settings={grid} onResize={onResize} /> @@ -242,7 +241,7 @@ export function ContextAppContent({ ); } -const WrapperWithPadding: FC> = ({ children }) => { +const WrapperWithPadding: FC = ({ children }) => { const padding = useEuiPaddingSize('s'); return ( diff --git a/src/plugins/discover/public/application/context/services/context_state.ts b/src/plugins/discover/public/application/context/services/context_state.ts index 8b41152496ec9..e67fbc7575a1e 100644 --- a/src/plugins/discover/public/application/context/services/context_state.ts +++ b/src/plugins/discover/public/application/context/services/context_state.ts @@ -20,6 +20,7 @@ import { import { connectToQueryState, DataPublicPluginStart, FilterManager } from '@kbn/data-plugin/public'; import { DataView } from '@kbn/data-views-plugin/common'; +import { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import { getValidFilters } from '../../../utils/get_valid_filters'; import { handleSourceColumnState } from '../../../utils/state_helpers'; @@ -32,6 +33,10 @@ export interface AppState { * Array of filters */ filters: Filter[]; + /** + * Data Grid related state + */ + grid?: DiscoverGridSettings; /** * Number of records to be fetched before anchor records (newer records) */ diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index e1b5636d010b1..71193e904a794 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -27,6 +27,9 @@ import { type DataTableColumnsMeta, getTextBasedColumnsMeta, getRenderCustomToolbarWithElements, + type DataGridDensity, + UnifiedDataTableProps, + UseColumnsProps, } from '@kbn/unified-data-table'; import { DOC_HIDE_TIME_COLUMN_SETTING, @@ -40,6 +43,7 @@ import { } from '@kbn/discover-utils'; import useObservable from 'react-use/lib/useObservable'; import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; +import { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import { DiscoverGrid } from '../../../../components/discover_grid'; import { getDefaultRowsPerPage } from '../../../../../common/constants'; import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; @@ -85,7 +89,7 @@ const DiscoverGridMemoized = React.memo(DiscoverGrid); // export needs for testing export const onResize = ( - colSettings: { columnId: string; width: number }, + colSettings: { columnId: string; width: number | undefined }, stateContainer: DiscoverStateContainer ) => { const state = stateContainer.appState.getState(); @@ -110,19 +114,29 @@ function DiscoverDocumentsComponent({ const documents$ = stateContainer.dataState.data$.documents$; const savedSearch = useSavedSearchInitial(); const { dataViews, capabilities, uiSettings, uiActions } = services; - const [query, sort, rowHeight, headerRowHeight, rowsPerPage, grid, columns, sampleSizeState] = - useAppStateSelector((state) => { - return [ - state.query, - state.sort, - state.rowHeight, - state.headerRowHeight, - state.rowsPerPage, - state.grid, - state.columns, - state.sampleSize, - ]; - }); + const [ + query, + sort, + rowHeight, + headerRowHeight, + rowsPerPage, + grid, + columns, + sampleSizeState, + density, + ] = useAppStateSelector((state) => { + return [ + state.query, + state.sort, + state.rowHeight, + state.headerRowHeight, + state.rowsPerPage, + state.grid, + state.columns, + state.sampleSize, + state.density, + ]; + }); const expandedDoc = useInternalStateSelector((state) => state.expandedDoc); const isEsqlMode = useIsEsqlMode(); const useNewFieldsApi = useMemo(() => !uiSettings.get(SEARCH_FIELDS_FROM_SOURCE), [uiSettings]); @@ -155,6 +169,13 @@ function DiscoverDocumentsComponent({ stateContainer, }); + const setAppState = useCallback( + ({ settings, ...rest }) => { + stateContainer.appState.update({ ...rest, grid: settings as DiscoverGridSettings }); + }, + [stateContainer] + ); + const { columns: currentColumns, onAddColumn, @@ -166,10 +187,11 @@ function DiscoverDocumentsComponent({ defaultOrder: uiSettings.get(SORT_DEFAULT_ORDER_SETTING), dataView, dataViews, - setAppState: stateContainer.appState.update, + setAppState, useNewFieldsApi, columns, sort, + settings: grid, }); const setExpandedDoc = useCallback( @@ -179,7 +201,7 @@ function DiscoverDocumentsComponent({ [stateContainer] ); - const onResizeDataGrid = useCallback( + const onResizeDataGrid = useCallback>( (colSettings) => onResize(colSettings, stateContainer), [stateContainer] ); @@ -219,6 +241,13 @@ function DiscoverDocumentsComponent({ [stateContainer] ); + const onUpdateDensity = useCallback( + (newDensity: DataGridDensity) => { + stateContainer.appState.update({ density: newDensity }); + }, + [stateContainer] + ); + // should be aligned with embeddable `showTimeCol` prop const showTimeCol = useMemo( () => !uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false), @@ -437,6 +466,8 @@ function DiscoverDocumentsComponent({ customGridColumnsConfiguration={customGridColumnsConfiguration} rowAdditionalLeadingControls={rowAdditionalLeadingControls} additionalFieldGroups={additionalFieldGroups} + dataGridDensityState={density} + onUpdateDataGridDensity={onUpdateDensity} />
diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx index d4798089e09ee..b92719f9a8bb3 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx @@ -30,9 +30,10 @@ import { SHOW_FIELD_STATISTICS, SORT_DEFAULT_ORDER_SETTING, } from '@kbn/discover-utils'; -import { popularizeField, useColumns } from '@kbn/unified-data-table'; +import { UseColumnsProps, popularizeField, useColumns } from '@kbn/unified-data-table'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { BehaviorSubject } from 'rxjs'; +import { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import { useSavedSearchInitial } from '../../state_management/discover_state_provider'; import { DiscoverStateContainer } from '../../state_management/discover_state'; import { VIEW_MODE } from '../../../../../common/constants'; @@ -80,11 +81,12 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) { const pageBackgroundColor = useEuiBackgroundColor('plain'); const globalQueryState = data.query.getState(); const { main$ } = stateContainer.dataState.data$; - const [query, savedQuery, columns, sort] = useAppStateSelector((state) => [ + const [query, savedQuery, columns, sort, grid] = useAppStateSelector((state) => [ state.query, state.savedQuery, state.columns, state.sort, + state.grid, ]); const isEsqlMode = useIsEsqlMode(); @@ -126,6 +128,13 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) { [dataState.fetchStatus, dataState.foundDocuments] ); + const setAppState = useCallback( + ({ settings, ...rest }) => { + stateContainer.appState.update({ ...rest, grid: settings as DiscoverGridSettings }); + }, + [stateContainer] + ); + const { columns: currentColumns, onAddColumn, @@ -135,10 +144,11 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) { defaultOrder: uiSettings.get(SORT_DEFAULT_ORDER_SETTING), dataView, dataViews, - setAppState: stateContainer.appState.update, + setAppState, useNewFieldsApi, columns, sort, + settings: grid, }); // The assistant is getting the state from the url correctly diff --git a/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx b/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx index 735eae1fa9039..1c2e7f3689929 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx @@ -78,6 +78,17 @@ export const DiscoverMainContent = ({ trackUiMetric(METRIC_TYPE.CLICK, DOCUMENTS_VIEW_CLICK); } } + + return new Promise((resolve, reject) => { + // return a promise to report when the view mode has been updated + stateContainer.appState.subscribe((state) => { + if (state.viewMode === mode) { + resolve(mode); + } else { + reject(mode); + } + }); + }); }, [trackUiMetric, stateContainer] ); diff --git a/src/plugins/discover/public/application/main/components/pattern_analysis/pattern_analysis_tab.tsx b/src/plugins/discover/public/application/main/components/pattern_analysis/pattern_analysis_tab.tsx index db02134e0169f..acb00fd027f57 100644 --- a/src/plugins/discover/public/application/main/components/pattern_analysis/pattern_analysis_tab.tsx +++ b/src/plugins/discover/public/application/main/components/pattern_analysis/pattern_analysis_tab.tsx @@ -7,24 +7,16 @@ */ import React, { memo, type FC } from 'react'; -import { useQuerySubscriber } from '@kbn/unified-field-list/src/hooks/use_query_subscriber'; import { useSavedSearch } from '../../state_management/discover_state_provider'; import { PatternAnalysisTable, type PatternAnalysisTableProps } from './pattern_analysis_table'; -import { useDiscoverServices } from '../../../../hooks/use_discover_services'; export const PatternAnalysisTab: FC> = memo( (props) => { - const services = useDiscoverServices(); - const querySubscriberResult = useQuerySubscriber({ - data: services.data, - }); const savedSearch = useSavedSearch(); return ( { const patternAnalysisComponentProps: LogCategorizationEmbeddableProps = useMemo( () => ({ - input: Object.assign( - {}, - pick(props, ['dataView', 'savedSearch', 'query', 'filters', 'switchToDocumentView']), - { lastReloadRequestTime } - ), + input: Object.assign({}, pick(props, ['dataView', 'savedSearch', 'switchToDocumentView']), { + lastReloadRequestTime, + }), renderViewModeToggle: props.renderViewModeToggle, }), [lastReloadRequestTime, props] diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx index fa8128c0b95ec..ac71b1a437038 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx @@ -250,7 +250,7 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) // As unifiedFieldListSidebarContainerRef ref can be empty in the beginning, // we need to fetch the data once API becomes available and after documents are fetched const initializeUnifiedFieldListSidebarContainerApi = useCallback( - (api) => { + (api: UnifiedFieldListSidebarContainerApi) => { if (!api) { return; } diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx index 097278ac9cd66..7b97db9b63318 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx @@ -183,8 +183,9 @@ export function AlertsPopover({ button={anchorElement} closePopover={onClose} isOpen={!alertFlyoutVisible} + panelPaddingSize="s" > - + ); diff --git a/src/plugins/discover/public/application/main/discover_main_route.tsx b/src/plugins/discover/public/application/main/discover_main_route.tsx index 0e1c1472ac556..4ceae12fe8929 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.tsx @@ -354,7 +354,10 @@ export function DiscoverMainRoute({ <> - + {mainContent} diff --git a/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts index f364530faba5e..35463c091109d 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts @@ -26,6 +26,7 @@ import { IKbnUrlStateStorage, ISyncStateRef, syncState } from '@kbn/kibana-utils import { isEqual, omit } from 'lodash'; import { connectToQueryState, syncGlobalQueryStateWithUrl } from '@kbn/data-plugin/public'; import type { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; +import type { DataGridDensity } from '@kbn/unified-data-table'; import type { DiscoverServices } from '../../../build_services'; import { addLog } from '../../../utils/add_log'; import { cleanupUrlState } from './utils/cleanup_url_state'; @@ -155,6 +156,10 @@ export interface DiscoverAppState { * Breakdown field of chart */ breakdownField?: string; + /** + * Density of table + */ + density?: DataGridDensity; } export interface AppStateUrl extends Omit { diff --git a/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts index 6e34982dc91ae..d943dba36f9e2 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts @@ -185,7 +185,7 @@ export function getDataStateContainer({ totalHits$: new BehaviorSubject(initialState), }; - let autoRefreshDone: AutoRefreshDoneFn | undefined; + let autoRefreshDone: AutoRefreshDoneFn | undefined | null = null; /** * handler emitted by `timefilter.getAutoRefreshFetch$()` * to notify when data completed loading and to start a new autorefresh loop @@ -304,8 +304,8 @@ export function getDataStateContainer({ // If the autoRefreshCallback is still the same as when we started i.e. there was no newer call // replacing this current one, call it to make sure we tell that the auto refresh is done - // and a new one can be scheduled. - if (autoRefreshDone === prevAutoRefreshDone) { + // and a new one can be scheduled. null is checked to always start initial looping. + if (autoRefreshDone === prevAutoRefreshDone || prevAutoRefreshDone === null) { // if this function was set and is executed, another refresh fetch can be triggered autoRefreshDone?.(); autoRefreshDone = undefined; diff --git a/src/plugins/discover/public/application/main/state_management/discover_state.test.ts b/src/plugins/discover/public/application/main/state_management/discover_state.test.ts index d9acde1645fcf..cd8e2c47bd02f 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_state.test.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_state.test.ts @@ -456,6 +456,7 @@ describe('Test discover state actions', () => { "columns": Array [ "default_column", ], + "density": undefined, "headerRowHeight": undefined, "hideAggregatedPreview": undefined, "hideChart": undefined, diff --git a/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.test.ts b/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.test.ts index e36a753bd4c25..bdf62d909d964 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.test.ts @@ -53,10 +53,13 @@ describe('getDefaultProfileState', () => { }, defaultColumns: ['messsage', 'bytes'], dataView: emptyDataView, - esqlQueryColumns: [{ id: '1', name: 'foo', meta: { type: 'string' } }], + esqlQueryColumns: [ + { id: '1', name: 'foo', meta: { type: 'string' } }, + { id: '2', name: 'bar', meta: { type: 'string' } }, + ], }); expect(appState).toEqual({ - columns: ['foo'], + columns: ['foo', 'bar'], grid: { columns: { foo: { diff --git a/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.ts b/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.ts index b1bc2bc3e3f92..9454bd483637a 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_default_profile_state.ts @@ -43,8 +43,13 @@ export const getDefaultProfileState = ({ ); if (validColumns?.length) { + const hasAutoWidthColumn = validColumns.some(({ width }) => !width); const columns = validColumns.reduce( - (acc, { name, width }) => (width ? { ...acc, [name]: { width } } : acc), + (acc, { name, width }, index) => { + // Ensure there's at least one auto width column so the columns fill the grid + const skipColumnWidth = !hasAutoWidthColumn && index === validColumns.length - 1; + return width && !skipColumnWidth ? { ...acc, [name]: { width } } : acc; + }, undefined ); diff --git a/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts index 86d9ffe99c244..8e264ea779c33 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts @@ -32,6 +32,7 @@ describe('getStateDefaults', () => { "dataViewId": "index-pattern-with-timefield-id", "type": "dataView", }, + "density": undefined, "filters": undefined, "grid": undefined, "headerRowHeight": undefined, @@ -71,6 +72,7 @@ describe('getStateDefaults', () => { "dataViewId": "the-data-view-id", "type": "dataView", }, + "density": undefined, "filters": undefined, "grid": undefined, "headerRowHeight": undefined, diff --git a/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts index 7e44adf64dbc1..81ec433da249a 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts @@ -81,6 +81,7 @@ export function getStateDefaults({ sampleSize: undefined, grid: undefined, breakdownField: undefined, + density: undefined, }; if (savedSearch.grid) { @@ -113,6 +114,9 @@ export function getStateDefaults({ if (savedSearch.breakdownField) { defaultState.breakdownField = savedSearch.breakdownField; } + if (savedSearch.density) { + defaultState.density = savedSearch.density; + } return defaultState; } diff --git a/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts index 6638e511f6b2f..b767cde6c4a92 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts @@ -69,6 +69,7 @@ export function updateSavedSearch({ savedSearch.headerRowHeight = state.headerRowHeight; savedSearch.rowsPerPage = state.rowsPerPage; savedSearch.sampleSize = state.sampleSize; + savedSearch.density = state.density; if (state.viewMode) { savedSearch.viewMode = state.viewMode; diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx index 28eeb9f3661ff..d5c00d812c7ca 100644 --- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx +++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx @@ -31,7 +31,7 @@ export const DocumentViewModeToggle = ({ isEsqlMode: boolean; prepend?: ReactElement; stateContainer: DiscoverStateContainer; - setDiscoverViewMode: (viewMode: VIEW_MODE) => void; + setDiscoverViewMode: (viewMode: VIEW_MODE) => Promise; patternCount?: number; dataView: DataView; }) => { @@ -86,8 +86,7 @@ export const DocumentViewModeToggle = ({ } }, [showPatternAnalysisTab, viewMode, setDiscoverViewMode]); - const includesNormalTabsStyle = - viewMode === VIEW_MODE.AGGREGATED_LEVEL || viewMode === VIEW_MODE.PATTERN_LEVEL || isLegacy; + const includesNormalTabsStyle = viewMode === VIEW_MODE.AGGREGATED_LEVEL || isLegacy; const containerPadding = includesNormalTabsStyle ? euiTheme.size.s : 0; const containerCss = css` diff --git a/src/plugins/discover/public/context_awareness/__mocks__/index.tsx b/src/plugins/discover/public/context_awareness/__mocks__/index.tsx index 5d55dfa306b8e..873319c0e75ab 100644 --- a/src/plugins/discover/public/context_awareness/__mocks__/index.tsx +++ b/src/plugins/discover/public/context_awareness/__mocks__/index.tsx @@ -63,6 +63,10 @@ export const createContextAwarenessMocks = ({ name: 'foo', width: 300, }, + { + name: 'bar', + width: 400, + }, ], rowHeight: 3, })), diff --git a/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx b/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx index 747bada5b0284..2d30aeee2e2c3 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx +++ b/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx @@ -7,7 +7,7 @@ */ import { EuiBadge } from '@elastic/eui'; -import type { DataTableRecord } from '@kbn/discover-utils'; +import { getFieldValue } from '@kbn/discover-utils'; import type { RowControlColumn } from '@kbn/unified-data-table'; import { isOfAggregateQueryType } from '@kbn/es-query'; import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; @@ -19,6 +19,7 @@ import { DataSourceCategory, DataSourceProfileProvider } from '../../profiles'; export const exampleDataSourceProfileProvider: DataSourceProfileProvider = { profileId: 'example-data-source-profile', + isExperimental: true, profile: { getCellRenderers: (prev) => () => ({ ...prev(), @@ -137,8 +138,3 @@ export const exampleDataSourceProfileProvider: DataSourceProfileProvider = { }; }, }; - -const getFieldValue = (record: DataTableRecord, field: string) => { - const value = record.flattened[field]; - return Array.isArray(value) ? value[0] : value; -}; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/example_document_profile/profile.ts b/src/plugins/discover/public/context_awareness/profile_providers/example_document_profile/profile.ts index 9739430e08000..61045fe37c342 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/example_document_profile/profile.ts +++ b/src/plugins/discover/public/context_awareness/profile_providers/example_document_profile/profile.ts @@ -6,11 +6,12 @@ * Side Public License, v 1. */ -import type { DataTableRecord } from '@kbn/discover-utils'; +import { getFieldValue } from '@kbn/discover-utils'; import { DocumentProfileProvider, DocumentType } from '../../profiles'; export const exampleDocumentProfileProvider: DocumentProfileProvider = { profileId: 'example-document-profile', + isExperimental: true, profile: {}, resolve: (params) => { if (getFieldValue(params.record, 'data_stream.type') !== 'example') { @@ -25,8 +26,3 @@ export const exampleDocumentProfileProvider: DocumentProfileProvider = { }; }, }; - -const getFieldValue = (record: DataTableRecord, field: string) => { - const value = record.flattened[field]; - return Array.isArray(value) ? value[0] : value; -}; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/example_root_pofile/profile.tsx b/src/plugins/discover/public/context_awareness/profile_providers/example_root_pofile/profile.tsx index 389059c518217..4d00318018a48 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/example_root_pofile/profile.tsx +++ b/src/plugins/discover/public/context_awareness/profile_providers/example_root_pofile/profile.tsx @@ -13,6 +13,7 @@ import { RootProfileProvider, SolutionType } from '../../profiles'; export const exampleRootProfileProvider: RootProfileProvider = { profileId: 'example-root-profile', + isExperimental: true, profile: { getCellRenderers: (prev) => () => ({ ...prev(), diff --git a/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.test.ts b/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.test.ts index 78048cdcbad60..de404317b1a39 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.test.ts +++ b/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.test.ts @@ -12,34 +12,51 @@ import { exampleDataSourceProfileProvider } from './example_data_source_profile' import { exampleDocumentProfileProvider } from './example_document_profile'; import { exampleRootProfileProvider } from './example_root_pofile'; import { - registerEnabledProfileProviders, registerProfileProviders, + registerEnabledProfileProviders, } from './register_profile_providers'; describe('registerEnabledProfileProviders', () => { - it('should register enabled profile providers', async () => { + it('should register all profile providers', async () => { const { rootProfileServiceMock, rootProfileProviderMock } = createContextAwarenessMocks({ shouldRegisterProviders: false, }); registerEnabledProfileProviders({ profileService: rootProfileServiceMock, - availableProviders: [rootProfileProviderMock], - enabledProfileIds: ['root-profile'], + providers: [rootProfileProviderMock], + enabledExperimentalProfileIds: [], }); const context = await rootProfileServiceMock.resolve({ solutionNavId: null }); expect(rootProfileServiceMock.getProfile(context)).toBe(rootProfileProviderMock.profile); }); - it('should not register disabled profile providers', async () => { + it('should not register experimental profile providers by default', async () => { + const { rootProfileServiceMock } = createContextAwarenessMocks({ + shouldRegisterProviders: false, + }); + + registerEnabledProfileProviders({ + profileService: rootProfileServiceMock, + providers: [exampleRootProfileProvider], + enabledExperimentalProfileIds: [], + }); + const context = await rootProfileServiceMock.resolve({ solutionNavId: null }); + expect(rootProfileServiceMock.getProfile(context)).not.toBe(exampleRootProfileProvider.profile); + expect(rootProfileServiceMock.getProfile(context)).toMatchObject({}); + }); + + it('should register experimental profile providers when enabled by config', async () => { const { rootProfileServiceMock, rootProfileProviderMock } = createContextAwarenessMocks({ shouldRegisterProviders: false, }); + registerEnabledProfileProviders({ profileService: rootProfileServiceMock, - availableProviders: [rootProfileProviderMock], - enabledProfileIds: [], + providers: [exampleRootProfileProvider], + enabledExperimentalProfileIds: [exampleRootProfileProvider.profileId], }); const context = await rootProfileServiceMock.resolve({ solutionNavId: null }); + expect(rootProfileServiceMock.getProfile(context)).toBe(exampleRootProfileProvider.profile); expect(rootProfileServiceMock.getProfile(context)).not.toBe(rootProfileProviderMock.profile); }); }); @@ -54,7 +71,7 @@ describe('registerProfileProviders', () => { rootProfileService: rootProfileServiceMock, dataSourceProfileService: dataSourceProfileServiceMock, documentProfileService: documentProfileServiceMock, - experimentalProfileIds: [ + enabledExperimentalProfileIds: [ exampleRootProfileProvider.profileId, exampleDataSourceProfileProvider.profileId, exampleDocumentProfileProvider.profileId, @@ -93,7 +110,7 @@ describe('registerProfileProviders', () => { rootProfileService: rootProfileServiceMock, dataSourceProfileService: dataSourceProfileServiceMock, documentProfileService: documentProfileServiceMock, - experimentalProfileIds: [], + enabledExperimentalProfileIds: [], }); const rootContext = await rootProfileServiceMock.resolve({ solutionNavId: null }); const dataSourceContext = await dataSourceProfileServiceMock.resolve({ diff --git a/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.ts b/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.ts index 22ed673cd9558..ffbad9bfe6f71 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.ts +++ b/src/plugins/discover/public/context_awareness/profile_providers/register_profile_providers.ts @@ -6,11 +6,9 @@ * Side Public License, v 1. */ -import { uniq } from 'lodash'; import type { DataSourceProfileService, DocumentProfileService, - RootProfileProvider, RootProfileService, } from '../profiles'; import type { BaseProfileProvider, BaseProfileService } from '../profile_service'; @@ -19,6 +17,7 @@ import { exampleDocumentProfileProvider } from './example_document_profile'; import { exampleRootProfileProvider } from './example_root_pofile'; import { createLogsDataSourceProfileProviders } from './logs_data_source_profile'; import { createLogDocumentProfileProvider } from './log_document_profile'; +import { createSecurityRootProfileProvider } from './security/security_root_profile'; import { createProfileProviderServices, ProfileProviderServices, @@ -28,40 +27,37 @@ export const registerProfileProviders = ({ rootProfileService, dataSourceProfileService, documentProfileService, - experimentalProfileIds, + enabledExperimentalProfileIds, }: { rootProfileService: RootProfileService; dataSourceProfileService: DataSourceProfileService; documentProfileService: DocumentProfileService; - experimentalProfileIds: string[]; + /** + * List of experimental profile Ids which are enabled in kibana config. + * */ + enabledExperimentalProfileIds: string[]; }) => { const providerServices = createProfileProviderServices(); const rootProfileProviders = createRootProfileProviders(providerServices); const dataSourceProfileProviders = createDataSourceProfileProviders(providerServices); const documentProfileProviders = createDocumentProfileProviders(providerServices); - const enabledProfileIds = uniq([ - ...extractProfileIds(rootProfileProviders), - ...extractProfileIds(dataSourceProfileProviders), - ...extractProfileIds(documentProfileProviders), - ...experimentalProfileIds, - ]); registerEnabledProfileProviders({ profileService: rootProfileService, - availableProviders: [exampleRootProfileProvider, ...rootProfileProviders], - enabledProfileIds, + providers: [...rootProfileProviders], + enabledExperimentalProfileIds, }); registerEnabledProfileProviders({ profileService: dataSourceProfileService, - availableProviders: [exampleDataSourceProfileProvider, ...dataSourceProfileProviders], - enabledProfileIds, + providers: [...dataSourceProfileProviders], + enabledExperimentalProfileIds, }); registerEnabledProfileProviders({ profileService: documentProfileService, - availableProviders: [exampleDocumentProfileProvider, ...documentProfileProviders], - enabledProfileIds, + providers: [...documentProfileProviders], + enabledExperimentalProfileIds, }); }; @@ -70,30 +66,37 @@ export const registerEnabledProfileProviders = < TService extends BaseProfileService >({ profileService, - availableProviders, - enabledProfileIds, + providers: availableProviders, + enabledExperimentalProfileIds = [], }: { profileService: TService; - availableProviders: TProvider[]; - enabledProfileIds: string[]; + providers: TProvider[]; + /** + * List of experimental profile Ids which are enabled in kibana config. + * */ + enabledExperimentalProfileIds?: string[]; }) => { for (const provider of availableProviders) { - if (enabledProfileIds.includes(provider.profileId)) { + const isProfileExperimental = provider.isExperimental ?? false; + const isProfileEnabled = + enabledExperimentalProfileIds.includes(provider.profileId) || !isProfileExperimental; + if (isProfileEnabled) { profileService.registerProvider(provider); } } }; -const extractProfileIds = (providers: Array>) => - providers.map(({ profileId }) => profileId); - -const createRootProfileProviders = (_providerServices: ProfileProviderServices) => - [] as RootProfileProvider[]; +const createRootProfileProviders = (_providerServices: ProfileProviderServices) => [ + exampleRootProfileProvider, + createSecurityRootProfileProvider(_providerServices), +]; const createDataSourceProfileProviders = (providerServices: ProfileProviderServices) => [ + exampleDataSourceProfileProvider, ...createLogsDataSourceProfileProviders(providerServices), ]; const createDocumentProfileProviders = (providerServices: ProfileProviderServices) => [ + exampleDocumentProfileProvider, createLogDocumentProfileProvider(providerServices), ]; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/index.ts b/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/index.ts new file mode 100644 index 0000000000000..b6bf175abed4d --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/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 { createSecurityRootProfileProvider } from './profile'; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/profile.tsx b/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/profile.tsx new file mode 100644 index 0000000000000..1bd58e361d88b --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/security/security_root_profile/profile.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 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 { getDiscoverCellRenderer } from '@kbn/security-solution-common'; +import { RootProfileProvider, SolutionType } from '../../../profiles'; +import { ProfileProviderServices } from '../../profile_provider_services'; +import { SecurityProfileProviderFactory } from '../types'; + +export const createSecurityRootProfileProvider: SecurityProfileProviderFactory< + RootProfileProvider +> = (services: ProfileProviderServices) => ({ + profileId: 'security-root-profile', + isExperimental: true, + profile: { + getCellRenderers: (prev) => () => ({ + ...prev(), + 'host.name': (props) => { + const CellRenderer = getDiscoverCellRenderer({ + fieldName: 'host.name', + }); + return ; + }, + }), + }, + resolve: (params) => { + if (params.solutionNavId === SolutionType.Security) { + return { isMatch: true, context: { solutionType: SolutionType.Security } }; + } + + return { isMatch: false }; + }, +}); diff --git a/src/plugins/discover/public/context_awareness/profile_providers/security/types.ts b/src/plugins/discover/public/context_awareness/profile_providers/security/types.ts new file mode 100644 index 0000000000000..f04ec6f00efb1 --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/security/types.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. + */ + +import { ProfileProviderServices } from '../profile_provider_services'; + +export type SecurityProfileProviderFactory = (services: ProfileProviderServices) => T; diff --git a/src/plugins/discover/public/context_awareness/profile_service.ts b/src/plugins/discover/public/context_awareness/profile_service.ts index efc143e222414..ac4f4eacee42c 100644 --- a/src/plugins/discover/public/context_awareness/profile_service.ts +++ b/src/plugins/discover/public/context_awareness/profile_service.ts @@ -20,6 +20,18 @@ export type ContextWithProfileId = TContext & { profileId: string }; export interface BaseProfileProvider { profileId: string; profile: ComposableProfile; + /** + * isExperimental Flag can be used for any profile which is under development and should not be enabled by default. + * + * Experimental profiles can still be enabled in kibana config with option `discover.experimental.enabledProfiles` as shown in example below: + * + * ```yaml + * discover.experimental.enabledProfiles: + * - example-root-profile + * - example-data-source-profile + * ``` + */ + isExperimental?: boolean; } export interface ProfileProvider diff --git a/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts b/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts index 0c324930e1f85..ea5ba55d8eccf 100644 --- a/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts +++ b/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts @@ -17,7 +17,7 @@ import { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; import { FetchContext } from '@kbn/presentation-publishing'; import { DiscoverGridSettings, SavedSearch, VIEW_MODE } from '@kbn/saved-search-plugin/common'; import { SearchResponseIncompleteWarning } from '@kbn/search-response-warnings/src/types'; -import { SortOrder } from '@kbn/unified-data-table'; +import type { SortOrder, DataGridDensity } from '@kbn/unified-data-table'; export const getMockedSearchApi = ({ searchSource, @@ -52,6 +52,7 @@ export const getMockedSearchApi = ({ headerRowHeight: new BehaviorSubject(savedSearch.headerRowHeight), rowsPerPage: new BehaviorSubject(savedSearch.rowsPerPage), sampleSize: new BehaviorSubject(savedSearch.sampleSize), + density: new BehaviorSubject(savedSearch.density), grid: new BehaviorSubject(savedSearch.grid), rows: new BehaviorSubject([]), totalHitCount: new BehaviorSubject(0), diff --git a/src/plugins/discover/public/embeddable/components/search_embeddable_grid_component.tsx b/src/plugins/discover/public/embeddable/components/search_embeddable_grid_component.tsx index 55ed59d30f1ae..f2ccc2b9b10c0 100644 --- a/src/plugins/discover/public/embeddable/components/search_embeddable_grid_component.tsx +++ b/src/plugins/discover/public/embeddable/components/search_embeddable_grid_component.tsx @@ -13,6 +13,7 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import { DOC_HIDE_TIME_COLUMN_SETTING, SEARCH_FIELDS_FROM_SOURCE, + SORT_DEFAULT_ORDER_SETTING, isLegacyTableEnabled, } from '@kbn/discover-utils'; import { Filter } from '@kbn/es-query'; @@ -22,9 +23,10 @@ import { } from '@kbn/presentation-publishing'; import { SortOrder } from '@kbn/saved-search-plugin/public'; import { SearchResponseIncompleteWarning } from '@kbn/search-response-warnings/src/types'; -import { columnActions, DataLoadingState } from '@kbn/unified-data-table'; +import { DataGridDensity, DataLoadingState, useColumns } from '@kbn/unified-data-table'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; +import { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import { DiscoverDocTableEmbeddable } from '../../components/doc_table/create_doc_table_embeddable'; import { useDiscoverServices } from '../../hooks/use_discover_services'; import { getSortForEmbeddable } from '../../utils'; @@ -34,6 +36,7 @@ import { isEsqlMode } from '../initialize_fetch'; import type { SearchEmbeddableApi, SearchEmbeddableStateManager } from '../types'; import { DiscoverGridEmbeddable } from './saved_search_grid'; import { getSearchEmbeddableDefaults } from '../get_search_embeddable_defaults'; +import { onResizeGridColumn } from '../../utils/on_resize_grid_column'; interface SavedSearchEmbeddableComponentProps { api: SearchEmbeddableApi & { fetchWarnings$: BehaviorSubject }; @@ -60,6 +63,7 @@ export function SearchEmbeddableGridComponent({ rows, totalHitCount, columnsMeta, + grid, ] = useBatchedPublishingSubjects( api.dataLoading, api.savedSearch$, @@ -67,7 +71,8 @@ export function SearchEmbeddableGridComponent({ api.fetchWarnings$, stateManager.rows, stateManager.totalHitCount, - stateManager.columnsMeta + stateManager.columnsMeta, + stateManager.grid ); const [panelTitle, panelDescription, savedSearchTitle, savedSearchDescription] = @@ -92,32 +97,37 @@ export function SearchEmbeddableGridComponent({ return getSortForEmbeddable(savedSearch.sort, dataView, discoverServices.uiSettings, isEsql); }, [savedSearch.sort, dataView, isEsql, discoverServices.uiSettings]); + const originalColumns = useMemo(() => savedSearch.columns ?? [], [savedSearch.columns]); + const useNewFieldsApi = !discoverServices.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false); + + const { columns, onAddColumn, onRemoveColumn, onMoveColumn, onSetColumns } = useColumns({ + capabilities: discoverServices.capabilities, + defaultOrder: discoverServices.uiSettings.get(SORT_DEFAULT_ORDER_SETTING), + dataView, + dataViews: discoverServices.dataViews, + setAppState: (params) => { + if (params.columns) { + stateManager.columns.next(params.columns); + } + if (params.sort) { + stateManager.sort.next(params.sort as SortOrder[]); + } + if (params.settings) { + stateManager.grid.next(params.settings as DiscoverGridSettings); + } + }, + useNewFieldsApi, + columns: originalColumns, + sort, + settings: grid, + }); + const onStateEditedProps = useMemo( () => ({ - onAddColumn: (columnName: string) => { - if (!savedSearch.columns) { - return; - } - const updatedColumns = columnActions.addColumn(savedSearch.columns, columnName, true); - stateManager.columns.next(updatedColumns); - }, - onSetColumns: (updatedColumns: string[]) => { - stateManager.columns.next(updatedColumns); - }, - onMoveColumn: (columnName: string, newIndex: number) => { - if (!savedSearch.columns) { - return; - } - const updatedColumns = columnActions.moveColumn(savedSearch.columns, columnName, newIndex); - stateManager.columns.next(updatedColumns); - }, - onRemoveColumn: (columnName: string) => { - if (!savedSearch.columns) { - return; - } - const updatedColumns = columnActions.removeColumn(savedSearch.columns, columnName, true); - stateManager.columns.next(updatedColumns); - }, + onAddColumn, + onSetColumns, + onMoveColumn, + onRemoveColumn, onUpdateRowsPerPage: (newRowsPerPage: number | undefined) => { stateManager.rowsPerPage.next(newRowsPerPage); }, @@ -137,8 +147,27 @@ export function SearchEmbeddableGridComponent({ onUpdateSampleSize: (newSampleSize: number | undefined) => { stateManager.sampleSize.next(newSampleSize); }, + onUpdateDataGridDensity: (newDensity: DataGridDensity | undefined) => { + stateManager.density.next(newDensity); + }, + onResize: (newGridSettings: { columnId: string; width: number | undefined }) => { + stateManager.grid.next(onResizeGridColumn(newGridSettings, grid)); + }, }), - [stateManager, savedSearch.columns] + [ + onAddColumn, + onSetColumns, + onMoveColumn, + onRemoveColumn, + stateManager.rowsPerPage, + stateManager.rowHeight, + stateManager.headerRowHeight, + stateManager.sort, + stateManager.sampleSize, + stateManager.density, + stateManager.grid, + grid, + ] ); const fetchedSampleSize = useMemo(() => { @@ -148,7 +177,7 @@ export function SearchEmbeddableGridComponent({ const defaults = getSearchEmbeddableDefaults(discoverServices.uiSettings); const sharedProps = { - columns: savedSearch.columns ?? [], + columns, dataView, interceptedWarnings, onFilter: onAddFilter, @@ -158,7 +187,7 @@ export function SearchEmbeddableGridComponent({ searchDescription: panelDescription || savedSearchDescription, sort, totalHitCount, - useNewFieldsApi: !discoverServices.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false), + useNewFieldsApi, }; if (useLegacyTable) { @@ -194,6 +223,7 @@ export function SearchEmbeddableGridComponent({ searchTitle={panelTitle || savedSearchTitle} services={discoverServices} showTimeCol={!discoverServices.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false)} + dataGridDensityState={savedSearch.density} /> ); } diff --git a/src/plugins/discover/public/embeddable/constants.ts b/src/plugins/discover/public/embeddable/constants.ts index 7ada36e3a005d..943e1363b5212 100644 --- a/src/plugins/discover/public/embeddable/constants.ts +++ b/src/plugins/discover/public/embeddable/constants.ts @@ -31,6 +31,8 @@ export const EDITABLE_SAVED_SEARCH_KEYS: Readonly(initialState.rowHeight); const rowsPerPage$ = new BehaviorSubject(initialState.rowsPerPage); const sampleSize$ = new BehaviorSubject(initialState.sampleSize); + const density$ = new BehaviorSubject(initialState.density); const sort$ = new BehaviorSubject(initialState.sort); const savedSearchViewMode$ = new BehaviorSubject(initialState.viewMode); @@ -129,6 +130,7 @@ export const initializeSearchEmbeddableApi = async ( sort: sort$, totalHitCount: totalHitCount$, viewMode: savedSearchViewMode$, + density: density$, }; /** The saved search should be the source of truth for all state */ @@ -169,6 +171,7 @@ export const initializeSearchEmbeddableApi = async ( comparators: { sort: [sort$, (value) => sort$.next(value), (a, b) => deepEqual(a, b)], columns: [columns$, (value) => columns$.next(value), (a, b) => deepEqual(a, b)], + grid: [grid$, (value) => grid$.next(value), (a, b) => deepEqual(a, b)], sampleSize: [ sampleSize$, (value) => sampleSize$.next(value), @@ -196,7 +199,7 @@ export const initializeSearchEmbeddableApi = async ( (value) => serializedSearchSource$.next(value), ], viewMode: [savedSearchViewMode$, (value) => savedSearchViewMode$.next(value)], - grid: [grid$, (value) => grid$.next(value)], + density: [density$, (value) => density$.next(value)], }, }; }; diff --git a/src/plugins/discover/public/embeddable/types.ts b/src/plugins/discover/public/embeddable/types.ts index 8ff429e6476f9..70a929d1dee60 100644 --- a/src/plugins/discover/public/embeddable/types.ts +++ b/src/plugins/discover/public/embeddable/types.ts @@ -41,6 +41,7 @@ export type SearchEmbeddableState = Pick< | 'sampleSize' | 'viewMode' | 'grid' + | 'density' > & { rows: DataTableRecord[]; columnsMeta: DataTableColumnsMeta | undefined; diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index d81bacb958d38..61a205be2cff5 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -306,13 +306,13 @@ export class DiscoverPlugin const rootProfileService = new RootProfileService(); const dataSourceProfileService = new DataSourceProfileService(); const documentProfileService = new DocumentProfileService(); - const experimentalProfileIds = this.experimentalFeatures.enabledProfiles ?? []; + const enabledExperimentalProfileIds = this.experimentalFeatures.enabledProfiles ?? []; registerProfileProviders({ rootProfileService, dataSourceProfileService, documentProfileService, - experimentalProfileIds, + enabledExperimentalProfileIds, }); return { rootProfileService, dataSourceProfileService, documentProfileService }; diff --git a/src/plugins/discover/public/utils/on_resize_grid_column.ts b/src/plugins/discover/public/utils/on_resize_grid_column.ts index cacbc2085b22f..9df887a3386a7 100644 --- a/src/plugins/discover/public/utils/on_resize_grid_column.ts +++ b/src/plugins/discover/public/utils/on_resize_grid_column.ts @@ -9,13 +9,13 @@ import type { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; export const onResizeGridColumn = ( - colSettings: { columnId: string; width: number }, + colSettings: { columnId: string; width: number | undefined }, gridState: DiscoverGridSettings | undefined ): DiscoverGridSettings => { const grid = { ...(gridState || {}) }; const newColumns = { ...(grid.columns || {}) }; - newColumns[colSettings.columnId] = { - width: Math.round(colSettings.width), - }; + newColumns[colSettings.columnId] = colSettings.width + ? { width: Math.round(colSettings.width) } + : {}; return { ...grid, columns: newColumns }; }; diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 526b3ea6ddf3c..a363981a5d731 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -94,7 +94,10 @@ "@kbn/search-types", "@kbn/presentation-containers", "@kbn/observability-ai-assistant-plugin", - "@kbn/fields-metadata-plugin" + "@kbn/fields-metadata-plugin", + "@kbn/security-solution-common" ], - "exclude": ["target/**/*"] + "exclude": [ + "target/**/*" + ] } diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx index f538c7b1164b1..5b198f7ad45fc 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx @@ -65,6 +65,7 @@ export const ReactEmbeddableRenderer = < | 'showBorder' | 'showBadges' | 'showNotifications' + | 'hideLoader' | 'hideHeader' | 'hideInspector' >; diff --git a/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx b/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx index b09215146a59b..3794f605e4e64 100644 --- a/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx +++ b/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx @@ -11,7 +11,7 @@ import { EuiFormRow, EuiSelect } from '@elastic/eui'; import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib'; -interface Props { +export interface Props { field: FieldHook; euiFieldProps: { options: Array< diff --git a/src/plugins/event_annotation/common/content_management/v1/types.ts b/src/plugins/event_annotation/common/content_management/v1/types.ts index d85250e3883fa..6e2ee48e010f9 100644 --- a/src/plugins/event_annotation/common/content_management/v1/types.ts +++ b/src/plugins/event_annotation/common/content_management/v1/types.ts @@ -18,7 +18,7 @@ import { CreateResult, UpdateResult, } from '@kbn/content-management-plugin/common'; -import { ContentManagementCrudTypes } from '@kbn/content-management-utils'; +import type { ContentManagementCrudTypes } from '@kbn/content-management-utils'; import type { DataViewSpec } from '@kbn/data-views-plugin/common'; import type { EventAnnotationConfig } from '@kbn/event-annotation-common'; diff --git a/src/plugins/event_annotation/server/content_management/event_annotation_group_storage.ts b/src/plugins/event_annotation/server/content_management/event_annotation_group_storage.ts index 49a5b516c1d24..ea92e9ac0fa10 100644 --- a/src/plugins/event_annotation/server/content_management/event_annotation_group_storage.ts +++ b/src/plugins/event_annotation/server/content_management/event_annotation_group_storage.ts @@ -9,7 +9,7 @@ import { SOContentStorage } from '@kbn/content-management-utils'; import { EVENT_ANNOTATION_GROUP_TYPE } from '@kbn/event-annotation-common'; import { Logger } from '@kbn/logging'; -import { cmServicesDefinition } from '../../common/content_management/cm_services'; +import { cmServicesDefinition } from './schema/cm_services'; import type { EventAnnotationGroupCrudTypes } from '../../common/content_management'; export class EventAnnotationGroupStorage extends SOContentStorage { diff --git a/src/plugins/event_annotation/common/content_management/cm_services.ts b/src/plugins/event_annotation/server/content_management/schema/cm_services.ts similarity index 100% rename from src/plugins/event_annotation/common/content_management/cm_services.ts rename to src/plugins/event_annotation/server/content_management/schema/cm_services.ts diff --git a/src/plugins/event_annotation/common/content_management/v1/cm_services.ts b/src/plugins/event_annotation/server/content_management/schema/v1/cm_services.ts similarity index 100% rename from src/plugins/event_annotation/common/content_management/v1/cm_services.ts rename to src/plugins/event_annotation/server/content_management/schema/v1/cm_services.ts diff --git a/src/plugins/field_formats/public/lib/converters/_string.scss b/src/plugins/field_formats/public/lib/converters/_string.scss index 9d97f0195780c..dd27bded25083 100644 --- a/src/plugins/field_formats/public/lib/converters/_string.scss +++ b/src/plugins/field_formats/public/lib/converters/_string.scss @@ -1,3 +1,7 @@ .ffString__emptyValue { color: $euiColorDarkShade; } + +.lnsTableCell--colored .ffString__emptyValue { + color: unset; +} diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts index cbd29e6bf4c18..a4121ed4195d1 100644 --- a/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts @@ -9,13 +9,12 @@ import type { Logger } from '@kbn/core/server'; import { set } from '@kbn/safer-lodash-set'; import { Readable } from 'stream'; -import { encode } from 'cbor-x'; +import { encode, decode } from '@kbn/cbor'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { ContentStream, ContentStreamEncoding, ContentStreamParameters } from './content_stream'; import type { GetResponse } from '@elastic/elasticsearch/lib/api/types'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { FileDocument } from '../../../../file_client/file_metadata_client/adapters/es_index'; -import * as cborx from 'cbor-x'; import { IndexRequest } from '@elastic/elasticsearch/lib/api/types'; describe('ContentStream', () => { @@ -415,7 +414,7 @@ describe('ContentStream', () => { stream.end('some data'); await new Promise((resolve) => stream.once('finish', resolve)); const docBuffer = (client.index.mock.calls[0][0] as IndexRequest).document as Buffer; - const docData = cborx.decode(docBuffer); + const docData = decode(docBuffer); expect(docData).toHaveProperty('@timestamp'); }); diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts index 9c8fc7fbe84c7..1e1d4c9d21708 100644 --- a/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts @@ -7,7 +7,7 @@ */ import { createId } from '@paralleldrive/cuid2'; -import * as cborx from 'cbor-x'; +import { encode, decode } from '@kbn/cbor'; import { errors as esErrors } from '@elastic/elasticsearch'; import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { ByteSizeValue } from '@kbn/config-schema'; @@ -144,7 +144,7 @@ export class ContentStream extends Duplex { } const buffer = Buffer.concat(chunks); const decodedChunkDoc: GetResponse | undefined = buffer.byteLength - ? (cborx.decode(buffer) as GetResponse) + ? (decode(buffer) as GetResponse) : undefined; // Because `asStream` was used in retrieving the document, errors are also not be processed @@ -245,7 +245,7 @@ export class ContentStream extends Duplex { id, index, op_type: 'create', - document: cborx.encode({ + document: encode({ data, bid, // Mark it as last? diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts index 947d9eecd8fd0..2279b85165299 100644 --- a/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts @@ -7,7 +7,7 @@ */ import { Readable } from 'stream'; -import { encode } from 'cbor-x'; +import { encode } from '@kbn/cbor'; import { promisify } from 'util'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; diff --git a/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts index 981810e968f65..922c84fa015d3 100644 --- a/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts @@ -107,7 +107,7 @@ describe('Elasticsearch blob storage', () => { esBlobStorage = createEsBlobStorage({ chunkSize: '1024B' }); const { id } = await esBlobStorage.upload(Readable.from([fileString])); expect(await getAllDocCount()).toMatchObject({ count: 37 }); - esRefreshIndexSpy.mockReset(); + esRefreshIndexSpy.mockClear(); const rs = await esBlobStorage.download({ id }); expect(esRefreshIndexSpy).toHaveBeenCalled(); // Make sure we refresh the index before downloading the chunks const chunks: string[] = []; @@ -141,7 +141,7 @@ describe('Elasticsearch blob storage', () => { const { id } = await esBlobStorage.upload(Readable.from([fileString])); const { id: id2 } = await esBlobStorage.upload(Readable.from([fileString2])); expect(await getAllDocCount()).toMatchObject({ count: 10 }); - esRefreshIndexSpy.mockReset(); + esRefreshIndexSpy.mockClear(); await esBlobStorage.delete(id); expect(esRefreshIndexSpy).toHaveBeenCalled(); // Make sure we refresh the index before deleting the chunks expect(await getAllDocCount()).toMatchObject({ count: 2 }); diff --git a/src/plugins/files/tsconfig.json b/src/plugins/files/tsconfig.json index 29f7281340dd0..c31650d197ba2 100644 --- a/src/plugins/files/tsconfig.json +++ b/src/plugins/files/tsconfig.json @@ -33,6 +33,7 @@ "@kbn/logging", "@kbn/core-http-common", "@kbn/core-lifecycle-server-internal", + "@kbn/cbor", ], "exclude": [ "target/**/*", diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts index 812052480e8b2..d3cca336413b8 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts @@ -141,7 +141,7 @@ export const getSavedObjects = (): SavedObject[] => [ description: 'Analyze mock eCommerce orders and revenue', refreshInterval: { pause: true, - value: 0, + value: 60000, }, timeRestore: true, optionsJSON: diff --git a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts index 3c3bf07f28da5..fcc780f8b7b64 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts @@ -141,7 +141,7 @@ export const getSavedObjects = (): SavedObject[] => [ 'Analyze mock flight data for ES-Air, Logstash Airways, Kibana Airlines and JetBeats', refreshInterval: { pause: true, - value: 0, + value: 60000, }, timeRestore: true, optionsJSON: diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index c0140bd89283d..d4a3fd466ba0d 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -305,8 +305,8 @@ export const getSavedObjects = (): SavedObject[] => [ }, description: "Analyze mock web traffic log data for Elastic's website", refreshInterval: { - pause: false, - value: 900000, + pause: true, + value: 60000, }, timeRestore: true, optionsJSON: diff --git a/src/plugins/home/server/tutorials/register.ts b/src/plugins/home/server/tutorials/register.ts index bc8c85c43e691..42e1d425cf539 100644 --- a/src/plugins/home/server/tutorials/register.ts +++ b/src/plugins/home/server/tutorials/register.ts @@ -98,7 +98,6 @@ import { redisenterpriseMetricsSpecProvider } from './redisenterprise_metrics'; import { santaLogsSpecProvider } from './santa_logs'; import { sonicwallLogsSpecProvider } from './sonicwall_logs'; import { sophosLogsSpecProvider } from './sophos_logs'; -import { squidLogsSpecProvider } from './squid_logs'; import { stanMetricsSpecProvider } from './stan_metrics'; import { statsdMetricsSpecProvider } from './statsd_metrics'; import { suricataLogsSpecProvider } from './suricata_logs'; @@ -223,7 +222,6 @@ export const builtInTutorials = [ santaLogsSpecProvider, sonicwallLogsSpecProvider, sophosLogsSpecProvider, - squidLogsSpecProvider, tomcatLogsSpecProvider, zscalerLogsSpecProvider, ]; diff --git a/src/plugins/home/server/tutorials/squid_logs/index.ts b/src/plugins/home/server/tutorials/squid_logs/index.ts deleted file mode 100644 index 05b76ab92bcc5..0000000000000 --- a/src/plugins/home/server/tutorials/squid_logs/index.ts +++ /dev/null @@ -1,61 +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 { i18n } from '@kbn/i18n'; -import { TutorialsCategory } from '../../services/tutorials'; -import { - onPremInstructions, - cloudInstructions, - onPremCloudInstructions, -} from '../instructions/filebeat_instructions'; -import { - TutorialContext, - TutorialSchema, -} from '../../services/tutorials/lib/tutorials_registry_types'; - -export function squidLogsSpecProvider(context: TutorialContext): TutorialSchema { - const moduleName = 'squid'; - const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'] as const; - return { - id: 'squidLogs', - name: i18n.translate('home.tutorials.squidLogs.nameTitle', { - defaultMessage: 'Squid Logs', - }), - moduleName, - category: TutorialsCategory.SECURITY_SOLUTION, - shortDescription: i18n.translate('home.tutorials.squidLogs.shortDescription', { - defaultMessage: 'Collect and parse logs from Squid servers with Filebeat.', - }), - longDescription: i18n.translate('home.tutorials.squidLogs.longDescription', { - defaultMessage: - 'This is a module for receiving Squid logs over Syslog or a file. \ -[Learn more]({learnMoreLink}).', - values: { - learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-squid.html', - }, - }), - euiIconType: 'logoLogging', - artifacts: { - dashboards: [], - application: { - path: '/app/security', - label: i18n.translate('home.tutorials.squidLogs.artifacts.dashboards.linkLabel', { - defaultMessage: 'Security App', - }), - }, - exportedFields: { - documentationUrl: '{config.docs.beats.filebeat}/exported-fields-squid.html', - }, - }, - completionTimeMinutes: 10, - onPrem: onPremInstructions(moduleName, platforms, context), - elasticCloud: cloudInstructions(moduleName, platforms, context), - onPremElasticCloud: onPremCloudInstructions(moduleName, platforms, context), - integrationBrowserCategories: ['security', 'network', 'proxy_security'], - }; -} diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index 0a3a113f07664..84aa916c2fe9f 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -114,6 +114,7 @@ export class RequestSelector extends Component { } > diff --git a/src/plugins/interactive_setup/server/verification_code.ts b/src/plugins/interactive_setup/server/verification_code.ts index d14cdb85e0204..47c3ba73c174d 100644 --- a/src/plugins/interactive_setup/server/verification_code.ts +++ b/src/plugins/interactive_setup/server/verification_code.ts @@ -69,20 +69,24 @@ Your verification code is: ${highlightedCode} /** * Returns a cryptographically secure and random 6-digit code. - * - * Implementation notes: `secureRandomNumber` returns a random number like `0.05505769583xxxx`. To - * turn that into a 6 digit code we multiply it by `10^6` and result is `055057`. */ private static generate(length: number) { - return Math.floor(secureRandomNumber() * Math.pow(10, length)) - .toString() - .padStart(length, '0'); + return secureRandomNumber(length).join(''); } } /** * Cryptographically secure equivalent of `Math.random()`. */ -function secureRandomNumber() { - return crypto.randomBytes(4).readUInt32LE() / 0x100000000; +function secureRandomNumber(length: number) { + const digits = []; + while (digits.length < length) { + const byte = crypto.randomBytes(1)[0]; + if (byte >= 250) { + continue; + } + digits.push(byte % 10); + } + + return digits; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index 3a8c0b9b6076a..8bc81a6f1d497 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -487,10 +487,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, }, - 'observability:aiAssistantResponseLanguage': { - type: 'keyword', - _meta: { description: 'Non-default value of setting.' }, - }, 'observability:aiAssistantSimulatedFunctionCalling': { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 92e507ebef855..9821fd1bad43f 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -55,7 +55,6 @@ export interface UsageStats { 'observability:logsExplorer:allowedDataViews': string[]; 'observability:logSources': string[]; 'observability:aiAssistantLogsIndexPattern': string; - 'observability:aiAssistantResponseLanguage': string; 'observability:aiAssistantSimulatedFunctionCalling': boolean; 'observability:aiAssistantSearchConnectorIndexPattern': string; 'visualization:heatmap:maxBuckets': number; diff --git a/src/plugins/links/common/content_management/v1/cm_services.ts b/src/plugins/links/common/content_management/v1/cm_services.ts deleted file mode 100644 index 597fcfe0d8451..0000000000000 --- a/src/plugins/links/common/content_management/v1/cm_services.ts +++ /dev/null @@ -1,139 +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 { schema } from '@kbn/config-schema'; -import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; -import { - savedObjectSchema, - createResultSchema, - updateOptionsSchema, - createOptionsSchemas, - objectTypeToGetResultSchema, -} from '@kbn/content-management-utils'; -import { DASHBOARD_LINK_TYPE, EXTERNAL_LINK_TYPE } from '.'; -import { LINKS_HORIZONTAL_LAYOUT, LINKS_VERTICAL_LAYOUT } from './constants'; - -const baseLinkSchema = { - id: schema.string(), - label: schema.maybe(schema.string()), - order: schema.number(), -}; - -const dashboardLinkSchema = schema.object({ - ...baseLinkSchema, - destinationRefName: schema.string(), - type: schema.literal(DASHBOARD_LINK_TYPE), - options: schema.maybe( - schema.object( - { - openInNewTab: schema.boolean(), - useCurrentFilters: schema.boolean(), - useCurrentDateRange: schema.boolean(), - }, - { unknowns: 'forbid' } - ) - ), -}); - -const externalLinkSchema = schema.object({ - ...baseLinkSchema, - type: schema.literal(EXTERNAL_LINK_TYPE), - destination: schema.string(), - options: schema.maybe( - schema.object( - { - openInNewTab: schema.boolean(), - encodeUrl: schema.boolean(), - }, - { unknowns: 'forbid' } - ) - ), -}); - -const linksAttributesSchema = schema.object( - { - title: schema.string(), - description: schema.maybe(schema.string()), - links: schema.arrayOf(schema.oneOf([dashboardLinkSchema, externalLinkSchema])), - layout: schema.maybe( - schema.oneOf([schema.literal(LINKS_HORIZONTAL_LAYOUT), schema.literal(LINKS_VERTICAL_LAYOUT)]) - ), - }, - { unknowns: 'forbid' } -); - -const linksSavedObjectSchema = savedObjectSchema(linksAttributesSchema); - -const searchOptionsSchema = schema.maybe( - schema.object( - { - onlyTitle: schema.maybe(schema.boolean()), - }, - { unknowns: 'forbid' } - ) -); - -const linksCreateOptionsSchema = schema.object({ - references: schema.maybe(createOptionsSchemas.references), - overwrite: createOptionsSchemas.overwrite, -}); - -const linksUpdateOptionsSchema = schema.object({ - references: updateOptionsSchema.references, -}); - -// Content management service definition. -// We need it for BWC support between different versions of the content -export const serviceDefinition: ServicesDefinition = { - get: { - out: { - result: { - schema: objectTypeToGetResultSchema(linksSavedObjectSchema), - }, - }, - }, - create: { - in: { - options: { - schema: linksCreateOptionsSchema, - }, - data: { - schema: linksAttributesSchema, - }, - }, - out: { - result: { - schema: createResultSchema(linksSavedObjectSchema), - }, - }, - }, - update: { - in: { - options: { - schema: linksUpdateOptionsSchema, // same schema as "create" - }, - data: { - schema: linksAttributesSchema, - }, - }, - }, - search: { - in: { - options: { - schema: searchOptionsSchema, - }, - }, - }, - mSearch: { - out: { - result: { - schema: linksSavedObjectSchema, - }, - }, - }, -}; diff --git a/src/plugins/links/common/persistable_state/references.ts b/src/plugins/links/common/persistable_state/references.ts index 3c527465a2868..93dc152949289 100644 --- a/src/plugins/links/common/persistable_state/references.ts +++ b/src/plugins/links/common/persistable_state/references.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Reference } from '@kbn/content-management-utils'; +import type { Reference } from '@kbn/content-management-utils'; import { omit } from 'lodash'; import { DASHBOARD_LINK_TYPE, LinksAttributes } from '../content_management'; diff --git a/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx b/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx index 8868dd1a2776a..30bd3d3879da9 100644 --- a/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx +++ b/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx @@ -94,7 +94,7 @@ export const DashboardLinkDestinationPicker = ({ ); const renderOption = useCallback( - (option, searchValue, contentClassName) => { + (option: DashboardComboBoxOption, searchValue: string, contentClassName: string) => { const { label, key: dashboardId } = option; return ( diff --git a/src/plugins/links/public/components/editor/links_editor.tsx b/src/plugins/links/public/components/editor/links_editor.tsx index 0ee31cd841521..ac8879d1dd850 100644 --- a/src/plugins/links/public/components/editor/links_editor.tsx +++ b/src/plugins/links/public/components/editor/links_editor.tsx @@ -10,6 +10,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import useMountedState from 'react-use/lib/useMountedState'; import { + DropResult, EuiButton, EuiButtonEmpty, EuiButtonGroup, @@ -101,7 +102,7 @@ const LinksEditor = ({ }, [initialLinks]); const onDragEnd = useCallback( - ({ source, destination }) => { + ({ source, destination }: DropResult) => { if (source && destination) { const newList = euiDragDropReorder(orderedLinks, source.index, destination.index).map( (link, i) => { diff --git a/src/plugins/links/public/lib/deserialize_from_library.ts b/src/plugins/links/public/lib/deserialize_from_library.ts index 859a988954a1b..2640540b6e49c 100644 --- a/src/plugins/links/public/lib/deserialize_from_library.ts +++ b/src/plugins/links/public/lib/deserialize_from_library.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { SOWithMetadata } from '@kbn/content-management-utils'; +import type { SOWithMetadata } from '@kbn/content-management-utils'; import { LinksAttributes } from '../../common/content_management'; import { injectReferences } from '../../common/persistable_state'; import { LinksByReferenceSerializedState, LinksRuntimeState, LinksSerializedState } from '../types'; diff --git a/src/plugins/links/server/content_management/links_storage.ts b/src/plugins/links/server/content_management/links_storage.ts index 21a5e4aa0de0d..ca403efcd099e 100644 --- a/src/plugins/links/server/content_management/links_storage.ts +++ b/src/plugins/links/server/content_management/links_storage.ts @@ -10,7 +10,7 @@ import type { Logger } from '@kbn/logging'; import { SOContentStorage } from '@kbn/content-management-utils'; import { CONTENT_ID } from '../../common'; import type { LinksCrudTypes } from '../../common/content_management'; -import { cmServicesDefinition } from '../../common/content_management/cm_services'; +import { cmServicesDefinition } from './schema/cm_services'; export class LinksStorage extends SOContentStorage { constructor({ diff --git a/src/plugins/links/common/content_management/cm_services.ts b/src/plugins/links/server/content_management/schema/cm_services.ts similarity index 100% rename from src/plugins/links/common/content_management/cm_services.ts rename to src/plugins/links/server/content_management/schema/cm_services.ts diff --git a/src/plugins/links/server/content_management/schema/v1/cm_services.ts b/src/plugins/links/server/content_management/schema/v1/cm_services.ts new file mode 100644 index 0000000000000..16a8b1209b22b --- /dev/null +++ b/src/plugins/links/server/content_management/schema/v1/cm_services.ts @@ -0,0 +1,142 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; +import { + savedObjectSchema, + createResultSchema, + updateOptionsSchema, + createOptionsSchemas, + objectTypeToGetResultSchema, +} from '@kbn/content-management-utils'; +import { DASHBOARD_LINK_TYPE, EXTERNAL_LINK_TYPE } from '../../../../common/content_management/v1'; +import { + LINKS_HORIZONTAL_LAYOUT, + LINKS_VERTICAL_LAYOUT, +} from '../../../../common/content_management/v1/constants'; + +const baseLinkSchema = { + id: schema.string(), + label: schema.maybe(schema.string()), + order: schema.number(), +}; + +const dashboardLinkSchema = schema.object({ + ...baseLinkSchema, + destinationRefName: schema.string(), + type: schema.literal(DASHBOARD_LINK_TYPE), + options: schema.maybe( + schema.object( + { + openInNewTab: schema.boolean(), + useCurrentFilters: schema.boolean(), + useCurrentDateRange: schema.boolean(), + }, + { unknowns: 'forbid' } + ) + ), +}); + +const externalLinkSchema = schema.object({ + ...baseLinkSchema, + type: schema.literal(EXTERNAL_LINK_TYPE), + destination: schema.string(), + options: schema.maybe( + schema.object( + { + openInNewTab: schema.boolean(), + encodeUrl: schema.boolean(), + }, + { unknowns: 'forbid' } + ) + ), +}); + +const linksAttributesSchema = schema.object( + { + title: schema.string(), + description: schema.maybe(schema.string()), + links: schema.arrayOf(schema.oneOf([dashboardLinkSchema, externalLinkSchema])), + layout: schema.maybe( + schema.oneOf([schema.literal(LINKS_HORIZONTAL_LAYOUT), schema.literal(LINKS_VERTICAL_LAYOUT)]) + ), + }, + { unknowns: 'forbid' } +); + +const linksSavedObjectSchema = savedObjectSchema(linksAttributesSchema); + +const searchOptionsSchema = schema.maybe( + schema.object( + { + onlyTitle: schema.maybe(schema.boolean()), + }, + { unknowns: 'forbid' } + ) +); + +const linksCreateOptionsSchema = schema.object({ + references: schema.maybe(createOptionsSchemas.references), + overwrite: createOptionsSchemas.overwrite, +}); + +const linksUpdateOptionsSchema = schema.object({ + references: updateOptionsSchema.references, +}); + +// Content management service definition. +// We need it for BWC support between different versions of the content +export const serviceDefinition: ServicesDefinition = { + get: { + out: { + result: { + schema: objectTypeToGetResultSchema(linksSavedObjectSchema), + }, + }, + }, + create: { + in: { + options: { + schema: linksCreateOptionsSchema, + }, + data: { + schema: linksAttributesSchema, + }, + }, + out: { + result: { + schema: createResultSchema(linksSavedObjectSchema), + }, + }, + }, + update: { + in: { + options: { + schema: linksUpdateOptionsSchema, // same schema as "create" + }, + data: { + schema: linksAttributesSchema, + }, + }, + }, + search: { + in: { + options: { + schema: searchOptionsSchema, + }, + }, + }, + mSearch: { + out: { + result: { + schema: linksSavedObjectSchema, + }, + }, + }, +}; diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx index 56daf31fb0703..f4c23d41e01ee 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx @@ -79,7 +79,7 @@ export function TopNavMenu( } function renderSearchBar(): ReactElement | null { - // Validate presense of all required fields + // Validate presence of all required fields if (!showSearchBar || !props.unifiedSearch) return null; const { AggregateQuerySearchBar } = props.unifiedSearch.ui; return {...searchBarProps} />; diff --git a/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx b/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx index 772714eb44e33..811492b8f9e7d 100644 --- a/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx +++ b/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx @@ -50,7 +50,7 @@ export const PresentationPanel = < }, []); if (loading) - return ( + return props.hideLoader ? null : ( { + pluginServices.setRegistry(stubRegistry.start({})); +}; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap index 5702690033996..817c6ba6e23a7 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap @@ -121,9 +121,7 @@ exports[`Table prevents hidden saved objects from being deleted 1`] = ` ] } /> - +
@@ -355,9 +353,7 @@ exports[`Table should render normally 1`] = ` ] } /> - +
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx index 6edd1d93fd7fd..b07bf84c1ac03 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx @@ -468,7 +468,7 @@ export class Table extends PureComponent { ]} /> {queryParseError} - + {exceededResultCount && ( <> diff --git a/src/plugins/saved_search/common/content_management/v1/cm_services.ts b/src/plugins/saved_search/common/content_management/v1/cm_services.ts deleted file mode 100644 index ef9d24bb8722d..0000000000000 --- a/src/plugins/saved_search/common/content_management/v1/cm_services.ts +++ /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 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 { schema } from '@kbn/config-schema'; -import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; -import { - savedObjectSchema, - objectTypeToGetResultSchema, - createOptionsSchemas, - updateOptionsSchema, - createResultSchema, -} from '@kbn/content-management-utils'; -import { MIN_SAVED_SEARCH_SAMPLE_SIZE, MAX_SAVED_SEARCH_SAMPLE_SIZE } from '../../constants'; - -const sortSchema = schema.arrayOf(schema.string(), { maxSize: 2 }); - -const savedSearchAttributesSchema = schema.object( - { - title: schema.string(), - sort: schema.oneOf([sortSchema, schema.arrayOf(sortSchema)]), - columns: schema.arrayOf(schema.string()), - description: schema.string(), - grid: schema.object({ - columns: schema.maybe( - schema.recordOf( - schema.string(), - schema.object({ - width: schema.maybe(schema.number()), - }) - ) - ), - }), - hideChart: schema.maybe(schema.boolean()), - isTextBasedQuery: schema.maybe(schema.boolean()), - usesAdHocDataView: schema.maybe(schema.boolean()), - kibanaSavedObjectMeta: schema.object({ - searchSourceJSON: schema.string(), - }), - viewMode: schema.maybe( - schema.oneOf([ - schema.literal('documents'), - schema.literal('patterns'), - schema.literal('aggregated'), - ]) - ), - hideAggregatedPreview: schema.maybe(schema.boolean()), - rowHeight: schema.maybe(schema.number()), - headerRowHeight: schema.maybe(schema.number()), - hits: schema.maybe(schema.number()), - timeRestore: schema.maybe(schema.boolean()), - timeRange: schema.maybe( - schema.object({ - from: schema.string(), - to: schema.string(), - }) - ), - refreshInterval: schema.maybe( - schema.object({ - pause: schema.boolean(), - value: schema.number(), - }) - ), - rowsPerPage: schema.maybe(schema.number()), - sampleSize: schema.maybe( - schema.number({ - min: MIN_SAVED_SEARCH_SAMPLE_SIZE, - max: MAX_SAVED_SEARCH_SAMPLE_SIZE, - }) - ), - breakdownField: schema.maybe(schema.string()), - visContext: schema.maybe( - schema.oneOf([ - // existing value - schema.object({ - // unified histogram state - suggestionType: schema.string(), - requestData: schema.object({ - dataViewId: schema.maybe(schema.string()), - timeField: schema.maybe(schema.string()), - timeInterval: schema.maybe(schema.string()), - breakdownField: schema.maybe(schema.string()), - }), - // lens attributes - attributes: schema.recordOf(schema.string(), schema.any()), - }), - // cleared previous value - schema.object({}), - ]) - ), - version: schema.maybe(schema.number()), - }, - { unknowns: 'forbid' } -); - -const savedSearchSavedObjectSchema = savedObjectSchema(savedSearchAttributesSchema); - -const savedSearchCreateOptionsSchema = schema.maybe( - schema.object({ - id: createOptionsSchemas.id, - references: createOptionsSchemas.references, - overwrite: createOptionsSchemas.overwrite, - }) -); - -const savedSearchUpdateOptionsSchema = schema.maybe( - schema.object({ - references: updateOptionsSchema.references, - }) -); -const savedSearchSearchOptionsSchema = schema.maybe( - schema.object({ - searchFields: schema.maybe(schema.arrayOf(schema.string())), - fields: schema.maybe(schema.arrayOf(schema.string())), - }) -); - -// Content management service definition. -// We need it for BWC support between different versions of the content -export const serviceDefinition: ServicesDefinition = { - get: { - out: { - result: { - schema: objectTypeToGetResultSchema(savedSearchSavedObjectSchema), - }, - }, - }, - create: { - in: { - options: { - schema: savedSearchCreateOptionsSchema, - }, - data: { - schema: savedSearchAttributesSchema, - }, - }, - out: { - result: { - schema: createResultSchema(savedSearchSavedObjectSchema), - }, - }, - }, - update: { - in: { - options: { - schema: savedSearchUpdateOptionsSchema, - }, - data: { - schema: savedSearchAttributesSchema, - }, - }, - }, - search: { - in: { - options: { - schema: savedSearchSearchOptionsSchema, - }, - }, - }, - mSearch: { - out: { - result: { - schema: savedSearchSavedObjectSchema, - }, - }, - }, -}; diff --git a/src/plugins/saved_search/common/saved_searches_utils.ts b/src/plugins/saved_search/common/saved_searches_utils.ts index 232d5286ba32a..1151830f0d8ab 100644 --- a/src/plugins/saved_search/common/saved_searches_utils.ts +++ b/src/plugins/saved_search/common/saved_searches_utils.ts @@ -46,5 +46,6 @@ export const fromSavedSearchAttributes = < sampleSize: attributes.sampleSize, breakdownField: attributes.breakdownField, visContext: attributes.visContext, + density: attributes.density, managed, } as ReturnType); diff --git a/src/plugins/saved_search/common/service/get_saved_searches.test.ts b/src/plugins/saved_search/common/service/get_saved_searches.test.ts index 6572d6addbbbb..4f7d288e185d5 100644 --- a/src/plugins/saved_search/common/service/get_saved_searches.test.ts +++ b/src/plugins/saved_search/common/service/get_saved_searches.test.ts @@ -88,6 +88,7 @@ describe('getSavedSearch', () => { "columns": Array [ "_source", ], + "density": undefined, "description": "description", "grid": Object {}, "headerRowHeight": undefined, @@ -197,6 +198,7 @@ describe('getSavedSearch', () => { "columns": Array [ "_source", ], + "density": undefined, "description": "description", "grid": Object {}, "headerRowHeight": undefined, diff --git a/src/plugins/saved_search/common/service/saved_searches_utils.test.ts b/src/plugins/saved_search/common/service/saved_searches_utils.test.ts index ce8c073dd27c9..96845d7fea7fb 100644 --- a/src/plugins/saved_search/common/service/saved_searches_utils.test.ts +++ b/src/plugins/saved_search/common/service/saved_searches_utils.test.ts @@ -47,6 +47,7 @@ describe('saved_searches_utils', () => { "a", "b", ], + "density": undefined, "description": "foo", "grid": Object {}, "headerRowHeight": undefined, @@ -124,6 +125,7 @@ describe('saved_searches_utils', () => { "c", "d", ], + "density": undefined, "description": "description", "grid": Object {}, "headerRowHeight": undefined, diff --git a/src/plugins/saved_search/common/service/saved_searches_utils.ts b/src/plugins/saved_search/common/service/saved_searches_utils.ts index 866b9876d4dd4..24fcda3255a8c 100644 --- a/src/plugins/saved_search/common/service/saved_searches_utils.ts +++ b/src/plugins/saved_search/common/service/saved_searches_utils.ts @@ -52,6 +52,7 @@ export const toSavedSearchAttributes = ( refreshInterval: savedSearch.refreshInterval, rowsPerPage: savedSearch.rowsPerPage, sampleSize: savedSearch.sampleSize, + density: savedSearch.density, breakdownField: savedSearch.breakdownField, visContext: savedSearch.visContext, }); diff --git a/src/plugins/saved_search/common/types.ts b/src/plugins/saved_search/common/types.ts index fe41fd66042fe..4c5bab04705e5 100644 --- a/src/plugins/saved_search/common/types.ts +++ b/src/plugins/saved_search/common/types.ts @@ -15,6 +15,7 @@ import type { import type { SavedObjectReference } from '@kbn/core-saved-objects-server'; import type { SavedObjectsResolveResponse } from '@kbn/core/server'; import type { SerializableRecord } from '@kbn/utility-types'; +import type { DataGridDensity } from '@kbn/unified-data-table'; import { VIEW_MODE } from '.'; export interface DiscoverGridSettings extends SerializableRecord { @@ -64,6 +65,7 @@ export interface SavedSearchAttributes { rowsPerPage?: number; sampleSize?: number; breakdownField?: string; + density?: DataGridDensity; visContext?: VisContextUnmapped; } diff --git a/src/plugins/saved_search/public/services/saved_searches/to_saved_search.test.ts b/src/plugins/saved_search/public/services/saved_searches/to_saved_search.test.ts index a319188a49f63..968c29831e73b 100644 --- a/src/plugins/saved_search/public/services/saved_searches/to_saved_search.test.ts +++ b/src/plugins/saved_search/public/services/saved_searches/to_saved_search.test.ts @@ -52,72 +52,73 @@ describe('toSavedSearch', () => { }; const savedSearch = await byValueToSavedSearch({ attributes }, mockServices); expect(savedSearch).toMatchInlineSnapshot(` - Object { - "breakdownField": undefined, - "columns": Array [ - "message", - "extension", - ], - "description": "", - "grid": Object {}, - "headerRowHeight": undefined, - "hideAggregatedPreview": undefined, - "hideChart": false, - "id": undefined, - "isTextBasedQuery": false, - "managed": false, - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "refreshInterval": undefined, - "rowHeight": undefined, - "rowsPerPage": undefined, - "sampleSize": undefined, - "searchSource": Object { - "create": [MockFunction], - "createChild": [MockFunction], - "createCopy": [MockFunction], - "destroy": [MockFunction], - "fetch": [MockFunction], - "fetch$": [MockFunction], - "getActiveIndexFilter": [MockFunction], - "getField": [MockFunction], - "getFields": [MockFunction], - "getId": [MockFunction], - "getOwnField": [MockFunction], - "getParent": [MockFunction], - "getSearchRequestBody": [MockFunction], - "getSerializedFields": [MockFunction], - "history": Array [], - "loadDataViewFields": [MockFunction], - "onRequestStart": [MockFunction], - "parseActiveIndexPatternFromQueryString": [MockFunction], - "removeField": [MockFunction], - "serialize": [MockFunction], - "setField": [MockFunction], - "setOverwriteDataViewType": [MockFunction], - "setParent": [MockFunction], - "toExpressionAst": [MockFunction], + Object { + "breakdownField": undefined, + "columns": Array [ + "message", + "extension", + ], + "density": undefined, + "description": "", + "grid": Object {}, + "headerRowHeight": undefined, + "hideAggregatedPreview": undefined, + "hideChart": false, + "id": undefined, + "isTextBasedQuery": false, + "managed": false, + "references": Array [ + Object { + "id": "1", + "name": "ref_0", + "type": "index-pattern", }, - "sharingSavedObjectProps": undefined, - "sort": Array [ - Array [ - "@timestamp", - "desc", - ], + ], + "refreshInterval": undefined, + "rowHeight": undefined, + "rowsPerPage": undefined, + "sampleSize": undefined, + "searchSource": Object { + "create": [MockFunction], + "createChild": [MockFunction], + "createCopy": [MockFunction], + "destroy": [MockFunction], + "fetch": [MockFunction], + "fetch$": [MockFunction], + "getActiveIndexFilter": [MockFunction], + "getField": [MockFunction], + "getFields": [MockFunction], + "getId": [MockFunction], + "getOwnField": [MockFunction], + "getParent": [MockFunction], + "getSearchRequestBody": [MockFunction], + "getSerializedFields": [MockFunction], + "history": Array [], + "loadDataViewFields": [MockFunction], + "onRequestStart": [MockFunction], + "parseActiveIndexPatternFromQueryString": [MockFunction], + "removeField": [MockFunction], + "serialize": [MockFunction], + "setField": [MockFunction], + "setOverwriteDataViewType": [MockFunction], + "setParent": [MockFunction], + "toExpressionAst": [MockFunction], + }, + "sharingSavedObjectProps": undefined, + "sort": Array [ + Array [ + "@timestamp", + "desc", ], - "tags": undefined, - "timeRange": undefined, - "timeRestore": undefined, - "title": "saved-search-title", - "usesAdHocDataView": undefined, - "viewMode": undefined, - "visContext": undefined, - } - `); + ], + "tags": undefined, + "timeRange": undefined, + "timeRestore": undefined, + "title": "saved-search-title", + "usesAdHocDataView": undefined, + "viewMode": undefined, + "visContext": undefined, + } + `); }); }); 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 d3ff8633637d2..de17c9e9cf5de 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 @@ -11,7 +11,7 @@ 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'; +import { cmServicesDefinition } from './schema/cm_services'; export class SavedSearchStorage extends SOContentStorage { constructor({ @@ -45,6 +45,7 @@ export class SavedSearchStorage extends SOContentStorage { 'rowsPerPage', 'breakdownField', 'sampleSize', + 'density', 'visContext', ], logger, diff --git a/src/plugins/saved_search/common/content_management/cm_services.ts b/src/plugins/saved_search/server/content_management/schema/cm_services.ts similarity index 100% rename from src/plugins/saved_search/common/content_management/cm_services.ts rename to src/plugins/saved_search/server/content_management/schema/cm_services.ts diff --git a/src/plugins/saved_search/server/content_management/schema/v1/cm_services.ts b/src/plugins/saved_search/server/content_management/schema/v1/cm_services.ts new file mode 100644 index 0000000000000..53df9882afd70 --- /dev/null +++ b/src/plugins/saved_search/server/content_management/schema/v1/cm_services.ts @@ -0,0 +1,181 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import type { ContentManagementServicesDefinition as ServicesDefinition } from '@kbn/object-versioning'; +import { + savedObjectSchema, + objectTypeToGetResultSchema, + createOptionsSchemas, + updateOptionsSchema, + createResultSchema, +} from '@kbn/content-management-utils'; +import { + MIN_SAVED_SEARCH_SAMPLE_SIZE, + MAX_SAVED_SEARCH_SAMPLE_SIZE, +} from '../../../../common/constants'; + +const sortSchema = schema.arrayOf(schema.string(), { maxSize: 2 }); + +const savedSearchAttributesSchema = schema.object( + { + title: schema.string(), + sort: schema.oneOf([sortSchema, schema.arrayOf(sortSchema)]), + columns: schema.arrayOf(schema.string()), + description: schema.string(), + grid: schema.object({ + columns: schema.maybe( + schema.recordOf( + schema.string(), + schema.object({ + width: schema.maybe(schema.number()), + }) + ) + ), + }), + hideChart: schema.maybe(schema.boolean()), + isTextBasedQuery: schema.maybe(schema.boolean()), + usesAdHocDataView: schema.maybe(schema.boolean()), + kibanaSavedObjectMeta: schema.object({ + searchSourceJSON: schema.string(), + }), + viewMode: schema.maybe( + schema.oneOf([ + schema.literal('documents'), + schema.literal('patterns'), + schema.literal('aggregated'), + ]) + ), + hideAggregatedPreview: schema.maybe(schema.boolean()), + rowHeight: schema.maybe(schema.number()), + headerRowHeight: schema.maybe(schema.number()), + hits: schema.maybe(schema.number()), + timeRestore: schema.maybe(schema.boolean()), + timeRange: schema.maybe( + schema.object({ + from: schema.string(), + to: schema.string(), + }) + ), + refreshInterval: schema.maybe( + schema.object({ + pause: schema.boolean(), + value: schema.number(), + }) + ), + rowsPerPage: schema.maybe(schema.number()), + sampleSize: schema.maybe( + schema.number({ + min: MIN_SAVED_SEARCH_SAMPLE_SIZE, + max: MAX_SAVED_SEARCH_SAMPLE_SIZE, + }) + ), + density: schema.maybe( + schema.oneOf([ + schema.literal('compact'), + schema.literal('normal'), + schema.literal('expanded'), + ]) + ), + breakdownField: schema.maybe(schema.string()), + visContext: schema.maybe( + schema.oneOf([ + // existing value + schema.object({ + // unified histogram state + suggestionType: schema.string(), + requestData: schema.object({ + dataViewId: schema.maybe(schema.string()), + timeField: schema.maybe(schema.string()), + timeInterval: schema.maybe(schema.string()), + breakdownField: schema.maybe(schema.string()), + }), + // lens attributes + attributes: schema.recordOf(schema.string(), schema.any()), + }), + // cleared previous value + schema.object({}), + ]) + ), + version: schema.maybe(schema.number()), + }, + { unknowns: 'forbid' } +); + +const savedSearchSavedObjectSchema = savedObjectSchema(savedSearchAttributesSchema); + +const savedSearchCreateOptionsSchema = schema.maybe( + schema.object({ + id: createOptionsSchemas.id, + references: createOptionsSchemas.references, + overwrite: createOptionsSchemas.overwrite, + }) +); + +const savedSearchUpdateOptionsSchema = schema.maybe( + schema.object({ + references: updateOptionsSchema.references, + }) +); +const savedSearchSearchOptionsSchema = schema.maybe( + schema.object({ + searchFields: schema.maybe(schema.arrayOf(schema.string())), + fields: schema.maybe(schema.arrayOf(schema.string())), + }) +); + +// Content management service definition. +// We need it for BWC support between different versions of the content +export const serviceDefinition: ServicesDefinition = { + get: { + out: { + result: { + schema: objectTypeToGetResultSchema(savedSearchSavedObjectSchema), + }, + }, + }, + create: { + in: { + options: { + schema: savedSearchCreateOptionsSchema, + }, + data: { + schema: savedSearchAttributesSchema, + }, + }, + out: { + result: { + schema: createResultSchema(savedSearchSavedObjectSchema), + }, + }, + }, + update: { + in: { + options: { + schema: savedSearchUpdateOptionsSchema, + }, + data: { + schema: savedSearchAttributesSchema, + }, + }, + }, + search: { + in: { + options: { + schema: savedSearchSearchOptionsSchema, + }, + }, + }, + mSearch: { + out: { + result: { + schema: savedSearchSavedObjectSchema, + }, + }, + }, +}; diff --git a/src/plugins/saved_search/server/saved_objects/schema.ts b/src/plugins/saved_search/server/saved_objects/schema.ts index 125ddcceb320c..effbc6f7eeb24 100644 --- a/src/plugins/saved_search/server/saved_objects/schema.ts +++ b/src/plugins/saved_search/server/saved_objects/schema.ts @@ -129,3 +129,9 @@ export const SCHEMA_SEARCH_MODEL_VERSION_4 = SCHEMA_SEARCH_MODEL_VERSION_3.exten ]) ), }); + +export const SCHEMA_SEARCH_MODEL_VERSION_5 = SCHEMA_SEARCH_MODEL_VERSION_4.extends({ + density: schema.maybe( + schema.oneOf([schema.literal('compact'), schema.literal('normal'), schema.literal('expanded')]) + ), +}); diff --git a/src/plugins/saved_search/server/saved_objects/search.ts b/src/plugins/saved_search/server/saved_objects/search.ts index 925a4dd66b180..1295b4b378d98 100644 --- a/src/plugins/saved_search/server/saved_objects/search.ts +++ b/src/plugins/saved_search/server/saved_objects/search.ts @@ -16,6 +16,7 @@ import { SCHEMA_SEARCH_MODEL_VERSION_2, SCHEMA_SEARCH_MODEL_VERSION_3, SCHEMA_SEARCH_MODEL_VERSION_4, + SCHEMA_SEARCH_MODEL_VERSION_5, } from './schema'; export function getSavedSearchObjectType( @@ -70,6 +71,13 @@ export function getSavedSearchObjectType( create: SCHEMA_SEARCH_MODEL_VERSION_4, }, }, + 5: { + changes: [], + schemas: { + forwardCompatibility: SCHEMA_SEARCH_MODEL_VERSION_5.extends({}, { unknowns: 'ignore' }), + create: SCHEMA_SEARCH_MODEL_VERSION_5, + }, + }, }, mappings: { dynamic: false, diff --git a/src/plugins/saved_search/tsconfig.json b/src/plugins/saved_search/tsconfig.json index 7100affb2e0c3..f96d7b385aa2c 100644 --- a/src/plugins/saved_search/tsconfig.json +++ b/src/plugins/saved_search/tsconfig.json @@ -28,6 +28,7 @@ "@kbn/utility-types", "@kbn/search-types", "@kbn/discover-utils", + "@kbn/unified-data-table", ], "exclude": ["target/**/*"] } diff --git a/src/plugins/telemetry/schema/kbn_packages.json b/src/plugins/telemetry/schema/kbn_packages.json index f33b6b66da1f9..7e2c3aad5c59f 100644 --- a/src/plugins/telemetry/schema/kbn_packages.json +++ b/src/plugins/telemetry/schema/kbn_packages.json @@ -1,4 +1,36 @@ { "properties": { + "favorites": { + "properties": { + "DYNAMIC_KEY": { + "properties": { + "total": { + "type": "long", + "_meta": { + "description": "Total favorite object count in this deployment" + } + }, + "total_users_spaces": { + "type": "long", + "_meta": { + "description": "Total users per space that have favorited an object of this type in this deployment" + } + }, + "avg_per_user_per_space": { + "type": "double", + "_meta": { + "description": "Average favorite objects count of this type per user per space for this deployment, only counts users who have favorited at least one object of this type" + } + }, + "max_per_user_per_space": { + "type": "long", + "_meta": { + "description": "Max favorite objects count of this type per user per space for this deployment" + } + } + } + } + } + } } } diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index ebd98b2190c12..8563b5beaf57c 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -10456,12 +10456,6 @@ "description": "Non-default value of setting." } }, - "observability:aiAssistantResponseLanguage": { - "type": "keyword", - "_meta": { - "description": "Non-default value of setting." - } - }, "observability:aiAssistantSimulatedFunctionCalling": { "type": "boolean", "_meta": { diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 2286d13f25e9c..09d5aa25c914b 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -11,6 +11,7 @@ "../../../typings/**/*", "schema/oss_plugins.json", "schema/oss_root.json", + "schema/kbn_packages.json" ], "kbn_references": [ "@kbn/core", diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx index 976ef71c6b647..2ff0d6a224af2 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx @@ -23,7 +23,10 @@ import { import { i18n } from '@kbn/i18n'; import { orderBy } from 'lodash'; import { getRouterLinkProps } from '@kbn/router-utils'; -import { DATA_QUALITY_LOCATOR_ID, DataQualityLocatorParams } from '@kbn/deeplinks-observability'; +import { + DATA_QUALITY_DETAILS_LOCATOR_ID, + DataQualityDetailsLocatorParams, +} from '@kbn/deeplinks-observability'; import { BrowserUrlService } from '@kbn/share-plugin/public'; import { getUnifiedDocViewerServices } from '../../plugin'; @@ -39,13 +42,6 @@ interface DegradedField { values: string[]; } -interface ParamsForLocator { - dataStreamType: string; - dataStreamName: string; - dataStreamNamespace: string; - rawName: string; -} - interface TableOptions { page: { index: number; @@ -117,7 +113,7 @@ export const LogsOverviewDegradedFields = ({ rawDoc }: { rawDoc: DataTableRecord const columns = getDegradedFieldsColumns(); const tableData = getDataFormattedForTable(ignoredFieldValues); - const paramsForLocator = getParamsForLocator(sourceFields); + const dataStream = getDataStreamRawName(sourceFields); const accordionId = useGeneratedHtmlId({ prefix: qualityIssuesAccordionTitle, @@ -194,9 +190,7 @@ export const LogsOverviewDegradedFields = ({ rawDoc }: { rawDoc: DataTableRecord buttonContent={accordionTitle} paddingSize="m" initialIsOpen={false} - extraAction={ - - } + extraAction={} data-test-subj="unifiedDocViewLogsOverviewDegradedFieldsAccordion" > { +): string | undefined => { if (sourceFields) { const dataStreamTypeArr = sourceFields['data_stream.type']; const dataStreamType = dataStreamTypeArr ? dataStreamTypeArr[0] : undefined; @@ -256,49 +250,35 @@ const getParamsForLocator = ( const dataStreamName = dataStreamNameArr ? dataStreamNameArr[0] : undefined; const dataStreamNamespaceArr = sourceFields['data_stream.namespace']; const dataStreamNamespace = dataStreamNamespaceArr ? dataStreamNamespaceArr[0] : undefined; - let rawName; + let dataStream; if (dataStreamType && dataStreamName && dataStreamNamespace) { - rawName = `${dataStreamType}-${dataStreamName}-${dataStreamNamespace}`; + dataStream = `${dataStreamType}-${dataStreamName}-${dataStreamNamespace}`; } - if (rawName) { - return { - dataStreamType, - dataStreamName, - dataStreamNamespace, - rawName, - }; - } + return dataStream; } }; const DatasetQualityLink = React.memo( ({ urlService, - paramsForLocator, + dataStream, }: { urlService: BrowserUrlService; - paramsForLocator?: ParamsForLocator; + dataStream: string | undefined; }) => { - const locator = urlService.locators.get(DATA_QUALITY_LOCATOR_ID); - const locatorParams: DataQualityLocatorParams = paramsForLocator - ? { - flyout: { - dataset: { - rawName: paramsForLocator.rawName, - type: paramsForLocator.dataStreamType, - name: paramsForLocator.dataStreamName, - namespace: paramsForLocator.dataStreamNamespace, - }, - }, - } - : {}; - - const datasetQualityUrl = locator?.getRedirectUrl(locatorParams); + if (!dataStream) { + return null; + } + const locator = urlService.locators.get( + DATA_QUALITY_DETAILS_LOCATOR_ID + ); + + const datasetQualityUrl = locator?.getRedirectUrl({ dataStream }); const navigateToDatasetQuality = () => { - locator?.navigate(locatorParams); + locator?.navigate({ dataStream }); }; const datasetQualityLinkProps = getRouterLinkProps({ @@ -306,7 +286,7 @@ const DatasetQualityLink = React.memo( onClick: navigateToDatasetQuality, }); - return paramsForLocator ? ( + return ( {datasetQualityLinkTitle} - ) : null; + ); } ); diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_header.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_header.tsx index 4bbc2993dedb0..c5b3b987c66a1 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_header.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_header.tsx @@ -43,7 +43,7 @@ export function LogsOverviewHeader({ doc }: { doc: LogDocumentOverview }) { }); const accordionTitle = ( - +

{contentLabel}

); @@ -80,7 +80,7 @@ export function LogsOverviewHeader({ doc }: { doc: LogDocumentOverview }) { {logLevelAndTimestamp} - + {value} diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/__snapshots__/table_cell_actions.test.tsx.snap b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/__snapshots__/table_cell_actions.test.tsx.snap index bbc8ee91569ad..aecef4797f9bd 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/__snapshots__/table_cell_actions.test.tsx.snap +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/__snapshots__/table_cell_actions.test.tsx.snap @@ -43,95 +43,10 @@ Array [ } } />, - , ] `; -exports[`TableActions getFieldCellActions should render correctly for undefined functions 2`] = ` -Array [ - , -] -`; +exports[`TableActions getFieldCellActions should render correctly for undefined functions 2`] = `Array []`; exports[`TableActions getFieldCellActions should render the panels correctly for defined onFilter function 1`] = ` Array [ @@ -217,47 +132,6 @@ Array [ } } />, - , ] `; diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.test.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.test.tsx new file mode 100644 index 0000000000000..74282a52b86c4 --- /dev/null +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.test.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 { render, screen } from '@testing-library/react'; +import { DataViewField } from '@kbn/data-views-plugin/common'; +import { TableRow } from './table_cell_actions'; +import { getPinColumnControl } from './get_pin_control'; +import { EuiDataGridCellValueElementProps } from '@elastic/eui/src/components/datagrid/data_grid_types'; + +describe('getPinControl', () => { + const rows: TableRow[] = [ + { + action: { + onFilter: jest.fn(), + flattenedField: 'flattenedField', + onToggleColumn: jest.fn(), + }, + field: { + pinned: true, + onTogglePinned: jest.fn(), + field: 'message', + fieldMapping: new DataViewField({ + type: 'keyword', + name: 'message', + searchable: true, + aggregatable: true, + }), + fieldType: 'keyword', + displayName: 'message', + scripted: false, + }, + value: { + ignored: undefined, + formattedValue: 'test', + }, + }, + ]; + + it('should render correctly', () => { + const control = getPinColumnControl({ rows }); + const Cell = control.rowCellRender as React.FC; + render( + + ); + + screen.getByTestId('unifiedDocViewer_pinControlButton_message').click(); + + expect(rows[0].field.onTogglePinned).toHaveBeenCalledWith('message'); + }); +}); diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.tsx new file mode 100644 index 0000000000000..0a2c45611dcdf --- /dev/null +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/get_pin_control.tsx @@ -0,0 +1,86 @@ +/* + * 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 { + EuiButtonIcon, + EuiDataGridControlColumn, + EuiScreenReaderOnly, + EuiToolTip, + useEuiTheme, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { css } from '@emotion/react'; +import type { TableRow } from './table_cell_actions'; + +interface PinControlCellProps { + row: TableRow; +} + +const PinControlCell: React.FC = React.memo(({ row }) => { + const { euiTheme } = useEuiTheme(); + + const fieldName = row.field.field; + const isPinned = row.field.pinned; + const label = isPinned + ? i18n.translate('unifiedDocViewer.docViews.table.unpinFieldLabel', { + defaultMessage: 'Unpin field', + }) + : i18n.translate('unifiedDocViewer.docViews.table.pinFieldLabel', { + defaultMessage: 'Pin field', + }); + + return ( +
+ + { + row.field.onTogglePinned(fieldName); + }} + /> + +
+ ); +}); + +export const getPinColumnControl = ({ rows }: { rows: TableRow[] }): EuiDataGridControlColumn => { + return { + id: 'pin_field', + width: 32, + headerCellRender: () => ( + + + {i18n.translate('unifiedDocViewer.fieldsTable.pinControlColumnHeader', { + defaultMessage: 'Pin field column', + })} + + + ), + rowCellRender: ({ rowIndex }) => { + const row = rows[rowIndex]; + if (!row) { + return null; + } + return ; + }, + }; +}; diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.scss b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.scss index 91022cc47faf8..330cf364ae55e 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.scss +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.scss @@ -80,8 +80,26 @@ background-color: tintOrShade($euiColorLightShade, 50%, 0); } - & .euiDataGridRowCell--firstColumn .euiDataGridRowCell__content { + & [data-gridcell-column-id='name'] .euiDataGridRowCell__content { padding-top: 0; padding-bottom: 0; } + + & [data-gridcell-column-id='pin_field'] .euiDataGridRowCell__content { + padding: $euiSizeXS / 2 0 0 $euiSizeXS; + } + + .kbnDocViewer__fieldsGrid__pinAction { + opacity: 0; + } + + & [data-gridcell-column-id='pin_field']:focus-within { + .kbnDocViewer__fieldsGrid__pinAction { + opacity: 1; + } + } + + .euiDataGridRow:hover .kbnDocViewer__fieldsGrid__pinAction { + opacity: 1; + } } diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.tsx index 64659877910a7..008149966c49d 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.tsx @@ -53,6 +53,7 @@ import { } from '../doc_viewer_source/get_height'; import { TableFilters, TableFiltersProps, useTableFilters } from './table_filters'; import { TableCell } from './table_cell'; +import { getPinColumnControl } from './get_pin_control'; export type FieldRecord = TableRow; @@ -295,6 +296,10 @@ export const DocViewerTable = ({ const rows = useMemo(() => [...pinnedItems, ...restItems], [pinnedItems, restItems]); + const leadingControlColumns = useMemo(() => { + return [getPinColumnControl({ rows })]; + }, [rows]); + const { curPageIndex, pageSize, totalPages, changePageIndex, changePageSize } = usePager({ initialPageSize: getPageSize(storage), totalItems: rows.length, @@ -492,6 +497,7 @@ export const DocViewerTable = ({ renderCellValue={renderCellValue} renderCellPopover={renderCellPopover} pagination={pagination} + leadingControlColumns={leadingControlColumns} /> diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell.tsx index 094050f2c3b49..ff1027a848cf5 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell.tsx @@ -33,7 +33,7 @@ export const TableCell: React.FC = React.memo( const { action: { flattenedField }, - field: { field, fieldMapping, fieldType, scripted, pinned }, + field: { field, fieldMapping, fieldType, scripted }, value: { formattedValue, ignored }, } = row; @@ -49,7 +49,6 @@ export const TableCell: React.FC = React.memo( fieldMapping?.displayName ?? field, searchTerm )} - isPinned={pinned} /> {isDetails && !!fieldMapping ? ( diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell_actions.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell_actions.tsx index 7814405e09201..b5e27837f44ef 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell_actions.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table_cell_actions.tsx @@ -202,38 +202,6 @@ export const FilterExist: React.FC = ({ Component, row }) => ); }; -export const PinToggle: React.FC = ({ Component, row }) => { - if (!row) { - return null; - } - - const { - field: { field, pinned, onTogglePinned }, - } = row; - - // Pinned - const pinnedLabel = pinned - ? i18n.translate('unifiedDocViewer.docViews.table.unpinFieldLabel', { - defaultMessage: 'Unpin field', - }) - : i18n.translate('unifiedDocViewer.docViews.table.pinFieldLabel', { - defaultMessage: 'Pin field', - }); - const pinnedIconType = pinned ? 'pinFilled' : 'pin'; - - return ( - onTogglePinned(field)} - > - {pinnedLabel} - - ); -}; - export const ToggleColumn: React.FC = ({ Component, row }) => { if (!row) { return null; @@ -293,9 +261,6 @@ export function getFieldCellActions({ }, ] : []), - ({ Component, rowIndex }: EuiDataGridColumnCellActionProps) => { - return ; - }, ]; } diff --git a/src/plugins/unified_histogram/public/chart/chart_config_panel.tsx b/src/plugins/unified_histogram/public/chart/chart_config_panel.tsx index 1c598d06a143c..00d1eee9bcba0 100644 --- a/src/plugins/unified_histogram/public/chart/chart_config_panel.tsx +++ b/src/plugins/unified_histogram/public/chart/chart_config_panel.tsx @@ -5,12 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import React, { ComponentProps, useCallback, useEffect, useRef, useState } from 'react'; import type { Observable } from 'rxjs'; import type { AggregateQuery, Query } from '@kbn/es-query'; -import { isEqual } from 'lodash'; +import { isEqual, isObject } from 'lodash'; import type { LensEmbeddableOutput, Suggestion } from '@kbn/lens-plugin/public'; import type { Datatable } from '@kbn/expressions-plugin/common'; +import { EditLensConfigPanelComponent } from '@kbn/lens-plugin/public/plugin'; import { deriveLensSuggestionFromLensAttributes } from '../utils/external_vis_context'; import { @@ -49,13 +50,16 @@ export function ChartConfigPanel({ const previousAdapters = useRef | undefined>(undefined); const previousQuery = useRef(undefined); - const updatePanelState = useCallback( + const updatePanelState = useCallback< + ComponentProps['updatePanelState'] + >( (datasourceState, visualizationState, visualizationId) => { const updatedSuggestion: Suggestion = { - ...currentSuggestionContext?.suggestion, - visualizationId: visualizationId ?? currentSuggestionContext?.suggestion?.visualizationId, - ...(datasourceState && { datasourceState }), - ...(visualizationState && { visualizationState }), + ...currentSuggestionContext.suggestion!, + visualizationId: + visualizationId ?? currentSuggestionContext.suggestion?.visualizationId ?? '', + ...(isObject(datasourceState) && { datasourceState }), + ...(isObject(visualizationState) && { visualizationState }), }; onSuggestionContextEdit({ ...currentSuggestionContext, @@ -65,7 +69,9 @@ export function ChartConfigPanel({ [currentSuggestionContext, onSuggestionContextEdit] ); - const updateSuggestion = useCallback( + const updateSuggestion = useCallback< + NonNullable['updateSuggestion']> + >( (attributes) => { const updatedSuggestion = deriveLensSuggestionFromLensAttributes({ externalVisContext: { diff --git a/src/plugins/unified_histogram/public/chart/toolbar_selector.tsx b/src/plugins/unified_histogram/public/chart/toolbar_selector.tsx index b9115847b7b03..58d6b5db00234 100644 --- a/src/plugins/unified_histogram/public/chart/toolbar_selector.tsx +++ b/src/plugins/unified_histogram/public/chart/toolbar_selector.tsx @@ -60,9 +60,11 @@ export const ToolbarSelector: React.FC = ({ [] ); - const onSelectionChange = useCallback( + const onSelectionChange = useCallback< + NonNullable['onChange']> + >( (newOptions) => { - const chosenOption = newOptions.find(({ checked }: SelectableEntry) => checked === 'on'); + const chosenOption = newOptions.find(({ checked }) => checked === 'on'); onChange?.( chosenOption?.value && chosenOption?.value !== EMPTY_OPTION ? chosenOption : undefined @@ -139,7 +141,7 @@ export const ToolbarSelector: React.FC = ({ anchorPosition="downLeft" > {popoverTitle} - id={`${dataTestSubj}Selectable`} singleSelection aria-label={popoverTitle} diff --git a/src/plugins/unified_histogram/public/container/hooks/use_state_props.test.ts b/src/plugins/unified_histogram/public/container/hooks/use_state_props.test.ts index 44a216178f6d5..1491556fc37d3 100644 --- a/src/plugins/unified_histogram/public/container/hooks/use_state_props.test.ts +++ b/src/plugins/unified_histogram/public/container/hooks/use_state_props.test.ts @@ -7,10 +7,9 @@ */ import { DataView, DataViewField, DataViewType } from '@kbn/data-views-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { Suggestion } from '@kbn/lens-plugin/public'; import { renderHook } from '@testing-library/react-hooks'; import { act } from 'react-test-renderer'; -import { UnifiedHistogramFetchStatus } from '../../types'; +import { UnifiedHistogramFetchStatus, UnifiedHistogramSuggestionContext } from '../../types'; import { dataViewMock } from '../../__mocks__/data_view'; import { dataViewWithTimefieldMock } from '../../__mocks__/data_view_with_timefield'; import { lensAdaptersMock } from '../../__mocks__/lens_adapters'; @@ -451,10 +450,12 @@ describe('useStateProps', () => { expect(stateService.setBreakdownField).toHaveBeenLastCalledWith('field'); act(() => { - onSuggestionContextChange({ title: 'Stacked Bar' } as Suggestion); + onSuggestionContextChange({ + suggestion: { title: 'Stacked Bar' }, + } as UnifiedHistogramSuggestionContext); }); expect(stateService.setCurrentSuggestionContext).toHaveBeenLastCalledWith({ - title: 'Stacked Bar', + suggestion: { title: 'Stacked Bar' }, }); }); diff --git a/src/plugins/unified_histogram/public/container/hooks/use_state_props.ts b/src/plugins/unified_histogram/public/container/hooks/use_state_props.ts index f5c8e8e3bc025..58ec13fd5d1a7 100644 --- a/src/plugins/unified_histogram/public/container/hooks/use_state_props.ts +++ b/src/plugins/unified_histogram/public/container/hooks/use_state_props.ts @@ -10,7 +10,11 @@ import { DataView, DataViewField, DataViewType } from '@kbn/data-views-plugin/co import { AggregateQuery, isOfAggregateQueryType, Query } from '@kbn/es-query'; import type { RequestAdapter } from '@kbn/inspector-plugin/public'; import { useCallback, useEffect, useMemo } from 'react'; -import { UnifiedHistogramChartLoadEvent, UnifiedHistogramFetchStatus } from '../../types'; +import { + UnifiedHistogramChartLoadEvent, + UnifiedHistogramFetchStatus, + UnifiedHistogramSuggestionContext, +} from '../../types'; import type { UnifiedHistogramStateService } from '../services/state_service'; import { breakdownFieldSelector, @@ -150,7 +154,7 @@ export const useStateProps = ({ ); const onSuggestionContextChange = useCallback( - (suggestionContext) => { + (suggestionContext: UnifiedHistogramSuggestionContext | undefined) => { stateService?.setCurrentSuggestionContext(suggestionContext); }, [stateService] diff --git a/src/plugins/unified_search/public/dataview_picker/change_dataview.test.tsx b/src/plugins/unified_search/public/dataview_picker/change_dataview.test.tsx index 842d57a1c5a0a..e3e2f30ec5d68 100644 --- a/src/plugins/unified_search/public/dataview_picker/change_dataview.test.tsx +++ b/src/plugins/unified_search/public/dataview_picker/change_dataview.test.tsx @@ -17,7 +17,7 @@ import { indexPatternEditorPluginMock as dataViewEditorPluginMock } from '@kbn/d import { ChangeDataView } from './change_dataview'; import { DataViewSelector } from './data_view_selector'; import { dataViewMock, dataViewMockEsql } from './mocks/dataview'; -import { DataViewPickerPropsExtended } from './data_view_picker'; +import { DataViewPickerProps } from './data_view_picker'; describe('DataView component', () => { const createMockWebStorage = () => ({ @@ -43,7 +43,7 @@ describe('DataView component', () => { }; function wrapDataViewComponentInContext( - testProps: DataViewPickerPropsExtended, + testProps: DataViewPickerProps, storageValue: boolean, uiSettingValue: boolean = false ) { @@ -75,7 +75,7 @@ describe('DataView component', () => { ); } - let props: DataViewPickerPropsExtended; + let props: DataViewPickerProps; beforeEach(() => { props = { currentDataViewId: 'dataview-1', diff --git a/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx b/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx index cc5242d212872..8c54b6be95fd3 100644 --- a/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx +++ b/src/plugins/unified_search/public/dataview_picker/change_dataview.tsx @@ -24,10 +24,9 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { getLanguageDisplayName } from '@kbn/es-query'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { IUnifiedSearchPluginServices } from '../types'; -import { type DataViewPickerPropsExtended } from './data_view_picker'; +import { type DataViewPickerProps } from './data_view_picker'; import type { DataViewListItemEnhanced } from './dataview_list'; import adhoc from './assets/adhoc.svg'; import { changeDataViewStyles } from './change_dataview.styles'; @@ -53,18 +52,13 @@ export function ChangeDataView({ onDataViewCreated, trigger, selectableProps, - textBasedLanguage, isDisabled, onEditDataView, onCreateDefaultAdHocDataView, -}: DataViewPickerPropsExtended) { +}: DataViewPickerProps) { const { euiTheme } = useEuiTheme(); const [isPopoverOpen, setPopoverIsOpen] = useState(false); const [dataViewsList, setDataViewsList] = useState([]); - const [triggerLabel, setTriggerLabel] = useState(''); - const [isTextBasedLangSelected, setIsTextBasedLangSelected] = useState( - Boolean(textBasedLanguage) - ); const kibana = useKibana(); const { application, data, dataViews, dataViewEditor } = kibana.services; @@ -91,20 +85,6 @@ export function ChangeDataView({ fetchDataViews(); }, [data, currentDataViewId, adHocDataViews, savedDataViews]); - useEffect(() => { - if (textBasedLanguage) { - setTriggerLabel(getLanguageDisplayName(textBasedLanguage)); - } else { - setTriggerLabel(trigger.label); - } - }, [textBasedLanguage, trigger.label]); - - useEffect(() => { - if (Boolean(textBasedLanguage) !== isTextBasedLangSelected) { - setIsTextBasedLangSelected(Boolean(textBasedLanguage)); - } - }, [isTextBasedLangSelected, textBasedLanguage]); - const isAdHocSelected = useMemo(() => { return adHocDataViews?.some((dataView) => dataView.id === currentDataViewId); }, [adHocDataViews, currentDataViewId]); @@ -121,14 +101,14 @@ export function ChangeDataView({ color={isMissingCurrent ? 'danger' : 'text'} iconSide="right" iconType="arrowDown" - title={triggerLabel} + title={trigger.label} disabled={isDisabled} textProps={{ className: 'eui-textTruncate' }} {...rest} > <> {/* we don't want to display the adHoc icon on text based mode */} - {isAdHocSelected && !isTextBasedLangSelected && ( + {isAdHocSelected && ( )} - {triggerLabel} + {trigger.label} ); @@ -256,45 +236,43 @@ export function ChangeDataView({ return ( - {!isTextBasedLangSelected && ( - <> - - - - {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.switcherLabelTitle', { - defaultMessage: 'Data view', - })} - - setPopoverIsOpen(false)} - panelPaddingSize="none" - initialFocus={`#${searchListInputId}`} - display="block" - buffer={8} - > -
- -
-
-
-
- - )} + <> + + + + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.switcherLabelTitle', { + defaultMessage: 'Data view', + })} + + setPopoverIsOpen(false)} + panelPaddingSize="none" + initialFocus={`#${searchListInputId}`} + display="block" + buffer={8} + > +
+ +
+
+
+
+
); } diff --git a/src/plugins/unified_search/public/dataview_picker/data_view_picker.tsx b/src/plugins/unified_search/public/dataview_picker/data_view_picker.tsx index ab13f5c1a257b..e79a4e45666a4 100644 --- a/src/plugins/unified_search/public/dataview_picker/data_view_picker.tsx +++ b/src/plugins/unified_search/public/dataview_picker/data_view_picker.tsx @@ -76,13 +76,6 @@ export interface DataViewPickerProps { isDisabled?: boolean; } -export interface DataViewPickerPropsExtended extends DataViewPickerProps { - /** - * Text based language that is currently selected; depends on the query - */ - textBasedLanguage?: string; -} - export const DataViewPicker = ({ isMissingCurrent, currentDataViewId, @@ -95,10 +88,9 @@ export const DataViewPicker = ({ trigger, selectableProps, textBasedLanguages, - textBasedLanguage, onCreateDefaultAdHocDataView, isDisabled, -}: DataViewPickerPropsExtended) => { +}: DataViewPickerProps) => { return ( ); diff --git a/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx b/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx index 003f8181bfefb..1b32952c15679 100644 --- a/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx +++ b/src/plugins/unified_search/public/dataview_picker/dataview_list.tsx @@ -16,6 +16,7 @@ import { EuiPanel, EuiButtonGroup, toSentenceCase, + Direction, } from '@elastic/eui'; import type { DataViewListItem } from '@kbn/data-views-plugin/public'; import { i18n } from '@kbn/i18n'; @@ -107,8 +108,8 @@ export function DataViewsList({ ); const onChangeSortDirection = useCallback( - (value) => { - sortingService.setDirection(value); + (value: string) => { + sortingService.setDirection(value as Direction); setSortedDataViewsList((dataViews) => sortingService.sortData(dataViews)); }, [sortingService] @@ -149,6 +150,7 @@ export function DataViewsList({ searchProps={{ id: searchListInputId, compressed: true, + autoFocus: true, placeholder: strings.editorAndPopover.search.getSearchPlaceholder(), 'data-test-subj': 'indexPattern-switcher--input', ...(selectableProps ? selectableProps.searchProps : undefined), diff --git a/src/plugins/unified_search/public/filters_builder/filter_item/params_editor.tsx b/src/plugins/unified_search/public/filters_builder/filter_item/params_editor.tsx index b51defaf2282e..4dac0d33163dd 100644 --- a/src/plugins/unified_search/public/filters_builder/filter_item/params_editor.tsx +++ b/src/plugins/unified_search/public/filters_builder/filter_item/params_editor.tsx @@ -10,10 +10,11 @@ import React, { useCallback, useContext } from 'react'; import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import type { Filter } from '@kbn/es-query'; import { EuiToolTip, EuiFormRow } from '@elastic/eui'; +import { FilterMetaParams } from '@kbn/es-query/src/filters/build_filters'; import type { Operator } from '../../filter_bar/filter_editor'; import { getFieldValidityAndErrorMessage } from '../../filter_bar/filter_editor/lib'; import { FiltersBuilderContextType } from '../context'; -import { ParamsEditorInput } from './params_editor_input'; +import { ParamsEditorInput, ParamsEditorInputProps } from './params_editor_input'; interface ParamsEditorProps { dataView: DataView; @@ -37,15 +38,15 @@ export function ParamsEditor({ filtersForSuggestions, }: ParamsEditorProps) { const { disabled, suggestionsAbstraction } = useContext(FiltersBuilderContextType); - const onParamsChange = useCallback( + const onParamsChange = useCallback( (selectedParams) => { - onHandleParamsChange(selectedParams); + onHandleParamsChange(selectedParams as FilterMetaParams); }, [onHandleParamsChange] ); - const onParamsUpdate = useCallback( - (value) => { + const onParamsUpdate = useCallback( + (value: any) => { onHandleParamsUpdate(value); }, [onHandleParamsUpdate] diff --git a/src/plugins/unified_search/public/filters_builder/filter_item/params_editor_input.tsx b/src/plugins/unified_search/public/filters_builder/filter_item/params_editor_input.tsx index c3138f7a14e24..d59ffa9782e35 100644 --- a/src/plugins/unified_search/public/filters_builder/filter_item/params_editor_input.tsx +++ b/src/plugins/unified_search/public/filters_builder/filter_item/params_editor_input.tsx @@ -34,7 +34,7 @@ export const strings = { }), }; -interface ParamsEditorInputProps { +export interface ParamsEditorInputProps { dataView: DataView; params: unknown; onParamsChange: (params: unknown) => void; diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx new file mode 100644 index 0000000000000..3234e08bddc6e --- /dev/null +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx @@ -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 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 { screen, render } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { coreMock } from '@kbn/core/public/mocks'; +import { ESQLMenuPopover } from './esql_menu_popover'; + +describe('ESQLMenuPopover', () => { + const renderESQLPopover = () => { + const startMock = coreMock.createStart(); + const services = { + docLinks: startMock.docLinks, + }; + return render( + + {' '} + + ); + }; + + it('should render a button', () => { + renderESQLPopover(); + expect(screen.getByTestId('esql-menu-button')).toBeInTheDocument(); + }); + + it('should open a menu when the popover is open', () => { + renderESQLPopover(); + expect(screen.getByTestId('esql-menu-button')).toBeInTheDocument(); + userEvent.click(screen.getByRole('button')); + + expect(screen.getByTestId('esql-examples')).toBeInTheDocument(); + expect(screen.getByTestId('esql-about')).toBeInTheDocument(); + expect(screen.getByTestId('esql-feedback')).toBeInTheDocument(); + }); +}); diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx new file mode 100644 index 0000000000000..f2c8b5f7798d5 --- /dev/null +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx @@ -0,0 +1,95 @@ +/* + * 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, { useMemo, useState } from 'react'; +import { + EuiPopover, + EuiButton, + EuiContextMenuPanel, + type EuiContextMenuPanelProps, + EuiContextMenuItem, + EuiHorizontalRule, +} from '@elastic/eui'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { i18n } from '@kbn/i18n'; +import { FEEDBACK_LINK } from '@kbn/esql-utils'; +import type { IUnifiedSearchPluginServices } from '../types'; + +export const ESQLMenuPopover = () => { + const kibana = useKibana(); + + const { docLinks } = kibana.services; + const [isESQLMenuPopoverOpen, setIsESQLMenuPopoverOpen] = useState(false); + const esqlPanelItems = useMemo(() => { + const panelItems: EuiContextMenuPanelProps['items'] = []; + panelItems.push( + + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { + defaultMessage: 'Documentation', + })} + , + + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { + defaultMessage: 'Example queries', + })} + , + , + + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { + defaultMessage: 'Submit feedback', + })} + + ); + return panelItems; + }, [docLinks.links.query.queryESQL, docLinks.links.query.queryESQLExamples]); + + return ( + setIsESQLMenuPopoverOpen(!isESQLMenuPopoverOpen)} + data-test-subj="esql-menu-button" + size="s" + > + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.label', { + defaultMessage: 'ES|QL help', + })} + + } + panelProps={{ + ['data-test-subj']: 'esql-menu-popover', + css: { width: 240 }, + }} + isOpen={isESQLMenuPopoverOpen} + closePopover={() => setIsESQLMenuPopoverOpen(false)} + panelPaddingSize="s" + display="block" + > + + + ); +}; diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx index 56d17679bd721..c685af3336551 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx @@ -50,6 +50,7 @@ import { NoDataPopover } from './no_data_popover'; import { shallowEqual } from '../utils/shallow_equal'; import { AddFilterPopover } from './add_filter_popover'; import { DataViewPicker, DataViewPickerProps } from '../dataview_picker'; +import { ESQLMenuPopover } from './esql_menu_popover'; import { FilterButtonGroup } from '../filter_bar/filter_button_group/filter_button_group'; import type { @@ -151,6 +152,7 @@ export interface QueryBarTopRowProps prepend?: React.ComponentProps['prepend']; query?: Query | QT; refreshInterval?: number; + minRefreshInterval?: number; screenTitle?: string; showQueryInput?: boolean; showAddFilter?: boolean; @@ -502,6 +504,7 @@ export const QueryBarTopRow = React.memo( end={props.dateRangeTo} isPaused={props.isRefreshPaused} refreshInterval={props.refreshInterval} + refreshMinInterval={props.minRefreshInterval} onTimeChange={onTimeChange} onRefresh={onRefresh} onRefreshChange={props.onRefreshChange} @@ -621,22 +624,17 @@ export const QueryBarTopRow = React.memo( } function renderDataViewsPicker() { - if (!props.dataViewPickerComponentProps) return; - let textBasedLanguage; - if (Boolean(isQueryLangSelected)) { - const query = props.query as AggregateQuery; - textBasedLanguage = getAggregateQueryMode(query); + if (props.dataViewPickerComponentProps && !Boolean(isQueryLangSelected)) { + return ( + + + + ); } - return ( - - - - ); } function renderAddButton() { @@ -770,12 +768,12 @@ export const QueryBarTopRow = React.memo( padding: ${isQueryLangSelected && !props.disableExternalPadding ? euiTheme.size.s : 0}; - padding-bottom: 0; `} justifyContent={shouldShowDatePickerAsBadge() ? 'flexStart' : 'flexEnd'} wrap > {props.dataViewPickerOverride || renderDataViewsPicker()} + {Boolean(isQueryLangSelected) && } { + const onInputChange = useCallback>((event) => { setFormErrors([]); setTitle(event.target.value); }, []); diff --git a/src/plugins/unified_search/public/saved_query_management/saved_query_management_list.tsx b/src/plugins/unified_search/public/saved_query_management/saved_query_management_list.tsx index d62061d7d6cf6..825b158849120 100644 --- a/src/plugins/unified_search/public/saved_query_management/saved_query_management_list.tsx +++ b/src/plugins/unified_search/public/saved_query_management/saved_query_management_list.tsx @@ -24,6 +24,7 @@ import { EuiHorizontalRule, EuiProgress, PrettyDuration, + EuiSelectableProps, } from '@elastic/eui'; import { EuiContextMenuClass } from '@elastic/eui/src/components/context_menu/context_menu'; import { i18n } from '@kbn/i18n'; @@ -282,9 +283,17 @@ export const SavedQueryManagementList = ({ } }, [onLoad, selectedSavedQuery, onClose]); - const handleSelect = useCallback((savedQueryToSelect) => { - setSelectedSavedQuery(savedQueryToSelect); - }, []); + const handleSelect = useCallback['onChange']>>( + (choices) => { + const choice = choices.find(({ checked }) => checked); + if (choice) { + setSelectedSavedQuery( + currentPageQueries.find((savedQuery) => savedQuery.id === choice.value) + ); + } + }, + [currentPageQueries] + ); const handleDelete = useCallback((savedQueryToDelete: SavedQuery) => { setShowDeletionConfirmationModal(true); @@ -439,14 +448,7 @@ export const SavedQueryManagementList = ({ {noSavedQueriesDescriptionText} } - onChange={(choices) => { - const choice = choices.find(({ checked }) => checked); - if (choice) { - handleSelect( - currentPageQueries.find((savedQuery) => savedQuery.id === choice.value) - ); - } - }} + onChange={handleSelect} renderOption={renderOption} css={{ '.euiSelectableList__list': { diff --git a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx index 38e3b11ae15e7..4f2a609c93cbc 100644 --- a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx @@ -171,7 +171,7 @@ export function createSearchBar({ query: props.query, queryStringManager: data.query.queryString, }) as { query: QT }; - const { timeRange, refreshInterval } = useTimefilter({ + const { timeRange, refreshInterval, minRefreshInterval } = useTimefilter({ dateRangeFrom: props.dateRangeFrom, dateRangeTo: props.dateRangeTo, refreshInterval: props.refreshInterval, @@ -232,6 +232,7 @@ export function createSearchBar({ timeHistory={data.query.timefilter.history} dateRangeFrom={timeRange.from} dateRangeTo={timeRange.to} + minRefreshInterval={minRefreshInterval} refreshInterval={refreshInterval.value} isRefreshPaused={refreshInterval.pause} isLoading={props.isLoading} diff --git a/src/plugins/unified_search/public/search_bar/lib/use_timefilter.ts b/src/plugins/unified_search/public/search_bar/lib/use_timefilter.ts index ddfff690fce81..de13936bed8d7 100644 --- a/src/plugins/unified_search/public/search_bar/lib/use_timefilter.ts +++ b/src/plugins/unified_search/public/search_bar/lib/use_timefilter.ts @@ -59,5 +59,6 @@ export const useTimefilter = (props: UseTimefilterProps) => { return { refreshInterval, timeRange, + minRefreshInterval: props.timefilter.getMinRefreshInterval(), }; }; diff --git a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx index f107d736ccf72..2efdc277daca0 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx @@ -94,6 +94,7 @@ function wrapSearchBarInContext(testProps: any) { notifications: startMock.notifications, http: startMock.http, theme: startMock.theme, + docLinks: startMock.docLinks, storage: createMockStorage(), data: { query: { diff --git a/src/plugins/unified_search/public/search_bar/search_bar.tsx b/src/plugins/unified_search/public/search_bar/search_bar.tsx index 2d7ce30423fc3..992f6290b53e8 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.tsx @@ -79,6 +79,7 @@ export interface SearchBarOwnProps { // Date picker isRefreshPaused?: boolean; refreshInterval?: number; + minRefreshInterval?: number; dateRangeFrom?: string; dateRangeTo?: string; // Query bar - should be in SearchBarInjectedDeps @@ -619,6 +620,7 @@ class SearchBarUI extends C dateRangeTo={this.state.dateRangeTo} isRefreshPaused={this.props.isRefreshPaused} refreshInterval={this.props.refreshInterval} + minRefreshInterval={this.props.minRefreshInterval} showAutoRefreshOnly={this.props.showAutoRefreshOnly} showQueryInput={this.props.showQueryInput} showAddFilter={this.props.showFilterBar} diff --git a/src/plugins/usage_collection/server/index.ts b/src/plugins/usage_collection/server/index.ts index bdac41e9c04da..8de2a99d30e7d 100644 --- a/src/plugins/usage_collection/server/index.ts +++ b/src/plugins/usage_collection/server/index.ts @@ -28,7 +28,7 @@ export type { export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './usage_counters'; -export type { UsageCollectionSetup } from './plugin'; +export type { UsageCollectionSetup, UsageCollectionStart } from './plugin'; export { config } from './config'; export const plugin = async (initializerContext: PluginInitializerContext) => { const { UsageCollectionPlugin } = await import('./plugin'); diff --git a/src/plugins/vis_default_editor/public/components/agg_params.tsx b/src/plugins/vis_default_editor/public/components/agg_params.tsx index aa1fe36d797e4..8e67a2624501f 100644 --- a/src/plugins/vis_default_editor/public/components/agg_params.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_params.tsx @@ -11,7 +11,7 @@ import { EuiForm, EuiAccordion, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import useUnmount from 'react-use/lib/useUnmount'; -import { IAggConfig, AggGroupNames } from '@kbn/data-plugin/public'; +import { IAggConfig, AggGroupNames, IAggType } from '@kbn/data-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { Schema } from '@kbn/visualizations-plugin/public'; @@ -124,7 +124,7 @@ function DefaultEditorAggParams({ !!error || isInvalidParamsTouched(agg.type, aggType, paramsState); const onAggSelect = useCallback( - (value) => { + (value: IAggType) => { if (agg.type !== value) { onAggTypeChange(agg.id, value); // reset touched and valid of params diff --git a/src/plugins/vis_default_editor/public/components/agg_select.tsx b/src/plugins/vis_default_editor/public/components/agg_select.tsx index 09aee4b217266..e65b56753ab1b 100644 --- a/src/plugins/vis_default_editor/public/components/agg_select.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_select.tsx @@ -104,14 +104,14 @@ function DefaultEditorAggSelect({ }, [setValue] ); - const onSearchChange = useCallback((searchValue) => setIsDirty(Boolean(searchValue)), []); + const onSearchChange = useCallback((searchValue: string) => setIsDirty(Boolean(searchValue)), []); const setTouched = useCallback( () => onChangeAggType({ type: AGG_TYPE_ACTION_KEYS.TOUCHED, payload: true }), [onChangeAggType] ); const setValidity = useCallback( - (valid) => onChangeAggType({ type: AGG_TYPE_ACTION_KEYS.VALID, payload: valid }), + (valid: boolean) => onChangeAggType({ type: AGG_TYPE_ACTION_KEYS.VALID, payload: valid }), [onChangeAggType] ); diff --git a/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx index 89a6109c52fc7..699dbe3470273 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx @@ -67,7 +67,7 @@ const defaultConfig = { }; function FromToList({ showValidation, onBlur, ...rest }: FromToListProps) { - const renderInputRow = useCallback( + const renderInputRow = useCallback( (item: FromToModel, index, onChangeValue) => ( <> diff --git a/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx index a63848c1d14ce..ca42f1bd23f02 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx @@ -63,7 +63,7 @@ const defaultConfig = { }; function MaskList({ showValidation, onBlur, ...rest }: MaskListProps) { - const renderInputRow = useCallback( + const renderInputRow = useCallback( ({ mask }: MaskModel, index, onChangeValue) => ( setIsDirty(Boolean(searchValue)), []); + const onSearchChange = useCallback((searchValue: string) => setIsDirty(Boolean(searchValue)), []); return ( setValue(ev.target.value), [setValue]); + const onChange = useCallback>( + (e) => setValue(e.target.value), + [setValue] + ); return ( setStateParamValue(PARAMS.NAME, optionId === PARAMS.ROWS), + (optionId: string) => setStateParamValue(PARAMS.NAME, optionId === PARAMS.ROWS), [setStateParamValue] ); diff --git a/src/plugins/vis_default_editor/public/components/controls/string.tsx b/src/plugins/vis_default_editor/public/components/controls/string.tsx index 254c299180662..90b47ebf5c0d4 100644 --- a/src/plugins/vis_default_editor/public/components/controls/string.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/string.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { useEffect, useCallback } from 'react'; +import React, { useEffect, useCallback, ChangeEventHandler } from 'react'; import { EuiFieldText, EuiFormRow } from '@elastic/eui'; import { AggParamEditorProps } from '../agg_param_props'; @@ -26,7 +26,10 @@ function StringParamEditor({ setValidity(isValid); }, [isValid, setValidity]); - const onChange = useCallback((ev) => setValue(ev.target.value), [setValue]); + const onChange = useCallback>( + (e) => setValue(e.target.value), + [setValue] + ); return ( void; @@ -18,9 +19,9 @@ function useSubAggParamsHandlers( aggParam: AggParamType, subAgg: IAggConfig, setValue: SetValue -) { - const setAggParamValue = useCallback( - (aggId, paramName, val) => { +): Pick { + const setAggParamValue = useCallback( + (_, paramName, val) => { const parsedParams = subAgg.serialize(); const params = { ...parsedParams, @@ -35,13 +36,13 @@ function useSubAggParamsHandlers( [agg, aggParam, setValue, subAgg] ); - const onAggTypeChange = useCallback( - (aggId, aggType) => { + const onAggTypeChange = useCallback( + (_, aggType) => { const parsedAgg = subAgg.serialize(); const parsedAggParams = parsedAgg.params as SerializableRecord; // we should share between aggs only field and base params: json, label, time shift. - const params = { + const params: AggConfigSerialized = { ...parsedAgg, params: { field: parsedAggParams.field, @@ -49,6 +50,7 @@ function useSubAggParamsHandlers( customLabel: parsedAggParams.customLabel, timeShift: parsedAggParams.timeShift, }, + // @ts-ignore - Need to verify type type: aggType, }; diff --git a/src/plugins/vis_default_editor/public/components/options/color_ranges.tsx b/src/plugins/vis_default_editor/public/components/options/color_ranges.tsx index 67a6c9c6e8f40..059518926a3e8 100644 --- a/src/plugins/vis_default_editor/public/components/options/color_ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/options/color_ranges.tsx @@ -39,8 +39,8 @@ function ColorRanges({ }, [colorsRange]); const validateRange = useCallback( - ({ from, to }, index) => { - if (!colorsRange[index]) { + ({ from, to }: RangeValues, index: number) => { + if (from === undefined || to === undefined || !colorsRange[index]) { return [false, false]; } diff --git a/src/plugins/vis_default_editor/public/components/options/index.ts b/src/plugins/vis_default_editor/public/components/options/index.ts index 09373dc64eb85..fa2aab1568610 100644 --- a/src/plugins/vis_default_editor/public/components/options/index.ts +++ b/src/plugins/vis_default_editor/public/components/options/index.ts @@ -9,11 +9,9 @@ export { BasicOptions } from './basic_options'; export { SwitchOption } from './switch'; export { SelectOption } from './select'; -export type { SetColorRangeValue } from './color_ranges'; -export { ColorRanges } from './color_ranges'; -export type { SetColorSchemaOptionsValue } from './color_schema'; -export { ColorSchemaOptions } from './color_schema'; -export { NumberInputOption } from './number_input'; +export { ColorRanges, type SetColorRangeValue } from './color_ranges'; +export { ColorSchemaOptions, type SetColorSchemaOptionsValue } from './color_schema'; +export { NumberInputOption, type NumberInputOptionProps } from './number_input'; export { RangeOption } from './range'; export { RequiredNumberInputOption } from './required_number_input'; export { TextInputOption } from './text_input'; diff --git a/src/plugins/vis_default_editor/public/components/options/legend_size_settings.tsx b/src/plugins/vis_default_editor/public/components/options/legend_size_settings.tsx index bbe47295c99e6..43d6b6d230b5d 100644 --- a/src/plugins/vis_default_editor/public/components/options/legend_size_settings.tsx +++ b/src/plugins/vis_default_editor/public/components/options/legend_size_settings.tsx @@ -71,7 +71,7 @@ export const LegendSizeSettings = ({ }, [isVerticalLegend, legendSize, onLegendSizeChange]); const onLegendSizeOptionChange = useCallback( - (option) => onLegendSizeChange(option === DEFAULT_LEGEND_SIZE ? undefined : option), + (size: LegendSize) => onLegendSizeChange(size === DEFAULT_LEGEND_SIZE ? undefined : size), [onLegendSizeChange] ); diff --git a/src/plugins/vis_default_editor/public/components/options/number_input.tsx b/src/plugins/vis_default_editor/public/components/options/number_input.tsx index 604a5896308ae..643d4ad60890e 100644 --- a/src/plugins/vis_default_editor/public/components/options/number_input.tsx +++ b/src/plugins/vis_default_editor/public/components/options/number_input.tsx @@ -62,4 +62,4 @@ function NumberInputOption({ ); } -export { NumberInputOption }; +export { NumberInputOption, type NumberInputOptionProps }; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx index 678a6c2edaf97..4b14ade5ef431 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { useCallback, useState } from 'react'; +import React, { SetStateAction, useCallback, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem, @@ -42,7 +42,7 @@ function DefaultEditorControls({ const { enableAutoApply } = vis.type.editorConfig; const [autoApplyEnabled, setAutoApplyEnabled] = useState(false); const toggleAutoApply = useCallback( - (nextAutoApplyEnabled) => setAutoApplyEnabled(nextAutoApplyEnabled), + (nextAutoApplyEnabled: SetStateAction) => setAutoApplyEnabled(nextAutoApplyEnabled), [] ); const onClickDiscard = useCallback(() => dispatch(discardChanges(vis)), [dispatch, vis]); diff --git a/src/plugins/vis_default_editor/public/index.ts b/src/plugins/vis_default_editor/public/index.ts index ffa5e5f88e661..1e251976d30a9 100644 --- a/src/plugins/vis_default_editor/public/index.ts +++ b/src/plugins/vis_default_editor/public/index.ts @@ -27,6 +27,7 @@ export { ColorRanges, BasicOptions, type SetColorRangeValue, + type NumberInputOptionProps, type SetColorSchemaOptionsValue, } from './components/options'; export type { RangeValues } from './components/controls/ranges'; diff --git a/src/plugins/vis_types/heatmap/public/editor/components/heatmap.tsx b/src/plugins/vis_types/heatmap/public/editor/components/heatmap.tsx index 14f09472df752..de483e34f7b11 100644 --- a/src/plugins/vis_types/heatmap/public/editor/components/heatmap.tsx +++ b/src/plugins/vis_types/heatmap/public/editor/components/heatmap.tsx @@ -69,7 +69,10 @@ const HeatmapOptions = (props: HeatmapOptionsProps) => { } }, [stateParams]); - const handleLegendSizeChange = useCallback((size) => setValue('legendSize', size), [setValue]); + const handleLegendSizeChange = useCallback( + (size?: LegendSize) => setValue('legendSize', size), + [setValue] + ); return ( <> diff --git a/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx b/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx index 0b16e538fb481..0134d8d056ec8 100644 --- a/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx +++ b/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx @@ -47,7 +47,10 @@ function LabelsPanel({ valueAxis, setValue, isNewLibrary }: LabelsPanelProps) { [setValueAxisLabels] ); - const setColor = useCallback((value) => setValueAxisLabels('color', value), [setValueAxisLabels]); + const setColor = useCallback( + (value: string) => setValueAxisLabels('color', value), + [setValueAxisLabels] + ); return ( diff --git a/src/plugins/vis_types/pie/public/editor/components/pie.tsx b/src/plugins/vis_types/pie/public/editor/components/pie.tsx index b1369e4e90929..8b5a6bdd7c490 100644 --- a/src/plugins/vis_types/pie/public/editor/components/pie.tsx +++ b/src/plugins/vis_types/pie/public/editor/components/pie.tsx @@ -117,14 +117,17 @@ const PieOptions = (props: PieOptionsProps) => { }, [props.palettes]); const handleEmptySizeRatioChange = useCallback( - (sizeId) => { + (sizeId: string) => { const emptySizeRatio = emptySizeRatioOptions.find(({ id }) => id === sizeId)?.value; setValue('emptySizeRatio', emptySizeRatio); }, [setValue] ); - const handleLegendSizeChange = useCallback((size) => setValue('legendSize', size), [setValue]); + const handleLegendSizeChange = useCallback( + (size?: LegendSize) => setValue('legendSize', size), + [setValue] + ); const handleLegendDisplayChange = useCallback( (name: keyof PartitionVisParams, show: boolean) => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx b/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx index b1c4adae3859b..9af19c8dc18f7 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx @@ -74,7 +74,7 @@ export const AnnotationsEditor = (props: AnnotationsEditorProps) => { ); const handleDelete = useCallback( - (annotation) => () => + (annotation: Annotation) => () => collectionActions.handleDelete(getCollectionActionsProps(props), annotation), [props] ); diff --git a/src/plugins/vis_types/timeseries/public/application/components/color_picker.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/color_picker.test.tsx index 3c32275ea5ee5..0619228404191 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/color_picker.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/color_picker.test.tsx @@ -8,60 +8,76 @@ import React from 'react'; import { ColorPicker, ColorPickerProps } from './color_picker'; -import { mount } from 'enzyme'; -import { ReactWrapper } from 'enzyme'; -import { EuiColorPicker, EuiIconTip } from '@elastic/eui'; -import { findTestSubject } from '@elastic/eui/lib/test'; +import { fireEvent, render, screen } from '@testing-library/react'; describe('ColorPicker', () => { + const onChange = jest.fn(); const defaultProps: ColorPickerProps = { name: 'color', value: null, - onChange: jest.fn(), + onChange, disableTrash: true, }; - let component: ReactWrapper; + + const renderColorPicker = (props?: Partial) => + render(); + + afterEach(() => { + jest.clearAllMocks(); + }); it('should render the EuiColorPicker', () => { - component = mount(); - expect(component.find(EuiColorPicker).length).toBe(1); + renderColorPicker(); + expect(screen.getByTestId('tvbColorPicker')).toBeInTheDocument(); }); it('should not render the clear button', () => { - component = mount(); - expect(findTestSubject(component, 'tvbColorPickerClear').length).toBe(0); + renderColorPicker(); + expect(screen.queryByTestId('tvbColorPickerClear')).toBeNull(); }); - it('should render the correct value to the input text if the prop value is hex', () => { - const props = { ...defaultProps, value: '#68BC00' }; - component = mount(); - findTestSubject(component, 'tvbColorPicker').find('button').simulate('click'); - const input = findTestSubject(component, 'euiColorPickerInput_top'); - expect(input.props().value).toBe('#68BC00'); + it('should render incorrect value to the input text but not call onChange prop', () => { + renderColorPicker({ value: '#68BC00' }); + fireEvent.click(screen.getByRole('button')); + fireEvent.change(screen.getAllByTestId('euiColorPickerInput_top')[0], { + target: { value: 'INVALID' }, + }); + expect(onChange).not.toHaveBeenCalled(); + expect(screen.getAllByTestId('euiColorPickerInput_top')[0]).toHaveValue('INVALID'); }); - - it('should render the correct value to the input text if the prop value is rgba', () => { - const props = { ...defaultProps, value: 'rgba(85,66,177,1)' }; - component = mount(); - findTestSubject(component, 'tvbColorPicker').find('button').simulate('click'); - const input = findTestSubject(component, 'euiColorPickerInput_top'); - expect(input.props().value).toBe('85,66,177,1'); + it('should render correct value to the input text and call onChange prop', () => { + renderColorPicker({ value: '#68BC00' }); + fireEvent.click(screen.getByRole('button')); + fireEvent.change(screen.getAllByTestId('euiColorPickerInput_top')[0], { + target: { value: '#FFF' }, + }); + expect(onChange).toHaveBeenCalled(); + expect(screen.getAllByTestId('euiColorPickerInput_top')[0]).toHaveValue('#FFF'); }); it('should render the correct aria label to the color swatch button', () => { - const props = { ...defaultProps, value: 'rgba(85,66,177,0.59)' }; - component = mount(); - const button = findTestSubject(component, 'tvbColorPicker').find('button'); - expect(button.prop('aria-label')).toBe('Color picker (rgba(85,66,177,0.59)), not accessible'); + renderColorPicker({ value: 'rgba(85,66,177,0.59)' }); + expect( + screen.getByLabelText('Color picker (rgba(85,66,177,0.59)), not accessible') + ).toBeInTheDocument(); }); it('should call clear function if the disableTrash prop is false', () => { - const props = { ...defaultProps, disableTrash: false, value: 'rgba(85,66,177,1)' }; - component = mount(); + const { container } = renderColorPicker({ disableTrash: false, value: 'rgba(85,66,177,1)' }); + fireEvent.click(screen.getByTestId('tvbColorPickerClear')); + expect(onChange).toHaveBeenCalled(); + expect(container.querySelector('[data-euiicon-type="cross"]')).toBeInTheDocument(); + }); - findTestSubject(component, 'tvbColorPickerClear').simulate('click'); + it('should render the correct value to the input text if the prop value is hex', () => { + renderColorPicker({ value: '#68BC00' }); + fireEvent.click(screen.getByRole('button')); + expect(screen.getAllByTestId('euiColorPickerInput_top')[0]).toHaveValue('#68BC00'); + }); - expect(component.find(EuiIconTip).length).toBe(1); - expect(defaultProps.onChange).toHaveBeenCalled(); + it('should render the correct value to the input text if the prop value is rgba', () => { + renderColorPicker({ value: 'rgba(85,66,177,1)' }); + fireEvent.click(screen.getByRole('button')); + expect(screen.getAllByTestId('euiColorPickerInput_top')[0]).toHaveValue('85,66,177,1'); }); }); diff --git a/src/plugins/vis_types/timeseries/public/application/components/color_picker.tsx b/src/plugins/vis_types/timeseries/public/application/components/color_picker.tsx index a44134dfa919c..474ce95412797 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/color_picker.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/color_picker.tsx @@ -41,8 +41,14 @@ export function ColorPicker({ name, value, disableTrash = false, onChange }: Col const { euiTheme } = useEuiTheme(); - const handleColorChange: EuiColorPickerProps['onChange'] = (text: string, { rgba, hex }) => { + const handleColorChange: EuiColorPickerProps['onChange'] = ( + text: string, + { rgba, hex, isValid } + ) => { setColor(text); + if (!isValid) { + return; + } onChange({ [name]: hex ? `rgba(${rgba.join(',')})` : '' }); }; diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile.test.ts index 885a2b16b44cc..e8f8fe266f78a 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile.test.ts @@ -226,7 +226,9 @@ describe('convertToPercentileColumns', () => { if (expected === null) { expect(convertToPercentileColumns(...input)).toBeNull(); } else if (Array.isArray(expected)) { - expect(convertToPercentileColumns(...input)).toEqual(expected.map(expect.objectContaining)); + expect(convertToPercentileColumns(...input)).toEqual( + expected.map((el) => (el === null ? null : expect.objectContaining(el))) + ); } else { expect(convertToPercentileColumns(...input)).toEqual(expect.objectContaining(expected)); } diff --git a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile_rank.test.ts b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile_rank.test.ts index 25c047f8a19be..a1b09b57119b2 100644 --- a/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile_rank.test.ts +++ b/src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile_rank.test.ts @@ -202,7 +202,7 @@ describe('convertToPercentileRankColumns', () => { expect(convertToPercentileRankColumns(...input)).toBeNull(); } else if (Array.isArray(expected)) { expect(convertToPercentileRankColumns(...input)).toEqual( - expected.map(expect.objectContaining) + expected.map((el) => (el === null ? null : expect.objectContaining(el))) ); } else { expect(convertToPercentileRankColumns(...input)).toEqual(expect.objectContaining(expected)); diff --git a/src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx b/src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx index 688247c5eb6d5..e9341ec5a4a2e 100644 --- a/src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx +++ b/src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx @@ -19,12 +19,12 @@ interface InspectorDataGridProps extends VegaRuntimeData { export const InspectorDataGrid = ({ columns, data, dataGridAriaLabel }: InspectorDataGridProps) => { const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: DEFAULT_PAGE_SIZE }); const onChangeItemsPerPage = useCallback( - (pageSize) => setPagination((p) => ({ ...p, pageSize, pageIndex: 0 })), + (pageSize: number) => setPagination((p) => ({ ...p, pageSize, pageIndex: 0 })), [setPagination] ); const onChangePage = useCallback( - (pageIndex) => setPagination((p) => ({ ...p, pageIndex })), + (pageIndex: number) => setPagination((p) => ({ ...p, pageIndex })), [setPagination] ); diff --git a/src/plugins/vis_types/vislib/public/vis_wrapper.tsx b/src/plugins/vis_types/vislib/public/vis_wrapper.tsx index 50e1b266963db..262f6cc70038a 100644 --- a/src/plugins/vis_types/vislib/public/vis_wrapper.tsx +++ b/src/plugins/vis_types/vislib/public/vis_wrapper.tsx @@ -48,37 +48,32 @@ const VislibWrapper = ({ core, charts, visData, visConfig, handlers }: VislibWra const visController = useRef(null); const skipRenderComplete = useRef(true); - const renderComplete = useMemo( - () => () => { - const usageCollection = getUsageCollectionStart(); - const containerType = extractContainerType(handlers.getExecutionContext()); - - if (usageCollection && containerType) { - usageCollection.reportUiCounter( - containerType, - METRIC_TYPE.COUNT, - `render_agg_based_${visConfig!.type}` - ); - } - handlers.done(); - }, - [handlers, visConfig] - ); + const renderComplete = useCallback(() => { + if (skipRenderComplete.current) { + return; + } + const usageCollection = getUsageCollectionStart(); + const containerType = extractContainerType(handlers.getExecutionContext()); + + if (usageCollection && containerType) { + usageCollection.reportUiCounter( + containerType, + METRIC_TYPE.COUNT, + `render_agg_based_${visConfig!.type}` + ); + } + handlers.done(); + skipRenderComplete.current = true; + }, [handlers, visConfig]); const renderChart = useMemo( () => debounce(() => { if (visController.current) { - visController.current.render( - visData, - visConfig, - handlers, - skipRenderComplete.current ? undefined : renderComplete - ); + visController.current.render(visData, visConfig, handlers, renderComplete); } - skipRenderComplete.current = true; }, 100), - [handlers, renderComplete, skipRenderComplete, visConfig, visData] + [handlers, renderComplete, visConfig, visData] ); const onResize: EuiResizeObserverProps['onResize'] = useCallback(() => { diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/chart_options.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/chart_options.tsx index 1d609187f83c5..8611f17d585dd 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/chart_options.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/chart_options.tsx @@ -47,7 +47,7 @@ function ChartOptions({ ); const setValueAxis = useCallback( - (paramName, value) => { + (paramName: 'valueAxis', value: string) => { changeValueAxis(index, paramName, value); }, [changeValueAxis, index] diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/y_extents.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/y_extents.tsx index 5b37ae97a1966..e8baea3ed4da1 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/y_extents.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/y_extents.tsx @@ -10,7 +10,7 @@ import React, { useEffect, useCallback } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { NumberInputOption } from '@kbn/vis-default-editor-plugin/public'; +import { NumberInputOption, NumberInputOptionProps } from '@kbn/vis-default-editor-plugin/public'; import { Scale, ScaleType } from '../../../../types'; import { SetScale } from './value_axis_options'; @@ -54,7 +54,7 @@ function YExtents({ scale, setScale, setMultipleValidity }: YExtentsProps) { const isValid = !errors.length; - const setExtents = useCallback( + const setExtents = useCallback['setValue']>( (paramName, value) => { setScale(paramName, value === '' ? null : value); }, diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx index f38471d2ae24e..fe997ead61eb5 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx @@ -46,7 +46,10 @@ export function PointSeriesOptions(props: ValidationVisOptionsProps) const [hadAutoLegendSize] = useState(() => legendSize === LegendSize.AUTO); - const handleLegendSizeChange = useCallback((size) => setValue('legendSize', size), [setValue]); + const handleLegendSizeChange = useCallback( + (size?: LegendSize) => setValue('legendSize', size), + [setValue] + ); return ( <> diff --git a/src/plugins/visualizations/common/content_management/v1/types.ts b/src/plugins/visualizations/common/content_management/v1/types.ts index 80159165d97d9..02ab5f762051f 100644 --- a/src/plugins/visualizations/common/content_management/v1/types.ts +++ b/src/plugins/visualizations/common/content_management/v1/types.ts @@ -18,7 +18,7 @@ import { CreateResult, UpdateResult, } from '@kbn/content-management-plugin/common'; -import { ContentManagementCrudTypes } from '@kbn/content-management-utils'; +import type { ContentManagementCrudTypes } from '@kbn/content-management-utils'; import { VisualizationContentType } from '../types'; diff --git a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts index f736455faf046..1144f4519490c 100644 --- a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts +++ b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts @@ -8,7 +8,7 @@ import { SearchQuery } from '@kbn/content-management-plugin/common'; import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; -import { +import type { ContentManagementCrudTypes, SavedObjectCreateOptions, SavedObjectUpdateOptions, diff --git a/src/setup_node_env/harden/index.js b/src/setup_node_env/harden/index.js index 7c3c1528ec2d9..170821a7da21e 100644 --- a/src/setup_node_env/harden/index.js +++ b/src/setup_node_env/harden/index.js @@ -9,6 +9,7 @@ var ritm = require('require-in-the-middle'); var lodashPatch = require('./lodash_template'); var patchChildProcess = require('./child_process'); +var hardenPrototypes = require('./prototype'); // the performance cost of using require-in-the-middle is atm directly related to the number of // registered hooks (as require is patched once for EACH hook) @@ -39,3 +40,9 @@ new ritm.Hook( return module; } ); + +// Use of the `KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING` environment variable is discouraged, and should only be set to facilitate testing +// specific scenarios. This should never be set in production. +if (!process.env.KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING) { + hardenPrototypes(); +} diff --git a/src/setup_node_env/harden/prototype.js b/src/setup_node_env/harden/prototype.js new file mode 100644 index 0000000000000..664697af7a34b --- /dev/null +++ b/src/setup_node_env/harden/prototype.js @@ -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. + */ + +function hardenPrototypes() { + // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal + // > The Object.seal() static method seals an object. + // > Sealing an object prevents extensions and makes existing properties non-configurable. + // > A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, + // > their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. + // > Values of existing properties can still be changed as long as they are writable. + // Object.freeze would take this one step further, and prevent the values of the properties from being changed as well. + // This is not currently feasible for Kibana, as this functionality is required for some of the libraries that we use, such as react-dom/server. + // While Object.seal() is not a silver bullet, it does provide a good balance between security and compatibility. + // The goal is to prevent a majority of prototype pollution vulnerabilities that can be exploited by an attacker. + + Object.seal(Object.prototype); + Object.seal(Number.prototype); + Object.seal(String.prototype); + Object.seal(Function.prototype); + + // corejs currently manipulates Array.prototype, so we cannot seal it. +} + +module.exports = hardenPrototypes; diff --git a/test/accessibility/apps/dashboard.ts b/test/accessibility/apps/dashboard.ts index 268bf06bc4b17..972f8f00d5d3f 100644 --- a/test/accessibility/apps/dashboard.ts +++ b/test/accessibility/apps/dashboard.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardName = 'Dashboard Listing A11y'; const clonedDashboardName = 'Dashboard Listing A11y (1)'; - it('dashboard', async () => { + it('navitate to dashboard app', async () => { await PageObjects.common.navigateToApp('dashboard'); await a11y.testAppSnapshot(); }); @@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await a11y.testAppSnapshot(); }); - it('Open Edit mode', async () => { + it('Open Edit mode again', async () => { await PageObjects.dashboard.switchToEditMode(); await a11y.testAppSnapshot(); }); @@ -86,7 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await a11y.testAppSnapshot(); }); - it('Open add panel', async () => { + it('Open add panel again', async () => { await dashboardAddPanel.clickOpenAddPanel(); await a11y.testAppSnapshot(); }); diff --git a/test/accessibility/apps/management.ts b/test/accessibility/apps/management.ts index 25db943a8fcf1..e04f576600cbc 100644 --- a/test/accessibility/apps/management.ts +++ b/test/accessibility/apps/management.ts @@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await a11y.testAppSnapshot(); }); - describe('data views', async () => { + describe('data views', () => { before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); diff --git a/test/analytics/services/index.ts b/test/analytics/services/index.ts index 0c75df9bc2050..0d3465986249a 100644 --- a/test/analytics/services/index.ts +++ b/test/analytics/services/index.ts @@ -7,14 +7,17 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services as commonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; + import { services as functionalServices } from '../../functional/services'; import { pageObjects } from '../../functional/page_objects'; import { KibanaEBTServerProvider, KibanaEBTUIProvider } from './kibana_ebt'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, ...functionalServices, kibana_ebt_server: KibanaEBTServerProvider, kibana_ebt_ui: KibanaEBTUIProvider, diff --git a/test/api_integration/apis/console/autocomplete_entities.ts b/test/api_integration/apis/console/autocomplete_entities.ts index a410e50950cd1..1993ef1f7fe19 100644 --- a/test/api_integration/apis/console/autocomplete_entities.ts +++ b/test/api_integration/apis/console/autocomplete_entities.ts @@ -8,25 +8,11 @@ import expect from '@kbn/expect'; import type { FtrProviderContext } from '../../ftr_provider_context'; -import { helpers } from './helpers'; export default ({ getService }: FtrProviderContext) => { - const { - createIndex, - createAlias, - createLegacyTemplate, - createIndexTemplate, - createComponentTemplate, - createDataStream, - deleteIndex, - deleteAlias, - deleteLegacyTemplate, - deleteIndexTemplate, - deleteComponentTemplate, - deleteDataStream, - } = helpers(getService); - + const console = getService('console'); const supertest = getService('supertest'); + const sendRequest = (query: object) => supertest.get('/api/console/autocomplete_entities').query(query); @@ -40,22 +26,26 @@ export default ({ getService }: FtrProviderContext) => { before(async () => { // Setup indices, aliases, templates, and data streams - await createIndex(indexName); - await createAlias(indexName, aliasName); - await createComponentTemplate(componentTemplateName); - await createIndexTemplate(indexTemplateName, [dataStreamName], [componentTemplateName]); - await createDataStream(dataStreamName); - await createLegacyTemplate(legacyTemplateName); + await console.createIndex(indexName); + await console.createAlias(indexName, aliasName); + await console.createComponentTemplate(componentTemplateName); + await console.createIndexTemplate( + indexTemplateName, + [dataStreamName], + [componentTemplateName] + ); + await console.createDataStream(dataStreamName); + await console.createLegacyTemplate(legacyTemplateName); }); after(async () => { // Cleanup indices, aliases, templates, and data streams - await deleteAlias(indexName, aliasName); - await deleteIndex(indexName); - await deleteDataStream(dataStreamName); - await deleteIndexTemplate(indexTemplateName); - await deleteComponentTemplate(componentTemplateName); - await deleteLegacyTemplate(legacyTemplateName); + await console.deleteAlias(indexName, aliasName); + await console.deleteIndex(indexName); + await console.deleteDataStream(dataStreamName); + await console.deleteIndexTemplate(indexTemplateName); + await console.deleteComponentTemplate(componentTemplateName); + await console.deleteLegacyTemplate(legacyTemplateName); }); it('should not succeed if no settings are provided in query params', async () => { diff --git a/test/api_integration/apis/console/helpers.ts b/test/api_integration/apis/console/helpers.ts deleted file mode 100644 index cfd1365f212fa..0000000000000 --- a/test/api_integration/apis/console/helpers.ts +++ /dev/null @@ -1,139 +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 { FtrProviderContext } from '../../ftr_provider_context'; - -export function helpers(getService: FtrProviderContext['getService']) { - const client = getService('es'); - - const createIndex = async (indexName: string) => { - await client.indices.create({ - index: indexName, - body: { - mappings: { - properties: { - foo: { - type: 'text', - }, - }, - }, - }, - }); - }; - - const createAlias = async (indexName: string, aliasName: string) => { - await client.indices.putAlias({ - index: indexName, - name: aliasName, - }); - }; - - const createLegacyTemplate = async (templateName: string) => { - await client.indices.putTemplate({ - name: templateName, - body: { - index_patterns: ['*'], - }, - }); - }; - - const createComponentTemplate = async (templateName: string) => { - await client.cluster.putComponentTemplate({ - name: templateName, - body: { - template: { - mappings: { - properties: { - '@timestamp': { - type: 'date', - format: 'date_optional_time||epoch_millis', - }, - message: { - type: 'wildcard', - }, - }, - }, - }, - }, - }); - }; - - const createIndexTemplate = async ( - templateName: string, - indexPatterns: string[], - composedOf: string[] - ) => { - await client.indices.putIndexTemplate({ - name: templateName, - body: { - index_patterns: indexPatterns, - data_stream: {}, - composed_of: composedOf, - priority: 500, - }, - }); - }; - - const createDataStream = async (dataStream: string) => { - await client.indices.createDataStream({ - name: dataStream, - }); - }; - - const deleteIndex = async (indexName: string) => { - await client.indices.delete({ - index: indexName, - }); - }; - - const deleteAlias = async (indexName: string, aliasName: string) => { - await client.indices.deleteAlias({ - index: indexName, - name: aliasName, - }); - }; - - const deleteIndexTemplate = async (templateName: string) => { - await client.indices.deleteIndexTemplate({ - name: templateName, - }); - }; - - const deleteComponentTemplate = async (templateName: string) => { - await client.cluster.deleteComponentTemplate({ - name: templateName, - }); - }; - - const deleteLegacyTemplate = async (templateName: string) => { - await client.indices.deleteTemplate({ - name: templateName, - }); - }; - - const deleteDataStream = async (dataStream: string) => { - await client.indices.deleteDataStream({ - name: dataStream, - }); - }; - - return { - createIndex, - createAlias, - createLegacyTemplate, - createIndexTemplate, - createComponentTemplate, - createDataStream, - deleteIndex, - deleteAlias, - deleteLegacyTemplate, - deleteIndexTemplate, - deleteComponentTemplate, - deleteDataStream, - }; -} diff --git a/test/api_integration/apis/custom_integration/integrations.ts b/test/api_integration/apis/custom_integration/integrations.ts index fd974a92adb1e..5a5284dd0a63d 100644 --- a/test/api_integration/apis/custom_integration/integrations.ts +++ b/test/api_integration/apis/custom_integration/integrations.ts @@ -40,7 +40,7 @@ export default function ({ getService }: FtrProviderContext) { expect(resp.body).to.be.an('array'); - expect(resp.body.length).to.be(109); // the beats + expect(resp.body.length).to.be(108); // the beats }); }); }); diff --git a/test/api_integration/apis/data_views/fields_route/cache.ts b/test/api_integration/apis/data_views/fields_route/cache.ts index dea14dec6bdcd..4a5505a772979 100644 --- a/test/api_integration/apis/data_views/fields_route/cache.ts +++ b/test/api_integration/apis/data_views/fields_route/cache.ts @@ -58,7 +58,7 @@ export default function ({ getService }: FtrProviderContext) { expect(response.get('vary')).to.equal('accept-encoding, user-hash'); expect(response.get('etag')).to.not.be.empty(); - kibanaServer.uiSettings.replace({ 'data_views:cache_max_age': 5 }); + await kibanaServer.uiSettings.replace({ 'data_views:cache_max_age': 5 }); }); it('returns 304 on matching etag', async () => { diff --git a/test/api_integration/services/index.ts b/test/api_integration/services/index.ts index 42a2616b781ac..f72460b7ffc5f 100644 --- a/test/api_integration/services/index.ts +++ b/test/api_integration/services/index.ts @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -import { services as commonServices } from '../../common/services'; - +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { KibanaSupertestProvider, ElasticsearchSupertestProvider } from './supertest'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, supertest: KibanaSupertestProvider, esSupertest: ElasticsearchSupertestProvider, }; diff --git a/test/common/config.js b/test/common/config.js index 2c707d3b6856a..8f2d6b7e14018 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -9,7 +9,6 @@ import path from 'path'; import { format as formatUrl } from 'url'; import { esTestConfig, kbnTestConfig, kibanaServerTestUser } from '@kbn/test'; -import { services } from './services'; export default function () { const servers = { @@ -42,6 +41,7 @@ export default function () { `--elasticsearch.password=${kibanaServerTestUser.password}`, // Needed for async search functional tests to introduce a delay `--data.search.aggs.shardDelay.enabled=true`, + `--data.query.timefilter.minRefreshInterval=1000`, `--security.showInsecureClusterWarning=false`, '--telemetry.banner=false', '--telemetry.optIn=false', @@ -84,6 +84,5 @@ export default function () { })}`, ], }, - services, }; } diff --git a/test/common/ftr_provider_context.ts b/test/common/ftr_provider_context.ts deleted file mode 100644 index 6d21aedfe1d5e..0000000000000 --- a/test/common/ftr_provider_context.ts +++ /dev/null @@ -1,14 +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 { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; - -import { services } from './services'; - -export type FtrProviderContext = GenericFtrProviderContext; -export class FtrService extends GenericFtrService {} diff --git a/test/common/services/console.ts b/test/common/services/console.ts deleted file mode 100644 index a864952fa081b..0000000000000 --- a/test/common/services/console.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 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 { FtrProviderContext } from '../ftr_provider_context'; -import { helpers } from '../../api_integration/apis/console/helpers'; -export function ConsoleProvider({ getService }: FtrProviderContext) { - return { - helpers: helpers(getService), - }; -} diff --git a/test/common/services/index.ts b/test/common/services/index.ts index ccc786d4ccc6e..18855d9dee114 100644 --- a/test/common/services/index.ts +++ b/test/common/services/index.ts @@ -7,17 +7,26 @@ */ import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; -import { DeploymentService } from './deployment'; -import { RandomnessService } from './randomness'; -import { SecurityServiceProvider } from './security'; -import { EsDeleteAllIndicesProvider } from './es_delete_all_indices'; -import { SavedObjectInfoService } from './saved_object_info'; -import { IndexPatternsService } from './index_patterns'; -import { BsearchService } from './bsearch'; -import { ConsoleProvider } from './console'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; // pick only services that work for any FTR config, e.g. 'samlAuth' requires SAML setup in config file -const { es, esArchiver, kibanaServer, retry, supertestWithoutAuth } = commonFunctionalServices; +const { + es, + esArchiver, + kibanaServer, + retry, + supertestWithoutAuth, + deployment, + randomness, + esDeleteAllIndices, + savedObjectInfo, + indexPatterns, + bsearch, + console, +} = commonFunctionalServices; + +// pick what was there previously +const { security } = commonFunctionalUIServices; export const services = { es, @@ -25,12 +34,12 @@ export const services = { kibanaServer, retry, supertestWithoutAuth, - deployment: DeploymentService, - randomness: RandomnessService, - security: SecurityServiceProvider, - esDeleteAllIndices: EsDeleteAllIndicesProvider, - savedObjectInfo: SavedObjectInfoService, - indexPatterns: IndexPatternsService, - bsearch: BsearchService, - console: ConsoleProvider, + deployment, + randomness, + security, + esDeleteAllIndices, + savedObjectInfo, + indexPatterns, + bsearch, + console, }; diff --git a/test/common/services/security/index.ts b/test/common/services/security/index.ts deleted file mode 100644 index d34246c0c4411..0000000000000 --- a/test/common/services/security/index.ts +++ /dev/null @@ -1,9 +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. - */ - -export { SecurityServiceProvider } from './security'; diff --git a/test/functional/apps/console/ace/_autocomplete.ts b/test/functional/apps/console/ace/_autocomplete.ts index fe329e8d2c320..afab6361152c6 100644 --- a/test/functional/apps/console/ace/_autocomplete.ts +++ b/test/functional/apps/console/ace/_autocomplete.ts @@ -8,7 +8,6 @@ import _ from 'lodash'; import expect from '@kbn/expect'; -import { asyncForEach } from '@kbn/std'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -17,6 +16,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'console', 'header']); const find = getService('find'); + async function runTemplateTest(type: string, template: string) { + await PageObjects.console.enterText(`{\n\t"type": "${type}"`); + await PageObjects.console.pressEnter(); + await PageObjects.console.sleepForDebouncePeriod(); + // Prompt autocomplete for 'settings' + await PageObjects.console.promptAutocomplete('s'); + + await retry.waitFor('autocomplete to be visible', () => + PageObjects.console.isAutocompleteVisible() + ); + await PageObjects.console.pressEnter(); + await retry.try(async () => { + const request = await PageObjects.console.getRequest(); + log.debug(request); + expect(request).to.contain(`${template}`); + }); + } + describe('console autocomplete feature', function describeIndexTests() { this.tags('includeFirefox'); before(async () => { @@ -365,47 +382,27 @@ GET _search }); }); - describe('with conditional templates', async () => { - const CONDITIONAL_TEMPLATES = [ - { - type: 'fs', - template: `"location": "path"`, - }, - { - type: 'url', - template: `"url": ""`, - }, - { type: 's3', template: `"bucket": ""` }, - { - type: 'azure', - template: `"path": ""`, - }, - ]; - + describe('with conditional templates', () => { beforeEach(async () => { await PageObjects.console.clearTextArea(); await PageObjects.console.enterRequest('\n POST _snapshot/test_repo'); await PageObjects.console.pressEnter(); }); - await asyncForEach(CONDITIONAL_TEMPLATES, async ({ type, template }) => { - it('should insert different templates depending on the value of type', async () => { - await PageObjects.console.enterText(`{\n\t"type": "${type}"`); - await PageObjects.console.pressEnter(); - await PageObjects.console.sleepForDebouncePeriod(); - // Prompt autocomplete for 'settings' - await PageObjects.console.promptAutocomplete('s'); + it('should insert fs template', async () => { + await runTemplateTest('fs', `"location": "path"`); + }); - await retry.waitFor('autocomplete to be visible', () => - PageObjects.console.isAutocompleteVisible() - ); - await PageObjects.console.pressEnter(); - await retry.try(async () => { - const request = await PageObjects.console.getRequest(); - log.debug(request); - expect(request).to.contain(`${template}`); - }); - }); + it('should insert url template', async () => { + await runTemplateTest('url', `"url": ""`); + }); + + it('should insert s3 template', async () => { + await runTemplateTest('s3', `"bucket": ""`); + }); + + it('should insert azure template', async () => { + await runTemplateTest('azure', `"path": ""`); }); }); }); diff --git a/test/functional/apps/console/ace/_comments.ts b/test/functional/apps/console/ace/_comments.ts index 8ef708d68b44f..b81fb3c2e4e2d 100644 --- a/test/functional/apps/console/ace/_comments.ts +++ b/test/functional/apps/console/ace/_comments.ts @@ -7,7 +7,6 @@ */ import expect from '@kbn/expect'; -import { asyncForEach } from '@kbn/std'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -15,6 +14,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const PageObjects = getPageObjects(['common', 'console', 'header']); + const enterRequest = async (url: string, body: string) => { + await PageObjects.console.clearTextArea(); + await PageObjects.console.enterRequest(url); + await PageObjects.console.pressEnter(); + await PageObjects.console.enterText(body); + }; + + async function runTest(input: { url?: string; body: string }, fn: () => Promise) { + await enterRequest(input.url ?? '\nGET search', input.body); + await fn(); + } + // Failing: See https://github.com/elastic/kibana/issues/138160 describe.skip('console app', function testComments() { this.tags('includeFirefox'); @@ -27,130 +38,193 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('with comments', async () => { - const enterRequest = async (url: string, body: string) => { - await PageObjects.console.clearTextArea(); - await PageObjects.console.enterRequest(url); - await PageObjects.console.pressEnter(); - await PageObjects.console.enterText(body); - }; - - async function runTests( - tests: Array<{ description: string; url?: string; body: string }>, - fn: () => Promise - ) { - await asyncForEach(tests, async ({ description, url, body }) => { - it(description, async () => { - await enterRequest(url ?? '\nGET search', body); - await fn(); - }); - }); - } - - describe('with single line comments', async () => { - await runTests( - [ + describe('with comments', () => { + describe('with single line comments', () => { + it('should allow in request url, using //', async () => { + await runTest( { url: '\n// GET _search', body: '', - description: 'should allow in request url, using //', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should allow in request body, using //', async () => { + await runTest( { body: '{\n\t\t"query": {\n\t\t\t// "match_all": {}', - description: 'should allow in request body, using //', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should allow in request url, using #', async () => { + await runTest( { url: '\n # GET _search', body: '', - description: 'should allow in request url, using #', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should allow in request body, using #', async () => { + await runTest( { body: '{\n\t\t"query": {\n\t\t\t# "match_all": {}', - description: 'should allow in request body, using #', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field names, using //', async () => { + await runTest( { - description: 'should accept as field names, using //', body: '{\n "//": {}', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field values, using //', async () => { + await runTest( { - description: 'should accept as field values, using //', body: '{\n "f": "//"', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field names, using #', async () => { + await runTest( { - description: 'should accept as field names, using #', body: '{\n "#": {}', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field values, using #', async () => { + await runTest( { - description: 'should accept as field values, using #', body: '{\n "f": "#"', }, - ], - async () => { - expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); - expect(await PageObjects.console.hasErrorMarker()).to.be(false); - } - ); + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); }); - describe('with multiline comments', async () => { - await runTests( - [ + describe('with multiline comments', () => { + it('should allow in request url, using /* */', async () => { + await runTest( { url: '\n /* \nGET _search \n*/', body: '', - description: 'should allow in request url, using /* */', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should allow in request body, using /* */', async () => { + await runTest( { body: '{\n\t\t"query": {\n\t\t\t/* "match_all": {} */', - description: 'should allow in request body, using /* */', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field names, using /*', async () => { + await runTest( { - description: 'should accept as field names, using /*', body: '{\n "/*": {} \n\t\t /* "f": 1 */', }, + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); + + it('should accept as field values, using */', async () => { + await runTest( { - description: 'should accept as field values, using */', body: '{\n /* "f": 1 */ \n"f": "*/"', }, - ], - async () => { - expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); - expect(await PageObjects.console.hasErrorMarker()).to.be(false); - } - ); + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(false); + expect(await PageObjects.console.hasErrorMarker()).to.be(false); + } + ); + }); }); - describe('with invalid syntax in request body', async () => { - await runTests( - [ + describe('with invalid syntax in request body', () => { + it('should highlight invalid syntax', async () => { + await runTest( { - description: 'should highlight invalid syntax', body: '{\n "query": \'\'', // E.g. using single quotes }, - ], - - async () => { - expect(await PageObjects.console.hasInvalidSyntax()).to.be(true); - } - ); + async () => { + expect(await PageObjects.console.hasInvalidSyntax()).to.be(true); + } + ); + }); }); - describe('with invalid request', async () => { - await runTests( - [ + describe('with invalid request', () => { + it('with invalid character should display error marker', async () => { + await runTest( { - description: 'with invalid character should display error marker', body: '{\n $ "query": {}', }, + async () => { + expect(await PageObjects.console.hasErrorMarker()).to.be(true); + } + ); + }); + + it('with missing field name', async () => { + await runTest( { - description: 'with missing field name', body: '{\n "query": {},\n {}', }, - ], - async () => { - expect(await PageObjects.console.hasErrorMarker()).to.be(true); - } - ); + async () => { + expect(await PageObjects.console.hasErrorMarker()).to.be(true); + } + ); + }); }); }); }); diff --git a/test/functional/apps/console/monaco/_autocomplete.ts b/test/functional/apps/console/monaco/_autocomplete.ts index b949a979a49db..9f7b3328d42a8 100644 --- a/test/functional/apps/console/monaco/_autocomplete.ts +++ b/test/functional/apps/console/monaco/_autocomplete.ts @@ -8,7 +8,6 @@ import _ from 'lodash'; import expect from '@kbn/expect'; -import { asyncForEach } from '@kbn/std'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -17,6 +16,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'console', 'header']); const find = getService('find'); + async function runTemplateTest(type: string, template: string) { + await PageObjects.console.monaco.enterText(`{\n\t"type": "${type}",\n`); + await PageObjects.console.sleepForDebouncePeriod(); + // Prompt autocomplete for 'settings' + await PageObjects.console.monaco.promptAutocomplete('s'); + + await retry.waitFor('autocomplete to be visible', () => + PageObjects.console.monaco.isAutocompleteVisible() + ); + await PageObjects.console.monaco.pressEnter(); + await retry.try(async () => { + const request = await PageObjects.console.monaco.getEditorText(); + log.debug(request); + expect(request).to.contain(`${template}`); + }); + } + describe('console autocomplete feature', function describeIndexTests() { this.tags('includeFirefox'); before(async () => { @@ -315,45 +331,26 @@ GET _search }); }); - describe('with conditional templates', async () => { - const CONDITIONAL_TEMPLATES = [ - { - type: 'fs', - template: `"location": "path"`, - }, - { - type: 'url', - template: `"url": ""`, - }, - { type: 's3', template: `"bucket": ""` }, - { - type: 'azure', - template: `"path": ""`, - }, - ]; - + describe('with conditional templates', () => { beforeEach(async () => { await PageObjects.console.monaco.clearEditorText(); await PageObjects.console.monaco.enterText('POST _snapshot/test_repo\n'); }); - await asyncForEach(CONDITIONAL_TEMPLATES, async ({ type, template }) => { - it('should insert different templates depending on the value of type', async () => { - await PageObjects.console.monaco.enterText(`{\n\t"type": "${type}",\n`); - await PageObjects.console.sleepForDebouncePeriod(); - // Prompt autocomplete for 'settings' - await PageObjects.console.monaco.promptAutocomplete('s'); + it('should insert fs template', async () => { + await runTemplateTest('fs', `"location": "path"`); + }); - await retry.waitFor('autocomplete to be visible', () => - PageObjects.console.monaco.isAutocompleteVisible() - ); - await PageObjects.console.monaco.pressEnter(); - await retry.try(async () => { - const request = await PageObjects.console.monaco.getEditorText(); - log.debug(request); - expect(request).to.contain(`${template}`); - }); - }); + it('should insert url template', async () => { + await runTemplateTest('url', `"url": ""`); + }); + + it('should insert s3 template', async () => { + await runTemplateTest('s3', `"bucket": ""`); + }); + + it('should insert azure template', async () => { + await runTemplateTest('azure', `"path": ""`); }); }); diff --git a/test/functional/apps/console/monaco/_comments.ts b/test/functional/apps/console/monaco/_comments.ts index ba8d8b6f04f07..37fcfc3e2db8f 100644 --- a/test/functional/apps/console/monaco/_comments.ts +++ b/test/functional/apps/console/monaco/_comments.ts @@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.console.closeHelpIfExists(); }); - describe('with comments', async () => { + describe('with comments', () => { const enterRequest = async (url: string, body: string) => { await PageObjects.console.monaco.clearEditorText(); await PageObjects.console.monaco.enterText(`${url}\n${body}`); @@ -41,6 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); } + // eslint-disable-next-line mocha/no-async-describe describe('with single line comments', async () => { await runTests( [ @@ -85,6 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); }); + // eslint-disable-next-line mocha/no-async-describe describe('with multiline comments', async () => { await runTests( [ @@ -112,6 +114,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); }); + // eslint-disable-next-line mocha/no-async-describe describe('with invalid syntax in request body', async () => { await runTests( [ @@ -127,6 +130,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); }); + // eslint-disable-next-line mocha/no-async-describe describe('with invalid request', async () => { await runTests( [ diff --git a/test/functional/apps/console/monaco/_console.ts b/test/functional/apps/console/monaco/_console.ts index 1c6afc39c5046..b48ba75529579 100644 --- a/test/functional/apps/console/monaco/_console.ts +++ b/test/functional/apps/console/monaco/_console.ts @@ -14,7 +14,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const log = getService('log'); - const toasts = getService('toasts'); const browser = getService('browser'); const PageObjects = getPageObjects(['common', 'console', 'header']); const security = getService('security'); @@ -58,12 +57,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(initialSize.width).to.be.greaterThan(afterSize.width); }); - it('should not send request with unsupported HTTP verbs', async () => { + it('should return statusCode 400 to unsupported HTTP verbs', async () => { + const expectedResponseContains = '"statusCode": 400'; await PageObjects.console.monaco.clearEditorText(); await PageObjects.console.monaco.enterText('OPTIONS /'); await PageObjects.console.clickPlay(); await retry.try(async () => { - expect(await toasts.getCount()).to.equal(1); + const actualResponse = await PageObjects.console.monaco.getOutputText(); + log.debug(actualResponse); + expect(actualResponse).to.contain(expectedResponseContains); + + expect(await PageObjects.console.hasSuccessBadge()).to.be(false); }); }); diff --git a/test/functional/apps/console/monaco/_context_menu.ts b/test/functional/apps/console/monaco/_context_menu.ts index f74e9d2814242..1e95e74a851b1 100644 --- a/test/functional/apps/console/monaco/_context_menu.ts +++ b/test/functional/apps/console/monaco/_context_menu.ts @@ -13,6 +13,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const log = getService('log'); const retry = getService('retry'); const PageObjects = getPageObjects(['common', 'console']); + const testSubjects = getService('testSubjects'); const browser = getService('browser'); const toasts = getService('toasts'); @@ -31,36 +32,89 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(PageObjects.console.isContextMenuOpen()).to.be.eql(true); }); - it('should have options to copy as curl, open documentation, and auto indent', async () => { + it('should have options to copy as, open documentation, and auto indent', async () => { await PageObjects.console.clickContextMenu(); expect(PageObjects.console.isContextMenuOpen()).to.be.eql(true); - expect(PageObjects.console.isCopyAsCurlButtonVisible()).to.be.eql(true); + expect(PageObjects.console.isCopyAsButtonVisible()).to.be.eql(true); expect(PageObjects.console.isOpenDocumentationButtonVisible()).to.be.eql(true); expect(PageObjects.console.isAutoIndentButtonVisible()).to.be.eql(true); }); - it('should copy as curl and show toast when copy as curl button is clicked', async () => { - await PageObjects.console.clickContextMenu(); - await PageObjects.console.clickCopyAsCurlButton(); + describe('Copy as', () => { + beforeEach(async () => { + await PageObjects.common.navigateToApp('console'); + await PageObjects.console.closeHelpIfExists(); + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText('GET _search'); + }); + + it('by default it should copy as curl and show toast when copy as button is clicked', async () => { + await PageObjects.console.clickContextMenu(); + await PageObjects.console.clickCopyAsButton(); + + const resultToast = await toasts.getElementByIndex(1); + const toastText = await resultToast.getVisibleText(); + + if (toastText.includes('Write permission denied')) { + log.debug('Write permission denied, skipping test'); + return; + } + + expect(toastText).to.be('Request copied to clipboard as curl'); - const resultToast = await toasts.getElementByIndex(1); - const toastText = await resultToast.getVisibleText(); + const canReadClipboard = await browser.checkBrowserPermission('clipboard-read'); + if (canReadClipboard) { + const clipboardText = await browser.getClipboardValue(); + expect(clipboardText).to.contain('curl -X GET'); + } + }); + + it.skip('allows to change default language', async () => { + await PageObjects.console.clickContextMenu(); + + // By default should be copy as cURL + let copyAsButton = await testSubjects.find('consoleMenuCopyAsButton'); + let buttonLabel = await copyAsButton.getVisibleText(); + expect(buttonLabel).to.contain('curl'); + + // Select python as default language + await PageObjects.console.changeDefaultLanguage('python'); + // Wait until async operation is done + await PageObjects.common.sleep(2000); + // Open the context menu once again + await PageObjects.console.clickContextMenu(); + + // By default should be copy as cURL + copyAsButton = await testSubjects.find('consoleMenuCopyAsButton'); + buttonLabel = await copyAsButton.getVisibleText(); + expect(buttonLabel).to.contain('Python'); + }); - if (toastText.includes('Write permission denied')) { - log.debug('Write permission denied, skipping test'); - return; - } + it('allows to select a different language to copy as and should copy it right away to clipboard', async () => { + await PageObjects.console.clickContextMenu(); + await PageObjects.console.changeLanguageAndCopy('javascript'); - expect(toastText).to.be('Request copied as cURL'); + const resultToast = await toasts.getElementByIndex(1); + const toastText = await resultToast.getVisibleText(); - const canReadClipboard = await browser.checkBrowserPermission('clipboard-read'); - if (canReadClipboard) { - const clipboardText = await browser.getClipboardValue(); - expect(clipboardText).to.contain('curl -XGET'); - } + if (toastText.includes('Write permission denied')) { + log.debug('Write permission denied, skipping test'); + return; + } + + expect(toastText).to.be('Request copied to clipboard as JavaScript'); + + const canReadClipboard = await browser.checkBrowserPermission('clipboard-read'); + if (canReadClipboard) { + const clipboardText = await browser.getClipboardValue(); + expect(clipboardText).to.contain('require("@elastic/elasticsearch")'); + } + }); }); it('should open documentation when open documentation button is clicked', async () => { + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText('GET _search'); await PageObjects.console.clickContextMenu(); await PageObjects.console.clickOpenDocumentationButton(); @@ -79,15 +133,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await browser.switchTab(0); }); - // not implemented yet for monaco https://github.com/elastic/kibana/issues/185891 - it.skip('should toggle auto indent when auto indent button is clicked', async () => { - await PageObjects.console.clearTextArea(); - await PageObjects.console.enterRequest('GET _search\n{"query": {"match_all": {}}}'); + it('should auto indent when auto indent button is clicked', async () => { + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText('GET _search\n{"query": {"match_all": {}}}'); + await PageObjects.console.clickContextMenu(); + await PageObjects.console.clickAutoIndentButton(); + // Retry until the request is auto indented + await retry.try(async () => { + const request = await PageObjects.console.monaco.getEditorText(); + expect(request).to.be.eql('GET _search\n{\n "query": {\n "match_all": {}\n }\n}'); + }); + }); + + // not implemented for monaco yet https://github.com/elastic/kibana/issues/185891 + it.skip('should collapse the request when auto indent button is clicked again', async () => { + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText('GET _search\n{"query": {"match_all": {}}}'); await PageObjects.console.clickContextMenu(); await PageObjects.console.clickAutoIndentButton(); // Retry until the request is auto indented await retry.try(async () => { - const request = await PageObjects.console.getRequest(); + const request = await PageObjects.console.monaco.getEditorText(); expect(request).to.be.eql('GET _search\n{\n "query": {\n "match_all": {}\n }\n}'); }); @@ -96,7 +162,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.console.clickAutoIndentButton(); // Retry until the request is condensed await retry.try(async () => { - const request = await PageObjects.console.getRequest(); + const request = await PageObjects.console.monaco.getEditorText(); expect(request).to.be.eql('GET _search\n{"query":{"match_all":{}}}'); }); }); diff --git a/test/functional/apps/console/monaco/_misc_console_behavior.ts b/test/functional/apps/console/monaco/_misc_console_behavior.ts index f7ad2957c8411..b952533c71a07 100644 --- a/test/functional/apps/console/monaco/_misc_console_behavior.ts +++ b/test/functional/apps/console/monaco/_misc_console_behavior.ts @@ -91,7 +91,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.monaco.getCurrentLineNumber()).to.be(4); }); - describe('open documentation', () => { + // FLAKY: https://github.com/elastic/kibana/issues/190321 + describe.skip('open documentation', () => { const requests = ['GET _search', 'GET test_index/_search', 'GET /_search']; requests.forEach((request) => { it('should open documentation when Ctrl+/ is pressed', async () => { @@ -147,5 +148,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); + + describe('invalid requests', () => { + const invalidRequestText = 'GET _search\n{"query": {"match_all": {'; + it(`should not delete any text if indentations applied to an invalid request`, async () => { + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText(invalidRequestText); + await PageObjects.console.monaco.selectCurrentRequest(); + await PageObjects.console.monaco.pressCtrlI(); + // Sleep for a bit and then check that the text has not changed + await PageObjects.common.sleep(1000); + await retry.try(async () => { + const request = await PageObjects.console.monaco.getEditorText(); + expect(request).to.be.eql(invalidRequestText); + }); + }); + + it(`should include an invalid json when sending a request`, async () => { + await PageObjects.console.monaco.clearEditorText(); + await PageObjects.console.monaco.enterText(invalidRequestText); + await PageObjects.console.monaco.selectCurrentRequest(); + await PageObjects.console.monaco.pressCtrlEnter(); + + await retry.try(async () => { + const actualResponse = await PageObjects.console.monaco.getOutputText(); + expect(actualResponse).to.contain('parsing_exception'); + expect(await PageObjects.console.hasSuccessBadge()).to.be(false); + }); + }); + }); }); } diff --git a/test/functional/apps/dashboard/group1/edit_embeddable_redirects.ts b/test/functional/apps/dashboard/group1/edit_embeddable_redirects.ts index f11ca330bf178..e81c38a94736c 100644 --- a/test/functional/apps/dashboard/group1/edit_embeddable_redirects.ts +++ b/test/functional/apps/dashboard/group1/edit_embeddable_redirects.ts @@ -36,7 +36,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('redirects via save and return button after edit', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.visualize.saveVisualizationAndReturn(); }); @@ -45,7 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const newTitle = 'wowee, looks like I have a new title'; await PageObjects.header.waitUntilLoadingHasFinished(); const originalPanelCount = await PageObjects.dashboard.getPanelCount(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, { saveAsNew: false, @@ -62,7 +60,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const newTitle = 'wowee, my title just got cooler'; await PageObjects.header.waitUntilLoadingHasFinished(); const originalPanelCount = await PageObjects.dashboard.getPanelCount(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, { saveAsNew: true, @@ -78,8 +75,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('loses originatingApp connection after save as when redirectToOrigin is false', async () => { const newTitle = 'wowee, my title just got cooler again'; await PageObjects.header.waitUntilLoadingHasFinished(); - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickEdit(); + await dashboardPanelActions.editPanelByTitle('wowee, my title just got cooler'); await PageObjects.visualize.linkedToOriginatingApp(); await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, { saveAsNew: true, diff --git a/test/functional/apps/dashboard/group1/edit_visualizations.js b/test/functional/apps/dashboard/group1/edit_visualizations.js index 20234ca1f8055..51492733ce06b 100644 --- a/test/functional/apps/dashboard/group1/edit_visualizations.js +++ b/test/functional/apps/dashboard/group1/edit_visualizations.js @@ -34,7 +34,6 @@ export default function ({ getService, getPageObjects }) { }; const editMarkdownVis = async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.visEditor.setMarkdownTxt(modifiedMarkdownText); @@ -86,7 +85,6 @@ export default function ({ getService, getPageObjects }) { }); it('cancel button returns to dashboard with no modal if there are no changes to apply', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); diff --git a/test/functional/apps/dashboard/group2/dashboard_filtering.ts b/test/functional/apps/dashboard/group2/dashboard_filtering.ts index 92f89280e7f90..5b51e6c7e4f55 100644 --- a/test/functional/apps/dashboard/group2/dashboard_filtering.ts +++ b/test/functional/apps/dashboard/group2/dashboard_filtering.ts @@ -268,7 +268,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.waitForRenderComplete(); await pieChart.expectPieSliceCount(5); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await queryBar.setQuery('weightLbs:>50'); await queryBar.submitQuery(); @@ -290,7 +289,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Nested visualization filter pills filters data as expected', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); @@ -305,7 +303,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Removing filter pills and query unfiters data as expected', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); diff --git a/test/functional/apps/dashboard/group2/full_screen_mode.ts b/test/functional/apps/dashboard/group2/full_screen_mode.ts index 23be5e4b7afe6..24ead0ce27fad 100644 --- a/test/functional/apps/dashboard/group2/full_screen_mode.ts +++ b/test/functional/apps/dashboard/group2/full_screen_mode.ts @@ -69,7 +69,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('displays exit full screen logo button when panel is expanded', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); const exists = await PageObjects.dashboard.exitFullScreenTextButtonExists(); diff --git a/test/functional/apps/dashboard/group2/panel_expand_toggle.ts b/test/functional/apps/dashboard/group2/panel_expand_toggle.ts index 99d09a5f42e7e..3a18389824758 100644 --- a/test/functional/apps/dashboard/group2/panel_expand_toggle.ts +++ b/test/functional/apps/dashboard/group2/panel_expand_toggle.ts @@ -35,7 +35,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('hides other panels', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); await retry.try(async () => { const panelCount = await PageObjects.dashboard.getPanelCount(); @@ -46,9 +45,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('shows other panels after being minimized', async () => { const panelCount = await PageObjects.dashboard.getPanelCount(); // Panels are all minimized on a fresh open of a dashboard, so we need to re-expand in order to then minimize. - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); // Add a retry to fix https://github.com/elastic/kibana/issues/14574. Perhaps the recent changes to this diff --git a/test/functional/apps/dashboard/group3/copy_panel_to.ts b/test/functional/apps/dashboard/group3/copy_panel_to.ts index 3c6fa6d790eaf..bcf7ddc12551f 100644 --- a/test/functional/apps/dashboard/group3/copy_panel_to.ts +++ b/test/functional/apps/dashboard/group3/copy_panel_to.ts @@ -100,9 +100,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('saveDashboardSuccess'); await PageObjects.dashboard.clickCancelOutOfEditMode(); - const panelOptions = await dashboardPanelActions.getPanelHeading(markdownTitle); - await dashboardPanelActions.openContextMenu(panelOptions); - await dashboardPanelActions.expectMissingEditPanelAction(); + await dashboardPanelActions.expectMissingEditPanelAction(markdownTitle); }); it('does not show the current dashboard in the dashboard picker', async () => { diff --git a/test/functional/apps/dashboard/group3/panel_context_menu.ts b/test/functional/apps/dashboard/group3/panel_context_menu.ts index d2807bc006d4c..a09871f7825b9 100644 --- a/test/functional/apps/dashboard/group3/panel_context_menu.ts +++ b/test/functional/apps/dashboard/group3/panel_context_menu.ts @@ -76,7 +76,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('visualization object edit menu', () => { it('opens a visualization when edit link is clicked', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); const currentUrl = await browser.getCurrentUrl(); @@ -118,7 +117,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('opens a saved search when edit link is clicked', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await PageObjects.header.waitUntilLoadingHasFinished(); const queryName = await PageObjects.discover.getCurrentQueryName(); @@ -139,15 +137,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before('reset dashboard', async () => { const currentUrl = await browser.getCurrentUrl(); await browser.get(currentUrl.toString(), false); - }); - - before('and add one panel and save to put dashboard in "view" mode', async () => { await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME); await PageObjects.dashboard.saveDashboard(dashboardName + '2'); - }); - - before('expand panel to "full screen"', async () => { - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); }); diff --git a/test/functional/apps/dashboard/group4/dashboard_listing.ts b/test/functional/apps/dashboard/group4/dashboard_listing.ts index 36e99d0e5c8c1..8a5e121f659cf 100644 --- a/test/functional/apps/dashboard/group4/dashboard_listing.ts +++ b/test/functional/apps/dashboard/group4/dashboard_listing.ts @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const listingTable = getService('listingTable'); const dashboardAddPanel = getService('dashboardAddPanel'); + const testSubjects = getService('testSubjects'); describe('dashboard listing page', function describeIndexTests() { const dashboardName = 'Dashboard Listing Test'; @@ -234,5 +235,43 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(newPanelCount).to.equal(originalPanelCount); }); }); + + describe('insights', () => { + const DASHBOARD_NAME = 'Insights Dashboard'; + + before(async () => { + await PageObjects.dashboard.navigateToApp(); + await PageObjects.dashboard.clickNewDashboard(); + await PageObjects.dashboard.saveDashboard(DASHBOARD_NAME, { + saveAsNew: true, + waitDialogIsClosed: false, + exitFromEditMode: false, + }); + await PageObjects.dashboard.gotoDashboardLandingPage(); + }); + + it('shows the insights panel and counts the views', async () => { + await listingTable.searchForItemWithName(DASHBOARD_NAME); + + async function getViewsCount() { + await listingTable.inspectVisualization(); + const totalViewsStats = await testSubjects.find('views-stats-total-views'); + const viewsStr = await ( + await totalViewsStats.findByCssSelector('.euiStat__title') + ).getVisibleText(); + await listingTable.closeInspector(); + return Number(viewsStr); + } + + const views1 = await getViewsCount(); + expect(views1).to.be(1); + + await listingTable.clickItemLink('dashboard', DASHBOARD_NAME); + await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.dashboard.gotoDashboardLandingPage(); + const views2 = await getViewsCount(); + expect(views2).to.be(2); + }); + }); }); } diff --git a/test/functional/apps/dashboard/group5/data_shared_attributes.ts b/test/functional/apps/dashboard/group5/data_shared_attributes.ts index 3202d418bd512..825e5bfc32d0a 100644 --- a/test/functional/apps/dashboard/group5/data_shared_attributes.ts +++ b/test/functional/apps/dashboard/group5/data_shared_attributes.ts @@ -129,8 +129,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('data-shared-item title should update a saved search when using a custom panel title', async () => { await PageObjects.dashboard.switchToEditMode(); const CUSTOM_SEARCH_TITLE = 'ima custom title for a search!'; - const el = await dashboardPanelActions.getPanelHeading('Rendering Test: saved search'); - await dashboardPanelActions.customizePanel(el); + await dashboardPanelActions.customizePanelByTitle('Rendering Test: saved search'); await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen(); await dashboardCustomizePanel.setCustomPanelTitle(CUSTOM_SEARCH_TITLE); await dashboardCustomizePanel.clickSaveButton(); diff --git a/test/functional/apps/dashboard/group5/legacy_urls.ts b/test/functional/apps/dashboard/group5/legacy_urls.ts index 0d09ba7a7ca79..566bc861c1ee8 100644 --- a/test/functional/apps/dashboard/group5/legacy_urls.ts +++ b/test/functional/apps/dashboard/group5/legacy_urls.ts @@ -93,7 +93,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.saveVisualizationExpectSuccess('legacy url markdown'); - (await find.byLinkText('abc')).click(); + await (await find.byLinkText('abc')).click(); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.timePicker.setDefaultDataRange(); @@ -115,7 +115,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.navigateToApp(); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.addVisualization('legacy url markdown'); - (await find.byLinkText('abc')).click(); + await (await find.byLinkText('abc')).click(); await PageObjects.header.waitUntilLoadingHasFinished(); await elasticChart.setNewChartUiDebugFlag(true); await PageObjects.timePicker.setDefaultDataRange(); diff --git a/test/functional/apps/dashboard/group5/saved_search_embeddable.ts b/test/functional/apps/dashboard/group5/saved_search_embeddable.ts index f20172d10ed5c..ee008a2c7d591 100644 --- a/test/functional/apps/dashboard/group5/saved_search_embeddable.ts +++ b/test/functional/apps/dashboard/group5/saved_search_embeddable.ts @@ -11,7 +11,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardPanelActions = getService('dashboardPanelActions'); - const testSubjects = getService('testSubjects'); const filterBar = getService('filterBar'); const find = getService('find'); const esArchiver = getService('esArchiver'); @@ -40,6 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await kibanaServer.savedObjects.cleanStandardList(); + await PageObjects.common.unsetTime(); }); it('highlighting on filtering works', async function () { @@ -77,26 +77,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.dashboard.waitForRenderComplete(); - await dashboardPanelActions.openContextMenu(); - const actionExists = await testSubjects.exists( - 'embeddablePanelAction-ACTION_VIEW_SAVED_SEARCH' - ); - if (!actionExists) { - await dashboardPanelActions.clickContextMenuMoreItem(); - } - const actionElement = await testSubjects.find( + await dashboardPanelActions.clickContextMenuItem( 'embeddablePanelAction-ACTION_VIEW_SAVED_SEARCH' ); - await actionElement.click(); await PageObjects.discover.waitForDiscoverAppOnScreen(); expect(await PageObjects.discover.getSavedSearchTitle()).to.equal( 'Rendering Test: saved search' ); }); - - after(async () => { - await PageObjects.common.unsetTime(); - }); }); } diff --git a/test/functional/apps/dashboard/group5/share.ts b/test/functional/apps/dashboard/group5/share.ts index 43af46a238589..7302f49ffb753 100644 --- a/test/functional/apps/dashboard/group5/share.ts +++ b/test/functional/apps/dashboard/group5/share.ts @@ -52,48 +52,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return await PageObjects.share.getSharedUrl(); }; - describe('share dashboard', () => { - const testFilterState = async (mode: TestingModes) => { - it('should not have "filters" state in either app or global state when no filters', async () => { - expect(await getSharedUrl(mode)).to.not.contain('filters'); - }); - - it('unpinned filter should show up only in app state when dashboard is unsaved', async () => { - await filterBar.addFilter({ field: 'geo.src', operation: 'is', value: 'AE' }); - await PageObjects.dashboard.waitForRenderComplete(); - - const sharedUrl = await getSharedUrl(mode); - const { globalState, appState } = getStateFromUrl(sharedUrl); - expect(globalState).to.not.contain('filters'); - if (mode === 'snapshot') { - expect(appState).to.contain('filters'); - } else { - expect(sharedUrl).to.not.contain('appState'); - } - }); - - it('unpinned filters should be removed from app state when dashboard is saved', async () => { - await PageObjects.dashboard.clickQuickSave(); - await PageObjects.dashboard.waitForRenderComplete(); + const unpinnedFilterIsOnlyWhenDashboardIsUnsaved = async (mode: TestingModes) => { + await filterBar.addFilter({ field: 'geo.src', operation: 'is', value: 'AE' }); + await PageObjects.dashboard.waitForRenderComplete(); + + const sharedUrl = await getSharedUrl(mode); + const { globalState, appState } = getStateFromUrl(sharedUrl); + expect(globalState).to.not.contain('filters'); + if (mode === 'snapshot') { + expect(appState).to.contain('filters'); + } else { + expect(sharedUrl).to.not.contain('appState'); + } + }; - const sharedUrl = await getSharedUrl(mode); - expect(sharedUrl).to.not.contain('appState'); - }); + const unpinnedFilterIsRemoved = async (mode: TestingModes) => { + await PageObjects.dashboard.clickQuickSave(); + await PageObjects.dashboard.waitForRenderComplete(); - it('pinned filter should show up only in global state', async () => { - await filterBar.toggleFilterPinned('geo.src'); - await PageObjects.dashboard.clickQuickSave(); - await PageObjects.dashboard.waitForRenderComplete(); + const sharedUrl = await getSharedUrl(mode); + expect(sharedUrl).to.not.contain('appState'); + }; - const sharedUrl = await getSharedUrl(mode); - const { globalState, appState } = getStateFromUrl(sharedUrl); - expect(globalState).to.contain('filters'); - if (mode === 'snapshot') { - expect(appState).to.not.contain('filters'); - } - }); - }; + const pinnedFilterIsWhenDashboardInGlobalState = async (mode: TestingModes) => { + await filterBar.toggleFilterPinned('geo.src'); + await PageObjects.dashboard.clickQuickSave(); + await PageObjects.dashboard.waitForRenderComplete(); + + const sharedUrl = await getSharedUrl(mode); + const { globalState, appState } = getStateFromUrl(sharedUrl); + expect(globalState).to.contain('filters'); + if (mode === 'snapshot') { + expect(appState).to.not.contain('filters'); + } + }; + describe('share dashboard', () => { before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.load( @@ -117,8 +111,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.unsetTime(); }); - describe('snapshot share', async () => { - describe('test local state', async () => { + describe('snapshot share', () => { + describe('test local state', () => { it('should not have "panels" state when not in unsaved changes state', async () => { await testSubjects.missingOrFail('dashboardUnsavedChangesBadge'); expect(await getSharedUrl('snapshot')).to.not.contain('panels'); @@ -144,8 +138,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('test filter state', async () => { - await testFilterState('snapshot'); + describe('test filter state', () => { + const mode = 'snapshot'; + + it('should not have "filters" state in either app or global state when no filters', async () => { + expect(await getSharedUrl(mode)).to.not.contain('filters'); + }); + + it('unpinned filter should show up only in app state when dashboard is unsaved', async () => { + await unpinnedFilterIsOnlyWhenDashboardIsUnsaved(mode); + }); + + it('unpinned filters should be removed from app state when dashboard is saved', async () => { + await unpinnedFilterIsRemoved(mode); + }); + + it('pinned filter should show up only in global state', async () => { + await pinnedFilterIsWhenDashboardInGlobalState(mode); + }); }); after(async () => { @@ -155,9 +165,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('saved object share', async () => { - describe('test filter state', async () => { - await testFilterState('savedObject'); + describe('saved object share', () => { + describe('test filter state', () => { + const mode = 'savedObject'; + + it('should not have "filters" state in either app or global state when no filters', async () => { + expect(await getSharedUrl(mode)).to.not.contain('filters'); + }); + + it('unpinned filter should show up only in app state when dashboard is unsaved', async () => { + await unpinnedFilterIsOnlyWhenDashboardIsUnsaved(mode); + }); + + it('unpinned filters should be removed from app state when dashboard is saved', async () => { + await unpinnedFilterIsRemoved(mode); + }); + + it('pinned filter should show up only in global state', async () => { + await pinnedFilterIsWhenDashboardInGlobalState(mode); + }); }); }); }); diff --git a/test/functional/apps/dashboard/group6/dashboard_snapshots.ts b/test/functional/apps/dashboard/group6/dashboard_snapshots.ts index 23b8b071e41d1..cbd9d3bfaaf91 100644 --- a/test/functional/apps/dashboard/group6/dashboard_snapshots.ts +++ b/test/functional/apps/dashboard/group6/dashboard_snapshots.ts @@ -63,7 +63,6 @@ export default function ({ await PageObjects.dashboard.saveDashboard('tsvb'); await PageObjects.dashboard.clickFullScreenMode(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); await PageObjects.dashboard.waitForRenderComplete(); @@ -85,7 +84,6 @@ export default function ({ await PageObjects.dashboard.saveDashboard('area'); await PageObjects.dashboard.clickFullScreenMode(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); await PageObjects.dashboard.waitForRenderComplete(); @@ -98,7 +96,7 @@ export default function ({ expect(percentDifference).to.be.lessThan(0.029); }); - describe('compare controls snapshot', async () => { + describe('compare controls snapshot', () => { const waitForPageReady = async () => { await PageObjects.header.waitUntilLoadingHasFinished(); await retry.waitFor('page ready for screenshot', async () => { diff --git a/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts index 9f5862c5fbbcd..683d6a6e7cc22 100644 --- a/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts @@ -215,7 +215,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.waitForRenderComplete(); await dashboard.expectUnsavedChangesBadge(); - pieChart.expectEmptyPieChart(); + await pieChart.expectEmptyPieChart(); }); it('hitting dashboard resets selections + unapplies timeslice', async () => { diff --git a/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts index 11ec5694e88b9..c05b26d32961c 100644 --- a/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts @@ -239,7 +239,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); }); - describe('Hierarchical chaining off', async () => { + describe('Hierarchical chaining off', () => { before(async () => { await dashboardControls.updateChainingSystem('NONE'); }); diff --git a/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts index 80a8bc8148977..00b6e24b56fb5 100644 --- a/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts @@ -6,13 +6,10 @@ * Side Public License, v 1. */ -import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; - import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); const queryBar = getService('queryBar'); const filterBar = getService('filterBar'); const testSubjects = getService('testSubjects'); @@ -24,70 +21,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Dashboard control group settings', () => { before(async () => { - await dashboard.navigateToApp(); - await dashboard.gotoDashboardLandingPage(); - await dashboard.clickNewDashboard(); - await timePicker.setDefaultDataRange(); - await dashboard.saveDashboard('Test Control Group Settings'); - }); - - it('adjust layout of controls', async () => { + await dashboard.loadSavedDashboard('control group settings test dashboard'); await dashboard.switchToEditMode(); - await dashboardControls.createControl({ - controlType: OPTIONS_LIST_CONTROL, - dataViewTitle: 'animals-*', - fieldName: 'sound.keyword', - }); - await dashboardControls.adjustControlsLayout('twoLine'); - const controlGroupWrapper = await testSubjects.find('controls-group-wrapper'); - expect(await controlGroupWrapper.elementHasClass('controlsWrapper--twoLine')).to.be(true); - }); - - describe('apply new default width and grow', async () => { - it('defaults to medium width and grow enabled', async () => { - await dashboardControls.openCreateControlFlyout(); - const mediumWidthButton = await testSubjects.find('control-editor-width-medium'); - expect(await mediumWidthButton.elementHasClass('euiButtonGroupButton-isSelected')).to.be( - true - ); - const growSwitch = await testSubjects.find('control-editor-grow-switch'); - expect(await growSwitch.getAttribute('aria-checked')).to.be('true'); - await testSubjects.click('control-editor-cancel'); - }); - - it('sets default to width and grow of last created control', async () => { - await dashboardControls.createControl({ - controlType: OPTIONS_LIST_CONTROL, - dataViewTitle: 'animals-*', - fieldName: 'name.keyword', - width: 'small', - grow: false, - }); - - const controlIds = await dashboardControls.getAllControlIds(); - const firstControl = await find.byXPath(`//div[@data-control-id="${controlIds[0]}"]`); - expect(await firstControl.elementHasClass('controlFrameWrapper--medium')).to.be(true); - expect(await firstControl.getAttribute('class')).not.to.contain('euiFlexItem-growZero'); - const secondControl = await find.byXPath(`//div[@data-control-id="${controlIds[1]}"]`); - expect(await secondControl.elementHasClass('controlFrameWrapper--small')).to.be(true); - expect(await secondControl.getAttribute('class')).to.contain('euiFlexItem-growZero'); - - await dashboardControls.openCreateControlFlyout(); - const smallWidthButton = await testSubjects.find('control-editor-width-small'); - expect(await smallWidthButton.elementHasClass('euiButtonGroupButton-isSelected')).to.be( - true - ); - const growSwitch = await testSubjects.find('control-editor-grow-switch'); - expect(await growSwitch.getAttribute('aria-checked')).to.be('false'); - await testSubjects.click('control-editor-cancel'); - }); }); - describe('filtering settings', async () => { - let firstOptionsListId: string; + describe('filtering settings', () => { + const firstOptionsListId = 'bcb81550-0843-44ea-9020-6c1ebf3228ac'; let beforeCount: number; - let rangeSliderId: string; + const rangeSliderId = '15925456-9e12-4b08-b2e6-4ae6ac27114d'; let beforeRange: number; const getRange = async () => { @@ -106,23 +48,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await dashboardControls.createControl({ - controlType: RANGE_SLIDER_CONTROL, - dataViewTitle: 'animals-*', - fieldName: 'weightLbs', - }); - await dashboard.clickQuickSave(); - - firstOptionsListId = (await dashboardControls.getAllControlIds())[0]; await dashboardControls.optionsListWaitForLoading(firstOptionsListId); await dashboardControls.optionsListOpenPopover(firstOptionsListId); beforeCount = await dashboardControls.optionsListPopoverGetAvailableOptionsCount(); - rangeSliderId = (await dashboardControls.getAllControlIds())[2]; beforeRange = await getRange(); }); - describe('do not apply global filters', async () => { + describe('do not apply global filters', () => { it('- filter pills', async () => { await filterBar.addFilter({ field: 'animal.keyword', operation: 'is', value: 'cat' }); await dashboardControls.optionsListOpenPopover(firstOptionsListId); @@ -172,65 +105,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('flyout only show settings that are relevant', async () => { - before(async () => { - await dashboard.switchToEditMode(); - }); - - it('when no controls', async () => { - await dashboardControls.deleteAllControls(); - await dashboardControls.openControlGroupSettingsFlyout(); - await testSubjects.missingOrFail('delete-all-controls-button'); - }); - - it('when at least one control', async () => { - await dashboardControls.createControl({ - controlType: OPTIONS_LIST_CONTROL, - dataViewTitle: 'animals-*', - fieldName: 'sound.keyword', - }); - await dashboardControls.openControlGroupSettingsFlyout(); - await testSubjects.existOrFail('delete-all-controls-button'); - }); - - afterEach(async () => { - await testSubjects.click('euiFlyoutCloseButton'); - if (await testSubjects.exists('confirmModalConfirmButton')) { - await testSubjects.click('confirmModalConfirmButton'); - } - }); - - after(async () => { - await dashboardControls.deleteAllControls(); - }); - }); - - describe('control group settings flyout closes', async () => { - it('on save', async () => { - await dashboardControls.openControlGroupSettingsFlyout(); - await dashboard.saveDashboard('Test Control Group Settings', { - saveAsNew: false, - exitFromEditMode: false, - }); - await testSubjects.missingOrFail('control-group-settings-flyout'); - }); - - it('on view mode change', async () => { - await dashboardControls.openControlGroupSettingsFlyout(); - await dashboard.clickCancelOutOfEditMode(); - await testSubjects.missingOrFail('control-group-settings-flyout'); - }); - + describe('control group settings flyout closes', () => { it('when navigating away from dashboard', async () => { await dashboard.switchToEditMode(); await dashboardControls.openControlGroupSettingsFlyout(); await dashboard.gotoDashboardLandingPage(); await testSubjects.missingOrFail('control-group-settings-flyout'); }); - - after(async () => { - await dashboard.loadSavedDashboard('Test Control Group Settings'); - }); }); }); } diff --git a/test/functional/apps/dashboard_elements/controls/common/index.ts b/test/functional/apps/dashboard_elements/controls/common/index.ts index c5fb1621e61f3..58c9a3dcb80fe 100644 --- a/test/functional/apps/dashboard_elements/controls/common/index.ts +++ b/test/functional/apps/dashboard_elements/controls/common/index.ts @@ -26,7 +26,6 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); - // enable the controls lab and navigate to the dashboard listing page to start await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); } diff --git a/test/functional/apps/dashboard_elements/controls/common/multiple_data_views.ts b/test/functional/apps/dashboard_elements/controls/common/multiple_data_views.ts index 45b0829f6ca5f..5a07e60d45695 100644 --- a/test/functional/apps/dashboard_elements/controls/common/multiple_data_views.ts +++ b/test/functional/apps/dashboard_elements/controls/common/multiple_data_views.ts @@ -105,13 +105,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('4'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - dashboardControls.validateRange('placeholder', controlIds[1], '100', '1200'); + await dashboardControls.validateRange('placeholder', controlIds[1], '100', '1200'); await dashboardControls.optionsListOpenPopover(controlIds[2]); expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('5'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); - dashboardControls.validateRange('placeholder', controlIds[3], '0', '19979'); + await dashboardControls.validateRange('placeholder', controlIds[3], '0', '19979'); }); it('ignores controls on other controls and panels using a data view without the control field by default', async () => { @@ -120,13 +120,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardControls.optionsListPopoverSelectOption('Kibana Airlines'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - dashboardControls.validateRange('placeholder', controlIds[1], '100', '1196'); + await dashboardControls.validateRange('placeholder', controlIds[1], '100', '1196'); await dashboardControls.optionsListOpenPopover(controlIds[2]); expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('5'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); - dashboardControls.validateRange('placeholder', controlIds[3], '0', '19979'); + await dashboardControls.validateRange('placeholder', controlIds[3], '0', '19979'); const logstashSavedSearchPanel = await testSubjects.find('embeddedSavedSearchDocTable'); expect( @@ -154,13 +154,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('4'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - dashboardControls.validateRange('placeholder', controlIds[1], '100', '1200'); + await dashboardControls.validateRange('placeholder', controlIds[1], '100', '1200'); await dashboardControls.optionsListOpenPopover(controlIds[2]); expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('0'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); - dashboardControls.validateRange('placeholder', controlIds[3], '0', '0'); + await dashboardControls.validateRange('placeholder', controlIds[3], '0', '0'); }); it('applies global filters on controls using a data view without the filter field', async () => { @@ -169,13 +169,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardControls.optionsListPopoverSelectOption('Kibana Airlines'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - dashboardControls.validateRange('placeholder', controlIds[1], '100', '1196'); + await dashboardControls.validateRange('placeholder', controlIds[1], '100', '1196'); await dashboardControls.optionsListOpenPopover(controlIds[2]); expect(await dashboardControls.optionsListGetCardinalityValue()).to.be('0'); await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[2]); - dashboardControls.validateRange('placeholder', controlIds[3], '0', '0'); + await dashboardControls.validateRange('placeholder', controlIds[3], '0', '0'); const logstashSavedSearchPanel = await testSubjects.find('embeddedSavedSearchDocTable'); expect( diff --git a/test/functional/apps/dashboard_elements/controls/common/range_slider.ts b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts index 06e67b9d8df91..604ebb2677c82 100644 --- a/test/functional/apps/dashboard_elements/controls/common/range_slider.ts +++ b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const DASHBOARD_NAME = 'Test Range Slider Control'; - describe('Range Slider Control', async () => { + describe('Range Slider Control', () => { before(async () => { await security.testUser.setRoles([ 'kibana_admin', @@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await security.testUser.restoreDefaults(); }); - describe('create and edit', async () => { + describe('create and edit', () => { it('can create a new range slider control from a blank state', async () => { await dashboardControls.createControl({ controlType: RANGE_SLIDER_CONTROL, @@ -257,7 +257,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('validation', async () => { + describe('validation', () => { it('displays error message when upper bound selection is less than lower bound selection', async () => { const firstId = (await dashboardControls.getAllControlIds())[0]; await dashboardControls.rangeSliderSetLowerBound(firstId, '500'); @@ -279,7 +279,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('interaction', async () => { + describe('interaction', () => { it('Malformed query throws an error', async () => { await queryBar.setQuery('AvgTicketPrice <= 300 error'); await queryBar.submitQuery(); diff --git a/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts index e29b53c95d4d0..22980eb6423a2 100644 --- a/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts +++ b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts @@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }; - describe('Replacing controls', async () => { + describe('Replacing controls', () => { let controlId: string; before(async () => { @@ -66,7 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await security.testUser.restoreDefaults(); }); - describe('Replace options list', async () => { + describe('Replace options list', () => { beforeEach(async () => { await dashboardControls.clearAllControls(); await dashboardControls.createControl({ @@ -98,7 +98,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Replace range slider', async () => { + describe('Replace range slider', () => { beforeEach(async () => { await dashboardControls.clearAllControls(); await dashboardControls.createControl({ diff --git a/test/functional/apps/dashboard_elements/controls/common/time_slider.ts b/test/functional/apps/dashboard_elements/controls/common/time_slider.ts index 32f6e39e6b3c2..ab1ddbcbe7e88 100644 --- a/test/functional/apps/dashboard_elements/controls/common/time_slider.ts +++ b/test/functional/apps/dashboard_elements/controls/common/time_slider.ts @@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'dashboard', ]); - describe('Time Slider Control', async () => { + describe('Time Slider Control', () => { before(async () => { await security.testUser.setRoles([ 'kibana_admin', @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await security.testUser.restoreDefaults(); }); - describe('create, edit, and delete', async () => { + describe('create, edit, and delete', () => { before(async () => { await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); @@ -130,8 +130,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('panel interactions', async () => { - describe('saved search', async () => { + describe('panel interactions', () => { + describe('saved search', () => { before(async () => { await dashboard.navigateToApp(); await dashboard.loadSavedDashboard('timeslider and saved search'); diff --git a/test/functional/apps/dashboard_elements/controls/options_list/index.ts b/test/functional/apps/dashboard_elements/controls/options_list/index.ts index 5f589129ed279..95cd5eccf169b 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/index.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/index.ts @@ -47,7 +47,7 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid await kibanaServer.savedObjects.cleanStandardList(); }; - describe('Options list control', async () => { + describe('Options list control', () => { before(setup); after(teardown); diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts index a19d5bfee82bb..1ab63c4a0f602 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clickQuickSave(); }); - describe('Options List Control Editor selects relevant data views', async () => { + describe('Options List Control Editor selects relevant data views', () => { it('selects the default data view when the dashboard is blank', async () => { expect(await dashboardControls.optionsListEditorGetCurrentDataView(true)).to.eql( 'logstash-*' diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_dashboard_interaction.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_dashboard_interaction.ts index 16d0b2cd5fc2d..77d7e2b2914d2 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_dashboard_interaction.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_dashboard_interaction.ts @@ -66,7 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clickQuickSave(); }); - describe('Applies query settings to controls', async () => { + describe('Applies query settings to controls', () => { it('Malformed query throws an error', async () => { await queryBar.setQuery('animal.keyword : "dog" error'); await queryBar.submitQuery(); // quicker than clicking the submit button, but hides the time picker @@ -111,7 +111,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await timePicker.setDefaultDataRange(); }); - describe('dashboard filters', async () => { + describe('dashboard filters', () => { before(async () => { await filterBar.addFilter({ field: 'sound.keyword', @@ -167,7 +167,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Selections made in control apply to dashboard', async () => { + describe('Selections made in control apply to dashboard', () => { it('Shows available options in options list', async () => { await queryBar.setQuery(''); await queryBar.submitQuery(); @@ -259,8 +259,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clearUnsavedChanges(); }); - describe('discarding changes', async () => { - describe('changes can be discarded', async () => { + describe('discarding changes', () => { + describe('changes can be discarded', () => { let selections = ''; beforeEach(async () => { @@ -292,7 +292,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Test data view runtime field', async () => { + describe('Test data view runtime field', () => { const FIELD_NAME = 'testRuntimeField'; const FIELD_VALUES = { G: @@ -360,7 +360,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Test exists query', async () => { + describe('Test exists query', () => { const newDocuments: Array<{ index: string; id: string }> = []; const addDocument = async (index: string, document: string) => { diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_validation.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_validation.ts index 9c222c78715b5..fa4322963381c 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_validation.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_validation.ts @@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clickQuickSave(); }); - describe('Options List dashboard validation', async () => { + describe('Options List dashboard validation', () => { before(async () => { await dashboardControls.optionsListOpenPopover(controlId); await dashboardControls.optionsListPopoverSelectOption('meow'); @@ -116,7 +116,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Options List dashboard no validation', async () => { + describe('Options List dashboard no validation', () => { before(async () => { await dashboardControls.optionsListOpenPopover(controlId); await dashboardControls.optionsListPopoverSelectOption('meow'); diff --git a/test/functional/apps/dashboard_elements/image_embeddable/image_embeddable.ts b/test/functional/apps/dashboard_elements/image_embeddable/image_embeddable.ts index 2636d00fb5cce..f408ea7a9681e 100644 --- a/test/functional/apps/dashboard_elements/image_embeddable/image_embeddable.ts +++ b/test/functional/apps/dashboard_elements/image_embeddable/image_embeddable.ts @@ -16,7 +16,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const retry = getService('retry'); - const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardDrilldownPanelActions = getService('dashboardDrilldownPanelActions'); const dashboardDrilldownsManage = getService('dashboardDrilldownsManage'); @@ -53,8 +52,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('image embeddable should support drilldowns', async () => { - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickContextMenuMoreItem(); await dashboardDrilldownPanelActions.expectExistsCreateDrilldownAction(); await dashboardDrilldownPanelActions.clickCreateDrilldown(); await dashboardDrilldownsManage.expectsCreateDrilldownFlyoutOpen(); diff --git a/test/functional/apps/dashboard_elements/links/links_create_edit.ts b/test/functional/apps/dashboard_elements/links/links_create_edit.ts index 54a58fbe0bc67..5598ba3444378 100644 --- a/test/functional/apps/dashboard_elements/links/links_create_edit.ts +++ b/test/functional/apps/dashboard_elements/links/links_create_edit.ts @@ -38,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const LINKS_PANEL_NAME = 'Some links'; describe('links panel create and edit', () => { - describe('creation', async () => { + describe('creation', () => { before(async () => { await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); @@ -95,7 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardLinks.clickPanelEditorCloseButton(); }); - describe('by-value links panel', async () => { + describe('by-value links panel', () => { it('can create a new by-value links panel', async () => { await dashboardAddPanel.clickEditorMenuButton(); await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Links'); @@ -139,7 +139,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.loadSavedDashboard('links 001'); await dashboard.switchToEditMode(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await dashboardLinks.expectPanelEditorFlyoutIsOpen(); @@ -159,7 +158,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.loadSavedDashboard('links 001'); await dashboard.switchToEditMode(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await dashboardLinks.expectPanelEditorFlyoutIsOpen(); @@ -178,7 +176,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.loadSavedDashboard('links 001'); await dashboard.switchToEditMode(); - await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickEdit(); await dashboardLinks.expectPanelEditorFlyoutIsOpen(); diff --git a/test/functional/apps/discover/ccs_compatibility/_timeout_results.ts b/test/functional/apps/discover/ccs_compatibility/_timeout_results.ts index f8f81a44bdf8c..aaaf7f8172b51 100644 --- a/test/functional/apps/discover/ccs_compatibility/_timeout_results.ts +++ b/test/functional/apps/discover/ccs_compatibility/_timeout_results.ts @@ -38,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.uiSettings.unset('search:timeout'); }); - describe('bfetch enabled', async () => { + describe('bfetch enabled', () => { it('timeout on single shard shows warning and results with bfetch enabled', async () => { await PageObjects.common.navigateToApp('discover'); await dataViews.createFromSearchBar({ @@ -91,7 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('bfetch disabled', async () => { + describe('bfetch disabled', () => { before(async () => { await kibanaServer.uiSettings.update({ 'bfetch:disable': true }); }); diff --git a/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts b/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts index a608d97873810..c6c70d964981d 100644 --- a/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts +++ b/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts @@ -35,11 +35,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.uiSettings.replace({}); }); - beforeEach(async function () { - await PageObjects.common.navigateToApp('discover'); - await PageObjects.discover.waitForDocTableLoadingComplete(); - }); - beforeEach(async function () { await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/classic/_doc_table.ts b/test/functional/apps/discover/classic/_doc_table.ts index 0e5934a62f943..d8cf4d2729174 100644 --- a/test/functional/apps/discover/classic/_doc_table.ts +++ b/test/functional/apps/discover/classic/_doc_table.ts @@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.timePicker.setDefaultAbsoluteRange(); }); - describe('classic table in window 900x700', async function () { + describe('classic table in window 900x700', function () { before(async () => { await browser.setWindowSize(900, 700); await PageObjects.common.navigateToApp('discover'); @@ -93,7 +93,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('classic table in window 600x700', async function () { + describe('classic table in window 600x700', function () { before(async () => { await browser.setWindowSize(600, 700); await PageObjects.common.navigateToApp('discover'); @@ -112,7 +112,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('legacy', async function () { + describe('legacy', function () { before(async () => { await PageObjects.common.navigateToApp('discover'); await PageObjects.discover.waitUntilSearchingHasFinished(); @@ -146,7 +146,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(skipButtonText === activeElementText).to.be(true); }); - describe('expand a document row', async function () { + describe('expand a document row', function () { const rowToInspect = 1; beforeEach(async function () { // close the toggle if open @@ -228,7 +228,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('add and remove columns', async function () { + describe('add and remove columns', function () { const extraColumns = ['phpmemory', 'ip']; const expectedFieldLength: Record = { phpmemory: 1, diff --git a/test/functional/apps/discover/classic/_esql_grid.ts b/test/functional/apps/discover/classic/_esql_grid.ts index d2bacbcd4947a..cb82deb8eece6 100644 --- a/test/functional/apps/discover/classic/_esql_grid.ts +++ b/test/functional/apps/discover/classic/_esql_grid.ts @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'doc_table:legacy': true, }; - describe('discover esql grid with legacy setting', async function () { + describe('discover esql grid with legacy setting', function () { before(async () => { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); diff --git a/test/functional/apps/discover/context_awareness/extensions/_get_default_app_state.ts b/test/functional/apps/discover/context_awareness/extensions/_get_default_app_state.ts index 4991aa5f36ee1..7e057da66b764 100644 --- a/test/functional/apps/discover/context_awareness/extensions/_get_default_app_state.ts +++ b/test/functional/apps/discover/context_awareness/extensions/_get_default_app_state.ts @@ -11,19 +11,29 @@ import kbnRison from '@kbn/rison'; import type { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects(['common', 'discover', 'unifiedFieldList']); + const PageObjects = getPageObjects(['common', 'discover', 'unifiedFieldList', 'header']); const dataViews = getService('dataViews'); const dataGrid = getService('dataGrid'); const queryBar = getService('queryBar'); const monacoEditor = getService('monacoEditor'); const testSubjects = getService('testSubjects'); const kibanaServer = getService('kibanaServer'); + const retry = getService('retry'); describe('extension getDefaultAppState', () => { afterEach(async () => { await kibanaServer.uiSettings.unset('defaultColumns'); }); + async function expectColumns(columns: string[]) { + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); + await retry.try(async () => { + const actualColumns = await PageObjects.discover.getColumnHeaders(); + expect(actualColumns).to.eql(columns); + }); + } + describe('ES|QL mode', () => { it('should render default columns and row height', async () => { const state = kbnRison.encode({ @@ -35,9 +45,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, { ensureCurrentUrl: false, }); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); const rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -55,9 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, { ensureCurrentUrl: false, }); - await PageObjects.discover.waitUntilSearchingHasFinished(); - let columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'Document']); + await expectColumns(['@timestamp', 'Document']); await dataGrid.clickGridSettings(); let rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -65,9 +71,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(rowHeightNumber).to.be(3); await monacoEditor.setCodeEditorValue('from my-example-logs'); await queryBar.clickQuerySubmitButton(); - await PageObjects.discover.waitUntilSearchingHasFinished(); - columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -88,16 +92,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.unifiedFieldList.clickFieldListItemRemove('log.level'); await PageObjects.unifiedFieldList.clickFieldListItemRemove('message'); - let columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'Document']); + await expectColumns(['@timestamp', 'Document']); await dataGrid.clickGridSettings(); await dataGrid.changeRowHeightValue('Single'); let rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Single'); await testSubjects.click('discoverNewButton'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -118,9 +119,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, { ensureCurrentUrl: false, }); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message', 'data_stream.type']); + await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']); }); }); @@ -130,9 +129,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ensureCurrentUrl: false, }); await dataViews.switchTo('my-example-logs'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); const rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -145,18 +142,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ensureCurrentUrl: false, }); await dataViews.switchTo('my-example-*'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - let columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'Document']); + await expectColumns(['@timestamp', 'Document']); await dataGrid.clickGridSettings(); let rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); let rowHeightNumber = await dataGrid.getCustomRowHeightNumber(); expect(rowHeightNumber).to.be(3); await dataViews.switchTo('my-example-logs'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -172,16 +165,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.unifiedFieldList.clickFieldListItemRemove('log.level'); await PageObjects.unifiedFieldList.clickFieldListItemRemove('message'); - let columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'Document']); + await expectColumns(['@timestamp', 'Document']); await dataGrid.clickGridSettings(); await dataGrid.changeRowHeightValue('Single'); let rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Single'); await testSubjects.click('discoverNewButton'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message']); + await expectColumns(['@timestamp', 'log.level', 'message']); await dataGrid.clickGridSettings(); rowHeightValue = await dataGrid.getCurrentRowHeightValue(); expect(rowHeightValue).to.be('Custom'); @@ -197,9 +187,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ensureCurrentUrl: false, }); await dataViews.switchTo('my-example-logs'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['@timestamp', 'log.level', 'message', 'data_stream.type']); + await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']); }); }); }); diff --git a/test/functional/apps/discover/esql/_esql_columns.ts b/test/functional/apps/discover/esql/_esql_columns.ts index ad1fe5d31edc9..2a639032646b5 100644 --- a/test/functional/apps/discover/esql/_esql_columns.ts +++ b/test/functional/apps/discover/esql/_esql_columns.ts @@ -36,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { defaultIndex: 'logstash-*', }; - describe('discover esql columns', async function () { + describe('discover esql columns', function () { before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); diff --git a/test/functional/apps/discover/esql/_esql_view.ts b/test/functional/apps/discover/esql/_esql_view.ts index a5a2fa78a7b65..7bdcb1bfe17fb 100644 --- a/test/functional/apps/discover/esql/_esql_view.ts +++ b/test/functional/apps/discover/esql/_esql_view.ts @@ -38,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { enableESQL: true, }; - describe('discover esql view', async function () { + describe('discover esql view', function () { before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); @@ -325,6 +325,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(requestNames).to.contain('Visualization'); }); }); + + describe('with slow queries', () => { + it('should show only one entry in inspector for table/visualization', async function () { + await PageObjects.discover.selectTextBaseLang(); + const testQuery = `from kibana_sample_data_flights | limit 10`; + await monacoEditor.setCodeEditorValue(testQuery); + + await browser.execute(() => { + window.ELASTIC_ESQL_DELAY_SECONDS = 5; + }); + await testSubjects.click('querySubmitButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await browser.execute(() => { + window.ELASTIC_ESQL_DELAY_SECONDS = undefined; + }); + + await inspector.open(); + const requestNames = (await inspector.getRequestNames()).split(','); + const requestTotalTime = await inspector.getRequestTotalTime(); + expect(requestTotalTime).to.be.greaterThan(5000); + expect(requestNames.length).to.be(2); + expect(requestNames).to.contain('Table'); + expect(requestNames).to.contain('Visualization'); + }); + }); }); describe('query history', () => { diff --git a/test/functional/apps/discover/ftr_provider_context.d.ts b/test/functional/apps/discover/ftr_provider_context.d.ts index 5bf34af1bf9f3..b006a98a73d7c 100644 --- a/test/functional/apps/discover/ftr_provider_context.d.ts +++ b/test/functional/apps/discover/ftr_provider_context.d.ts @@ -7,7 +7,13 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services } from '../../services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { services as functionalServces } from '../../services'; import { pageObjects } from '../../page_objects'; +const services = { + ...functionalServces, + ...commonFunctionalServices, +}; + export type FtrProviderContext = GenericFtrProviderContext; diff --git a/test/functional/apps/discover/group1/_date_nanos_mixed.ts b/test/functional/apps/discover/group1/_date_nanos_mixed.ts index df45356a69789..8c563ce14d6d9 100644 --- a/test/functional/apps/discover/group1/_date_nanos_mixed.ts +++ b/test/functional/apps/discover/group1/_date_nanos_mixed.ts @@ -40,6 +40,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await security.testUser.restoreDefaults(); await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_mixed'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); + await PageObjects.common.unsetTime(); }); it('shows a list of records of indices with date & date_nanos fields in the right order', async function () { @@ -53,9 +54,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const rowData4 = await PageObjects.discover.getDocTableIndex(isLegacy ? 7 : 4); expect(rowData4).to.contain('Jan 1, 2019 @ 12:10:30.123000000'); }); - - after(async () => { - await PageObjects.common.unsetTime(); - }); }); } diff --git a/test/functional/apps/discover/group2_data_grid3/_data_grid_column_widths.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_column_widths.ts new file mode 100644 index 0000000000000..a7ae825420151 --- /dev/null +++ b/test/functional/apps/discover/group2_data_grid3/_data_grid_column_widths.ts @@ -0,0 +1,130 @@ +/* + * 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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const browser = getService('browser'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const dataGrid = getService('dataGrid'); + const dashboardAddPanel = getService('dashboardAddPanel'); + const PageObjects = getPageObjects([ + 'common', + 'discover', + 'header', + 'timePicker', + 'dashboard', + 'unifiedFieldList', + ]); + const security = getService('security'); + + const testResizeColumn = async (field: string) => { + const { originalWidth, newWidth } = await dataGrid.resizeColumn(field, -100); + expect(newWidth).to.be(originalWidth - 100); + await dataGrid.clickResetColumnWidth(field); + const resetWidth = (await (await dataGrid.getHeaderElement(field)).getSize()).width; + expect(resetWidth).to.be(originalWidth); + }; + + describe('discover data grid column widths', function describeIndexTests() { + before(async () => { + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.uiSettings.replace({}); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + beforeEach(async function () { + await PageObjects.common.navigateToApp('discover'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); + }); + + it('should not show reset width button for auto width column', async () => { + await PageObjects.unifiedFieldList.clickFieldListItemAdd('@message'); + expect(await dataGrid.resetColumnWidthExists('@message')).to.be(false); + }); + + it('should show reset width button for absolute width column, and allow resetting to auto width', async () => { + await PageObjects.unifiedFieldList.clickFieldListItemAdd('@message'); + await testResizeColumn('@message'); + }); + + it('should reset the last column to auto width if only absolute width columns remain', async () => { + await PageObjects.unifiedFieldList.clickFieldListItemAdd('@message'); + const { originalWidth: messageOriginalWidth, newWidth: messageNewWidth } = + await dataGrid.resizeColumn('@message', -300); + expect(messageNewWidth).to.be(messageOriginalWidth - 300); + await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes'); + const { originalWidth: bytesOriginalWidth, newWidth: bytesNewWidth } = + await dataGrid.resizeColumn('bytes', -100); + expect(bytesNewWidth).to.be(bytesOriginalWidth - 100); + let messageWidth = (await (await dataGrid.getHeaderElement('@message')).getSize()).width; + expect(messageWidth).to.be(messageNewWidth); + await dataGrid.clickRemoveColumn('bytes'); + messageWidth = (await (await dataGrid.getHeaderElement('@message')).getSize()).width; + expect(messageWidth).to.be(messageOriginalWidth); + }); + + it('should not reset the last column to auto width when there are remaining auto width columns', async () => { + await PageObjects.unifiedFieldList.clickFieldListItemAdd('@message'); + await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes'); + const { originalWidth: bytesOriginalWidth, newWidth: bytesNewWidth } = + await dataGrid.resizeColumn('bytes', -200); + expect(bytesNewWidth).to.be(bytesOriginalWidth - 200); + await PageObjects.unifiedFieldList.clickFieldListItemAdd('agent'); + const { originalWidth: agentOriginalWidth, newWidth: agentNewWidth } = + await dataGrid.resizeColumn('agent', -100); + expect(agentNewWidth).to.be(agentOriginalWidth - 100); + await dataGrid.clickRemoveColumn('bytes'); + const agentWidth = (await (await dataGrid.getHeaderElement('agent')).getSize()).width; + expect(agentWidth).to.be(agentNewWidth); + }); + + it('should allow resetting column width in surrounding docs view', async () => { + await PageObjects.unifiedFieldList.clickFieldListItemAdd('@message'); + await dataGrid.clickRowToggle({ rowIndex: 0 }); + const [, surroundingActionEl] = await dataGrid.getRowActions({ rowIndex: 0 }); + await surroundingActionEl.click(); + await PageObjects.header.waitUntilLoadingHasFinished(); + await testResizeColumn('@message'); + }); + + it('should allow resetting column width in Dashboard panel', async () => { + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.clickNewDashboard(); + await dashboardAddPanel.clickOpenAddPanel(); + await dashboardAddPanel.addSavedSearch('A Saved Search'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await testResizeColumn('_source'); + }); + + it('should use custom column width on Dashboard when specified', async () => { + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.clickNewDashboard(); + await dashboardAddPanel.clickOpenAddPanel(); + await dashboardAddPanel.addSavedSearch('A Saved Search'); + await PageObjects.header.waitUntilLoadingHasFinished(); + const { originalWidth, newWidth } = await dataGrid.resizeColumn('_source', -100); + expect(newWidth).to.be(originalWidth - 100); + await PageObjects.dashboard.saveDashboard('test'); + await browser.refresh(); + await PageObjects.header.waitUntilLoadingHasFinished(); + const initialWidth = (await (await dataGrid.getHeaderElement('_source')).getSize()).width; + expect(initialWidth).to.be(newWidth); + }); + }); +} diff --git a/test/functional/apps/discover/group2_data_grid3/_data_grid_density.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_density.ts new file mode 100644 index 0000000000000..45105fe907a0f --- /dev/null +++ b/test/functional/apps/discover/group2_data_grid3/_data_grid_density.ts @@ -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 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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const browser = getService('browser'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const dataGrid = getService('dataGrid'); + const testSubjects = getService('testSubjects'); + const PageObjects = getPageObjects(['settings', 'common', 'discover', 'header', 'timePicker']); + const defaultSettings = { defaultIndex: 'logstash-*' }; + const security = getService('security'); + + describe('discover data grid density', function () { + before(async () => { + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); + await browser.setWindowSize(1200, 2000); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.uiSettings.replace({}); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + beforeEach(async function () { + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update(defaultSettings); + await PageObjects.common.navigateToApp('discover'); + await PageObjects.discover.waitUntilSearchingHasFinished(); + }); + + it('should use the default density', async () => { + await dataGrid.clickGridSettings(); + const selected = await dataGrid.getCurrentDensityValue(); + expect(selected).to.be('Compact'); + }); + + it('should allow to change density', async () => { + await dataGrid.clickGridSettings(); + await dataGrid.changeDensityValue('Normal'); + + // toggle the popover + // Right now changing the density closes the popover (see packages/kbn-unified-data-table/src/components/data_table.tsx:1144) + // When that workaround is removed we will need to uncomment this next line + // await dataGrid.clickGridSettings(); + await dataGrid.clickGridSettings(); + expect(await dataGrid.getCurrentDensityValue()).to.be('Normal'); + }); + + it('should persist the density selection after reloading the page', async () => { + await dataGrid.clickGridSettings(); + await dataGrid.changeDensityValue('Expanded'); + await dataGrid.clickGridSettings(); + expect(await dataGrid.getCurrentDensityValue()).to.be('Expanded'); + + await browser.refresh(); + await PageObjects.discover.waitUntilSearchingHasFinished(); + + await dataGrid.clickGridSettings(); + expect(await dataGrid.getCurrentDensityValue()).to.be('Expanded'); + }); + + it('should save and revert unsaved densities properly', async () => { + // Open saved search + await PageObjects.discover.loadSavedSearch('A Saved Search'); + + // Change density + await dataGrid.clickGridSettings(); + await dataGrid.changeDensityValue('Expanded'); + await PageObjects.discover.saveUnsavedChanges(); + + // Change density + await dataGrid.clickGridSettings(); + await dataGrid.changeDensityValue('Normal'); + await testSubjects.existOrFail('unsavedChangesBadge'); + + // Revert change + await PageObjects.discover.revertUnsavedChanges(); + + // Verify density reset + await dataGrid.clickGridSettings(); + expect(await dataGrid.getCurrentDensityValue()).to.be('Expanded'); + }); + }); +} diff --git a/test/functional/apps/discover/group2_data_grid3/index.ts b/test/functional/apps/discover/group2_data_grid3/index.ts index b7a5e25a491b5..66584faa2dc6d 100644 --- a/test/functional/apps/discover/group2_data_grid3/index.ts +++ b/test/functional/apps/discover/group2_data_grid3/index.ts @@ -25,5 +25,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./_data_grid_row_selection')); loadTestFile(require.resolve('./_data_grid_sample_size')); loadTestFile(require.resolve('./_data_grid_pagination')); + loadTestFile(require.resolve('./_data_grid_density')); + loadTestFile(require.resolve('./_data_grid_column_widths')); }); } diff --git a/test/functional/apps/discover/group3/_doc_viewer.ts b/test/functional/apps/discover/group3/_doc_viewer.ts index 66f1f74a4ddbe..0464f2e4f32d5 100644 --- a/test/functional/apps/discover/group3/_doc_viewer.ts +++ b/test/functional/apps/discover/group3/_doc_viewer.ts @@ -24,10 +24,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const dataGrid = getService('dataGrid'); const monacoEditor = getService('monacoEditor'); + const browser = getService('browser'); describe('discover doc viewer', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await browser.setWindowSize(1600, 1200); }); beforeEach(async () => { @@ -174,7 +176,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(initialFieldsCount).to.above(numberFieldsCount); const pinnedFieldsCount = 1; - await dataGrid.clickFieldActionInFlyout('agent', 'togglePinFilterButton'); + await dataGrid.togglePinActionInFlyout('agent'); await PageObjects.discover.openFilterByFieldTypeInDocViewer(); expect(await find.allByCssSelector('[data-test-subj*="typeFilter"]')).to.have.length(6); @@ -229,5 +231,43 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); + + describe('pinning fields', function () { + it('should be able to pin and unpin fields', async function () { + await dataGrid.clickRowToggle(); + await PageObjects.discover.isShowingDocViewer(); + await retry.waitFor('rendered items', async () => { + return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length > 0; + }); + + let fieldNameCells = await find.allByCssSelector('.kbnDocViewer__fieldName'); + let fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText())); + + expect(fieldNames.join(',').startsWith('_id,_ignored,_index,_score,@message')).to.be(true); + expect(await dataGrid.isFieldPinnedInFlyout('agent')).to.be(false); + + await dataGrid.togglePinActionInFlyout('agent'); + + fieldNameCells = await find.allByCssSelector('.kbnDocViewer__fieldName'); + fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText())); + expect(fieldNames.join(',').startsWith('agent,_id,_ignored')).to.be(true); + expect(await dataGrid.isFieldPinnedInFlyout('agent')).to.be(true); + + await dataGrid.togglePinActionInFlyout('@message'); + + fieldNameCells = await find.allByCssSelector('.kbnDocViewer__fieldName'); + fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText())); + expect(fieldNames.join(',').startsWith('@message,agent,_id,_ignored')).to.be(true); + expect(await dataGrid.isFieldPinnedInFlyout('@message')).to.be(true); + + await dataGrid.togglePinActionInFlyout('@message'); + + fieldNameCells = await find.allByCssSelector('.kbnDocViewer__fieldName'); + fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText())); + expect(fieldNames.join(',').startsWith('agent,_id,_ignored')).to.be(true); + expect(await dataGrid.isFieldPinnedInFlyout('agent')).to.be(true); + expect(await dataGrid.isFieldPinnedInFlyout('@message')).to.be(false); + }); + }); }); } diff --git a/test/functional/apps/discover/group5/_filter_editor.ts b/test/functional/apps/discover/group5/_filter_editor.ts index 41d5f38b1103b..b71f0b342af3b 100644 --- a/test/functional/apps/discover/group5/_filter_editor.ts +++ b/test/functional/apps/discover/group5/_filter_editor.ts @@ -69,7 +69,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('version fields', async () => { + describe('version fields', () => { const es = getService('es'); const indexPatterns = getService('indexPatterns'); const indexTitle = 'version-test'; diff --git a/test/functional/apps/discover/group5/_shared_links.ts b/test/functional/apps/discover/group5/_shared_links.ts index 3aeda46316c59..238a859e7cdc5 100644 --- a/test/functional/apps/discover/group5/_shared_links.ts +++ b/test/functional/apps/discover/group5/_shared_links.ts @@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; } - describe('shared links with state in query', async () => { + describe('shared links with state in query', () => { let teardown: () => Promise; before(async function () { teardown = await setup({ storeStateInSessionStorage: false }); @@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('shared links with state in sessionStorage', async () => { + describe('shared links with state in sessionStorage', () => { let teardown: () => Promise; before(async function () { teardown = await setup({ storeStateInSessionStorage: true }); diff --git a/test/functional/apps/discover/group5/_url_state.ts b/test/functional/apps/discover/group5/_url_state.ts index 099fbed1589a3..2516f2ed08659 100644 --- a/test/functional/apps/discover/group5/_url_state.ts +++ b/test/functional/apps/discover/group5/_url_state.ts @@ -179,6 +179,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 22, 2015 @ 20:40:22.952jpg1,576', 'Sep 22, 2015 @ 20:11:39.532png1,708', 'Sep 22, 2015 @ 19:45:13.813php1,406', + 'Sep 22, 2015 @ 19:40:17.903jpg1,557', ]); expect(await PageObjects.discover.getHitCount()).to.be(totalHitsForOneFilter); @@ -204,6 +205,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 22, 2015 @ 18:50:22.335css1,841', 'Sep 22, 2015 @ 18:40:32.329css1,945', 'Sep 22, 2015 @ 18:13:35.361css1,752', + 'Sep 22, 2015 @ 17:22:12.782css1,583', ]; expect(await dataGrid.getRowsText()).to.eql(filteredRows); diff --git a/test/functional/apps/getting_started/_shakespeare.ts b/test/functional/apps/getting_started/_shakespeare.ts index 5426594bee30a..99d04ce708700 100644 --- a/test/functional/apps/getting_started/_shakespeare.ts +++ b/test/functional/apps/getting_started/_shakespeare.ts @@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); - kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.uiSettings.replace({}); }); diff --git a/test/functional/apps/home/_sample_data.ts b/test/functional/apps/home/_sample_data.ts index 4120a9ecc1a54..43e2a9fa6dad4 100644 --- a/test/functional/apps/home/_sample_data.ts +++ b/test/functional/apps/home/_sample_data.ts @@ -36,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('listing', () => { before(async () => { - PageObjects.home.openSampleDataAccordion(); + await PageObjects.home.openSampleDataAccordion(); }); it('should display registered flights sample data sets', async () => { diff --git a/test/functional/apps/kibana_overview/_no_data.ts b/test/functional/apps/kibana_overview/_no_data.ts index 8dec616eb8afe..debb9783982c6 100644 --- a/test/functional/apps/kibana_overview/_no_data.ts +++ b/test/functional/apps/kibana_overview/_no_data.ts @@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('overview page - no data', function describeIndexTests() { before(async () => { await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); - kibanaServer.savedObjects.clean({ types: ['index-pattern'] }); + await kibanaServer.savedObjects.clean({ types: ['index-pattern'] }); await kibanaServer.importExport.unload( 'test/functional/fixtures/kbn_archiver/kibana_sample_data_flights_index_pattern' ); diff --git a/test/functional/apps/management/_kibana_settings.ts b/test/functional/apps/management/_kibana_settings.ts index 875635cbd6a09..352293d7fe58b 100644 --- a/test/functional/apps/management/_kibana_settings.ts +++ b/test/functional/apps/management/_kibana_settings.ts @@ -26,6 +26,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndexPatterns(); await PageObjects.settings.removeLogstashIndexPatternIfExist(); + await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); + await browser.refresh(); }); it('should allow setting advanced settings', async function () { @@ -95,10 +97,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(globalState.length).to.be.greaterThan(20); }); }); - - after(async function () { - await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); - await browser.refresh(); - }); }); } diff --git a/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts b/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts index d2ab2b64bf738..8a69b6a9ed80d 100644 --- a/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts +++ b/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('index pattern wizard ccs', () => { - describe('remote cluster only', async () => { + describe('remote cluster only', () => { beforeEach(async function () { await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); @@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.savedObjects.cleanStandardList(); }); }); - describe('remote and local clusters', async () => { + describe('remote and local clusters', () => { before(async () => { await es.transport.request({ path: '/blogs/_doc', diff --git a/test/functional/apps/management/data_views/_cache.ts b/test/functional/apps/management/data_views/_cache.ts index 764dd99d20252..4c8c928da9f73 100644 --- a/test/functional/apps/management/data_views/_cache.ts +++ b/test/functional/apps/management/data_views/_cache.ts @@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['settings', 'common', 'header']); const testSubjects = getService('testSubjects'); - describe('Data view field caps cache advanced setting', async function () { + describe('Data view field caps cache advanced setting', function () { before(async () => { await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaSettings(); diff --git a/test/functional/apps/management/data_views/_field_formatter.ts b/test/functional/apps/management/data_views/_field_formatter.ts index 7cfa792c41332..53542bbf4fa59 100644 --- a/test/functional/apps/management/data_views/_field_formatter.ts +++ b/test/functional/apps/management/data_views/_field_formatter.ts @@ -555,7 +555,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('check formats', async () => { + describe('check formats', () => { before(async () => { await PageObjects.common.navigateToApp('discover', { hash: `/doc/${indexPatternId}/${indexTitle}?id=${testDocumentId}`, diff --git a/test/functional/apps/management/data_views/_handle_alias.ts b/test/functional/apps/management/data_views/_handle_alias.ts index ba9459c0fa47e..addb6388ada0b 100644 --- a/test/functional/apps/management/data_views/_handle_alias.ts +++ b/test/functional/apps/management/data_views/_handle_alias.ts @@ -57,7 +57,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.settings.createIndexPattern('alias2*', 'date'); }); - describe('discover verify hits', async () => { + describe('discover verify hits', () => { before(async () => { const from = 'Nov 12, 2016 @ 05:00:00.000'; const to = 'Nov 19, 2016 @ 05:00:00.000'; diff --git a/test/functional/apps/management/data_views/_scripted_fields.ts b/test/functional/apps/management/data_views/_scripted_fields.ts index 2c70161a3bc43..659eec0b65bcf 100644 --- a/test/functional/apps/management/data_views/_scripted_fields.ts +++ b/test/functional/apps/management/data_views/_scripted_fields.ts @@ -56,6 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async function afterAll() { await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); + await PageObjects.common.unsetTime(); }); /** @@ -145,7 +146,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('discover scripted field', async () => { + describe('discover scripted field', () => { before(async () => { const from = 'Sep 17, 2015 @ 06:31:44.000'; const to = 'Sep 18, 2015 @ 18:31:44.000'; @@ -515,9 +516,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); - - after(async () => { - await PageObjects.common.unsetTime(); - }); }); } diff --git a/test/functional/apps/visualize/group1/_data_table_nontimeindex.ts b/test/functional/apps/visualize/group1/_data_table_nontimeindex.ts index 897722d714145..3d776666b3a9b 100644 --- a/test/functional/apps/visualize/group1/_data_table_nontimeindex.ts +++ b/test/functional/apps/visualize/group1/_data_table_nontimeindex.ts @@ -103,7 +103,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(data).to.be.eql([['14,004', '1,412.6']]); }); - describe('data table with date histogram', async () => { + describe('data table with date histogram', () => { before(async () => { await PageObjects.visualize.navigateToNewAggBasedVisualization(); await PageObjects.visualize.clickDataTable(); diff --git a/test/functional/apps/visualize/group2/_gauge_chart.ts b/test/functional/apps/visualize/group2/_gauge_chart.ts index 5c35a90d42027..15fb5b1696590 100644 --- a/test/functional/apps/visualize/group2/_gauge_chart.ts +++ b/test/functional/apps/visualize/group2/_gauge_chart.ts @@ -18,21 +18,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); - // FLAKY: https://github.com/elastic/kibana/issues/181883 - describe.skip('gauge chart', function indexPatternCreation() { + async function initGaugeVis() { + log.debug('navigateToApp visualize'); + await PageObjects.visualize.navigateToNewAggBasedVisualization(); + log.debug('clickGauge'); + await PageObjects.visualize.clickGauge(); + await PageObjects.visualize.clickNewSearch(); + await PageObjects.timePicker.setDefaultAbsoluteRange(); + } + + describe('gauge chart', function indexPatternCreation() { before(async () => { await PageObjects.visualize.initTests(); + await initGaugeVis(); }); - async function initGaugeVis() { - log.debug('navigateToApp visualize'); - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - log.debug('clickGauge'); - await PageObjects.visualize.clickGauge(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - } - - before(initGaugeVis); it('should have inspector enabled', async function () { await inspector.expectIsEnabled(); @@ -57,7 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('gaugePercentageMode'); await testSubjects.setValue('gaugePercentageModeFormatPattern', '0.0%'); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(false); await retry.try(async function tryingForTime() { const expectedTexts = ['57.3%', 'Average bytes']; @@ -77,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectField('machine.os.raw'); log.debug('Size = 4'); await PageObjects.visEditor.setSize(4); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(false); }); it('should show Split Gauges', async () => { @@ -113,7 +112,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickBucket('Metric', 'metrics'); await PageObjects.visEditor.selectAggregation('Min', 'metrics'); await PageObjects.visEditor.selectField('bytes', 'metrics'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(false); await retry.try(async function tryingForTime() { const metricValue = await PageObjects.visChart.getGaugeValue(); diff --git a/test/functional/apps/visualize/group2/_heatmap_chart.ts b/test/functional/apps/visualize/group2/_heatmap_chart.ts index 09439635ebc5e..4054ea334cac8 100644 --- a/test/functional/apps/visualize/group2/_heatmap_chart.ts +++ b/test/functional/apps/visualize/group2/_heatmap_chart.ts @@ -15,8 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const inspector = getService('inspector'); const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); - // FLAKY: https://github.com/elastic/kibana/issues/181884 - describe.skip('heatmap chart', function indexPatternCreation() { + describe('heatmap chart', function indexPatternCreation() { const vizName1 = 'Visualization HeatmapChart'; let isNewChartsLibraryEnabled = false; @@ -38,7 +37,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Field = @timestamp'); await PageObjects.visEditor.selectField('@timestamp'); // leaving Interval set to Auto - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled); }); it('should save and load', async function () { @@ -97,7 +96,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show 6 color ranges if changed on options', async function () { await PageObjects.visEditor.clickOptionsTab(); await PageObjects.visEditor.changeHeatmapColorNumbers(6); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); const legends = await PageObjects.visChart.getLegendEntries(); @@ -138,7 +137,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('customize 2 last ranges'); await PageObjects.visEditor.setCustomRangeByIndex(6, '650', '720'); await PageObjects.visEditor.setCustomRangeByIndex(7, '800', '905'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); const legends = await PageObjects.visChart.getLegendEntries(); diff --git a/test/functional/apps/visualize/group3/_annotation_listing.ts b/test/functional/apps/visualize/group3/_annotation_listing.ts index f58f2fd386028..37123fc4ab721 100644 --- a/test/functional/apps/visualize/group3/_annotation_listing.ts +++ b/test/functional/apps/visualize/group3/_annotation_listing.ts @@ -143,7 +143,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { color: '#00FF00', }); - retry.try(async () => { + await retry.try(async () => { expect(await PageObjects.annotationEditor.getAnnotationCount()).to.be(2); }); }); diff --git a/test/functional/apps/visualize/group3/_pie_chart.ts b/test/functional/apps/visualize/group3/_pie_chart.ts index 466c82227606f..0ef5b3411ed24 100644 --- a/test/functional/apps/visualize/group3/_pie_chart.ts +++ b/test/functional/apps/visualize/group3/_pie_chart.ts @@ -69,7 +69,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should show 10 slices in pie chart', async function () { - pieChart.expectPieSliceCount(10, isNewChartsLibraryEnabled); + await pieChart.expectPieSliceCount(10, isNewChartsLibraryEnabled); }); it('should show correct data', async function () { diff --git a/test/functional/apps/visualize/group5/_tsvb_time_series.ts b/test/functional/apps/visualize/group5/_tsvb_time_series.ts index 55c59e38f359a..5e471b3ebb825 100644 --- a/test/functional/apps/visualize/group5/_tsvb_time_series.ts +++ b/test/functional/apps/visualize/group5/_tsvb_time_series.ts @@ -145,8 +145,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(actualCountMin).to.be('3 hours'); }); - // FLAKY: https://github.com/elastic/kibana/issues/182136 - describe.skip('Dark mode', () => { + describe('Dark mode', () => { before(async () => { await kibanaServer.uiSettings.update({ 'theme:darkMode': true, @@ -156,7 +155,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it(`viz should have light class when background color is white`, async () => { await visualBuilder.clickPanelOptions('timeSeries'); await visualBuilder.setBackgroundColor('#FFFFFF'); - await retry.try(async () => { expect(await visualBuilder.checkTimeSeriesIsLight()).to.be(true); }); diff --git a/test/functional/apps/visualize/group6/_tsvb_table.ts b/test/functional/apps/visualize/group6/_tsvb_table.ts index e7e24885cb406..54fbcc0e6f911 100644 --- a/test/functional/apps/visualize/group6/_tsvb_table.ts +++ b/test/functional/apps/visualize/group6/_tsvb_table.ts @@ -195,7 +195,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - it('should display drilldown urls', async () => { + it('should display drilldown urls after field formatting is applied', async () => { const baseURL = 'http://elastic.co/foo/'; await visualBuilder.clickPanelOptions('table'); diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts index 50f0988575750..0e11eaa86c6db 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_area_chart.ts @@ -30,38 +30,36 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const vizName = 'Visualization AreaChart Name Test - Charts library'; + const initAreaChart = async () => { + log.debug('navigateToApp visualize'); + await PageObjects.visualize.navigateToNewAggBasedVisualization(); + log.debug('clickAreaChart'); + await PageObjects.visualize.clickAreaChart(); + log.debug('clickNewSearch'); + await PageObjects.visualize.clickNewSearch(); + log.debug('Click X-axis'); + await PageObjects.visEditor.clickBucket('X-axis'); + log.debug('Click Date Histogram'); + await PageObjects.visEditor.selectAggregation('Date Histogram'); + log.debug('Check field value'); + const fieldValues = await PageObjects.visEditor.getField(); + log.debug('fieldValue = ' + fieldValues); + expect(fieldValues[0]).to.be('@timestamp'); + const intervalValue = await PageObjects.visEditor.getInterval(); + log.debug('intervalValue = ' + intervalValue); + expect(intervalValue[0]).to.be('Auto'); + await PageObjects.visEditor.clickGo(true); + }; + describe('area charts', function indexPatternCreation() { before(async () => { await PageObjects.visualize.initTests(); - await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); - }); - const initAreaChart = async () => { - log.debug('navigateToApp visualize'); - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - log.debug('clickAreaChart'); - await PageObjects.visualize.clickAreaChart(); - log.debug('clickNewSearch'); - await PageObjects.visualize.clickNewSearch(); - log.debug('Click X-axis'); - await PageObjects.visEditor.clickBucket('X-axis'); - log.debug('Click Date Histogram'); - await PageObjects.visEditor.selectAggregation('Date Histogram'); - log.debug('Check field value'); - const fieldValues = await PageObjects.visEditor.getField(); - log.debug('fieldValue = ' + fieldValues); - expect(fieldValues[0]).to.be('@timestamp'); - const intervalValue = await PageObjects.visEditor.getInterval(); - log.debug('intervalValue = ' + intervalValue); - expect(intervalValue[0]).to.be('Auto'); - await PageObjects.visEditor.clickGo(true); - }; - - before(async function () { await security.testUser.setRoles([ 'kibana_admin', 'long_window_logstash', 'test_logstash_reader', ]); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await initAreaChart(); }); diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts index 6fdaa4d5a0189..c0d6c8adb42f1 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_point_series_options.ts @@ -230,7 +230,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('timezones', async function () { + describe('timezones', function () { it('should show round labels in default timezone', async function () { const expectedLabels = [ '2015-09-20 00:00', diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts index 6e5d26d52f6e8..a52fd828e07df 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/_vertical_bar_chart.ts @@ -281,7 +281,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('vertical bar in percent mode', async () => { + describe('vertical bar in percent mode', () => { it('should show ticks with percentage values', async function () { const axisId = 'ValueAxis-1'; await PageObjects.visEditor.clickMetricsAndAxes(); diff --git a/test/functional/apps/visualize/replaced_vislib_chart_types/index.ts b/test/functional/apps/visualize/replaced_vislib_chart_types/index.ts index a2118e55ecd52..e58a4d3ea3897 100644 --- a/test/functional/apps/visualize/replaced_vislib_chart_types/index.ts +++ b/test/functional/apps/visualize/replaced_vislib_chart_types/index.ts @@ -23,9 +23,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); - }); - - before(async () => { await kibanaServer.uiSettings.update({ 'histogram:maxBars': 100, }); diff --git a/test/functional/fixtures/kbn_archiver/dashboard/current/kibana.json b/test/functional/fixtures/kbn_archiver/dashboard/current/kibana.json index 500443f11900a..a89dcf714dfc3 100644 --- a/test/functional/fixtures/kbn_archiver/dashboard/current/kibana.json +++ b/test/functional/fixtures/kbn_archiver/dashboard/current/kibana.json @@ -3175,3 +3175,53 @@ "coreMigrationVersion": "8.8.0", "typeMigrationVersion": "8.9.0" } + +{ + "id": "153e3302-1b37-4c45-9b11-91deec40ab47", + "type": "dashboard", + "namespaces": [ + "default" + ], + "updated_at": "2024-08-21T20:48:22.388Z", + "created_at": "2024-08-21T20:46:21.250Z", + "version": "WzQ4MCwxXQ==", + "attributes": { + "version": 2, + "controlGroupInput": { + "controlStyle": "oneLine", + "chainingSystem": "HIERARCHICAL", + "showApplySelections": false, + "panelsJSON": "{\"bcb81550-0843-44ea-9020-6c1ebf3228ac\":{\"type\":\"optionsListControl\",\"order\":0,\"grow\":true,\"width\":\"medium\",\"explicitInput\":{\"id\":\"bcb81550-0843-44ea-9020-6c1ebf3228ac\",\"fieldName\":\"sound.keyword\",\"title\":\"sound.keyword\",\"grow\":true,\"width\":\"medium\",\"searchTechnique\":\"prefix\",\"enhancements\":{}}},\"15925456-9e12-4b08-b2e6-4ae6ac27114d\":{\"type\":\"rangeSliderControl\",\"order\":1,\"grow\":true,\"width\":\"medium\",\"explicitInput\":{\"fieldName\":\"weightLbs\",\"title\":\"weightLbs\",\"searchTechnique\":\"exact\",\"id\":\"15925456-9e12-4b08-b2e6-4ae6ac27114d\",\"enhancements\":{}}}}", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}" + }, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" + }, + "description": "", + "refreshInterval": { + "pause": true, + "value": 60000 + }, + "timeRestore": true, + "optionsJSON": "{\"useMargins\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false,\"hidePanelTitles\":false}", + "panelsJSON": "[]", + "timeFrom": "2018-01-01T00:00:00.000Z", + "title": "control group settings test dashboard", + "timeTo": "2018-04-13T00:00:00.000Z" + }, + "references": [ + { + "name": "controlGroup_bcb81550-0843-44ea-9020-6c1ebf3228ac:optionsListDataView", + "type": "index-pattern", + "id": "a0f483a0-3dc9-11e8-8660-4d65aa086b3c" + }, + { + "name": "controlGroup_15925456-9e12-4b08-b2e6-4ae6ac27114d:rangeSliderDataView", + "type": "index-pattern", + "id": "a0f483a0-3dc9-11e8-8660-4d65aa086b3c" + } + ], + "managed": false, + "coreMigrationVersion": "8.8.0", + "typeMigrationVersion": "10.2.0" +} diff --git a/test/functional/page_objects/console_page.ts b/test/functional/page_objects/console_page.ts index 942f9f998afb9..b96d7ba46b253 100644 --- a/test/functional/page_objects/console_page.ts +++ b/test/functional/page_objects/console_page.ts @@ -553,7 +553,7 @@ export class ConsolePageObject extends FtrService { await this.retry.try(async () => { const firstInnerHtml = await line.getAttribute('innerHTML'); // The line number is not updated immediately after the click, so we need to wait for it. - this.common.sleep(500); + await this.common.sleep(500); line = await editor.findByCssSelector('.ace_active-line'); const secondInnerHtml = await line.getAttribute('innerHTML'); // The line number will change as the user types, but we want to wait until it's stable. @@ -638,11 +638,44 @@ export class ConsolePageObject extends FtrService { return await this.testSubjects.exists('a11y-overlay'); } + public async isCopyAsButtonVisible() { + return await this.testSubjects.exists('consoleMenuCopyAsButton'); + } + public async clickCopyAsCurlButton() { const button = await this.testSubjects.find('consoleMenuCopyAsCurl'); await button.click(); } + public async changeLanguageAndCopy(language: string) { + const openModalButton = await this.testSubjects.find('changeLanguageButton'); + await openModalButton.click(); + + const changeLangButton = await this.testSubjects.find(`languageOption-${language}`); + await changeLangButton.click(); + + const submitButton = await this.testSubjects.find('copyAsLanguageSubmit'); + await submitButton.click(); + } + + public async changeDefaultLanguage(language: string) { + const openModalButton = await this.testSubjects.find('changeLanguageButton'); + await openModalButton.click(); + + const changeDefaultLangButton = await this.testSubjects.find( + `changeDefaultLanguageTo-${language}` + ); + await changeDefaultLangButton.click(); + + const submitButton = await this.testSubjects.find('copyAsLanguageSubmit'); + await submitButton.click(); + } + + public async clickCopyAsButton() { + const button = await this.testSubjects.find('consoleMenuCopyAsButton'); + await button.click(); + } + public async clickOpenDocumentationButton() { const button = await this.testSubjects.find('consoleMenuOpenDocs'); await button.click(); diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index 408054a5c6114..73690a74b0c3d 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -85,7 +85,7 @@ export class DashboardPageObject extends FtrService { } public async expectAppStateRemovedFromURL() { - this.retry.try(async () => { + await this.retry.try(async () => { const url = await this.browser.getCurrentUrl(); expect(url.indexOf('_a')).to.be(-1); }); @@ -453,7 +453,7 @@ export class DashboardPageObject extends FtrService { const edit = editMode ? `?_a=(viewMode:edit)` : ''; dashboardLocation = `/view/${id}${edit}`; } - this.common.navigateToActualUrl('dashboard', dashboardLocation, args); + await this.common.navigateToActualUrl('dashboard', dashboardLocation, args); } public async gotoDashboardListingURL({ diff --git a/test/functional/page_objects/dashboard_page_controls.ts b/test/functional/page_objects/dashboard_page_controls.ts index c57539ba2079b..a3573438124e5 100644 --- a/test/functional/page_objects/dashboard_page_controls.ts +++ b/test/functional/page_objects/dashboard_page_controls.ts @@ -638,7 +638,7 @@ export class DashboardPageControls extends FtrService { selectedType?: string; }) { this.log.debug(`Verifying that control types match what is expected for the selected field`); - asyncForEach(supportedTypes, async (type) => { + await asyncForEach(supportedTypes, async (type) => { const controlTypeItem = await this.testSubjects.find(`create__${type}`); expect(await controlTypeItem.isEnabled()).to.be(true); if (type === selectedType) { diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 3d364d9ff2c3e..066040c9ca727 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -413,7 +413,7 @@ export class DiscoverPageObject extends FtrService { // add the focus to the button to make it appear const skipButton = await this.testSubjects.find('discoverSkipTableButton'); // force focus on it, to make it interactable - skipButton.focus(); + await skipButton.focus(); // now click it! return skipButton.click(); } @@ -521,8 +521,8 @@ export class DiscoverPageObject extends FtrService { return await this.testSubjects.exists('discoverNoResultsTimefilter'); } - public showsErrorCallout() { - this.retry.try(async () => { + public async showsErrorCallout() { + await this.retry.try(async () => { await this.testSubjects.existOrFail('discoverErrorCalloutTitle'); }); } diff --git a/test/functional/page_objects/embedded_console.ts b/test/functional/page_objects/embedded_console.ts new file mode 100644 index 0000000000000..3f656969e79e2 --- /dev/null +++ b/test/functional/page_objects/embedded_console.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 type { FtrProviderContext } from '../ftr_provider_context'; + +export function EmbeddedConsoleProvider(ctx: FtrProviderContext) { + const testSubjects = ctx.getService('testSubjects'); + + return { + async expectEmbeddedConsoleControlBarExists() { + await testSubjects.existOrFail('consoleEmbeddedSection'); + }, + async expectEmbeddedConsoleToBeOpen() { + await testSubjects.existOrFail('consoleEmbeddedBody'); + }, + async expectEmbeddedConsoleToBeClosed() { + await testSubjects.missingOrFail('consoleEmbeddedBody'); + }, + async clickEmbeddedConsoleControlBar() { + await testSubjects.click('consoleEmbeddedControlBar'); + }, + async expectEmbeddedConsoleNotebooksButtonExists() { + await testSubjects.existOrFail('consoleEmbeddedNotebooksButton'); + }, + async clickEmbeddedConsoleNotebooksButton() { + await testSubjects.click('consoleEmbeddedNotebooksButton'); + }, + async expectEmbeddedConsoleNotebooksToBeOpen() { + await testSubjects.existOrFail('consoleEmbeddedNotebooksContainer'); + }, + async expectEmbeddedConsoleNotebooksToBeClosed() { + await testSubjects.missingOrFail('consoleEmbeddedNotebooksContainer'); + }, + async expectEmbeddedConsoleNotebookListItemToBeAvailable(id: string) { + await testSubjects.existOrFail(`console-embedded-notebook-select-btn-${id}`); + }, + async clickEmbeddedConsoleNotebook(id: string) { + await testSubjects.click(`console-embedded-notebook-select-btn-${id}`); + }, + async expectEmbeddedConsoleNotebookToBeAvailable(id: string) { + await testSubjects.click(`console-embedded-notebook-select-btn-${id}`); + }, + }; +} diff --git a/test/functional/page_objects/index.ts b/test/functional/page_objects/index.ts index 34859cfe943d3..00947dfc33695 100644 --- a/test/functional/page_objects/index.ts +++ b/test/functional/page_objects/index.ts @@ -36,6 +36,8 @@ import { UnifiedSearchPageObject } from './unified_search_page'; import { UnifiedFieldListPageObject } from './unified_field_list'; import { FilesManagementPageObject } from './files_management'; import { AnnotationEditorPageObject } from './annotation_library_editor_page'; +import { SolutionNavigationProvider } from './solution_navigation'; +import { EmbeddedConsoleProvider } from './embedded_console'; export const pageObjects = { annotationEditor: AnnotationEditorPageObject, @@ -46,12 +48,14 @@ export const pageObjects = { dashboardControls: DashboardPageControls, dashboardLinks: DashboardPageLinks, discover: DiscoverPageObject, + embeddedConsole: EmbeddedConsoleProvider, error: ErrorPageObject, header: HeaderPageObject, home: HomePageObject, newsfeed: NewsfeedPageObject, settings: SettingsPageObject, share: SharePageObject, + solutionNavigation: SolutionNavigationProvider, legacyDataTableVis: LegacyDataTableVisPageObject, login: LoginPageObject, timelion: TimelionPageObject, @@ -69,3 +73,5 @@ export const pageObjects = { unifiedFieldList: UnifiedFieldListPageObject, filesManagement: FilesManagementPageObject, }; + +export { SolutionNavigationProvider } from './solution_navigation'; diff --git a/test/functional/page_objects/solution_navigation.ts b/test/functional/page_objects/solution_navigation.ts new file mode 100644 index 0000000000000..d42cad60641e9 --- /dev/null +++ b/test/functional/page_objects/solution_navigation.ts @@ -0,0 +1,338 @@ +/* + * 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 expect from '@kbn/expect'; +import type { AppDeepLinkId } from '@kbn/core-chrome-browser'; + +import type { NavigationID as MlNavId } from '@kbn/default-nav-ml'; +import type { NavigationID as AlNavId } from '@kbn/default-nav-analytics'; +import type { NavigationID as MgmtNavId } from '@kbn/default-nav-management'; +import type { NavigationID as DevNavId } from '@kbn/default-nav-devtools'; + +// use this for nicer type suggestions, but allow any string anyway +type NavigationId = MlNavId | AlNavId | MgmtNavId | DevNavId | string; + +import type { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; +import type { FtrProviderContext } from '../ftr_provider_context'; + +const getSectionIdTestSubj = (sectionId: NavigationId) => `~nav-item-${sectionId}`; + +const TIMEOUT_CHECK = 3000; + +export function SolutionNavigationProvider(ctx: Pick) { + const testSubjects = ctx.getService('testSubjects'); + const browser = ctx.getService('browser'); + const retry = ctx.getService('retry'); + const log = ctx.getService('log'); + + async function getByVisibleText( + selector: string | (() => Promise), + text: string + ) { + const subjects = + typeof selector === 'string' ? await testSubjects.findAll(selector) : await selector(); + let found: WebElementWrapper | null = null; + for (const subject of subjects) { + const visibleText = await subject.getVisibleText(); + if (visibleText === text) { + found = subject; + break; + } + } + return found; + } + + return { + // check that chrome ui is in project/solution mode + async expectExists() { + await testSubjects.existOrFail('kibanaProjectHeader'); + }, + async clickLogo() { + await testSubjects.click('nav-header-logo'); + }, + // side nav related actions + sidenav: { + async expectLinkExists( + by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string } + ) { + if ('deepLinkId' in by) { + await testSubjects.existOrFail(`~nav-item-deepLinkId-${by.deepLinkId}`, { + timeout: TIMEOUT_CHECK, + }); + } else if ('navId' in by) { + await testSubjects.existOrFail(`~nav-item-id-${by.navId}`, { timeout: TIMEOUT_CHECK }); + } else { + expect(await getByVisibleText('~nav-item', by.text)).not.be(null); + } + }, + async expectLinkMissing( + by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string } + ) { + if ('deepLinkId' in by) { + await testSubjects.missingOrFail(`~nav-item-deepLinkId-${by.deepLinkId}`, { + timeout: TIMEOUT_CHECK, + }); + } else if ('navId' in by) { + await testSubjects.missingOrFail(`~nav-item-id-${by.navId}`, { timeout: TIMEOUT_CHECK }); + } else { + expect(await getByVisibleText('~nav-item', by.text)).be(null); + } + }, + async expectLinkActive( + by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string } + ) { + await this.expectLinkExists(by); + if ('deepLinkId' in by) { + await testSubjects.existOrFail( + `~nav-item-deepLinkId-${by.deepLinkId} & ~nav-item-isActive`, + { timeout: TIMEOUT_CHECK } + ); + } else if ('navId' in by) { + await testSubjects.existOrFail(`~nav-item-id-${by.navId} & ~nav-item-isActive`, { + timeout: TIMEOUT_CHECK, + }); + } else { + await retry.try(async () => { + const link = await getByVisibleText('~nav-item', by.text); + expect(await link!.elementHasClass(`nav-item-isActive`)).to.be(true); + }); + } + }, + async clickLink(by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string }) { + await this.expectLinkExists(by); + if ('deepLinkId' in by) { + await testSubjects.click(`~nav-item-deepLinkId-${by.deepLinkId}`); + } else if ('navId' in by) { + await testSubjects.click(`~nav-item-id-${by.navId}`); + } else { + await retry.try(async () => { + const link = await getByVisibleText('~nav-item', by.text); + await link!.click(); + }); + } + }, + async findLink(by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string }) { + await this.expectLinkExists(by); + if ('deepLinkId' in by) { + return testSubjects.find(`~nav-item-deepLinkId-${by.deepLinkId}`); + } else if ('navId' in by) { + return testSubjects.find(`~nav-item-id-${by.navId}`); + } else { + return retry.try(async () => { + const link = await getByVisibleText('~nav-item', by.text); + return link; + }); + } + }, + async expectSectionExists(sectionId: NavigationId) { + log.debug('SolutionNavigation.sidenav.expectSectionExists', sectionId); + await testSubjects.existOrFail(getSectionIdTestSubj(sectionId), { timeout: TIMEOUT_CHECK }); + }, + async isSectionOpen(sectionId: NavigationId) { + await this.expectSectionExists(sectionId); + const collapseBtn = await testSubjects.find(`~accordionArrow-${sectionId}`); + const isExpanded = await collapseBtn.getAttribute('aria-expanded'); + return isExpanded === 'true'; + }, + async expectSectionOpen(sectionId: NavigationId) { + log.debug('SolutionNavigation.sidenav.expectSectionOpen', sectionId); + await this.expectSectionExists(sectionId); + await retry.waitFor(`section ${sectionId} to be open`, async () => { + const isOpen = await this.isSectionOpen(sectionId); + return isOpen; + }); + }, + async expectSectionClosed(sectionId: NavigationId) { + await this.expectSectionExists(sectionId); + await retry.waitFor(`section ${sectionId} to be closed`, async () => { + const isOpen = await this.isSectionOpen(sectionId); + return !isOpen; + }); + }, + async openSection(sectionId: NavigationId) { + log.debug('SolutionNavigation.sidenav.openSection', sectionId); + await this.expectSectionExists(sectionId); + const isOpen = await this.isSectionOpen(sectionId); + if (isOpen) return; + const collapseBtn = await testSubjects.find(`~accordionArrow-${sectionId}`, TIMEOUT_CHECK); + await collapseBtn.click(); + await this.expectSectionOpen(sectionId); + }, + async closeSection(sectionId: NavigationId) { + await this.expectSectionExists(sectionId); + const isOpen = await this.isSectionOpen(sectionId); + if (!isOpen) return; + const collapseBtn = await testSubjects.find(`~accordionArrow-${sectionId}`, TIMEOUT_CHECK); + await collapseBtn.click(); + await this.expectSectionClosed(sectionId); + }, + async expectPanelExists(sectionId: NavigationId) { + log.debug('SolutionNavigation.sidenav.expectPanelExists', sectionId); + await testSubjects.existOrFail(`~sideNavPanel-id-${sectionId}`, { + timeout: TIMEOUT_CHECK, + }); + }, + async isPanelOpen(sectionId: NavigationId) { + try { + const panel = await testSubjects.find(`~sideNavPanel-id-${sectionId}`, TIMEOUT_CHECK); + return !!panel; + } catch (err) { + return false; + } + }, + async openPanel(sectionId: NavigationId) { + log.debug('SolutionNavigation.sidenav.openPanel', sectionId); + + const isOpen = await this.isPanelOpen(sectionId); + if (isOpen) return; + + const panelOpenerBtn = await testSubjects.find( + `~panelOpener-id-${sectionId}`, + TIMEOUT_CHECK + ); + + await panelOpenerBtn.click(); + }, + async isCollapsed() { + const collapseNavBtn = await testSubjects.find('euiCollapsibleNavButton', TIMEOUT_CHECK); + return (await collapseNavBtn.getAttribute('aria-expanded')) === 'false'; + }, + async isExpanded() { + return !(await this.isCollapsed()); + }, + /** + * Toggles collapsed state of sidenav + */ + async toggle(collapsed?: boolean) { + const currentlyCollapsed = await this.isCollapsed(); + const shouldBeCollapsed = collapsed ?? !currentlyCollapsed; + + if (currentlyCollapsed !== shouldBeCollapsed) { + log.debug( + 'SolutionNavigation.sidenav.toggle', + shouldBeCollapsed ? 'Collapsing' : 'Expanding' + ); + + const collapseNavBtn = await testSubjects.find('euiCollapsibleNavButton', TIMEOUT_CHECK); + await collapseNavBtn.click(); + } + }, + }, + breadcrumbs: { + async expectExists() { + await testSubjects.existOrFail('breadcrumbs', { timeout: TIMEOUT_CHECK }); + }, + async clickBreadcrumb(by: { deepLinkId: AppDeepLinkId } | { text: string }) { + if ('deepLinkId' in by) { + await testSubjects.click(`~breadcrumb-deepLinkId-${by.deepLinkId}`); + } else { + await (await getByVisibleText('~breadcrumb', by.text))?.click(); + } + }, + getBreadcrumb(by: { deepLinkId: AppDeepLinkId } | { text: string }) { + if ('deepLinkId' in by) { + return testSubjects.find(`~breadcrumb-deepLinkId-${by.deepLinkId}`, TIMEOUT_CHECK); + } else { + return getByVisibleText('~breadcrumb', by.text); + } + }, + async expectBreadcrumbExists(by: { deepLinkId: AppDeepLinkId } | { text: string }) { + log.debug('SolutionNavigation.breadcrumbs.expectBreadcrumbExists', JSON.stringify(by)); + if ('deepLinkId' in by) { + await testSubjects.existOrFail(`~breadcrumb-deepLinkId-${by.deepLinkId}`, { + timeout: TIMEOUT_CHECK, + }); + } else { + await retry.try(async () => { + expect(await getByVisibleText('~breadcrumb', by.text)).not.be(null); + }); + } + }, + async expectBreadcrumbMissing(by: { deepLinkId: AppDeepLinkId } | { text: string }) { + if ('deepLinkId' in by) { + await testSubjects.missingOrFail(`~breadcrumb-deepLinkId-${by.deepLinkId}`, { + timeout: TIMEOUT_CHECK, + }); + } else { + await retry.try(async () => { + expect(await getByVisibleText('~breadcrumb', by.text)).be(null); + }); + } + }, + async expectBreadcrumbTexts(expectedBreadcrumbTexts: string[]) { + log.debug( + 'SolutionNavigation.breadcrumbs.expectBreadcrumbTexts', + JSON.stringify(expectedBreadcrumbTexts) + ); + await retry.try(async () => { + const breadcrumbsContainer = await testSubjects.find('breadcrumbs', TIMEOUT_CHECK); + const breadcrumbs = await breadcrumbsContainer.findAllByTestSubject('~breadcrumb'); + breadcrumbs.shift(); // remove home + expect(expectedBreadcrumbTexts.length).to.eql(breadcrumbs.length); + const texts = await Promise.all(breadcrumbs.map((b) => b.getVisibleText())); + expect(expectedBreadcrumbTexts).to.eql(texts); + }); + }, + }, + recent: { + async expectExists() { + await testSubjects.existOrFail('nav-item-recentlyAccessed', { timeout: TIMEOUT_CHECK }); + }, + async expectHidden() { + await testSubjects.missingOrFail('nav-item-recentlyAccessed', { timeout: TIMEOUT_CHECK }); + }, + async expectLinkExists(text: string) { + await this.expectExists(); + let foundLink: WebElementWrapper | null = null; + await retry.try(async () => { + foundLink = await getByVisibleText( + async () => + ( + await testSubjects.find('nav-item-recentlyAccessed', TIMEOUT_CHECK) + ).findAllByTagName('a'), + text + ); + expect(!!foundLink).to.be(true); + }); + + return foundLink!; + }, + async clickLink(text: string) { + const link = await this.expectLinkExists(text); + await link!.click(); + }, + }, + + // helper to assert that the page did not reload + async createNoPageReloadCheck() { + const trackReloadTs = Date.now(); + await browser.execute( + ({ ts }) => { + // @ts-ignore + window.__testTrackReload__ = ts; + }, + { + ts: trackReloadTs, + } + ); + + return async () => { + const noReload = await browser.execute( + ({ ts }) => { + // @ts-ignore + return window.__testTrackReload__ && window.__testTrackReload__ === ts; + }, + { + ts: trackReloadTs, + } + ); + expect(noReload).to.be(true); + }; + }, + }; +} diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index 3da12ca470fe3..c2bf40b6c9042 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -68,7 +68,7 @@ export class VisualBuilderPageObject extends FtrService { private async toggleYesNoSwitch(testSubj: string, value: boolean) { const option = await this.testSubjects.find(`${testSubj}-${value ? 'yes' : 'no'}`); - (await option.findByCssSelector('label')).click(); + await (await option.findByCssSelector('label')).click(); await this.header.waitUntilLoadingHasFinished(); } @@ -577,7 +577,7 @@ export class VisualBuilderPageObject extends FtrService { if (useKibanaIndices === false) { const el = await this.testSubjects.find(metricsIndexPatternInput); - el.focus(); + await el.focus(); await el.clearValue(); if (value) { await el.type(value, { charByChar: true }); diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index f8c48cb3af437..e943ebda715f6 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -287,7 +287,7 @@ export class VisualizeChartPageObject extends FtrService { const legendItemColor = await chart.findByCssSelector( `[data-ech-series-name="${name}"] .echLegendItem__color` ); - legendItemColor.click(); + await legendItemColor.click(); await this.waitForVisualizationRenderingStabilized(); // arbitrary color chosen, any available would do @@ -307,7 +307,7 @@ export class VisualizeChartPageObject extends FtrService { const legendItemColor = await chart.findByCssSelector( `[data-ech-series-name="${name}"] .echLegendItem__color` ); - legendItemColor.click(); + await legendItemColor.click(); } else { // This click has been flaky in opening the legend, hence the this.retry. See // https://github.com/elastic/kibana/issues/17468 @@ -333,7 +333,7 @@ export class VisualizeChartPageObject extends FtrService { cell ); await this.common.sleep(2000); - filterBtn.click(); + await filterBtn.click(); }); } diff --git a/test/functional/page_objects/visualize_editor_page.ts b/test/functional/page_objects/visualize_editor_page.ts index f6f4f121ad11a..ef1f074f82611 100644 --- a/test/functional/page_objects/visualize_editor_page.ts +++ b/test/functional/page_objects/visualize_editor_page.ts @@ -68,6 +68,8 @@ export class VisualizeEditorPageObject extends FtrService { await this.elasticChart.setNewChartUiDebugFlag(); } + await this.common.sleep(500); // wait for the visualization to render + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); this.log.debug(`Before Rendering count ${prevRenderingCount}`); await this.testSubjects.clickWhenNotDisabledWithoutRetry('visualizeEditorRenderButton'); @@ -278,7 +280,7 @@ export class VisualizeEditorPageObject extends FtrService { public async setCustomLabel(label: string, index: number | string = 1) { const customLabel = await this.testSubjects.find(`visEditorStringInput${index}customLabel`); - customLabel.type(label); + await customLabel.type(label); } public async selectYAxisAggregation(agg: string, field: string, label: string, index = 1) { diff --git a/test/functional/screenshots/baseline/dashboard_embed_mode_scrolling.png b/test/functional/screenshots/baseline/dashboard_embed_mode_scrolling.png index 94de1a1c3cc4f..2f5e437ade253 100644 Binary files a/test/functional/screenshots/baseline/dashboard_embed_mode_scrolling.png and b/test/functional/screenshots/baseline/dashboard_embed_mode_scrolling.png differ diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index 476ffb49f13ee..6e3deae8fae32 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -284,11 +284,11 @@ export class DashboardExpectService extends FtrService { } async savedSearchRowsExist() { - this.testSubjects.existOrFail('docTableExpandToggleColumn'); + await this.testSubjects.existOrFail('docTableExpandToggleColumn'); } async savedSearchRowsMissing() { - this.testSubjects.missingOrFail('docTableExpandToggleColumn'); + await this.testSubjects.missingOrFail('docTableExpandToggleColumn'); } async dataTableRowCount(expectedCount: number) { diff --git a/test/functional/services/dashboard/panel_actions.ts b/test/functional/services/dashboard/panel_actions.ts index 3e63d526760ef..ef8ca6eaa759a 100644 --- a/test/functional/services/dashboard/panel_actions.ts +++ b/test/functional/services/dashboard/panel_actions.ts @@ -13,7 +13,6 @@ const REMOVE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-deletePanel'; const EDIT_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-editPanel'; const INLINE_EDIT_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-ACTION_CONFIGURE_IN_LENS'; const EDIT_IN_LENS_EDITOR_DATA_TEST_SUBJ = 'navigateToLensEditorLink'; -const REPLACE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-replacePanel'; const CLONE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-clonePanel'; const TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-togglePanel'; const CUSTOMIZE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-ACTION_CUSTOMIZE_PANEL'; @@ -32,6 +31,7 @@ export class DashboardPanelActionsService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); private readonly browser = this.ctx.getService('browser'); + private readonly find = this.ctx.getService('find'); private readonly inspector = this.ctx.getService('inspector'); private readonly testSubjects = this.ctx.getService('testSubjects'); @@ -62,6 +62,12 @@ export class DashboardPanelActionsService extends FtrService { await toggleMenuItem.click(DASHBOARD_TOP_OFFSET); } + async toggleContextMenuByTitle(title = '') { + this.log.debug(`toggleContextMenu(${title})`); + const header = await this.getPanelHeading(title); + await this.toggleContextMenu(header); + } + async expectContextMenuToBeOpen() { this.log.debug('expectContextMenuToBeOpen'); await this.testSubjects.existOrFail('embeddablePanelContextMenuOpen'); @@ -69,11 +75,19 @@ export class DashboardPanelActionsService extends FtrService { async openContextMenu(parent?: WebElementWrapper) { this.log.debug(`openContextMenu(${parent}`); - await this.toggleContextMenu(parent); + const open = await this.testSubjects.exists('embeddablePanelContextMenuOpen'); + if (!open) await this.toggleContextMenu(parent); await this.expectContextMenuToBeOpen(); } + async openContextMenuByTitle(title = '') { + this.log.debug(`openContextMenuByTitle(${title})`); + const header = await this.getPanelHeading(title); + await this.openContextMenu(header); + } + async hasContextMenuMoreItem() { + this.log.debug('hasContextMenuMoreItem'); return await this.testSubjects.exists('embeddablePanelMore-mainMenu'); } @@ -87,21 +101,30 @@ export class DashboardPanelActionsService extends FtrService { } async openContextMenuMorePanel(parent?: WebElementWrapper) { + this.log.debug('openContextMenuMorePanel'); await this.openContextMenu(parent); await this.clickContextMenuMoreItem(); } - async clickContextMenuItem(itemSelector: string, parent?: WebElementWrapper) { + async clickContextMenuItem(testSubject: string, parent?: WebElementWrapper) { + this.log.debug(`clickContextMenuItem`); await this.openContextMenu(parent); - const exists = await this.testSubjects.exists(itemSelector); + const exists = await this.testSubjects.exists(testSubject); if (!exists) { await this.clickContextMenuMoreItem(); } - await this.testSubjects.click(itemSelector); + await this.testSubjects.click(testSubject); + } + + async clickContextMenuItemByTitle(testSubject: string, title = '') { + this.log.debug(`openContextMenuByTitle(${title})`); + const header = await this.getPanelHeading(title); + await this.clickContextMenuItem(testSubject, header); } async navigateToEditorFromFlyout() { - await this.testSubjects.clickWhenNotDisabledWithoutRetry(INLINE_EDIT_PANEL_DATA_TEST_SUBJ); + this.log.debug('navigateToEditorFromFlyout'); + await this.clickContextMenuItem(INLINE_EDIT_PANEL_DATA_TEST_SUBJ); await this.header.waitUntilLoadingHasFinished(); await this.testSubjects.click(EDIT_IN_LENS_EDITOR_DATA_TEST_SUBJ); const isConfirmModalVisible = await this.testSubjects.exists('confirmModalConfirmButton'); @@ -112,12 +135,7 @@ export class DashboardPanelActionsService extends FtrService { async clickInlineEdit() { this.log.debug('clickInlineEditAction'); - await this.expectContextMenuToBeOpen(); - const isInlineEditingActionVisible = await this.testSubjects.exists( - INLINE_EDIT_PANEL_DATA_TEST_SUBJ - ); - if (!isInlineEditingActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.clickWhenNotDisabledWithoutRetry(INLINE_EDIT_PANEL_DATA_TEST_SUBJ); + await this.clickContextMenuItem(INLINE_EDIT_PANEL_DATA_TEST_SUBJ); await this.header.waitUntilLoadingHasFinished(); await this.common.waitForTopNavToBeVisible(); } @@ -126,9 +144,9 @@ export class DashboardPanelActionsService extends FtrService { * The dashboard/canvas panels can be either edited on their editor or inline. * The inline editing panels allow the navigation to the editor after the flyout opens */ - async clickEdit() { + async clickEdit(parent?: WebElementWrapper) { this.log.debug('clickEdit'); - await this.expectContextMenuToBeOpen(); + await this.openContextMenu(parent); const isActionVisible = await this.testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ); const isInlineEditingActionVisible = await this.testSubjects.exists( INLINE_EDIT_PANEL_DATA_TEST_SUBJ @@ -149,40 +167,26 @@ export class DashboardPanelActionsService extends FtrService { * The dashboard/canvas panels can be either edited on their editor or inline. * The inline editing panels allow the navigation to the editor after the flyout opens */ - async editPanelByTitle(title?: string) { + async editPanelByTitle(title = '') { this.log.debug(`editPanelByTitle(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - if (await this.testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ)) { - await this.testSubjects.clickWhenNotDisabledWithoutRetry(EDIT_PANEL_DATA_TEST_SUBJ); - } else { - await this.navigateToEditorFromFlyout(); - } + const header = await this.getPanelHeading(title); + await this.clickEdit(header); } async clickExpandPanelToggle() { this.log.debug(`clickExpandPanelToggle`); - await this.expectContextMenuToBeOpen(); - const isActionVisible = await this.testSubjects.exists(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.click(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); + await this.openContextMenu(); + await this.clickContextMenuItem(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); } async removePanel(parent?: WebElementWrapper) { this.log.debug('removePanel'); await this.openContextMenu(parent); - const isActionVisible = await this.testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - const isPanelActionVisible = await this.testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); - if (!isPanelActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.click(REMOVE_PANEL_DATA_TEST_SUBJ); + await this.clickContextMenuItem(REMOVE_PANEL_DATA_TEST_SUBJ, parent); } - async removePanelByTitle(title: string) { + async removePanelByTitle(title = '') { + this.log.debug(`removePanel(${title})`); const header = await this.getPanelHeading(title); this.log.debug('found header? ', Boolean(header)); await this.removePanel(header); @@ -190,62 +194,36 @@ export class DashboardPanelActionsService extends FtrService { async customizePanel(parent?: WebElementWrapper) { this.log.debug('customizePanel'); - await this.openContextMenu(parent); - const isActionVisible = await this.testSubjects.exists(CUSTOMIZE_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - const isPanelActionVisible = await this.testSubjects.exists(CUSTOMIZE_PANEL_DATA_TEST_SUBJ); - if (!isPanelActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.click(CUSTOMIZE_PANEL_DATA_TEST_SUBJ); + await this.clickContextMenuItem(CUSTOMIZE_PANEL_DATA_TEST_SUBJ, parent); } - async replacePanelByTitle(title?: string) { - this.log.debug(`replacePanel(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - const actionExists = await this.testSubjects.exists(REPLACE_PANEL_DATA_TEST_SUBJ); - if (!actionExists) { - await this.clickContextMenuMoreItem(); - } - await this.testSubjects.click(REPLACE_PANEL_DATA_TEST_SUBJ); + async customizePanelByTitle(title = '') { + this.log.debug('customizePanel'); + const header = await this.getPanelHeading(title); + await this.clickContextMenuItem(CUSTOMIZE_PANEL_DATA_TEST_SUBJ, header); } - async clonePanelByTitle(title?: string) { + async clonePanelByTitle(title = '') { this.log.debug(`clonePanel(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - const isActionVisible = await this.testSubjects.exists(CLONE_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); + const header = await this.getPanelHeading(title); + await this.clickContextMenuItem(CLONE_PANEL_DATA_TEST_SUBJ, header); await this.dashboard.waitForRenderComplete(); } - async openCopyToModalByTitle(title?: string) { + async openCopyToModalByTitle(title = '') { this.log.debug(`copyPanelTo(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - const isActionVisible = await this.testSubjects.exists(COPY_PANEL_TO_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await this.testSubjects.click(COPY_PANEL_TO_DATA_TEST_SUBJ); + const header = await this.getPanelHeading(title); + await this.clickContextMenuItem(COPY_PANEL_TO_DATA_TEST_SUBJ, header); } async openInspectorByTitle(title: string) { + this.log.debug(`openInspector(${title})`); const header = await this.getPanelHeading(title); await this.openInspector(header); } async getSearchSessionIdByTitle(title: string) { + this.log.debug(`getSearchSessionId(${title})`); await this.openInspectorByTitle(title); await this.inspector.openInspectorRequestsView(); const searchSessionId = await ( @@ -256,6 +234,7 @@ export class DashboardPanelActionsService extends FtrService { } async getSearchResponseByTitle(title: string) { + this.log.debug(`setSearchResponse(${title})`); await this.openInspectorByTitle(title); await this.inspector.openInspectorRequestsView(); const response = await this.inspector.getResponse(); @@ -264,6 +243,7 @@ export class DashboardPanelActionsService extends FtrService { } async openInspector(parent?: WebElementWrapper) { + this.log.debug(`openInspector`); await this.clickContextMenuItem(OPEN_INSPECTOR_TEST_SUBJ, parent); } @@ -311,12 +291,11 @@ export class DashboardPanelActionsService extends FtrService { }); } - async expectExistsPanelAction(testSubject: string, title?: string) { - this.log.debug('expectExistsPanelAction', testSubject); + async expectExistsPanelAction(testSubject: string, title = '') { + this.log.debug('expectExistsPanelAction', testSubject, title); const panelWrapper = title ? await this.getPanelHeading(title) : undefined; await this.openContextMenu(panelWrapper); - if (!(await this.testSubjects.exists(testSubject))) { if (await this.hasContextMenuMoreItem()) { await this.clickContextMenuMoreItem(); @@ -326,12 +305,12 @@ export class DashboardPanelActionsService extends FtrService { await this.toggleContextMenu(panelWrapper); } - async expectExistsRemovePanelAction() { + async expectExistsRemovePanelAction(title = '') { this.log.debug('expectExistsRemovePanelAction'); - await this.expectExistsPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); + await this.expectExistsPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ, title); } - async expectExistsEditPanelAction(title?: string, allowsInlineEditing?: boolean) { + async expectExistsEditPanelAction(title = '', allowsInlineEditing?: boolean) { this.log.debug('expectExistsEditPanelAction'); let testSubj = EDIT_PANEL_DATA_TEST_SUBJ; if (allowsInlineEditing) { @@ -340,43 +319,45 @@ export class DashboardPanelActionsService extends FtrService { await this.expectExistsPanelAction(testSubj, title); } - async expectExistsClonePanelAction() { + async expectExistsClonePanelAction(title = '') { this.log.debug('expectExistsClonePanelAction'); - await this.expectExistsPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); + await this.expectExistsPanelAction(CLONE_PANEL_DATA_TEST_SUBJ, title); } - async expectExistsToggleExpandAction() { + async expectExistsToggleExpandAction(title = '') { this.log.debug('expectExistsToggleExpandAction'); - await this.expectExistsPanelAction(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); + await this.expectExistsPanelAction(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ, title); } - async expectMissingPanelAction(testSubject: string) { - this.log.debug('expectMissingPanelAction', testSubject); - await this.openContextMenu(); + async expectMissingPanelAction(testSubject: string, title = '') { + this.log.debug('expectMissingPanelAction', testSubject, title); + await this.openContextMenuByTitle(title); await this.testSubjects.missingOrFail(testSubject); if (await this.hasContextMenuMoreItem()) { await this.clickContextMenuMoreItem(); await this.testSubjects.missingOrFail(testSubject); } - await this.toggleContextMenu(); + await this.toggleContextMenuByTitle(title); } - async expectMissingEditPanelAction() { + async expectMissingEditPanelAction(title = '') { this.log.debug('expectMissingEditPanelAction'); - await this.expectMissingPanelAction(EDIT_PANEL_DATA_TEST_SUBJ); + await this.expectMissingPanelAction(EDIT_PANEL_DATA_TEST_SUBJ, title); } - async expectMissingDuplicatePanelAction() { + async expectMissingDuplicatePanelAction(title = '') { this.log.debug('expectMissingDuplicatePanelAction'); - await this.expectMissingPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); + await this.expectMissingPanelAction(CLONE_PANEL_DATA_TEST_SUBJ, title); } - async expectMissingRemovePanelAction() { + async expectMissingRemovePanelAction(title = '') { this.log.debug('expectMissingRemovePanelAction'); - await this.expectMissingPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); + await this.expectMissingPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ, title); } - async getPanelHeading(title: string) { + async getPanelHeading(title = '') { + this.log.debug(`getPanelHeading(${title})`); + if (!title) return await this.find.byClassName('embPanel__header'); return await this.testSubjects.find(`embeddablePanelHeading-${title.replace(/\s/g, '')}`); } @@ -399,11 +380,15 @@ export class DashboardPanelActionsService extends FtrService { await this.openContextMenu(parent); const isActionVisible = await this.testSubjects.exists(CONVERT_TO_LENS_TEST_SUBJ); if (!isActionVisible) await this.clickContextMenuMoreItem(); - const isPanelActionVisible = await this.testSubjects.exists(CONVERT_TO_LENS_TEST_SUBJ); - if (!isPanelActionVisible) await this.clickContextMenuMoreItem(); return await this.testSubjects.exists(CONVERT_TO_LENS_TEST_SUBJ, { timeout: 500 }); } + async canConvertToLensByTitle(title = '') { + this.log.debug(`canConvertToLens(${title})`); + const header = await this.getPanelHeading(title); + return await this.canConvertToLens(header); + } + async convertToLens(parent?: WebElementWrapper) { this.log.debug('convertToLens'); @@ -415,4 +400,10 @@ export class DashboardPanelActionsService extends FtrService { await this.testSubjects.click(CONVERT_TO_LENS_TEST_SUBJ); }); } + + async convertToLensByTitle(title = '') { + this.log.debug(`convertToLens(${title})`); + const header = await this.getPanelHeading(title); + return await this.convertToLens(header); + } } diff --git a/test/functional/services/dashboard/panel_drilldown_actions.ts b/test/functional/services/dashboard/panel_drilldown_actions.ts index 57fc42f323fbe..1374890fe97c4 100644 --- a/test/functional/services/dashboard/panel_drilldown_actions.ts +++ b/test/functional/services/dashboard/panel_drilldown_actions.ts @@ -15,31 +15,44 @@ const MANAGE_DRILLDOWNS_DATA_TEST_SUBJ = 'embeddablePanelAction-OPEN_FLYOUT_EDIT export function DashboardDrilldownPanelActionsProvider({ getService }: FtrProviderContext) { const log = getService('log'); const testSubjects = getService('testSubjects'); + const dashboardPanelActions = getService('dashboardPanelActions'); return new (class DashboardDrilldownPanelActions { async expectExistsCreateDrilldownAction() { log.debug('expectExistsCreateDrilldownAction'); - await testSubjects.existOrFail(CREATE_DRILLDOWN_DATA_TEST_SUBJ); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.expectContextMenuToBeOpen(); + await dashboardPanelActions.clickContextMenuMoreItem(); + await await testSubjects.existOrFail(CREATE_DRILLDOWN_DATA_TEST_SUBJ); } async expectMissingCreateDrilldownAction() { log.debug('expectMissingCreateDrilldownAction'); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.expectContextMenuToBeOpen(); + await dashboardPanelActions.clickContextMenuMoreItem(); await testSubjects.existOrFail(MANAGE_DRILLDOWNS_DATA_TEST_SUBJ); } async clickCreateDrilldown() { log.debug('clickCreateDrilldown'); await this.expectExistsCreateDrilldownAction(); - await testSubjects.clickWhenNotDisabledWithoutRetry(CREATE_DRILLDOWN_DATA_TEST_SUBJ); + await dashboardPanelActions.clickContextMenuItem(CREATE_DRILLDOWN_DATA_TEST_SUBJ); } async expectExistsManageDrilldownsAction() { log.debug('expectExistsCreateDrilldownAction'); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.expectContextMenuToBeOpen(); + await dashboardPanelActions.clickContextMenuMoreItem(); await testSubjects.existOrFail(CREATE_DRILLDOWN_DATA_TEST_SUBJ); } async expectMissingManageDrilldownsAction() { log.debug('expectExistsRemovePanelAction'); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.expectContextMenuToBeOpen(); + await dashboardPanelActions.clickContextMenuMoreItem(); await testSubjects.existOrFail(MANAGE_DRILLDOWNS_DATA_TEST_SUBJ); } @@ -56,7 +69,7 @@ export function DashboardDrilldownPanelActionsProvider({ getService }: FtrProvid async clickActionByText(text: string) { log.debug(`clickActionByText: "${text}"`); - (await this.getActionWebElementByText(text)).click(); + await (await this.getActionWebElementByText(text)).click(); } async getActionHrefByText(text: string) { @@ -67,7 +80,7 @@ export function DashboardDrilldownPanelActionsProvider({ getService }: FtrProvid async openHrefByText(text: string) { log.debug(`openHref: "${text}"`); - (await this.getActionWebElementByText(text)).openHref(); + await (await this.getActionWebElementByText(text)).openHref(); } async getActionWebElementByText(text: string): Promise { diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index 70a67d33ffd00..207bd808d8ebb 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -27,6 +27,7 @@ export class DataGridService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); async getDataGridTableData(): Promise { const table = await this.find.byCssSelector('.euiDataGrid'); @@ -82,6 +83,20 @@ export class DataGridService extends FtrService { .map((cell) => $(cell).text()); } + public getHeaderElement(field: string) { + return this.testSubjects.find(`dataGridHeaderCell-${field}`); + } + + public async resizeColumn(field: string, delta: number) { + const header = await this.getHeaderElement(field); + const originalWidth = (await header.getSize()).width; + const resizer = await header.findByCssSelector( + this.testSubjects.getCssSelector('dataGridColumnResizer') + ); + await this.browser.dragAndDrop({ location: resizer }, { location: { x: delta, y: 0 } }); + return { originalWidth, newWidth: (await header.getSize()).width }; + } + private getCellElementSelector(rowIndex: number = 0, columnIndex: number = 0) { return `[data-test-subj="euiDataGridBody"] [data-test-subj="dataGridRowCell"][data-gridcell-column-index="${columnIndex}"][data-gridcell-visible-row-index="${rowIndex}"]`; } @@ -465,6 +480,16 @@ export class DataGridService extends FtrService { await this.testSubjects.click('gridEditFieldButton'); } + public async resetColumnWidthExists(field: string) { + await this.openColMenuByField(field); + return await this.testSubjects.exists('unifiedDataTableResetColumnWidth'); + } + + public async clickResetColumnWidth(field: string) { + await this.openColMenuByField(field); + await this.testSubjects.click('unifiedDataTableResetColumnWidth'); + } + public async clickGridSettings() { await this.testSubjects.click('dataGridDisplaySelectorButton'); } @@ -512,6 +537,18 @@ export class DataGridService extends FtrService { await option.click(); } + public async getCurrentDensityValue() { + const buttonGroup = await this.testSubjects.find('densityButtonGroup'); + const selectedButton = await buttonGroup.findByCssSelector('[aria-pressed=true]'); + return selectedButton.getVisibleText(); + } + + public async changeDensityValue(newValue: string) { + const buttonGroup = await this.testSubjects.find('densityButtonGroup'); + const option = await buttonGroup.findByCssSelector(`[data-text="${newValue}"]`); + await option.click(); + } + private async findSampleSizeInput() { return await this.find.byCssSelector( 'input[type="number"][data-test-subj="unifiedDataTableSampleSizeInput"]' @@ -567,6 +604,24 @@ export class DataGridService extends FtrService { await this.testSubjects.click(`${actionName}-${fieldName}`); } + public async isFieldPinnedInFlyout(fieldName: string): Promise { + return !( + await this.testSubjects.getAttribute(`unifiedDocViewer_pinControl_${fieldName}`, 'class') + )?.includes('kbnDocViewer__fieldsGrid__pinAction'); + } + + public async togglePinActionInFlyout(fieldName: string): Promise { + await this.testSubjects.moveMouseTo(`unifiedDocViewer_pinControl_${fieldName}`); + const isPinned = await this.isFieldPinnedInFlyout(fieldName); + await this.retry.waitFor('pin action to appear', async () => { + return this.testSubjects.exists(`unifiedDocViewer_pinControlButton_${fieldName}`); + }); + await this.testSubjects.click(`unifiedDocViewer_pinControlButton_${fieldName}`); + await this.retry.waitFor('pin action to toggle', async () => { + return (await this.isFieldPinnedInFlyout(fieldName)) !== isPinned; + }); + } + public async expandFieldNameCellInFlyout(fieldName: string): Promise { const buttonSelector = 'euiDataGridCellExpandButton'; await this.testSubjects.click(`tableDocViewRow-${fieldName}-name`); diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index be4abf4e0daf2..c508410739db0 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -133,10 +133,11 @@ export class FilterBarService extends FtrService { * @param key field name */ public async removeFilter(key: string): Promise { - await this.retry.try(async () => { + await this.retry.waitFor('filter pill context menu is open', async () => { await this.testSubjects.click(`~filter & ~filter-key-${key}`); - await this.testSubjects.click(`deleteFilter`); + return await this.testSubjects.exists('deleteFilter'); }); + await this.testSubjects.click(`deleteFilter`); await this.header.awaitGlobalLoadingIndicatorHidden(); } diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 83672889eff75..01df9b5fdcbbf 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -7,7 +7,7 @@ */ import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; -import { services as commonServiceProviders } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; import { AppsMenuService } from './apps_menu'; import { @@ -57,7 +57,7 @@ import { ESQLService } from './esql'; import { DataViewsService } from './data_views'; export const services = { - ...commonServiceProviders, + ...commonFunctionalServices, ...commonFunctionalUIServices, filterBar: FilterBarService, queryBar: QueryBarService, diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index 348f37281156e..af695ad0a308a 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -328,4 +328,9 @@ export class InspectorService extends FtrService { return value === comboBoxOptions; } + + public async getRequestTotalTime() { + const [ms] = (await this.testSubjects.getVisibleText('inspectorRequestTotalTime')).split('ms'); + return parseFloat(ms); + } } diff --git a/test/functional/services/listing_table.ts b/test/functional/services/listing_table.ts index a3a056358fa24..6368474d4886a 100644 --- a/test/functional/services/listing_table.ts +++ b/test/functional/services/listing_table.ts @@ -53,14 +53,14 @@ export class ListingTableService extends FtrService { */ public async setSearchFilterValue(value: string) { const searchFilter = await this.getSearchFilter(); - searchFilter.type(value); + await searchFilter.type(value); } /** * Clears search input on landing page */ public async clearSearchFilter() { - this.testSubjects.click('clearSearchButton'); + await this.testSubjects.click('clearSearchButton'); } private async getAllItemsNamesOnCurrentPage(): Promise { diff --git a/test/harden/child_process.js b/test/harden/child_process.js index 029b1a038fcbf..2f33a1b0172dc 100644 --- a/test/harden/child_process.js +++ b/test/harden/child_process.js @@ -6,6 +6,9 @@ * Side Public License, v 1. */ +// We must disable prototype hardening to test the pollution +process.env.KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING = 'true'; + require('../../src/setup_node_env'); const cp = require('child_process'); diff --git a/test/harden/lodash_template.js b/test/harden/lodash_template.js index 49cf7351972e8..c6dc240ffbb63 100644 --- a/test/harden/lodash_template.js +++ b/test/harden/lodash_template.js @@ -6,6 +6,9 @@ * Side Public License, v 1. */ +// We must disable prototype hardening to test the pollution +process.env.KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING = 'true'; + require('../../src/setup_node_env'); const _ = require('lodash'); // eslint-disable-next-line no-restricted-modules diff --git a/test/harden/prototype.js b/test/harden/prototype.js new file mode 100644 index 0000000000000..dcd5386a17af3 --- /dev/null +++ b/test/harden/prototype.js @@ -0,0 +1,205 @@ +/* + * 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. + */ + +require('../../src/setup_node_env'); + +const test = require('tape'); + +test('Object.prototype', (t) => { + t.test('Prevents new properties from being added to the prototype', (t) => { + Object.prototype.test = 'whoops'; // eslint-disable-line no-extend-native + t.equal({}.test, undefined); + t.end(); + }); + + t.test('Permits overriding Object.prototype.toString', (t) => { + let originalToString; + t.test('setup', (t) => { + originalToString = Object.prototype.toString; + t.end(); + }); + + t.test('test', (t) => { + // Assert native toString behavior + t.equal({}.toString(), '[object Object]'); + + const { + writable: originalWritable, + enumerable: originalEnumerable, + configurable: originalConfigurable, + } = Object.getOwnPropertyDescriptor(Object.prototype, 'toString'); + + // eslint-disable-next-line no-extend-native + Object.prototype.toString = function toString() { + return 'my new toString function'; + }; + t.equal({}.toString(), 'my new toString function'); + + const toStringDescriptor = Object.getOwnPropertyDescriptor(Object.prototype, 'toString'); + + // Overwriting a property should not change its descriptor. + t.equal(toStringDescriptor.writable, originalWritable); + t.equal(toStringDescriptor.enumerable, originalEnumerable); + t.equal(toStringDescriptor.configurable, originalConfigurable); + + t.end(); + }); + + t.test('teardown', (t) => { + // eslint-disable-next-line no-extend-native + Object.prototype.toString = originalToString; + t.end(); + }); + }); +}); + +test('Number.prototype', (t) => { + t.test('Prevents new properties from being added to the prototype', (t) => { + Number.prototype.test = 'whoops'; // eslint-disable-line no-extend-native + t.equal((12).test, undefined); + t.end(); + }); + + t.test('Permits overriding Number.prototype.toString', (t) => { + let originalToString; + t.test('setup', (t) => { + originalToString = Number.prototype.toString; + t.end(); + }); + + t.test('test', (t) => { + // Assert native toString behavior + t.equal((1).toString(), '1'); + + const { + writable: originalWritable, + enumerable: originalEnumerable, + configurable: originalConfigurable, + } = Object.getOwnPropertyDescriptor(Number.prototype, 'toString'); + + // eslint-disable-next-line no-extend-native + Number.prototype.toString = function toString() { + return 'my new Number.toString function'; + }; + t.equal((12).toString(), 'my new Number.toString function'); + + const toStringDescriptor = Object.getOwnPropertyDescriptor(Number.prototype, 'toString'); + + // Overwriting a property should not change its descriptor. + t.equal(toStringDescriptor.writable, originalWritable); + t.equal(toStringDescriptor.enumerable, originalEnumerable); + t.equal(toStringDescriptor.configurable, originalConfigurable); + + t.end(); + }); + + t.test('teardown', (t) => { + // eslint-disable-next-line no-extend-native + Number.prototype.toString = originalToString; + t.end(); + }); + }); +}); + +test('String.prototype', (t) => { + t.test('Prevents new properties from being added to the prototype', (t) => { + String.prototype.test = 'whoops'; // eslint-disable-line no-extend-native + t.equal('hello'.test, undefined); + t.end(); + }); + + t.test('Permits overriding String.prototype.toString', (t) => { + let originalToString; + t.test('setup', (t) => { + originalToString = String.prototype.toString; + t.end(); + }); + + t.test('test', (t) => { + // Assert native toString behavior + t.equal((1).toString(), '1'); + + const { + writable: originalWritable, + enumerable: originalEnumerable, + configurable: originalConfigurable, + } = Object.getOwnPropertyDescriptor(String.prototype, 'toString'); + + // eslint-disable-next-line no-extend-native + String.prototype.toString = function toString() { + return 'my new String.toString function'; + }; + t.equal('test'.toString(), 'my new String.toString function'); + + const toStringDescriptor = Object.getOwnPropertyDescriptor(String.prototype, 'toString'); + + // Overwriting a property should not change its descriptor. + t.equal(toStringDescriptor.writable, originalWritable); + t.equal(toStringDescriptor.enumerable, originalEnumerable); + t.equal(toStringDescriptor.configurable, originalConfigurable); + + t.end(); + }); + + t.test('teardown', (t) => { + // eslint-disable-next-line no-extend-native + String.prototype.toString = originalToString; + t.end(); + }); + }); +}); + +test('Function.prototype', (t) => { + t.test('Prevents new properties from being added to the prototype', (t) => { + Function.prototype.test = 'whoops'; // eslint-disable-line no-extend-native + const fn = function testFn() {}; + t.equal(fn.test, undefined); + t.end(); + }); + + t.test('Permits overriding Function.prototype.toString', (t) => { + let originalToString; + t.test('setup', (t) => { + originalToString = Function.prototype.toString; + t.end(); + }); + + t.test('test', (t) => { + // Assert native toString behavior + const fn = function testFn() {}; + t.equal(fn.toString(), 'function testFn() {}'); + + const { + writable: originalWritable, + enumerable: originalEnumerable, + configurable: originalConfigurable, + } = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); + + // eslint-disable-next-line no-extend-native + Function.prototype.toString = function toString() { + return 'my new Function.toString function'; + }; + t.equal(fn.toString(), 'my new Function.toString function'); + + const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); + + // Overwriting a property should not change its descriptor. + t.equal(toStringDescriptor.writable, originalWritable); + t.equal(toStringDescriptor.enumerable, originalEnumerable); + t.equal(toStringDescriptor.configurable, originalConfigurable); + + t.end(); + }); + + t.test('teardown', (t) => { + // eslint-disable-next-line no-extend-native + Function.prototype.toString = originalToString; + t.end(); + }); + }); +}); diff --git a/test/health_gateway/services/index.ts b/test/health_gateway/services/index.ts index b9c44e227adae..5a89fb849f952 100644 --- a/test/health_gateway/services/index.ts +++ b/test/health_gateway/services/index.ts @@ -6,11 +6,13 @@ * Side Public License, v 1. */ -import { services as commonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { HealthGatewayService } from './health_gateway'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, healthGateway: HealthGatewayService, }; diff --git a/test/plugin_functional/config.ts b/test/plugin_functional/config.ts index 7b967b8591bf4..5ed34a69bae01 100644 --- a/test/plugin_functional/config.ts +++ b/test/plugin_functional/config.ts @@ -19,6 +19,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('./test_suites/telemetry'), require.resolve('./test_suites/core'), require.resolve('./test_suites/custom_visualizations'), + require.resolve('./test_suites/hardening'), require.resolve('./test_suites/panel_actions'), require.resolve('./test_suites/core_plugins'), require.resolve('./test_suites/management'), @@ -26,6 +27,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('./test_suites/data_plugin'), require.resolve('./test_suites/saved_objects_management'), require.resolve('./test_suites/saved_objects_hidden_type'), + require.resolve('./test_suites/shared_ux'), ], services: { ...functionalConfig.get('services'), diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/kibana.jsonc b/test/plugin_functional/plugins/eui_provider_dev_warning/kibana.jsonc new file mode 100644 index 0000000000000..970c25a20d596 --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/kibana.jsonc @@ -0,0 +1,13 @@ +{ + "type": "plugin", + "id": "@kbn/eui-provider-dev-warning", + "owner": "@elastic/appex-sharedux", + "plugin": { + "id": "euiProviderDevWarning", + "server": false, + "browser": true, + "configPath": [ + "eui_provider_dev_warning" + ] + } +} diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/package.json b/test/plugin_functional/plugins/eui_provider_dev_warning/package.json new file mode 100644 index 0000000000000..97def81d81579 --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/package.json @@ -0,0 +1,14 @@ +{ + "name": "@kbn/eui-provider-dev-warning", + "version": "1.0.0", + "main": "target/test/plugin_functional/plugins/eui_provider_dev_warning", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "SSPL-1.0 OR Elastic License 2.0", + "scripts": { + "kbn": "node ../../../../scripts/kbn.js", + "build": "rm -rf './target' && ../../../../node_modules/.bin/tsc" + } +} diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/public/application.tsx b/test/plugin_functional/plugins/eui_provider_dev_warning/public/application.tsx new file mode 100644 index 0000000000000..64541566c26a5 --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/public/application.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 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 { EuiPageTemplate, EuiTitle, EuiText } from '@elastic/eui'; +import ReactDOM from 'react-dom'; +import { AppMountParameters, CoreStart } from '@kbn/core/public'; + +export const renderApp = (_core: CoreStart, { element }: AppMountParameters) => { + ReactDOM.render( + + + +

EuiProvider is missing

+
+
+ + +

Goal of this page

+
+ +

+ The goal of this page is to create a UI that attempts to render EUI React components + without wrapping the rendering tree in EuiProvider. +

+
+
+
, + element + ); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/public/index.ts b/test/plugin_functional/plugins/eui_provider_dev_warning/public/index.ts new file mode 100644 index 0000000000000..8241ab91ba378 --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/public/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { EuiProviderDevWarningPlugin } from './plugin'; + +export function plugin() { + return new EuiProviderDevWarningPlugin(); +} diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/public/plugin.ts b/test/plugin_functional/plugins/eui_provider_dev_warning/public/plugin.ts new file mode 100644 index 0000000000000..a524ff6c2095c --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/public/plugin.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AppMountParameters, CoreSetup, Plugin } from '@kbn/core/public'; + +export class EuiProviderDevWarningPlugin + implements Plugin +{ + public setup(core: CoreSetup) { + core.application.register({ + id: 'euiProviderDevWarning', + title: 'EUI Provider Dev Warning', + async mount(params: AppMountParameters) { + const { renderApp } = await import('./application'); + const [coreStart] = await core.getStartServices(); + coreStart.chrome.docTitle.change('EuiProvider test'); + return renderApp(coreStart, params); + }, + }); + + // Return methods that should be available to other plugins + return {}; + } + + public start() {} + public stop() {} +} + +export type EuiProviderDevWarningPluginSetup = ReturnType; +export type EuiProviderDevWarningPluginStart = ReturnType; diff --git a/test/plugin_functional/plugins/eui_provider_dev_warning/tsconfig.json b/test/plugin_functional/plugins/eui_provider_dev_warning/tsconfig.json new file mode 100644 index 0000000000000..db7cf2bb2089d --- /dev/null +++ b/test/plugin_functional/plugins/eui_provider_dev_warning/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "../../../../typings/**/*" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core" + ] +} diff --git a/test/plugin_functional/plugins/hardening/kibana.jsonc b/test/plugin_functional/plugins/hardening/kibana.jsonc new file mode 100644 index 0000000000000..c5680af0dd35e --- /dev/null +++ b/test/plugin_functional/plugins/hardening/kibana.jsonc @@ -0,0 +1,13 @@ +{ + "type": "plugin", + "id": "@kbn/hardening-plugin", + "owner": "@elastic/kibana-security", + "plugin": { + "id": "hardeningPlugin", + "server": true, + "browser": false, + "configPath": [ + "hardening_plugin" + ] + } +} diff --git a/test/plugin_functional/plugins/hardening/package.json b/test/plugin_functional/plugins/hardening/package.json new file mode 100644 index 0000000000000..c33feeb7a4f52 --- /dev/null +++ b/test/plugin_functional/plugins/hardening/package.json @@ -0,0 +1,14 @@ +{ + "name": "@kbn/hardening-plugin", + "version": "1.0.0", + "main": "target/test/plugin_functional/plugins/hardening", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "SSPL-1.0 OR Elastic License 2.0", + "scripts": { + "kbn": "node ../../../../scripts/kbn.js", + "build": "rm -rf './target' && ../../../../node_modules/.bin/tsc" + } +} \ No newline at end of file diff --git a/test/plugin_functional/plugins/hardening/server/index.ts b/test/plugin_functional/plugins/hardening/server/index.ts new file mode 100644 index 0000000000000..cafadea796f5e --- /dev/null +++ b/test/plugin_functional/plugins/hardening/server/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. + */ + +import { HardeningPlugin } from './plugin'; + +export const plugin = async () => new HardeningPlugin(); diff --git a/test/plugin_functional/plugins/hardening/server/plugin.ts b/test/plugin_functional/plugins/hardening/server/plugin.ts new file mode 100644 index 0000000000000..451f4e233169f --- /dev/null +++ b/test/plugin_functional/plugins/hardening/server/plugin.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 type { Plugin, CoreSetup } from '@kbn/core/server'; + +export class HardeningPlugin implements Plugin { + public setup(core: CoreSetup, deps: {}) { + core.http.createRouter().get( + { + path: '/api/hardening/_pollute_prototypes', + validate: false, + }, + async (context, request, response) => { + const result: Record; error?: string }> = { + object: {}, + number: {}, + string: {}, + fn: {}, + array: {}, + }; + // Attempt to pollute Object.prototype + try { + (({}) as any).__proto__.polluted = true; + } catch (e) { + result.object.error = e.message; + } finally { + result.object.prototype = { ...Object.keys(Object.getPrototypeOf({})) }; + } + + // Attempt to pollute String.prototype + try { + ('asdf' as any).__proto__.polluted = true; + } catch (e) { + result.string.error = e.message; + } finally { + result.string.prototype = { ...Object.keys(Object.getPrototypeOf('asf')) }; + } + + // Attempt to pollute Number.prototype + try { + (12 as any).__proto__.polluted = true; + } catch (e) { + result.number.error = e.message; + } finally { + result.number.prototype = { ...Object.keys(Object.getPrototypeOf(12)) }; + } + + // Attempt to pollute Function.prototype + const fn = function fn() {}; + try { + (fn as any).__proto__.polluted = true; + } catch (e) { + result.fn.error = e.message; + } finally { + result.fn.prototype = { ...Object.keys(Object.getPrototypeOf(fn)) }; + } + + // Attempt to pollute Array.prototype + try { + ([] as any).__proto__.polluted = true; + } catch (e) { + result.array.error = e.message; + } finally { + result.array.prototype = { ...Object.keys(Object.getPrototypeOf([])) }; + } + + return response.ok({ body: result }); + } + ); + } + + public start() {} + public stop() {} +} diff --git a/test/plugin_functional/plugins/hardening/tsconfig.json b/test/plugin_functional/plugins/hardening/tsconfig.json new file mode 100644 index 0000000000000..bf146797a42ee --- /dev/null +++ b/test/plugin_functional/plugins/hardening/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "server/**/*.ts", + "../../../../typings/**/*", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/core" + ] +} diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx index 2ffe694e37b5e..7b92509ed53cf 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx @@ -16,7 +16,7 @@ interface CounterParams { } export class SelfChangingEditor extends React.Component> { - onCounterChange = (ev: any) => { + onCounterChange = (ev: React.ChangeEvent) => { this.props.setValue('counter', parseInt(ev.target.value, 10)); }; diff --git a/test/plugin_functional/snapshots/baseline/hardening/prototype.json b/test/plugin_functional/snapshots/baseline/hardening/prototype.json new file mode 100644 index 0000000000000..4e3a9d8219492 --- /dev/null +++ b/test/plugin_functional/snapshots/baseline/hardening/prototype.json @@ -0,0 +1 @@ +{"object":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"number":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"string":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"fn":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"array":{"prototype":{"0":"polluted"}}} \ No newline at end of file diff --git a/test/plugin_functional/test_suites/core/route.ts b/test/plugin_functional/test_suites/core/route.ts index 597189dd5faf3..90189fe72c804 100644 --- a/test/plugin_functional/test_suites/core/route.ts +++ b/test/plugin_functional/test_suites/core/route.ts @@ -23,12 +23,12 @@ export default function ({ getService }: PluginFunctionalProviderContext) { request.write(body[i++]); } else { clearInterval(intervalId); - request.end((err, res) => { + void request.end((err, res) => { resolve(res); }); } }, interval); - request.on('error', (err) => { + void request.on('error', (err) => { clearInterval(intervalId); reject(err); }); diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index a7afb228f5c1f..f4e43bf5fc06d 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -123,6 +123,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'data.search.sessions.management.refreshTimeout (duration?)', 'data.search.sessions.maxUpdateRetries (number?)', 'data.search.sessions.notTouchedTimeout (duration?)', + 'data.query.timefilter.minRefreshInterval (number?)', 'data_views.scriptedFieldsEnabled (boolean?|never)', 'data_visualizer.resultLinks.fileBeat.enabled (boolean)', 'dev_tools.deeplinks.navLinkStatus (string?)', diff --git a/test/plugin_functional/test_suites/hardening/index.ts b/test/plugin_functional/test_suites/hardening/index.ts new file mode 100644 index 0000000000000..b4eedb16495fe --- /dev/null +++ b/test/plugin_functional/test_suites/hardening/index.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 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 { PluginFunctionalProviderContext } from '../../services'; + +export default function ({ loadTestFile }: PluginFunctionalProviderContext) { + describe('hardening', function () { + loadTestFile(require.resolve('./prototype')); + }); +} diff --git a/test/plugin_functional/test_suites/hardening/prototype.ts b/test/plugin_functional/test_suites/hardening/prototype.ts new file mode 100644 index 0000000000000..823667a009544 --- /dev/null +++ b/test/plugin_functional/test_suites/hardening/prototype.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 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 { PluginFunctionalProviderContext } from '../../services'; + +export default function ({ getService }: PluginFunctionalProviderContext) { + const supertest = getService('supertest'); + const snapshots = getService('snapshots'); + + describe('prototype', function () { + it('does not allow polluting most prototypes', async () => { + const response = await supertest + .get('/api/hardening/_pollute_prototypes') + .set('kbn-xsrf', 'true') + .expect(200); + + await snapshots.compareAgainstBaseline('hardening/prototype', response.body); + }); + }); +} diff --git a/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts b/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts index 8e7adb504ebee..1eac63022d6d6 100644 --- a/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts +++ b/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts @@ -8,6 +8,7 @@ import path from 'path'; import expect from '@kbn/expect'; +import { byIdAscComparator } from '@kbn/core-saved-objects-import-export-server-internal/src/export/utils'; import { PluginFunctionalProviderContext } from '../../services'; const fixturePaths = { @@ -47,11 +48,13 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide .expect(200) .then((resp) => { expect( - resp.body.saved_objects.map((obj: any) => ({ - id: obj.id, - type: obj.type, - hidden: obj.meta.hiddenType, - })) + resp.body.saved_objects + .map((obj: any) => ({ + id: obj.id, + type: obj.type, + hidden: obj.meta.hiddenType, + })) + .sort(byIdAscComparator) ).to.eql([ { id: 'obj_1', diff --git a/test/plugin_functional/test_suites/shared_ux/eui_provider.ts b/test/plugin_functional/test_suites/shared_ux/eui_provider.ts new file mode 100644 index 0000000000000..b378939741f34 --- /dev/null +++ b/test/plugin_functional/test_suites/shared_ux/eui_provider.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { PluginFunctionalProviderContext } from '../../services'; + +export default function ({ getPageObjects, getService }: PluginFunctionalProviderContext) { + const PageObjects = getPageObjects(['common', 'header']); + const testSubjects = getService('testSubjects'); + const browser = getService('browser'); + + describe('EUI Provider Dev Warning', () => { + it('shows error toast to developer', async () => { + const pageTitle = 'EuiProvider test - Elastic'; + + await PageObjects.common.navigateToApp('euiProviderDevWarning'); + await PageObjects.header.waitUntilLoadingHasFinished(); + expect(await browser.getTitle()).eql(pageTitle); + await testSubjects.existOrFail('core-chrome-euiDevProviderWarning-toast'); + + // check that the error has been detected and stored in session storage + const euiProviderWarning = await browser.getSessionStorageItem('dev.euiProviderWarning'); + const { + message: errorMessage, + stack: errorStack, + pageHref: errorPageHref, + pageTitle: errorPageTitle, + } = JSON.parse(euiProviderWarning!); + expect(errorMessage).to.not.be.empty(); + expect(errorStack).to.not.be.empty(); + expect(errorPageHref).to.not.be.empty(); + expect(errorPageTitle).to.be(pageTitle); + }); + + after(async () => { + // clean up to ensure test suite will pass + await browser.removeSessionStorageItem('dev.euiProviderWarning'); + }); + }); +} diff --git a/test/plugin_functional/test_suites/shared_ux/index.ts b/test/plugin_functional/test_suites/shared_ux/index.ts new file mode 100644 index 0000000000000..a42a855ea4b3f --- /dev/null +++ b/test/plugin_functional/test_suites/shared_ux/index.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 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 { PluginFunctionalProviderContext } from '../../services'; + +export default function ({ loadTestFile }: PluginFunctionalProviderContext) { + describe('SharedUX', () => { + loadTestFile(require.resolve('./eui_provider')); + }); +} diff --git a/test/plugin_functional/test_suites/telemetry/telemetry.ts b/test/plugin_functional/test_suites/telemetry/telemetry.ts index a998e139eb5c6..2c542d3598f29 100644 --- a/test/plugin_functional/test_suites/telemetry/telemetry.ts +++ b/test/plugin_functional/test_suites/telemetry/telemetry.ts @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide const browser = getService('browser'); const find = getService('find'); const supertest = getService('supertest'); + const log = getService('log'); const PageObjects = getPageObjects(['common']); describe('Telemetry service', () => { @@ -30,7 +31,8 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide return browser.executeAsync((cb) => { (window as unknown as Record Promise>) ._checkCanSendTelemetry() - .then(cb); + .then(cb) + .catch((err) => log.error(err)); }); }; @@ -39,7 +41,8 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide await browser.executeAsync((cb) => { (window as unknown as Record Promise>) ._resetTelemetry() - .then(() => cb()); + .then(() => cb()) + .catch((err) => log.error(err)); }); }); diff --git a/test/server_integration/config.base.js b/test/server_integration/config.base.js index 71006c258c423..61243595505eb 100644 --- a/test/server_integration/config.base.js +++ b/test/server_integration/config.base.js @@ -12,13 +12,15 @@ import { ElasticsearchSupertestProvider, } from './services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; + export default async function ({ readConfigFile }) { const commonConfig = await readConfigFile(require.resolve('../common/config')); const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js')); return { services: { - ...commonConfig.get('services'), + ...commonFunctionalServices, supertest: createKibanaSupertestProvider(), supertestWithoutAuth: KibanaSupertestWithoutAuthProvider, esSupertest: ElasticsearchSupertestProvider, diff --git a/test/server_integration/services/types.d.ts b/test/server_integration/services/types.d.ts index 2df95f0297f90..204c0ae0106e5 100644 --- a/test/server_integration/services/types.d.ts +++ b/test/server_integration/services/types.d.ts @@ -7,7 +7,14 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services as kibanaCommonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; + +export const kibanaCommonServices = { + ...commonFunctionalServices, + ...commonFunctionalUIServices, +} as const; + import { services as kibanaApiIntegrationServices } from '../../api_integration/services'; export type FtrProviderContext = GenericFtrProviderContext< diff --git a/test/tsconfig.json b/test/tsconfig.json index 0f120b831abe7..8b0d946bded62 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -47,8 +47,6 @@ "@kbn/controls-plugin", "@kbn/field-formats-plugin", "@kbn/axe-config", - "@kbn/dev-cli-runner", - "@kbn/dev-cli-errors", "@kbn/data-view-field-editor-plugin", "@kbn/data-views-plugin", "@kbn/guided-onboarding-plugin", @@ -71,7 +69,12 @@ "@kbn/links-plugin", "@kbn/ftr-common-functional-ui-services", "@kbn/monaco", - "@kbn/search-types", "@kbn/console-plugin", + "@kbn/core-chrome-browser", + "@kbn/default-nav-ml", + "@kbn/default-nav-analytics", + "@kbn/default-nav-management", + "@kbn/default-nav-devtools", + "@kbn/core-saved-objects-import-export-server-internal", ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index 4fb1008c3b79b..44bb897bea1c2 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -130,6 +130,8 @@ "@kbn/cases-components/*": ["packages/kbn-cases-components/*"], "@kbn/cases-plugin": ["x-pack/plugins/cases"], "@kbn/cases-plugin/*": ["x-pack/plugins/cases/*"], + "@kbn/cbor": ["packages/kbn-cbor"], + "@kbn/cbor/*": ["packages/kbn-cbor/*"], "@kbn/cell-actions": ["packages/kbn-cell-actions"], "@kbn/cell-actions/*": ["packages/kbn-cell-actions/*"], "@kbn/chart-expressions-common": ["src/plugins/chart_expressions/common"], @@ -140,6 +142,8 @@ "@kbn/charts-plugin/*": ["src/plugins/charts/*"], "@kbn/check-mappings-update-cli": ["packages/kbn-check-mappings-update-cli"], "@kbn/check-mappings-update-cli/*": ["packages/kbn-check-mappings-update-cli/*"], + "@kbn/check-prod-native-modules-cli": ["packages/kbn-check-prod-native-modules-cli"], + "@kbn/check-prod-native-modules-cli/*": ["packages/kbn-check-prod-native-modules-cli/*"], "@kbn/ci-stats-core": ["packages/kbn-ci-stats-core"], "@kbn/ci-stats-core/*": ["packages/kbn-ci-stats-core/*"], "@kbn/ci-stats-performance-metrics": ["packages/kbn-ci-stats-performance-metrics"], @@ -168,6 +172,10 @@ "@kbn/cloud-links-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_links/*"], "@kbn/cloud-plugin": ["x-pack/plugins/cloud"], "@kbn/cloud-plugin/*": ["x-pack/plugins/cloud/*"], + "@kbn/cloud-security-posture": ["x-pack/packages/kbn-cloud-security-posture"], + "@kbn/cloud-security-posture/*": ["x-pack/packages/kbn-cloud-security-posture/*"], + "@kbn/cloud-security-posture-common": ["x-pack/packages/kbn-cloud-security-posture-common"], + "@kbn/cloud-security-posture-common/*": ["x-pack/packages/kbn-cloud-security-posture-common/*"], "@kbn/cloud-security-posture-plugin": ["x-pack/plugins/cloud_security_posture"], "@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"], "@kbn/code-editor": ["packages/shared-ux/code_editor/impl"], @@ -188,6 +196,10 @@ "@kbn/console-plugin/*": ["src/plugins/console/*"], "@kbn/content-management-content-editor": ["packages/content-management/content_editor"], "@kbn/content-management-content-editor/*": ["packages/content-management/content_editor/*"], + "@kbn/content-management-content-insights-public": ["packages/content-management/content_insights/content_insights_public"], + "@kbn/content-management-content-insights-public/*": ["packages/content-management/content_insights/content_insights_public/*"], + "@kbn/content-management-content-insights-server": ["packages/content-management/content_insights/content_insights_server"], + "@kbn/content-management-content-insights-server/*": ["packages/content-management/content_insights/content_insights_server/*"], "@kbn/content-management-examples-plugin": ["examples/content_management_examples"], "@kbn/content-management-examples-plugin/*": ["examples/content_management_examples/*"], "@kbn/content-management-favorites-public": ["packages/content-management/favorites/favorites_public"], @@ -784,6 +796,8 @@ "@kbn/entities-data-access-plugin/*": ["x-pack/plugins/observability_solution/entities_data_access/*"], "@kbn/entities-schema": ["x-pack/packages/kbn-entities-schema"], "@kbn/entities-schema/*": ["x-pack/packages/kbn-entities-schema/*"], + "@kbn/entity-manager-fixture-plugin": ["x-pack/test/api_integration/apis/entity_manager/fixture_plugin"], + "@kbn/entity-manager-fixture-plugin/*": ["x-pack/test/api_integration/apis/entity_manager/fixture_plugin/*"], "@kbn/entityManager-plugin": ["x-pack/plugins/observability_solution/entity_manager"], "@kbn/entityManager-plugin/*": ["x-pack/plugins/observability_solution/entity_manager/*"], "@kbn/error-boundary-example-plugin": ["examples/error_boundary"], @@ -830,6 +844,8 @@ "@kbn/esql-validation-autocomplete/*": ["packages/kbn-esql-validation-autocomplete/*"], "@kbn/esql-validation-example-plugin": ["examples/esql_validation_example"], "@kbn/esql-validation-example-plugin/*": ["examples/esql_validation_example/*"], + "@kbn/eui-provider-dev-warning": ["test/plugin_functional/plugins/eui_provider_dev_warning"], + "@kbn/eui-provider-dev-warning/*": ["test/plugin_functional/plugins/eui_provider_dev_warning/*"], "@kbn/event-annotation-common": ["packages/kbn-event-annotation-common"], "@kbn/event-annotation-common/*": ["packages/kbn-event-annotation-common/*"], "@kbn/event-annotation-components": ["packages/kbn-event-annotation-components"], @@ -948,6 +964,10 @@ "@kbn/global-search-test-plugin/*": ["x-pack/test/plugin_functional/plugins/global_search_test/*"], "@kbn/graph-plugin": ["x-pack/plugins/graph"], "@kbn/graph-plugin/*": ["x-pack/plugins/graph/*"], + "@kbn/grid-example-plugin": ["examples/grid_example"], + "@kbn/grid-example-plugin/*": ["examples/grid_example/*"], + "@kbn/grid-layout": ["packages/kbn-grid-layout"], + "@kbn/grid-layout/*": ["packages/kbn-grid-layout/*"], "@kbn/grokdebugger-plugin": ["x-pack/plugins/grokdebugger"], "@kbn/grokdebugger-plugin/*": ["x-pack/plugins/grokdebugger/*"], "@kbn/grouping": ["packages/kbn-grouping"], @@ -962,6 +982,8 @@ "@kbn/handlebars/*": ["packages/kbn-handlebars/*"], "@kbn/hapi-mocks": ["packages/kbn-hapi-mocks"], "@kbn/hapi-mocks/*": ["packages/kbn-hapi-mocks/*"], + "@kbn/hardening-plugin": ["test/plugin_functional/plugins/hardening"], + "@kbn/hardening-plugin/*": ["test/plugin_functional/plugins/hardening/*"], "@kbn/health-gateway-server": ["packages/kbn-health-gateway-server"], "@kbn/health-gateway-server/*": ["packages/kbn-health-gateway-server/*"], "@kbn/hello-world-plugin": ["examples/hello_world"], @@ -1020,6 +1042,8 @@ "@kbn/investigate-app-plugin/*": ["x-pack/plugins/observability_solution/investigate_app/*"], "@kbn/investigate-plugin": ["x-pack/plugins/observability_solution/investigate"], "@kbn/investigate-plugin/*": ["x-pack/plugins/observability_solution/investigate/*"], + "@kbn/investigation-shared": ["packages/kbn-investigation-shared"], + "@kbn/investigation-shared/*": ["packages/kbn-investigation-shared/*"], "@kbn/io-ts-utils": ["packages/kbn-io-ts-utils"], "@kbn/io-ts-utils/*": ["packages/kbn-io-ts-utils/*"], "@kbn/ipynb": ["packages/kbn-ipynb"], @@ -1228,6 +1252,8 @@ "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], "@kbn/object-versioning": ["packages/kbn-object-versioning"], "@kbn/object-versioning/*": ["packages/kbn-object-versioning/*"], + "@kbn/object-versioning-utils": ["packages/kbn-object-versioning-utils"], + "@kbn/object-versioning-utils/*": ["packages/kbn-object-versioning-utils/*"], "@kbn/observability-ai-assistant-app-plugin": ["x-pack/plugins/observability_solution/observability_ai_assistant_app"], "@kbn/observability-ai-assistant-app-plugin/*": ["x-pack/plugins/observability_solution/observability_ai_assistant_app/*"], "@kbn/observability-ai-assistant-management-plugin": ["x-pack/plugins/observability_solution/observability_ai_assistant_management"], @@ -1254,6 +1280,8 @@ "@kbn/observability-plugin/*": ["x-pack/plugins/observability_solution/observability/*"], "@kbn/observability-shared-plugin": ["x-pack/plugins/observability_solution/observability_shared"], "@kbn/observability-shared-plugin/*": ["x-pack/plugins/observability_solution/observability_shared/*"], + "@kbn/observability-utils": ["x-pack/packages/observability/observability_utils"], + "@kbn/observability-utils/*": ["x-pack/packages/observability/observability_utils/*"], "@kbn/oidc-provider-plugin": ["x-pack/test/security_api_integration/plugins/oidc_provider"], "@kbn/oidc-provider-plugin/*": ["x-pack/test/security_api_integration/plugins/oidc_provider/*"], "@kbn/open-telemetry-instrumented-plugin": ["test/common/plugins/otel_metrics"], @@ -1442,8 +1470,12 @@ "@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"], "@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"], "@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"], + "@kbn/screenshotting-server": ["packages/kbn-screenshotting-server"], + "@kbn/screenshotting-server/*": ["packages/kbn-screenshotting-server/*"], "@kbn/search-api-panels": ["packages/kbn-search-api-panels"], "@kbn/search-api-panels/*": ["packages/kbn-search-api-panels/*"], + "@kbn/search-assistant": ["x-pack/plugins/search_assistant"], + "@kbn/search-assistant/*": ["x-pack/plugins/search_assistant/*"], "@kbn/search-connectors": ["packages/kbn-search-connectors"], "@kbn/search-connectors/*": ["packages/kbn-search-connectors/*"], "@kbn/search-connectors-plugin": ["x-pack/plugins/search_connectors"], @@ -1456,6 +1488,8 @@ "@kbn/search-homepage/*": ["x-pack/plugins/search_homepage/*"], "@kbn/search-index-documents": ["packages/kbn-search-index-documents"], "@kbn/search-index-documents/*": ["packages/kbn-search-index-documents/*"], + "@kbn/search-indices": ["x-pack/plugins/search_indices"], + "@kbn/search-indices/*": ["x-pack/plugins/search_indices/*"], "@kbn/search-inference-endpoints": ["x-pack/plugins/search_inference_endpoints"], "@kbn/search-inference-endpoints/*": ["x-pack/plugins/search_inference_endpoints/*"], "@kbn/search-notebooks": ["x-pack/plugins/search_notebooks"], @@ -1472,6 +1506,8 @@ "@kbn/security-api-integration-helpers/*": ["x-pack/test/security_api_integration/packages/helpers/*"], "@kbn/security-api-key-management": ["x-pack/packages/security/api_key_management"], "@kbn/security-api-key-management/*": ["x-pack/packages/security/api_key_management/*"], + "@kbn/security-authorization-core": ["x-pack/packages/security/authorization_core"], + "@kbn/security-authorization-core/*": ["x-pack/packages/security/authorization_core/*"], "@kbn/security-form-components": ["x-pack/packages/security/form_components"], "@kbn/security-form-components/*": ["x-pack/packages/security/form_components/*"], "@kbn/security-hardening": ["packages/kbn-security-hardening"], @@ -1484,6 +1520,10 @@ "@kbn/security-plugin-types-public/*": ["x-pack/packages/security/plugin_types_public/*"], "@kbn/security-plugin-types-server": ["x-pack/packages/security/plugin_types_server"], "@kbn/security-plugin-types-server/*": ["x-pack/packages/security/plugin_types_server/*"], + "@kbn/security-role-management-model": ["x-pack/packages/security/role_management_model"], + "@kbn/security-role-management-model/*": ["x-pack/packages/security/role_management_model/*"], + "@kbn/security-solution-common": ["x-pack/packages/security-solution/common"], + "@kbn/security-solution-common/*": ["x-pack/packages/security-solution/common/*"], "@kbn/security-solution-distribution-bar": ["x-pack/packages/security-solution/distribution_bar"], "@kbn/security-solution-distribution-bar/*": ["x-pack/packages/security-solution/distribution_bar/*"], "@kbn/security-solution-ess": ["x-pack/plugins/security_solution_ess"], @@ -1506,6 +1546,8 @@ "@kbn/security-solution-upselling/*": ["x-pack/packages/security-solution/upselling/*"], "@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/plugins/test_endpoints"], "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/plugins/test_endpoints/*"], + "@kbn/security-ui-components": ["x-pack/packages/security/ui_components"], + "@kbn/security-ui-components/*": ["x-pack/packages/security/ui_components/*"], "@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"], "@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"], "@kbn/securitysolution-data-table": ["x-pack/packages/security-solution/data_table"], @@ -1682,6 +1724,8 @@ "@kbn/shared-ux-storybook-mock/*": ["packages/shared-ux/storybook/mock/*"], "@kbn/shared-ux-tabbed-modal": ["packages/shared-ux/modal/tabbed"], "@kbn/shared-ux-tabbed-modal/*": ["packages/shared-ux/modal/tabbed/*"], + "@kbn/shared-ux-table-persist": ["packages/shared-ux/table_persist"], + "@kbn/shared-ux-table-persist/*": ["packages/shared-ux/table_persist/*"], "@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"], "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], "@kbn/slo-plugin": ["x-pack/plugins/observability_solution/slo"], diff --git a/typings/borc.d.ts b/typings/borc.d.ts new file mode 100644 index 0000000000000..7c194a7ee39e8 --- /dev/null +++ b/typings/borc.d.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. + */ + +declare module 'borc'; diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 7ff0f3e3ef766..f2ab7a782915e 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -22,7 +22,11 @@ "xpack.cloudDefend": "plugins/cloud_defend", "xpack.cloudLinks": "plugins/cloud_integrations/cloud_links", "xpack.cloudDataMigration": "plugins/cloud_integrations/cloud_data_migration", - "xpack.csp": "plugins/cloud_security_posture", + "xpack.csp": [ + "plugins/cloud_security_posture", + "packages/kbn-cloud-security-posture-common", + "packages/kbn-cloud-security-posture" + ], "xpack.customBranding": "plugins/custom_branding", "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.dataQuality": "plugins/data_quality", @@ -98,9 +102,11 @@ "xpack.runtimeFields": "plugins/runtime_fields", "xpack.screenshotting": "plugins/screenshotting", "xpack.searchHomepage": "plugins/search_homepage", + "xpack.searchIndices": "plugins/search_indices", "xpack.searchNotebooks": "plugins/search_notebooks", "xpack.searchPlayground": "plugins/search_playground", "xpack.searchInferenceEndpoints": "plugins/search_inference_endpoints", + "xpack.searchAssistant": "plugins/search_assistant", "xpack.searchProfiler": "plugins/searchprofiler", "xpack.security": ["plugins/security", "packages/security"], "xpack.server": "legacy/server", diff --git a/x-pack/examples/testing_embedded_lens/public/app.tsx b/x-pack/examples/testing_embedded_lens/public/app.tsx index c3d4d103a9a4e..9aa6a40fe20cf 100644 --- a/x-pack/examples/testing_embedded_lens/public/app.tsx +++ b/x-pack/examples/testing_embedded_lens/public/app.tsx @@ -470,7 +470,7 @@ export const App = (props: { const currentSO = useRef(initialAttributes); const [currentValid, saveValidSO] = useState(initialAttributes); const switchChartPreset = useCallback( - (newIndex) => { + (newIndex: number) => { const newChart = charts[newIndex]; const newAttributes = JSON.stringify(newChart.attributes, null, 2); currentSO.current = newAttributes; @@ -694,7 +694,7 @@ export const App = (props: { ({ value: i, text: id }))} value={undefined} - onChange={(e) => switchChartPreset(Number(e.target.value))} + onChange={(e) => switchChartPreset(+e.target.value)} aria-label="Load from a preset" prepend={'Load preset'} /> diff --git a/x-pack/packages/kbn-cloud-security-posture-common/README.md b/x-pack/packages/kbn-cloud-security-posture-common/README.md new file mode 100644 index 0000000000000..8f4b7fb4be9d9 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/README.md @@ -0,0 +1,9 @@ +# @kbn/cloud-security-posture-common + +This package provides common code consumed in both the browser, i.e. the +`packages/kbn-cloud-security-posture` package and `plugins/cloud_security_posture` plugin, and on the server, i.e. the +`plugins/cloud_security_posture` plugin. + +## Maintainers + +Maintained by the Cloud Security Team \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture-common/constants.ts b/x-pack/packages/kbn-cloud-security-posture-common/constants.ts new file mode 100644 index 0000000000000..935e747b20fa8 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/constants.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. + */ +export const KSPM_POLICY_TEMPLATE = 'kspm'; +export const CSPM_POLICY_TEMPLATE = 'cspm'; +export const CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN = + 'logs-cloud_security_posture.findings_latest-default'; +export const CDR_LATEST_THIRD_PARTY_MISCONFIGURATIONS_INDEX_PATTERN = + 'logs-*_latest_misconfigurations_cdr'; +export const CDR_MISCONFIGURATIONS_INDEX_PATTERN = `${CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN},${CDR_LATEST_THIRD_PARTY_MISCONFIGURATIONS_INDEX_PATTERN}`; +export const LATEST_FINDINGS_RETENTION_POLICY = '26h'; +export const MAX_FINDINGS_TO_LOAD = 500; +export const CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH = + '/internal/cloud_security_posture/rules/_get_states'; +export const CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION = '1'; +export const STATUS_ROUTE_PATH = '/internal/cloud_security_posture/status'; +export const STATUS_API_CURRENT_VERSION = '1'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/index.ts b/x-pack/packages/kbn-cloud-security-posture-common/index.ts new file mode 100644 index 0000000000000..66a98d5e398c3 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase. +// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths +// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here. + +export type { + CspStatusCode, + IndexStatus, + IndexDetails, + BaseCspSetupBothPolicy, + BaseCspSetupStatus, + CspSetupStatus, +} from './types/status'; +export type { CspFinding } from './types/findings'; +export type { BenchmarksCisId } from './types/benchmark'; +export * from './constants'; +export { extractErrorMessage, buildMutedRulesFilter } from './utils/helpers'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js new file mode 100644 index 0000000000000..d6f06d2bcc21c --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/packages/kbn-cloud-security-posture-common'], +}; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/kibana.jsonc b/x-pack/packages/kbn-cloud-security-posture-common/kibana.jsonc new file mode 100644 index 0000000000000..21721cfb69f44 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/kibana.jsonc @@ -0,0 +1,6 @@ + +{ + "id": "@kbn/cloud-security-posture-common", + "owner": "@elastic/kibana-cloud-security-posture", + "type": "shared-common" + } \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture-common/package.json b/x-pack/packages/kbn-cloud-security-posture-common/package.json new file mode 100644 index 0000000000000..9010e267fe5d0 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/cloud-security-posture-common", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0", + "description": "Shared components for cloud security posture, both client and server side" + } \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts new file mode 100644 index 0000000000000..b8b927b3d1c5f --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * as rulesV1 from './v1'; +export * as rulesV2 from './v2'; +export * as rulesV3 from './v3'; +export * as rulesV4 from './v4'; +export * as rulesV5 from './v5'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts new file mode 100644 index 0000000000000..b56fab649ade5 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.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 * from './v5'; diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v1.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v1.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v2.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v2.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v2.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v2.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v3.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v3.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts similarity index 98% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts index 33134eed32e38..4f05a15f555b5 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts @@ -6,7 +6,7 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; -import { BenchmarksCisId } from '../latest'; +import { BenchmarksCisId } from '../../types/benchmark'; import { DEFAULT_BENCHMARK_RULES_PER_PAGE } from './v3'; export type { cspBenchmarkRuleMetadataSchema, diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v5.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v5.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v5.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v5.ts diff --git a/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json new file mode 100644 index 0000000000000..17961df586258 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/data-views-plugin", + "@kbn/i18n", + ] +} diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts new file mode 100644 index 0000000000000..ed661879558e7 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts @@ -0,0 +1,7 @@ +/* + * 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 type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts new file mode 100644 index 0000000000000..8a7a563fb26c7 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/findings.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; you may not use this file except in compliance with the Elastic License + * 2.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 type { EcsDataStream, EcsEvent } from '@elastic/ecs'; +import type { CspBenchmarkRuleMetadata } from '../schema/rules/latest'; + +export interface CspFinding { + '@timestamp': string; + cluster_id?: string; + orchestrator?: CspFindingOrchestrator; + cloud?: CspFindingCloud; // only available on CSPM findings + result: CspFindingResult; + resource: CspFindingResource; + rule: CspBenchmarkRuleMetadata; + host: CspFindingHost; + event: EcsEvent; + data_stream: EcsDataStream; + agent: CspFindingAgent; + ecs: { + version: string; + }; +} + +interface CspFindingOrchestrator { + cluster?: { + id?: string; + name?: string; + }; +} + +interface CspFindingCloud { + provider: 'aws' | 'azure' | 'gcp'; + account: { + name: string; + id: string; + }; + region?: string; +} + +interface CspFindingResult { + evaluation: 'passed' | 'failed'; + expected?: Record; + evidence: Record; +} + +interface CspFindingResource { + name: string; + sub_type: string; + raw: object; + id: string; + type: string; + [other_keys: string]: unknown; +} + +interface CspFindingHost { + id: string; + containerized: boolean; + ip: string[]; + mac: string[]; + name: string; + hostname: string; + architecture: string; + os: { + kernel: string; + codename: string; + type: string; + platform: string; + version: string; + family: string; + name: string; + }; + [other_keys: string]: unknown; +} + +interface CspFindingAgent { + version: string; + // ephemeral_id: string; + id: string; + name: string; + type: string; +} diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types/status.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/status.ts new file mode 100644 index 0000000000000..92ad6ee126b8a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/status.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. + */ + +/* + * 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 type CspStatusCode = + | 'indexed' // latest findings index exists and has results + | 'indexing' // index timeout was not surpassed since installation, assumes data is being indexed + | 'unprivileged' // user lacks privileges for the latest findings index + | 'index-timeout' // index timeout was surpassed since installation + | 'not-deployed' // no healthy agents were deployed + | 'not-installed' // number of installed csp integrations is 0; + | 'waiting_for_results'; // have healthy agents but no findings at all, assumes data is being indexed for the 1st time + +export type IndexStatus = + | 'not-empty' // Index contains documents + | 'empty' // Index doesn't contain documents (or doesn't exist) + | 'unprivileged'; // User doesn't have access to query the index + +export interface IndexDetails { + index: string; + status: IndexStatus; +} + +export interface BaseCspSetupBothPolicy { + status: CspStatusCode; + installedPackagePolicies: number; + healthyAgents: number; +} + +export interface BaseCspSetupStatus { + indicesDetails: IndexDetails[]; + latestPackageVersion: string; + cspm: BaseCspSetupBothPolicy; + kspm: BaseCspSetupBothPolicy; + vuln_mgmt: BaseCspSetupBothPolicy; + isPluginInitialized: boolean; + installedPackageVersion?: string | undefined; + hasMisconfigurationsFindings?: boolean; +} + +export type CspSetupStatus = BaseCspSetupStatus; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts new file mode 100644 index 0000000000000..7e5f4f1d8120a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts @@ -0,0 +1,141 @@ +/* + * 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 { extractErrorMessage, defaultErrorMessage, buildMutedRulesFilter } from './helpers'; + +const fallbackMessage = 'thisIsAFallBackMessage'; + +describe('test helper methods', () => { + describe('extractErrorMessage Test', () => { + it('should return error message if input is instance of Error', () => { + const errorMessage = 'thisIsInstanceOfErrorMessage'; + const error = new Error(errorMessage); + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(errorMessage); + }); + + it('should return string if input is string', () => { + const error: string = 'thisIsAString'; + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(error); + }); + + it('should return fallbackMessage is input is not string nor instance of Error', () => { + const error: number = 12345; + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(fallbackMessage); + }); + + it('should return default message when input is not string nor instance of Error and fallbackMessage is not provided', () => { + const error: number = 12345; + const extractedErrorMessage = extractErrorMessage(error); + + expect(extractedErrorMessage).toMatch(defaultErrorMessage); + }); + }); + + describe('buildMutedRulesFilter Test', () => { + it('should return an empty array if no rules are muted', () => { + const rulesStates = { + rule1: { + muted: false, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: false, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + expect(buildMutedRulesFilter(rulesStates)).toEqual([]); + }); + + it('should return the correct query for a single muted rule', () => { + const rulesStates = { + rule1: { + muted: true, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: false, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + const expectedQuery = [ + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '1' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '1' } }, + ], + }, + }, + ]; + + expect(buildMutedRulesFilter(rulesStates)).toEqual(expectedQuery); + }); + + it('should return the correct queries for multiple muted rules', () => { + const rulesStates = { + rule1: { + muted: true, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: true, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + const expectedQuery = [ + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '1' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '1' } }, + ], + }, + }, + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '2' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '2' } }, + ], + }, + }, + ]; + + expect(buildMutedRulesFilter(rulesStates)).toEqual(expectedQuery); + }); + }); +}); diff --git a/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts new file mode 100644 index 0000000000000..7c26c61778137 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.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 { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; +import { i18n } from '@kbn/i18n'; +import type { CspBenchmarkRulesStates } from '../schema/rules/latest'; + +export const defaultErrorMessage = i18n.translate('xpack.csp.common.utils.helpers.unknownError', { + defaultMessage: 'Unknown Error', +}); + +export const extractErrorMessage = (e: unknown, fallbackMessage?: string): string => { + if (e instanceof Error) return e.message; + if (typeof e === 'string') return e; + + return fallbackMessage ?? defaultErrorMessage; +}; + +export const buildMutedRulesFilter = ( + rulesStates: CspBenchmarkRulesStates +): QueryDslQueryContainer[] => { + const mutedRules = Object.fromEntries( + Object.entries(rulesStates).filter(([key, value]) => value.muted === true) + ); + + const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { + const rule = mutedRules[key]; + return { + bool: { + must: [ + { term: { 'rule.benchmark.id': rule.benchmark_id } }, + { term: { 'rule.benchmark.version': rule.benchmark_version } }, + { term: { 'rule.benchmark.rule_number': rule.rule_number } }, + ], + }, + }; + }); + + return mutedRulesFilterQuery; +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/README.md b/x-pack/packages/kbn-cloud-security-posture/README.md new file mode 100644 index 0000000000000..204ff85e41a41 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/README.md @@ -0,0 +1,9 @@ +# @kbn/cloud-security-posture + +This package includes +- Hooks that's used on Flyout component that's used in Alerts page on Security Solution Plugins as well as components on CSP plugin +- Utilities and types thats used for the Hooks above as well as in CSP plugins + +## Maintainers + +Maintained by the Cloud Security Team \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture/index.ts b/x-pack/packages/kbn-cloud-security-posture/index.ts new file mode 100644 index 0000000000000..bb40ae57eca2a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './type'; +export { showErrorToast } from './src/utils/show_error_toast'; diff --git a/x-pack/packages/kbn-cloud-security-posture/kibana.jsonc b/x-pack/packages/kbn-cloud-security-posture/kibana.jsonc new file mode 100644 index 0000000000000..4c5a4f1f0165d --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "id": "@kbn/cloud-security-posture", + "owner": "@elastic/kibana-cloud-security-posture", + "type": "shared-browser" +} \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture/package.json b/x-pack/packages/kbn-cloud-security-posture/package.json new file mode 100644 index 0000000000000..c9d9081d1b6b9 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/cloud-security-posture", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0", + "description": "Shared components for cloud security posture, client side" +} \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.ts b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.ts new file mode 100644 index 0000000000000..f77e1e5c12c8d --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.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 { useQuery, type UseQueryOptions } from '@tanstack/react-query'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { CoreStart } from '@kbn/core/public'; +import { STATUS_API_CURRENT_VERSION, STATUS_ROUTE_PATH } from '@kbn/cloud-security-posture-common'; +import type { CspSetupStatus } from '@kbn/cloud-security-posture-common'; + +const getCspSetupStatusQueryKey = 'csp_status_key'; + +export const useCspSetupStatusApi = ( + options?: UseQueryOptions +) => { + const { http } = useKibana().services; + return useQuery( + [getCspSetupStatusQueryKey], + () => http.get(STATUS_ROUTE_PATH, { version: STATUS_API_CURRENT_VERSION }), + options + ); +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.ts b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.ts new file mode 100644 index 0000000000000..06270d9bc710a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.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 { useQuery } from '@tanstack/react-query'; +import { + CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION, + CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH, +} from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { CoreStart } from '@kbn/core/public'; + +export const getRuleStatesKey = ['get_rules_state_key']; + +export const useGetCspBenchmarkRulesStatesApi = () => { + const { http } = useKibana().services; + return useQuery(getRuleStatesKey, () => + http.get(CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH, { + version: CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION, + }) + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts b/x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts similarity index 90% rename from x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts rename to x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts index 75316d9495b26..060ae8c3b69ee 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts +++ b/x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts @@ -4,9 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import type { CoreStart } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; -import { extractErrorMessage } from '../../../common/utils/helpers'; +import { extractErrorMessage } from '@kbn/cloud-security-posture-common'; const SEARCH_FAILED_TEXT = i18n.translate( 'xpack.csp.findings.findingsErrorToast.searchFailedTitle', diff --git a/x-pack/packages/kbn-cloud-security-posture/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/tsconfig.json new file mode 100644 index 0000000000000..152c3fe8a8b29 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/tsconfig.json @@ -0,0 +1,40 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/licensing-plugin", + "@kbn/data-views-plugin", + "@kbn/unified-search-plugin", + "@kbn/ui-actions-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/charts-plugin", + "@kbn/discover-plugin", + "@kbn/fleet-plugin", + "@kbn/usage-collection-plugin", + "@kbn/share-plugin", + "@kbn/es-query", + "@kbn/cloud-plugin", + "@kbn/spaces-plugin", + "@kbn/kibana-react-plugin", + "@kbn/cloud-security-posture-common", + "@kbn/i18n", + ] +} diff --git a/x-pack/packages/kbn-cloud-security-posture/type.ts b/x-pack/packages/kbn-cloud-security-posture/type.ts new file mode 100644 index 0000000000000..70daabecf67d3 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/type.ts @@ -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 { CloudSetup } from '@kbn/cloud-plugin/public'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; +import { DataViewsServicePublic } from '@kbn/data-views-plugin/public'; +import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; +import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import { IndexPatternFieldEditorStart } from '@kbn/data-view-field-editor-plugin/public'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import { ToastsStart } from '@kbn/core/public'; +import { Storage } from '@kbn/kibana-utils-plugin/public'; + +import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { DiscoverStart } from '@kbn/discover-plugin/public'; +import type { FleetStart } from '@kbn/fleet-plugin/public'; +import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; +import { SharePluginStart } from '@kbn/share-plugin/public'; +import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; + +import type { BoolQuery } from '@kbn/es-query'; +export interface FindingsBaseEsQuery { + query?: { + bool: BoolQuery; + }; +} + +export interface CspClientPluginStartDeps { + // required + data: DataPublicPluginStart; + dataViews: DataViewsServicePublic; + dataViewFieldEditor: IndexPatternFieldEditorStart; + unifiedSearch: UnifiedSearchPublicPluginStart; + uiActions: UiActionsStart; + fieldFormats: FieldFormatsStart; + toastNotifications: ToastsStart; + charts: ChartsPluginStart; + discover: DiscoverStart; + fleet: FleetStart; + licensing: LicensingPluginStart; + share: SharePluginStart; + storage: Storage; + spaces: SpacesPluginStart; + cloud: CloudSetup; + + // optional + usageCollection?: UsageCollectionStart; +} diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts index 758c9f5b8e2cc..f1a994a37a24c 100644 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts +++ b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts @@ -21,7 +21,7 @@ const components = [ { name: `${MONGODB}_${ECS_VERSION}_base`, template: base }, { name: `${MONGODB}_${ECS_VERSION}_log`, template: log }, { name: `${MONGODB}_${ECS_VERSION}_host`, template: host }, - { name: `${MONGODB}_${ECS_VERSION}_host`, template: mongodb }, + { name: `${MONGODB}_${ECS_VERSION}_mongodb`, template: mongodb }, ]; export const indexTemplate: IndexTemplateDef = { diff --git a/x-pack/packages/kbn-data-forge/src/lib/create_config.ts b/x-pack/packages/kbn-data-forge/src/lib/create_config.ts index 43e51b2c93438..1373f20a5dd1f 100644 --- a/x-pack/packages/kbn-data-forge/src/lib/create_config.ts +++ b/x-pack/packages/kbn-data-forge/src/lib/create_config.ts @@ -14,7 +14,7 @@ import { DEFAULTS } from '../constants'; export async function readConfig(filePath: string): Promise { const data = await promises.readFile(filePath); - const decodedPartialConfig = PartialConfigRT.decode(yaml.load(data.toString())); + const decodedPartialConfig = PartialConfigRT.decode(yaml.safeLoad(data.toString())); if (isLeft(decodedPartialConfig)) { throw new Error( `Could not validate config: ${PathReporter.report(decodedPartialConfig).join('\n')}` diff --git a/x-pack/packages/kbn-elastic-assistant-common/constants.ts b/x-pack/packages/kbn-elastic-assistant-common/constants.ts index a25c935139b24..d84d9d4cd6825 100755 --- a/x-pack/packages/kbn-elastic-assistant-common/constants.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/constants.ts @@ -50,3 +50,6 @@ export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_find` as const; export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_bulk_action` as const; + +export const ELASTIC_AI_ASSISTANT_EVALUATE_URL = + `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/evaluate` as const; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen.ts index 52174259eeec5..7a184fa28916f 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '../common_attributes.gen'; import { Replacements } from '../conversations/common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.schema.yaml index e4a1e1ce0f7b9..aa9f2aa8d879d 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.schema.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Execute Connector API endpoint - version: '1' + version: "1" paths: /internal/elastic_assistant/actions/connector/{connectorId}/_execute: post: @@ -103,4 +103,3 @@ paths: type: string message: type: string - diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts index 4aed90462893c..0e66e1bf4eede 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts index d74f96b9be6ce..1c478cb0b1f5c 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts index bc59404e0abff..8c99ca0756eb3 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '../common_attributes.gen'; import { AttackDiscoveryResponse } from './common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts index 57b79b87fe4f9..9599e8596e553 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts @@ -14,7 +14,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString, User } from '../common_attributes.gen'; import { Replacements, ApiConfig } from '../conversations/common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts index 00eb09809614b..765a24e00ba52 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '../common_attributes.gen'; import { AttackDiscoveryResponse, AttackDiscoveryStat } from './common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts index d2912c6e09ba2..e080be1138eb3 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { AnonymizationFieldResponse } from '../anonymization_fields/bulk_crud_anonymization_fields_route.gen'; import { ApiConfig, Replacements } from '../conversations/common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/capabilities/get_capabilities_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/capabilities/get_capabilities_route.gen.ts index 6341f7296f390..55797f5d97847 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/capabilities/get_capabilities_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/capabilities/get_capabilities_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type GetCapabilitiesResponse = z.infer; export const GetCapabilitiesResponse = z.object({ diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts index 0b6c3bbe6cbb3..cd43bda23faf4 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type RootContext = z.infer; export const RootContext = z.literal('security'); diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common.ts index 5e847aef69fc0..64745bf1c9c28 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common.ts @@ -14,7 +14,7 @@ import type { RouteValidationResultFactory, RouteValidationError, } from '@kbn/core/server'; -import type { TypeOf, ZodType } from 'zod'; +import type { TypeOf, ZodType } from '@kbn/zod'; import { stringifyZodError } from '@kbn/zod-helpers'; type RequestValidationResult = diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts index 613d54fa080fb..1697011a08532 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts @@ -14,7 +14,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; /** * A string that is not empty and does not contain only whitespace diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts index 7789a4fbb2983..6a35bd91378de 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString } from '../common_attributes.gen'; import { ConversationMessageCreateProps, ConversationResponse } from './common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts index 65ea85b3f0190..b26ae9d9d913f 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ConversationCreateProps, diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts index 03f63ec0f2d29..1ba701474b1f8 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts @@ -14,7 +14,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString, User } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts index 4145cb66b2852..8fd92c41f1a51 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ConversationCreateProps, diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts index 95c9f7f53c8a2..244a88fa1daff 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts index c0920c34a6b2a..e7999a8665cda 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.gen.ts @@ -14,9 +14,10 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export type GetEvaluateResponse = z.infer; export const GetEvaluateResponse = z.object({ - agentExecutors: z.array(z.string()), + datasets: z.array(z.string()), + graphs: z.array(z.string()), }); diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.schema.yaml index deccfb9f2488c..01a93b6952a8c 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/get_evaluate_route.schema.yaml @@ -1,32 +1,37 @@ openapi: 3.0.0 info: title: Get Evaluate API endpoint - version: '1' + version: "1" paths: /internal/elastic_assistant/evaluate: get: x-codegen-enabled: true x-labels: [ess, serverless] operationId: GetEvaluate - description: Get relevant data for performing an evaluation like available sample data, agents, and evaluators + description: Get relevant data for performing an evaluation like available sample data, graphs, and evaluators summary: Get relevant data for performing an evaluation tags: - Evaluation API responses: - '200': + "200": description: Successful response content: application/json: schema: type: object properties: - agentExecutors: + datasets: + type: array + items: + type: string + graphs: type: array items: type: string required: - - agentExecutors - '400': + - datasets + - graphs + "400": description: Generic Error content: application/json: diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts index f405d211d6d56..b6d51b9bea3fc 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.gen.ts @@ -14,65 +14,21 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; -export type OutputIndex = z.infer; -export const OutputIndex = z.string().regex(/^.kibana-elastic-ai-assistant-/); - -export type DatasetItem = z.infer; -export const DatasetItem = z.object({ - id: z.string().optional(), - input: z.string(), - prediction: z.string().optional(), - reference: z.string(), - tags: z.array(z.string()).optional(), -}); - -export type Dataset = z.infer; -export const Dataset = z.array(DatasetItem).default([]); +import { Replacements } from '../conversations/common_attributes.gen'; export type PostEvaluateBody = z.infer; export const PostEvaluateBody = z.object({ - dataset: Dataset.optional(), - evalPrompt: z.string().optional(), -}); - -export type PostEvaluateRequestQuery = z.infer; -export const PostEvaluateRequestQuery = z.object({ - /** - * Agents parameter description - */ - agents: z.string(), - /** - * Dataset Name parameter description - */ - datasetName: z.string().optional(), - /** - * Evaluation Type parameter description - */ - evaluationType: z.string().optional(), - /** - * Eval Model parameter description - */ - evalModel: z.string().optional(), - /** - * Models parameter description - */ - models: z.string(), - /** - * Output Index parameter description - */ - outputIndex: OutputIndex, - /** - * Project Name parameter description - */ - projectName: z.string().optional(), - /** - * Run Name parameter description - */ + graphs: z.array(z.string()), + datasetName: z.string(), + connectorIds: z.array(z.string()), runName: z.string().optional(), + alertsIndexPattern: z.string().optional().default('.alerts-security.alerts-default'), + langSmithApiKey: z.string().optional(), + replacements: Replacements.optional().default({}), + size: z.number().optional().default(20), }); -export type PostEvaluateRequestQueryInput = z.input; export type PostEvaluateRequestBody = z.infer; export const PostEvaluateRequestBody = PostEvaluateBody; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.schema.yaml index 4b567f9cd118a..d0bec37344165 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/evaluation/post_evaluate_route.schema.yaml @@ -1,14 +1,14 @@ openapi: 3.0.0 info: title: Post Evaluate API endpoint - version: '1' + version: "1" paths: /internal/elastic_assistant/evaluate: post: x-codegen-enabled: true x-labels: [ess, serverless] operationId: PostEvaluate - description: Perform an evaluation using sample data against a combination of Agents and Connectors + description: Perform an evaluation using sample data against a combination of Graphs and Connectors summary: Performs an evaluation of the Elastic Assistant tags: - Evaluation API @@ -17,53 +17,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PostEvaluateBody' - parameters: - - name: agents - in: query - description: Agents parameter description - required: true - schema: - type: string - - name: datasetName - in: query - description: Dataset Name parameter description - schema: - type: string - - name: evaluationType - in: query - description: Evaluation Type parameter description - schema: - type: string - - name: evalModel - in: query - description: Eval Model parameter description - schema: - type: string - - name: models - in: query - description: Models parameter description - required: true - schema: - type: string - - name: outputIndex - in: query - description: Output Index parameter description - required: true - schema: - $ref: '#/components/schemas/OutputIndex' - - name: projectName - in: query - description: Project Name parameter description - schema: - type: string - - name: runName - in: query - description: Run Name parameter description - schema: - type: string + $ref: "#/components/schemas/PostEvaluateBody" responses: - '200': + "200": description: Successful response content: application/json: @@ -77,7 +33,7 @@ paths: required: - evaluationId - success - '400': + "400": description: Generic Error content: application/json: @@ -92,36 +48,33 @@ paths: type: string components: schemas: - OutputIndex: - type: string - pattern: '^.kibana-elastic-ai-assistant-' - DatasetItem: + PostEvaluateBody: type: object + required: + - graphs + - datasetName + - connectorIds properties: - id: - type: string - input: - type: string - prediction: - type: string - reference: + graphs: + type: array + items: + type: string + datasetName: type: string - tags: + connectorIds: type: array items: type: string - required: - - input - - reference - Dataset: - type: array - items: - $ref: '#/components/schemas/DatasetItem' - default: [] - PostEvaluateBody: - type: object - properties: - dataset: - $ref: '#/components/schemas/Dataset' - evalPrompt: + runName: + type: string + alertsIndexPattern: + type: string + default: ".alerts-security.alerts-default" + langSmithApiKey: type: string + replacements: + $ref: "../conversations/common_attributes.schema.yaml#/components/schemas/Replacements" + default: {} + size: + type: number + default: 20 diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/bulk_crud_knowledge_base_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/bulk_crud_knowledge_base_route.gen.ts index 5c5f7e2faafb9..44759badb7374 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/bulk_crud_knowledge_base_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/bulk_crud_knowledge_base_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { KnowledgeBaseEntryCreateProps, diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/common_attributes.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/common_attributes.gen.ts index d1cc9b57460c2..2736baf8a135d 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/common_attributes.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/common_attributes.gen.ts @@ -14,7 +14,7 @@ * version: not applicable */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString, User } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts index 04b97d826c69e..f18bfb57fa359 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; /** * AI assistant KnowledgeBase. diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_knowledge_base_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_knowledge_base_route.gen.ts index 669292e955ec9..c73fb3ba7b7cf 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_knowledge_base_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_knowledge_base_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { KnowledgeBaseEntryCreateProps, diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/find_knowledge_base_entries_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/find_knowledge_base_entries_route.gen.ts index 25db35693c3dc..cb5ae50ec81f0 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/find_knowledge_base_entries_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/find_knowledge_base_entries_route.gen.ts @@ -14,7 +14,7 @@ * version: 1 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts index 820d27dca30ce..1196de5cecf3d 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { NonEmptyString, User } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts index ab40398cddbdb..5c4efb19a44ef 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts @@ -14,7 +14,7 @@ * version: 2023-10-31 */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; diff --git a/x-pack/packages/kbn-elastic-assistant-common/tsconfig.json b/x-pack/packages/kbn-elastic-assistant-common/tsconfig.json index 02f5f7b3babd5..b9f4da3d1f1dc 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/tsconfig.json +++ b/x-pack/packages/kbn-elastic-assistant-common/tsconfig.json @@ -20,5 +20,6 @@ "@kbn/securitysolution-io-ts-utils", "@kbn/core", "@kbn/logging", + "@kbn/zod", ] } diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.test.tsx index d25953370e97a..2320eceb0271e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.test.tsx @@ -7,7 +7,7 @@ import { postEvaluation } from './evaluate'; import { HttpSetup } from '@kbn/core-http-browser'; -import { API_VERSIONS } from '@kbn/elastic-assistant-common'; +import { API_VERSIONS, PostEvaluateRequestBodyInput } from '@kbn/elastic-assistant-common'; jest.mock('@kbn/core-http-browser'); @@ -16,39 +16,26 @@ const mockHttp = { } as unknown as HttpSetup; describe('postEvaluation', () => { - it('calls the knowledge base API when correct resource path', async () => { + const evalParams: PostEvaluateRequestBodyInput = { + graphs: ['not', 'alphabetical'], + datasetName: 'Test Dataset', + runName: 'Test Run Name', + connectorIds: ['not', 'alphabetical'], + }; + + it('calls the evaluate API when correct resource path', async () => { (mockHttp.post as jest.Mock).mockResolvedValue({ success: true }); + const testProps = { http: mockHttp, - evalParams: { - agents: ['not', 'alphabetical'], - dataset: '{}', - datasetName: 'Test Dataset', - projectName: 'Test Project Name', - runName: 'Test Run Name', - evalModel: ['not', 'alphabetical'], - evalPrompt: 'evalPrompt', - evaluationType: ['not', 'alphabetical'], - models: ['not', 'alphabetical'], - outputIndex: 'outputIndex', - }, + evalParams, }; await postEvaluation(testProps); expect(mockHttp.post).toHaveBeenCalledWith('/internal/elastic_assistant/evaluate', { - body: '{"dataset":{},"evalPrompt":"evalPrompt"}', + body: '{"graphs":["not","alphabetical"],"datasetName":"Test Dataset","runName":"Test Run Name","connectorIds":["not","alphabetical"]}', headers: { 'Content-Type': 'application/json' }, - query: { - models: 'alphabetical,not', - agents: 'alphabetical,not', - datasetName: 'Test Dataset', - evaluationType: 'alphabetical,not', - evalModel: 'alphabetical,not', - outputIndex: 'outputIndex', - projectName: 'Test Project Name', - runName: 'Test Run Name', - }, signal: undefined, version: API_VERSIONS.internal.v1, }); @@ -59,11 +46,12 @@ describe('postEvaluation', () => { throw new Error(error); }); - const knowledgeBaseArgs = { + const evaluationArgs = { resource: 'a-resource', http: mockHttp, + evalParams, }; - await expect(postEvaluation(knowledgeBaseArgs)).resolves.toThrowError('simulated error'); + await expect(postEvaluation(evaluationArgs)).rejects.toThrowError('simulated error'); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.tsx index 6581e22e77921..864d6af374ce3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/evaluate.tsx @@ -8,14 +8,15 @@ import { HttpSetup, IHttpFetchError } from '@kbn/core-http-browser'; import { API_VERSIONS, + ELASTIC_AI_ASSISTANT_EVALUATE_URL, GetEvaluateResponse, + PostEvaluateRequestBodyInput, PostEvaluateResponse, } from '@kbn/elastic-assistant-common'; -import { PerformEvaluationParams } from './use_perform_evaluation'; export interface PostEvaluationParams { http: HttpSetup; - evalParams?: PerformEvaluationParams; + evalParams: PostEvaluateRequestBodyInput; signal?: AbortSignal | undefined; } @@ -33,35 +34,15 @@ export const postEvaluation = async ({ http, evalParams, signal, -}: PostEvaluationParams): Promise => { - try { - const path = `/internal/elastic_assistant/evaluate`; - const query = { - agents: evalParams?.agents.sort()?.join(','), - datasetName: evalParams?.datasetName, - evaluationType: evalParams?.evaluationType.sort()?.join(','), - evalModel: evalParams?.evalModel.sort()?.join(','), - outputIndex: evalParams?.outputIndex, - models: evalParams?.models.sort()?.join(','), - projectName: evalParams?.projectName, - runName: evalParams?.runName, - }; - - return await http.post(path, { - body: JSON.stringify({ - dataset: JSON.parse(evalParams?.dataset ?? '[]'), - evalPrompt: evalParams?.evalPrompt ?? '', - }), - headers: { - 'Content-Type': 'application/json', - }, - query, - signal, - version: API_VERSIONS.internal.v1, - }); - } catch (error) { - return error as IHttpFetchError; - } +}: PostEvaluationParams): Promise => { + return http.post(ELASTIC_AI_ASSISTANT_EVALUATE_URL, { + body: JSON.stringify(evalParams), + headers: { + 'Content-Type': 'application/json', + }, + signal, + version: API_VERSIONS.internal.v1, + }); }; export interface GetEvaluationParams { @@ -83,9 +64,7 @@ export const getEvaluation = async ({ signal, }: GetEvaluationParams): Promise => { try { - const path = `/internal/elastic_assistant/evaluate`; - - return await http.get(path, { + return await http.get(ELASTIC_AI_ASSISTANT_EVALUATE_URL, { signal, version: API_VERSIONS.internal.v1, }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.test.tsx index f9fdb2e80b7b2..6d1296fc9aa64 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.test.tsx @@ -9,7 +9,7 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { usePerformEvaluation, UsePerformEvaluationParams } from './use_perform_evaluation'; import { postEvaluation as _postEvaluation } from './evaluate'; import { useMutation as _useMutation } from '@tanstack/react-query'; -import { API_VERSIONS } from '@kbn/elastic-assistant-common'; +import { API_VERSIONS, PostEvaluateRequestBodyInput } from '@kbn/elastic-assistant-common'; const useMutationMock = _useMutation as jest.Mock; const postEvaluationMock = _postEvaluation as jest.Mock; @@ -55,20 +55,10 @@ describe('usePerformEvaluation', () => { await waitForNextUpdate(); expect(defaultProps.http.post).toHaveBeenCalledWith('/internal/elastic_assistant/evaluate', { - body: '{"dataset":[],"evalPrompt":""}', + body: undefined, headers: { 'Content-Type': 'application/json', }, - query: { - agents: undefined, - datasetName: undefined, - evalModel: undefined, - evaluationType: undefined, - models: undefined, - outputIndex: undefined, - projectName: undefined, - runName: undefined, - }, signal: undefined, version: API_VERSIONS.internal.v1, }); @@ -78,17 +68,13 @@ describe('usePerformEvaluation', () => { it('Correctly passes and formats evalParams', async () => { useMutationMock.mockImplementation(async (queryKey, fn, opts) => { try { - const res = await fn({ - agents: ['d', 'c'], - dataset: '["kewl"]', - evalModel: ['b', 'a'], - evalPrompt: 'evalPrompt', - evaluationType: ['f', 'e'], - models: ['h', 'g'], - outputIndex: 'outputIndex', - projectName: 'test project', + const evalParams: PostEvaluateRequestBodyInput = { + graphs: ['d', 'c'], + datasetName: 'kewl', + connectorIds: ['h', 'g'], runName: 'test run', - }); + }; + const res = await fn(evalParams); return Promise.resolve(res); } catch (e) { opts.onError(e); @@ -99,20 +85,10 @@ describe('usePerformEvaluation', () => { await waitForNextUpdate(); expect(defaultProps.http.post).toHaveBeenCalledWith('/internal/elastic_assistant/evaluate', { - body: '{"dataset":["kewl"],"evalPrompt":"evalPrompt"}', + body: '{"graphs":["d","c"],"datasetName":"kewl","connectorIds":["h","g"],"runName":"test run"}', headers: { 'Content-Type': 'application/json', }, - query: { - agents: 'c,d', - datasetName: undefined, - evalModel: 'a,b', - evaluationType: 'e,f', - models: 'g,h', - outputIndex: 'outputIndex', - projectName: 'test project', - runName: 'test run', - }, signal: undefined, version: API_VERSIONS.internal.v1, }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.tsx index 30e95d9d80407..fc803bb0ec50d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/evaluate/use_perform_evaluation.tsx @@ -6,9 +6,10 @@ */ import { useMutation } from '@tanstack/react-query'; -import type { HttpSetup, IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; +import type { HttpSetup, IHttpFetchError } from '@kbn/core-http-browser'; import type { IToasts } from '@kbn/core-notifications-browser'; import { i18n } from '@kbn/i18n'; +import { PostEvaluateRequestBodyInput } from '@kbn/elastic-assistant-common'; import { postEvaluation } from './evaluate'; const PERFORM_EVALUATION_MUTATION_KEY = ['elastic-assistant', 'perform-evaluation']; @@ -18,17 +19,12 @@ export interface UsePerformEvaluationParams { toasts?: IToasts; } -export interface PerformEvaluationParams { - agents: string[]; - dataset: string | undefined; - datasetName: string | undefined; - evalModel: string[]; - evalPrompt: string; - evaluationType: string[]; - models: string[]; - outputIndex: string; - projectName: string | undefined; - runName: string | undefined; +export interface ResponseError { + statusCode: number; + success: boolean; + message: { + error: string; + }; } /** @@ -43,15 +39,14 @@ export interface PerformEvaluationParams { export const usePerformEvaluation = ({ http, toasts }: UsePerformEvaluationParams) => { return useMutation( PERFORM_EVALUATION_MUTATION_KEY, - (evalParams?: PerformEvaluationParams | void) => { - // Optional params workaround: see: https://github.com/TanStack/query/issues/1077#issuecomment-1431247266 - return postEvaluation({ http, evalParams: evalParams ?? undefined }); + (evalParams: PostEvaluateRequestBodyInput) => { + return postEvaluation({ http, evalParams }); }, { - onError: (error: IHttpFetchError) => { + onError: (error: IHttpFetchError) => { if (error.name !== 'AbortError') { toasts?.addError( - error.body && error.body.message ? new Error(error.body.message) : error, + error?.body?.message?.error ? new Error(error.body.message.error) : error, { title: i18n.translate('xpack.elasticAssistant.evaluation.evaluationError', { defaultMessage: 'Error performing evaluation...', diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx new file mode 100644 index 0000000000000..eaf9a32fde81a --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useMutation } from '@tanstack/react-query'; +import type { HttpSetup, IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; +import type { IToasts } from '@kbn/core-notifications-browser'; +import { i18n } from '@kbn/i18n'; + +import { + API_VERSIONS, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, + KnowledgeBaseEntryCreateProps, + KnowledgeBaseEntryResponse, +} from '@kbn/elastic-assistant-common'; +import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries'; + +const CREATE_KNOWLEDGE_BASE_ENTRY_MUTATION_KEY = [ + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, + API_VERSIONS.internal.v1, +]; + +export interface UseCreateKnowledgeBaseEntryParams { + http: HttpSetup; + signal?: AbortSignal; + toasts?: IToasts; +} + +/** + * Hook for creating a Knowledge Base Entry + * + * @param {Object} options - The options object + * @param {HttpSetup} options.http - HttpSetup + * @param {AbortSignal} [options.signal] - AbortSignal + * @param {IToasts} [options.toasts] - IToasts + * + * @returns mutation hook for creating a Knowledge Base Entry + * + */ +export const useCreateKnowledgeBaseEntry = ({ + http, + signal, + toasts, +}: UseCreateKnowledgeBaseEntryParams) => { + const invalidateKnowledgeBaseEntries = useInvalidateKnowledgeBaseEntries(); + + return useMutation( + CREATE_KNOWLEDGE_BASE_ENTRY_MUTATION_KEY, + (entry: KnowledgeBaseEntryCreateProps) => { + return http.post( + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, + { + body: JSON.stringify(entry), + version: API_VERSIONS.internal.v1, + signal, + } + ); + }, + { + onError: (error: IHttpFetchError) => { + if (error.name !== 'AbortError') { + toasts?.addError( + error.body && error.body.message ? new Error(error.body.message) : error, + { + title: i18n.translate( + 'xpack.elasticAssistant.knowledgeBase.entries.createErrorTitle', + { + defaultMessage: 'Error creating Knowledge Base Entry', + } + ), + } + ); + } + }, + onSettled: () => { + invalidateKnowledgeBaseEntries(); + }, + } + ); +}; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx new file mode 100644 index 0000000000000..0cfce8f576b24 --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx @@ -0,0 +1,90 @@ +/* + * 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 { useMutation } from '@tanstack/react-query'; +import type { HttpSetup, IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; +import type { IToasts } from '@kbn/core-notifications-browser'; +import { i18n } from '@kbn/i18n'; + +import { + API_VERSIONS, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + KnowledgeBaseEntryBulkActionBase, + KnowledgeBaseEntryBulkCrudActionResponse, + PerformKnowledgeBaseEntryBulkActionRequestBody, +} from '@kbn/elastic-assistant-common'; +import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries'; + +const DELETE_KNOWLEDGE_BASE_ENTRIES_MUTATION_KEY = [ + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + API_VERSIONS.internal.v1, +]; + +export interface UseDeleteKnowledgeEntriesParams { + http: HttpSetup; + signal?: AbortSignal; + toasts?: IToasts; +} + +/** + * Hook for deleting Knowledge Base Entries by id or query. + * + * @param {Object} options - The options object + * @param {HttpSetup} options.http - HttpSetup + * @param {AbortSignal} [options.signal] - AbortSignal + * @param {IToasts} [options.toasts] - IToasts + * + * @returns mutation hook for deleting Knowledge Base Entries + * + */ +export const useDeleteKnowledgeBaseEntries = ({ + http, + signal, + toasts, +}: UseDeleteKnowledgeEntriesParams) => { + const invalidateKnowledgeBaseEntries = useInvalidateKnowledgeBaseEntries(); + + return useMutation( + DELETE_KNOWLEDGE_BASE_ENTRIES_MUTATION_KEY, + ({ ids, query }: KnowledgeBaseEntryBulkActionBase) => { + const body: PerformKnowledgeBaseEntryBulkActionRequestBody = { + delete: { + query, + ids, + }, + }; + return http.post( + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + { + body: JSON.stringify(body), + version: API_VERSIONS.internal.v1, + signal, + } + ); + }, + { + onError: (error: IHttpFetchError) => { + if (error.name !== 'AbortError') { + toasts?.addError( + error.body && error.body.message ? new Error(error.body.message) : error, + { + title: i18n.translate( + 'xpack.elasticAssistant.knowledgeBase.entries.deleteErrorTitle', + { + defaultMessage: 'Error deleting Knowledge Base Entries', + } + ), + } + ); + } + }, + onSettled: () => { + invalidateKnowledgeBaseEntries(); + }, + } + ); +}; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts new file mode 100644 index 0000000000000..aa1d72d755ffa --- /dev/null +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.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 { HttpSetup } from '@kbn/core/public'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { + API_VERSIONS, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, + FindKnowledgeBaseEntriesResponse, +} from '@kbn/elastic-assistant-common'; + +import { useCallback } from 'react'; + +export interface UseKnowledgeBaseEntriesParams { + http: HttpSetup; + signal?: AbortSignal | undefined; +} + +/** + * Hook for fetching Knowledge Base Entries. + * + * Note: RBAC is handled at kbDataClient layer, so unless user has KB feature privileges, this will only return system and their own user KB entries. + * + * @param {Object} options - The options object. + * @param {HttpSetup} options.http - HttpSetup + * @param {Function} [options.onFetch] - transformation function for kb entries fetch result + * @param {AbortSignal} [options.signal] - AbortSignal + * + * @returns {useQuery} hook for fetching Knowledge Base Entries + */ +const query = { + page: 1, + perPage: 100, +}; + +export const KNOWLEDGE_BASE_ENTRY_QUERY_KEY = [ + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, + query.page, + query.perPage, + API_VERSIONS.internal.v1, +]; + +export const useKnowledgeBaseEntries = ({ http, signal }: UseKnowledgeBaseEntriesParams) => + useQuery( + KNOWLEDGE_BASE_ENTRY_QUERY_KEY, + async () => + http.fetch( + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, + { + method: 'GET', + version: API_VERSIONS.internal.v1, + query, + signal, + } + ), + { + keepPreviousData: true, + initialData: { page: 1, perPage: 100, total: 0, data: [] }, + } + ); + +/** + * Use this hook to invalidate the Knowledge Base Entries cache. For example, adding, + * editing, or deleting any Knowledge Base entries should lead to cache invalidation. + * + * @returns {Function} - Function to invalidate the Knowledge Base Entries cache + */ +export const useInvalidateKnowledgeBaseEntries = () => { + const queryClient = useQueryClient(); + + return useCallback(() => { + queryClient.invalidateQueries(KNOWLEDGE_BASE_ENTRY_QUERY_KEY, { + refetchType: 'active', + }); + }, [queryClient]); +}; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx index 9ec703093d44f..58d47a696225f 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx @@ -38,7 +38,7 @@ export const EmptyConvo: React.FC = ({ setIsSettingsModalVisible, }) => { return ( - + = ({ text-align: center; `} > - + diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx index 348fbb1ad3496..89518940799ee 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx @@ -106,6 +106,7 @@ export const FlyoutNavigation = memo( size="xs" color="primary" iconType="newChat" + data-test-subj="newChatFromOverlay" onClick={onConversationCreate} disabled={isLoading || !isAssistantEnabled} > diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx index 9b75c2e9e7c53..03016f143b6b0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx @@ -59,6 +59,7 @@ export const AssistantTitle: React.FC<{ `} > ( onConversationSelected({ cId: conversation.id, cTitle: conversation.title }) } label={conversation.title} + data-test-subj={`conversation-select-${conversation.title}`} isActive={ !isEmpty(conversation.id) ? conversation.id === currentConversation?.id diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx index f4e0e7aa76528..f6e7b320611b1 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx @@ -456,7 +456,7 @@ const AssistantComponent: React.FC = ({ overflow: hidden; `} > - + = ({ {Object.keys(selectedPromptContexts) .sort() - .map((id) => ( + .map((id, i) => ( { render({option.dropdownDisplay}); - expect(screen.getByTestId('name')).toHaveTextContent(mockSystemPrompt.name); + expect(screen.getByTestId(`systemPrompt-${mockSystemPrompt.name}`)).toHaveTextContent( + mockSystemPrompt.name + ); }); it('shows the expected prompt content in the dropdownDisplay', () => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx index b5efd08b28f9c..b28d13a91fcd2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx @@ -46,7 +46,7 @@ export const getOptionFromPrompt = ({ ), dropdownDisplay: ( <> - {name} + {name} {/* Empty content tooltip gets around :hover styles from SuperSelectOptionButton */} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx index 2ac6aee95386a..b480d2150bc28 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx @@ -67,7 +67,6 @@ const SystemPromptComponent: React.FC = ({ isCleared={isCleared} refetchConversations={refetchConversations} isSettingsModalVisible={isSettingsModalVisible} - onSystemPromptSelectionChange={onSystemPromptSelectionChange} selectedPrompt={selectedPrompt} setIsSettingsModalVisible={setIsSettingsModalVisible} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx index 7b8e451449884..6f4cd976846c2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx @@ -33,7 +33,7 @@ export const SystemPromptSettings: React.FC = React.m return ( <> -

{i18n.SETTINGS_TITLE}

+

{i18n.SETTINGS_TITLE}

{i18n.SETTINGS_DESCRIPTION} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx index eedb560019f0c..835047a8da8c0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx @@ -88,6 +88,7 @@ export const PromptContextSelector: React.FC = React.memo( = React.memo( > onClickAddQuickPrompt(badge)} onClickAriaLabel={badge.name} > diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx index e6ce69f65abab..a06c28ed360f5 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx @@ -17,7 +17,6 @@ import { EuiComboBox, EuiButton, EuiComboBoxOptionOption, - EuiTextArea, EuiTextColor, EuiFieldText, EuiFlexItem, @@ -28,52 +27,33 @@ import { import { css } from '@emotion/react'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { GetEvaluateResponse, PostEvaluateResponse } from '@kbn/elastic-assistant-common'; +import type { + GetEvaluateResponse, + PostEvaluateRequestBodyInput, +} from '@kbn/elastic-assistant-common'; import * as i18n from './translations'; import { useAssistantContext } from '../../../assistant_context'; import { useLoadConnectors } from '../../../connectorland/use_load_connectors'; import { getActionTypeTitle, getGenAiConfig } from '../../../connectorland/helpers'; import { PRECONFIGURED_CONNECTOR } from '../../../connectorland/translations'; import { usePerformEvaluation } from '../../api/evaluate/use_perform_evaluation'; -import { getApmLink, getDiscoverLink } from './utils'; import { useEvaluationData } from '../../api/evaluate/use_evaluation_data'; -const DEFAULT_EVAL_TYPES_OPTIONS = [ - { label: 'correctness' }, - { label: 'esql-validator', disabled: true }, - { label: 'custom', disabled: true }, -]; -const DEFAULT_OUTPUT_INDEX = '.kibana-elastic-ai-assistant-evaluation-results'; - /** * Evaluation Settings -- development-only feature for evaluating models */ export const EvaluationSettings: React.FC = React.memo(() => { - const { actionTypeRegistry, basePath, http, setTraceOptions, traceOptions } = - useAssistantContext(); + const { actionTypeRegistry, http, setTraceOptions, toasts, traceOptions } = useAssistantContext(); const { data: connectors } = useLoadConnectors({ http }); - const { - data: evalResponse, - mutate: performEvaluation, - isLoading: isPerformingEvaluation, - } = usePerformEvaluation({ + const { mutate: performEvaluation, isLoading: isPerformingEvaluation } = usePerformEvaluation({ http, + toasts, }); const { data: evalData } = useEvaluationData({ http }); - const defaultAgents = useMemo( - () => (evalData as GetEvaluateResponse)?.agentExecutors ?? [], - [evalData] - ); + const defaultGraphs = useMemo(() => (evalData as GetEvaluateResponse)?.graphs ?? [], [evalData]); + const datasets = useMemo(() => (evalData as GetEvaluateResponse)?.datasets ?? [], [evalData]); // Run Details - // Project Name - const [projectName, setProjectName] = useState(); - const onProjectNameChange = useCallback( - (e) => { - setProjectName(e.target.value); - }, - [setProjectName] - ); // Run Name const [runName, setRunName] = useState(); const onRunNameChange = useCallback( @@ -82,14 +62,6 @@ export const EvaluationSettings: React.FC = React.memo(() => { }, [setRunName] ); - // Local Output Index - const [outputIndex, setOutputIndex] = useState(DEFAULT_OUTPUT_INDEX); - const onOutputIndexChange = useCallback( - (e) => { - setOutputIndex(e.target.value); - }, - [setOutputIndex] - ); /** Trace Options **/ const [showTraceOptions, setShowTraceOptions] = useState(false); const onApmUrlChange = useCallback( @@ -111,56 +83,17 @@ export const EvaluationSettings: React.FC = React.memo(() => { [setTraceOptions, traceOptions] ); /** Dataset **/ - const [useLangSmithDataset, setUseLangSmithDataset] = useState(true); - const datasetToggleButton = useMemo(() => { - return ( - - {i18n.EVALUATOR_DATASET_LABEL} - {' ('} - setUseLangSmithDataset(true)} - > - {i18n.LANGSMITH_DATASET_LABEL} - - {' / '} - setUseLangSmithDataset(false)} - > - {i18n.CUSTOM_DATASET_LABEL} - - {')'} - - ); - }, [useLangSmithDataset]); - const [datasetName, setDatasetName] = useState(); - const onDatasetNameChange = useCallback( - (e) => { - setDatasetName(e.target.value); - }, - [setDatasetName] - ); - const sampleDataset = [ - { - input: - 'As an expert user of Elastic Security, please generate an accurate and valid ESQL query to detect the use case below. Your response should be formatted to be able to use immediately in an Elastic Security timeline or detection rule. Take your time with the answer, and really make sure you check your knowledge really well on all the functions I am asking for. check it multiple times if you need to. I cannot afford for queries to be inaccurate. Assume I am using the Elastic Common Schema. Ensure the answers are formatted in a way which is easily copyable.\n\n' + - 'Write an ESQL query for detecting cryptomining activity on an AWS EC2 instance.', - reference: - 'FROM metrics-apm*\n| WHERE metricset.name == ""transaction"" AND metricset.interval == ""1m""\n| EVAL bucket = AUTO_BUCKET(transaction.duration.histogram, 50, , )\n| STATS avg_duration = AVG(transaction.duration.histogram) BY bucket', - }, - ]; - const [datasetText, setDatasetText] = useState(JSON.stringify(sampleDataset, null, 2)); - const onDatasetTextChange = useCallback( - (e) => { - setDatasetText(e.target.value); + const [selectedDatasetOptions, setSelectedDatasetOptions] = useState< + Array> + >([]); + const datasetOptions = useMemo(() => { + return datasets.map((label) => ({ label })); + }, [datasets]); + const onDatasetOptionsChange = useCallback( + (selectedOptions: Array>) => { + setSelectedDatasetOptions(selectedOptions); }, - [setDatasetText] + [setSelectedDatasetOptions] ); // Predictions @@ -191,17 +124,17 @@ export const EvaluationSettings: React.FC = React.memo(() => { ); }, [actionTypeRegistry, connectors, visColorsBehindText]); - // Agents - const [selectedAgentOptions, setSelectedAgentOptions] = useState< + // Graphs + const [selectedGraphOptions, setSelectedGraphOptions] = useState< Array> >([]); - const onAgentOptionsChange = useCallback( - (agentOptions: Array>) => { - setSelectedAgentOptions(agentOptions); + const onGraphOptionsChange = useCallback( + (graphOptions: Array>) => { + setSelectedGraphOptions(graphOptions); }, - [setSelectedAgentOptions] + [setSelectedGraphOptions] ); - const onAgentOptionsCreate = useCallback( + const onGraphOptionsCreate = useCallback( (searchValue: string) => { const normalizedSearchValue = searchValue.trim(); @@ -209,108 +142,35 @@ export const EvaluationSettings: React.FC = React.memo(() => { return; } - setSelectedAgentOptions([...selectedAgentOptions, { label: normalizedSearchValue }]); + setSelectedGraphOptions([...selectedGraphOptions, { label: normalizedSearchValue }]); }, - [selectedAgentOptions] - ); - const agentOptions = useMemo(() => { - return defaultAgents.map((label) => ({ label })); - }, [defaultAgents]); - - // Evaluation - // Evaluation Type - const [selectedEvaluationType, setSelectedEvaluationType] = useState< - Array> - >([]); - const onEvaluationTypeChange = useCallback( - (evaluationType: Array>) => { - setSelectedEvaluationType(evaluationType); - }, - [setSelectedEvaluationType] - ); - const onEvaluationTypeOptionsCreate = useCallback( - (searchValue: string) => { - const normalizedSearchValue = searchValue.trim(); - - if (!normalizedSearchValue) { - return; - } - - setSelectedEvaluationType([{ label: normalizedSearchValue }]); - }, - [setSelectedEvaluationType] - ); - const evaluationTypeOptions = useMemo(() => { - return DEFAULT_EVAL_TYPES_OPTIONS; - }, []); - - // Eval Model - const [selectedEvaluatorModelOptions, setSelectedEvaluatorModelOptions] = useState< - Array> - >([]); - const onEvaluatorModelOptionsChange = useCallback( - (selectedOptions: Array>) => { - setSelectedEvaluatorModelOptions(selectedOptions); - }, - [setSelectedEvaluatorModelOptions] - ); - - // Eval Prompt - const sampleEvalPrompt: string = `For the below input: \n\n{{input}} \n\na prediction: \n\n{{prediction}} \n\nwas made. How's it stack up against this reference: \n\n{{reference}} \n\nReturn output in a succinct sentence ranking on a simple grading rubric focused on correctness.`; - const [evalPrompt, setEvalPrompt] = useState(sampleEvalPrompt); - const onEvalPromptChange = useCallback( - (e) => { - setEvalPrompt(e.target.value); - }, - [setEvalPrompt] + [selectedGraphOptions] ); + const graphOptions = useMemo(() => { + return defaultGraphs.map((label) => ({ label })); + }, [defaultGraphs]); // Required fields by eval API const isPerformEvaluationDisabled = - selectedModelOptions.length === 0 || - selectedAgentOptions.length === 0 || - outputIndex.length === 0; + selectedModelOptions.length === 0 || selectedGraphOptions.length === 0; // Perform Evaluation Button const handlePerformEvaluation = useCallback(async () => { - const evalParams = { - models: selectedModelOptions.flatMap((option) => option.key ?? []), - agents: selectedAgentOptions.map((option) => option.label), - dataset: useLangSmithDataset ? undefined : datasetText, - datasetName: useLangSmithDataset ? datasetName : undefined, - evalModel: selectedEvaluatorModelOptions.flatMap((option) => option.key ?? []), - evalPrompt, - evaluationType: selectedEvaluationType.map((option) => option.label), - outputIndex, - projectName, + const evalParams: PostEvaluateRequestBodyInput = { + connectorIds: selectedModelOptions.flatMap((option) => option.key ?? []).sort(), + graphs: selectedGraphOptions.map((option) => option.label).sort(), + datasetName: selectedDatasetOptions[0]?.label, runName, }; performEvaluation(evalParams); }, [ - datasetName, - datasetText, - evalPrompt, - outputIndex, performEvaluation, - projectName, runName, - selectedAgentOptions, - selectedEvaluationType, - selectedEvaluatorModelOptions, + selectedDatasetOptions, + selectedGraphOptions, selectedModelOptions, - useLangSmithDataset, ]); - const discoverLink = useMemo( - () => getDiscoverLink(basePath, (evalResponse as PostEvaluateResponse)?.evaluationId ?? ''), - [basePath, evalResponse] - ); - - const apmLink = useMemo( - () => getApmLink(basePath, (evalResponse as PostEvaluateResponse)?.evaluationId ?? ''), - [basePath, evalResponse] - ); - const getSection = (title: string, description: string) => (
@@ -337,10 +197,6 @@ export const EvaluationSettings: React.FC = React.memo(() => { () => getSection(i18n.PREDICTION_DETAILS_TITLE, i18n.PREDICTION_DETAILS_DESCRIPTION), [] ); - const evalDetailsSection = useMemo( - () => getSection(i18n.EVALUATION_DETAILS_TITLE, i18n.EVALUATION_DETAILS_DESCRIPTION), - [] - ); const buttonCss = css` &:hover { @@ -362,79 +218,33 @@ export const EvaluationSettings: React.FC = React.memo(() => { initialIsOpen={true} paddingSize="s" > - - - - - - - - - - - - - {useLangSmithDataset ? ( - - ) : ( - - )} + - { { { @@ -508,7 +318,7 @@ export const EvaluationSettings: React.FC = React.memo(() => { helpText={i18n.CONNECTORS_DESCRIPTION} > { - {/* Evaluation Details*/} - - - - - - - - - - - - - - { - {i18n.EVALUATOR_FUN_FACT_DISCOVER_LINK} - - ), - apm: ( - - {i18n.EVALUATOR_FUN_FACT_APM_LINK} - - ), - }} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/translations.ts index e875b4c35b203..b1adb6296b2a1 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/translations.ts @@ -17,7 +17,7 @@ export const SETTINGS_DESCRIPTION = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.settingsDescription', { defaultMessage: - 'Run predictions and evaluations against test data sets using different models (connectors), agents, and evaluation schemes.', + 'Run predictions against LangSmith test data sets using different models (connectors) and graphs.', } ); @@ -31,7 +31,7 @@ export const RUN_DETAILS_TITLE = i18n.translate( export const RUN_DETAILS_DESCRIPTION = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.runDetailsDescription', { - defaultMessage: 'Configure test run details like project, run name, dataset, and output index.', + defaultMessage: 'Configure test run details like the run name and dataset.', } ); @@ -46,43 +46,7 @@ export const PREDICTION_DETAILS_DESCRIPTION = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.predictionDetailsDescription', { defaultMessage: - 'Choose models (connectors) and corresponding agents the dataset should run against.', - } -); - -export const EVALUATION_DETAILS_TITLE = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationDetailsTitle', - { - defaultMessage: 'Evaluation (Optional)', - } -); - -export const EVALUATION_DETAILS_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationDetailsDescription', - { - defaultMessage: - 'Evaluate prediction results using a specific model (connector) and evaluation criterion.', - } -); - -export const PROJECT_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.projectLabel', - { - defaultMessage: 'Project', - } -); - -export const PROJECT_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.projectDescription', - { - defaultMessage: 'LangSmith project to write results to.', - } -); - -export const PROJECT_PLACEHOLDER = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.projectPlaceholder', - { - defaultMessage: '8.12 Testing', + 'Choose models (connectors) and corresponding graphs the dataset should run against.', } ); @@ -103,7 +67,7 @@ export const RUN_NAME_DESCRIPTION = i18n.translate( export const RUN_NAME_PLACEHOLDER = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.runNamePlaceholder', { - defaultMessage: '8.12 ESQL Query Generation', + defaultMessage: '8.16 Streaming Regression', } ); @@ -121,75 +85,17 @@ export const CONNECTORS_DESCRIPTION = i18n.translate( } ); -export const AGENTS_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.agentsLabel', - { - defaultMessage: 'Agents', - } -); - -export const AGENTS_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.agentsDescription', - { - defaultMessage: 'Select the agents (RAG algorithms) to evaluate the dataset against.', - } -); - -export const EVALUATOR_MODEL_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorModelLabel', +export const GRAPHS_LABEL = i18n.translate( + 'xpack.elasticAssistant.assistant.settings.evaluationSettings.graphsLabel', { - defaultMessage: 'Evaluator Model', + defaultMessage: 'Graphs', } ); -export const EVALUATOR_MODEL_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorModelDescription', +export const GRAPHS_DESCRIPTION = i18n.translate( + 'xpack.elasticAssistant.assistant.settings.evaluationSettings.graphsDescription', { - defaultMessage: 'Model that performs the final evaluation.', - } -); - -export const EVALUATION_TYPE_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationTypeLabel', - { - defaultMessage: 'Evaluation type', - } -); - -export const EVALUATION_TYPE_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationTypeDescription', - { - defaultMessage: - 'Type of evaluation to perform, e.g. "correctness" "esql-validator", or "custom".', - } -); - -export const EVALUATION_PROMPT_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationPromptLabel', - { - defaultMessage: 'Evaluation prompt', - } -); - -export const EVALUATION_PROMPT_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluationPromptDescription', - { - defaultMessage: - 'Prompt template given `input`, `reference` and `prediction` template variables.', - } -); -export const EVALUATOR_OUTPUT_INDEX_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorOutputIndexLabel', - { - defaultMessage: 'Output index', - } -); - -export const EVALUATOR_OUTPUT_INDEX_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorOutputIndexDescription', - { - defaultMessage: - 'Index to write results to. Must be prefixed with ".kibana-elastic-ai-assistant-".', + defaultMessage: 'Select the different graphs to evaluate the dataset against.', } ); @@ -250,14 +156,7 @@ export const LANGSMITH_API_KEY_DESCRIPTION = i18n.translate( export const EVALUATOR_DATASET_LABEL = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorDatasetLabel', { - defaultMessage: 'Dataset', - } -); - -export const LANGSMITH_DATASET_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.langsmithDatasetLabel', - { - defaultMessage: 'LangSmith', + defaultMessage: 'LangSmith Dataset', } ); @@ -271,22 +170,7 @@ export const LANGSMITH_DATASET_DESCRIPTION = i18n.translate( export const LANGSMITH_DATASET_PLACEHOLDER = i18n.translate( 'xpack.elasticAssistant.assistant.settings.evaluationSettings.langsmithDatasetPlaceholder', { - defaultMessage: 'ESQL Query Generation', - } -); - -export const CUSTOM_DATASET_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.customDatasetLabel', - { - defaultMessage: 'Custom', - } -); - -export const CUSTOM_DATASET_DESCRIPTION = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.customDatasetDescription', - { - defaultMessage: - 'Custom dataset to evaluate. Array of objects with "input" and "references" properties.', + defaultMessage: 'Select dataset...', } ); @@ -296,16 +180,3 @@ export const PERFORM_EVALUATION = i18n.translate( defaultMessage: 'Perform evaluation...', } ); - -export const EVALUATOR_FUN_FACT_DISCOVER_LINK = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorFunFactDiscoverLinkText', - { - defaultMessage: 'Discover', - } -); -export const EVALUATOR_FUN_FACT_APM_LINK = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.evaluationSettings.evaluatorFunFactApmLinkText', - { - defaultMessage: 'APM', - } -); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx index e07f84eb0d487..4908b580552fb 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx @@ -25,6 +25,7 @@ export const UpgradeLicenseCallToAction: React.FC = ({ http }) => { const basePath = http.basePath.get(); return ( = React.memo( dropdownDisplay: ( - + {connector.name} {connectorDetails && ( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.tsx index 01f4049fb67b3..b23f85519a08b 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useMemo, useState } from 'react'; -import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiComboBoxProps } from '@elastic/eui'; import * as i18n from './translations'; @@ -49,7 +49,9 @@ export const ModelSelector: React.FC = React.memo( ); // Callback for when user types to create a new model - const onCreateOption = useCallback( + const onCreateOption = useCallback< + NonNullable['onCreateOption']> + >( (searchValue, flattenedOptions = []) => { if (!searchValue || !searchValue.trim().toLowerCase()) { return; @@ -58,8 +60,7 @@ export const ModelSelector: React.FC = React.memo( const normalizedSearchValue = searchValue.trim().toLowerCase(); const optionExists = flattenedOptions.findIndex( - (option: EuiComboBoxOptionOption) => - option.label.trim().toLowerCase() === normalizedSearchValue + (option) => option.label.trim().toLowerCase() === normalizedSearchValue ) !== -1; const newOption = { diff --git a/x-pack/packages/kbn-entities-schema/oas.yaml b/x-pack/packages/kbn-entities-schema/oas.yaml new file mode 100644 index 0000000000000..35e6eafe6a43a --- /dev/null +++ b/x-pack/packages/kbn-entities-schema/oas.yaml @@ -0,0 +1,567 @@ +openapi: 3.1.0 +info: + title: Elastic Entity Model (EEM) API + version: v1 +components: + schemas: + createEntityDefinitionQuerySchema: + type: object + properties: + installOnly: + type: boolean + default: false + additionalProperties: false + getEntityDefinitionQuerySchema: + type: object + properties: + page: + type: number + perPage: + type: number + additionalProperties: false + resetEntityDefinitionParamsSchema: + type: object + properties: + id: + type: string + required: + - id + additionalProperties: false + deleteEntityDefinitionParamsSchema: + type: object + properties: + id: + type: string + required: + - id + additionalProperties: false + deleteEntityDefinitionQuerySchema: + type: object + properties: + deleteData: + type: boolean + default: false + additionalProperties: false + entityDefinitionSchema: + type: object + properties: + id: + type: string + pattern: ^[\w-]+$ + version: + type: string + name: + type: string + description: + type: string + type: + type: string + filter: + type: string + indexPatterns: + type: array + items: + type: string + identityFields: + type: array + items: + anyOf: + - type: object + properties: + field: + type: string + optional: + type: boolean + required: + - field + - optional + additionalProperties: false + - type: string + displayNameTemplate: + type: string + metadata: + type: array + items: + anyOf: + - type: object + properties: + source: + type: string + destination: + type: string + limit: + type: number + default: 1000 + required: + - source + additionalProperties: false + - type: string + metrics: + type: array + items: + type: object + properties: + name: + type: string + metrics: + type: array + items: + anyOf: + - type: object + properties: + name: + type: string + minLength: 1 + maxLength: 1 + pattern: "[a-zA-Z]" + aggregation: + type: string + enum: + - avg + - max + - min + - sum + - value_count + - cardinality + - last_value + - std_deviation + field: + type: string + filter: + type: string + required: + - name + - aggregation + - field + additionalProperties: false + - type: object + properties: + name: + type: string + minLength: 1 + maxLength: 1 + pattern: "[a-zA-Z]" + aggregation: + type: string + enum: + - doc_count + filter: + type: string + required: + - name + - aggregation + additionalProperties: false + - type: object + properties: + name: + type: string + minLength: 1 + maxLength: 1 + pattern: "[a-zA-Z]" + aggregation: + type: string + enum: + - percentile + field: + type: string + percentile: + type: number + filter: + type: string + required: + - name + - aggregation + - field + - percentile + additionalProperties: false + equation: + type: string + required: + - name + - metrics + - equation + additionalProperties: false + staticFields: + type: object + additionalProperties: + type: string + managed: + type: boolean + default: false + history: + type: object + properties: + timestampField: + type: string + interval: + type: string + pattern: ^\d+[m|d|s|h]$ + settings: + type: object + properties: + syncField: + type: string + syncDelay: + type: string + pattern: ^\d+[m|d|s|h]$ + lookbackPeriod: + type: string + pattern: ^\d+[m|d|s|h]$ + default: 1h + frequency: + type: string + pattern: ^\d+[m|d|s|h]$ + backfillSyncDelay: + type: string + pattern: ^\d+[m|d|s|h]$ + backfillLookbackPeriod: + type: string + pattern: ^\d+[m|d|s|h]$ + backfillFrequency: + type: string + pattern: ^\d+[m|d|s|h]$ + additionalProperties: false + required: + - timestampField + - interval + additionalProperties: false + latest: + type: object + properties: + settings: + type: object + properties: + syncField: + type: string + syncDelay: + type: string + pattern: ^\d+[m|d|s|h]$ + frequency: + type: string + pattern: ^\d+[m|d|s|h]$ + additionalProperties: false + additionalProperties: false + installStatus: + anyOf: + - type: string + enum: + - installing + - type: string + enum: + - upgrading + - type: string + enum: + - installed + - type: string + enum: + - failed + installStartedAt: + type: string + required: + - id + - version + - name + - type + - indexPatterns + - identityFields + - displayNameTemplate + - history + additionalProperties: false + entitySummarySchema: + allOf: + - type: object + properties: + entity: + type: object + properties: + id: + type: string + type: + type: string + identityFields: + type: array + items: + type: string + displayName: + type: string + metrics: + type: object + additionalProperties: + type: number + definitionVersion: + type: string + schemaVersion: + type: string + definitionId: + type: string + lastSeenTimestamp: + type: string + firstSeenTimestamp: + type: string + required: + - id + - type + - identityFields + - displayName + - metrics + - definitionVersion + - schemaVersion + - definitionId + - lastSeenTimestamp + - firstSeenTimestamp + additionalProperties: false + required: + - entity + - anyOf: + - anyOf: + - type: string + - type: number + - type: boolean + - enum: + - "null" + nullable: true + - type: array + items: {} + - type: object + additionalProperties: {} + entityHistorySchema: + allOf: + - type: object + properties: + "@timestamp": + type: string + entity: + type: object + properties: + id: + type: string + type: + type: string + identityFields: + type: array + items: + type: string + displayName: + type: string + metrics: + type: object + additionalProperties: + type: number + definitionVersion: + type: string + schemaVersion: + type: string + definitionId: + type: string + required: + - id + - type + - identityFields + - displayName + - metrics + - definitionVersion + - schemaVersion + - definitionId + additionalProperties: false + required: + - "@timestamp" + - entity + - anyOf: + - anyOf: + - type: string + - type: number + - type: boolean + - enum: + - "null" + nullable: true + - type: array + items: {} + - type: object + additionalProperties: {} +paths: + /internal/entities/managed/enablement: + get: + description: Check if managed (built-in) entity discovery is enabled. Enabled + entity discovery requires a valid api key and the latest version of the + builtin definitions installed and running. + tags: + - management + responses: + "200": + description: OK - Verify result in response body + content: + application/json: + schema: + type: object + properties: + enabled: + type: boolean + example: false + reason: + type: string + example: api_key_not_found + delete: + description: Disable managed (built-in) entity discovery. This stops and deletes + the transforms, ingest pipelines, definitions saved objects, and index + templates for this entity definition, as well as the stored API key for + entity discovery management. + tags: + - management + parameters: + - in: query + name: deleteData + description: If true, delete all entity data in the managed indices + required: false + schema: + type: boolean + default: false + responses: + "200": + description: Built-in entity discovery successfully disabled + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + "403": + description: The current user does not have the required permissions to disable + entity discovery + put: + description: Enable managed (built-in) entity discovery. + tags: + - management + parameters: + - in: query + name: installOnly + description: If true, the definition transforms will not be started + required: false + schema: + type: boolean + default: false + responses: + "200": + description: OK - Verify result in response body + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: false + reason: + type: string + example: api_key_service_disabled + message: + type: string + example: API key service is not enabled; try configuring + `xpack.security.authc.api_key.enabled` in your + elasticsearch config + "403": + description: The current user does not have the required permissions to enable + entity discovery + /internal/entities/definition: + post: + description: Install an entity definition. + tags: + - definitions + parameters: + - in: query + name: installOnly + description: If true, the definition transforms will not be started + required: false + schema: + type: boolean + default: false + requestBody: + description: The entity definition to install + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/entityDefinitionSchema" + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/entityDefinitionSchema" + "400": + description: The entity definition cannot be installed; see the error for more + details + "409": + description: An entity definition with this ID already exists + delete: + description: Uninstall an entity definition. This stops and deletes the + transforms, ingest pipelines, definitions saved objects, and index + templates for this entity definition. + tags: + - definitions + parameters: + - in: path + name: id + description: The entity definition ID + schema: + $ref: "#/components/schemas/deleteEntityDefinitionParamsSchema/properties/id" + required: true + - in: query + name: deleteData + description: If true, delete all entity data in the indices associated with this + entity definition + schema: + $ref: "#/components/schemas/deleteEntityDefinitionQuerySchema/properties/delete\ + Data" + responses: + "200": + description: Success + content: + application/json: + schema: + type: object + properties: + acknowledged: + type: boolean + "400": + description: The entity definition cannot be removed; see the error for more + details + "404": + description: Entity definition with given ID not found + get: + description: Get all installed entity definitions. + tags: + - definitions + parameters: + - in: query + name: page + schema: + $ref: "#/components/schemas/getEntityDefinitionQuerySchema/properties/page" + - in: query + name: perPage + schema: + $ref: "#/components/schemas/getEntityDefinitionQuerySchema/properties/perPage" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + definitions: + type: array + items: + allOf: + - $ref: "#/components/schemas/entityDefinitionSchema" + - type: object + properties: + state: + type: object + properties: + installed: + type: boolean + running: + type: boolean +tags: [] diff --git a/x-pack/packages/kbn-entities-schema/package.json b/x-pack/packages/kbn-entities-schema/package.json index 0be44d9d75055..bdf1fb6ea7ce5 100644 --- a/x-pack/packages/kbn-entities-schema/package.json +++ b/x-pack/packages/kbn-entities-schema/package.json @@ -2,5 +2,9 @@ "name": "@kbn/entities-schema", "private": true, "version": "1.0.0", - "license": "Elastic License 2.0" -} \ No newline at end of file + "license": "Elastic License 2.0", + "scripts": { + "openapi:generate": "node scripts/generate", + "openapi:serve": "node scripts/serve_oas_ui" + } +} diff --git a/x-pack/packages/kbn-entities-schema/scripts/generate.js b/x-pack/packages/kbn-entities-schema/scripts/generate.js new file mode 100644 index 0000000000000..e3214affce38e --- /dev/null +++ b/x-pack/packages/kbn-entities-schema/scripts/generate.js @@ -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. + */ + +require('../../../../src/setup_node_env'); + +const { generateOAS } = require('./generate_oas'); +const { writeFileSync } = require('fs'); + +const spec = generateOAS({ format: '.yaml' }); +writeFileSync('oas.yaml', spec); diff --git a/x-pack/packages/kbn-entities-schema/scripts/generate_oas.js b/x-pack/packages/kbn-entities-schema/scripts/generate_oas.js new file mode 100644 index 0000000000000..d1310535db3a9 --- /dev/null +++ b/x-pack/packages/kbn-entities-schema/scripts/generate_oas.js @@ -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. + */ + +require('../../../../src/setup_node_env'); + +const swaggerJsdoc = require('swagger-jsdoc'); +const { zodToJsonSchema } = require('zod-to-json-schema'); + +const { + createEntityDefinitionQuerySchema, + getEntityDefinitionQuerySchema, + resetEntityDefinitionParamsSchema, + deleteEntityDefinitionParamsSchema, + deleteEntityDefinitionQuerySchema, + entityDefinitionSchema, + entityLatestSchema, + entityHistorySchema, +} = require('..'); + +const schemaOptions = { + target: 'openApi3', + $refStrategy: 'none', +}; + +export const generateOAS = (options) => + swaggerJsdoc({ + definition: { + openapi: '3.1.0', + info: { + title: 'Elastic Entity Model (EEM) API', + version: 'v1', + }, + components: { + schemas: { + createEntityDefinitionQuerySchema: zodToJsonSchema( + createEntityDefinitionQuerySchema, + schemaOptions + ), + getEntityDefinitionQuerySchema: zodToJsonSchema( + getEntityDefinitionQuerySchema, + schemaOptions + ), + resetEntityDefinitionParamsSchema: zodToJsonSchema( + resetEntityDefinitionParamsSchema, + schemaOptions + ), + deleteEntityDefinitionParamsSchema: zodToJsonSchema( + deleteEntityDefinitionParamsSchema, + schemaOptions + ), + deleteEntityDefinitionQuerySchema: zodToJsonSchema( + deleteEntityDefinitionQuerySchema, + schemaOptions + ), + entityDefinitionSchema: zodToJsonSchema(entityDefinitionSchema, schemaOptions), + entitySummarySchema: zodToJsonSchema(entityLatestSchema, schemaOptions), + entityHistorySchema: zodToJsonSchema(entityHistorySchema, schemaOptions), + }, + }, + }, + apis: ['../../plugins/observability_solution/entity_manager/server/routes/**/*.ts'], + ...options, + }); diff --git a/x-pack/packages/kbn-entities-schema/scripts/serve_oas_ui.js b/x-pack/packages/kbn-entities-schema/scripts/serve_oas_ui.js new file mode 100644 index 0000000000000..956163f665bcf --- /dev/null +++ b/x-pack/packages/kbn-entities-schema/scripts/serve_oas_ui.js @@ -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. + */ + +require('../../../../src/setup_node_env'); + +const { generateOAS } = require('./generate_oas'); +const express = require('express'); +const swaggerUi = require('swagger-ui-express'); + +const app = express(); +app.use('/', swaggerUi.serve, swaggerUi.setup(generateOAS())); + +const port = 3000; +app.listen(port, () => { + console.log(`OpenAPI UI available on http://localhost:${port}`); +}); diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts index 6766410fcd316..9f223b9051f8c 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export const createEntityDefinitionQuerySchema = z.object({ installOnly: z.optional(z.coerce.boolean()).default(false), diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts index 21482ec5e3cb9..0ce8f1b330d89 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export const deleteEntityDefinitionParamsSchema = z.object({ id: z.string(), diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/get.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/get.ts index f703da8a7b6b2..58111119601d9 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/get.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/get.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export const getEntityDefinitionQuerySchema = z.object({ page: z.optional(z.coerce.number()), diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/reset.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/reset.ts index e93b8e789280f..efe2848b2c686 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/reset.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/reset.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; export const resetEntityDefinitionParamsSchema = z.object({ id: z.string(), diff --git a/x-pack/packages/kbn-entities-schema/src/schema/common.ts b/x-pack/packages/kbn-entities-schema/src/schema/common.ts index a7f0f97d755f0..6e46a335dadde 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/common.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/common.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import moment from 'moment'; export const arrayOfStringsSchema = z.array(z.string()); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/entity.test.ts b/x-pack/packages/kbn-entities-schema/src/schema/entity.test.ts new file mode 100644 index 0000000000000..c8ef716371338 --- /dev/null +++ b/x-pack/packages/kbn-entities-schema/src/schema/entity.test.ts @@ -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 { entityLatestSchema, entityMetadataSchema } from './entity'; + +const entity = { + entity: { + lastSeenTimestamp: '2024-08-06T17:03:50.722Z', + schemaVersion: 'v1', + definitionVersion: '999.999.999', + displayName: 'message_processor', + identityFields: ['log.logger', 'event.category'], + id: '6UHVPiduEC2qk6rMjs1Jzg==', + metrics: { + logRate: 100, + errorRate: 0, + }, + type: 'service', + firstSeenTimestamp: '2024-08-06T16:50:00.000Z', + definitionId: 'admin-console-services', + }, +}; + +const metadata = { + host: { + os: { + name: [], + }, + name: [ + 'message_processor.prod.002', + 'message_processor.prod.001', + 'message_processor.prod.010', + 'message_processor.prod.006', + 'message_processor.prod.005', + 'message_processor.prod.004', + 'message_processor.prod.003', + 'message_processor.prod.009', + 'message_processor.prod.008', + 'message_processor.prod.007', + ], + }, + event: { + ingested: '2024-08-06T17:06:24.444700Z', + category: '', + }, + sourceIndex: ['kbn-data-forge-fake_stack.message_processor-2024-08-01'], + log: { + logger: 'message_processor', + }, + tags: ['infra:message_processor'], +}; + +describe('Entity Schemas', () => { + describe('entityMetadataSchema', () => { + it('should parse metadata object', () => { + const results = entityMetadataSchema.safeParse(metadata); + expect(results).toHaveProperty('success', true); + }); + }); + + describe('entitySummarySchema', () => { + it('should parse an entity with metadata', () => { + const doc = { + ...entity, + ...metadata, + }; + + const result = entityLatestSchema.safeParse(doc); + expect(result).toHaveProperty('success', true); + }); + }); +}); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/entity.ts b/x-pack/packages/kbn-entities-schema/src/schema/entity.ts index 58a9c011091b4..eae6873356c14 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/entity.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/entity.ts @@ -5,27 +5,45 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { arrayOfStringsSchema } from './common'; -const entitySchema = z.object({ - entity: z.object({ - id: z.string(), - identityFields: arrayOfStringsSchema, - displayName: z.string(), - metrics: z.record(z.string(), z.number()), - }), +export const entityBaseSchema = z.object({ + id: z.string(), + type: z.string(), + identityFields: arrayOfStringsSchema, + displayName: z.string(), + metrics: z.record(z.string(), z.number()), + definitionVersion: z.string(), + schemaVersion: z.string(), + definitionId: z.string(), }); -export const entitySummarySchema = z.intersection( - entitySchema.extend({ - lastSeenTimestamp: z.string(), - firstSeenTimestamp: z.string(), - }), - z.record(z.string(), z.string().or(z.number())) -); +export interface MetadataRecord { + [key: string]: string[] | MetadataRecord | string; +} -export const entityHistorySchema = z.intersection( - entitySchema.extend({ ['@timestamp']: z.string() }), - z.record(z.string(), z.string().or(z.number())) +const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]); +type Literal = z.infer; +type Metadata = Literal | { [key: string]: Metadata } | Metadata[]; +export const entityMetadataSchema: z.ZodType = z.lazy(() => + z.union([literalSchema, z.array(entityMetadataSchema), z.record(entityMetadataSchema)]) ); + +export const entityLatestSchema = z + .object({ + entity: entityBaseSchema.merge( + z.object({ + lastSeenTimestamp: z.string(), + firstSeenTimestamp: z.string(), + }) + ), + }) + .and(entityMetadataSchema); + +export const entityHistorySchema = z + .object({ + '@timestamp': z.string(), + entity: entityBaseSchema, + }) + .and(entityMetadataSchema); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts b/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts index bcb26cf8818db..ae612c27a24b5 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { z } from 'zod'; +import { z } from '@kbn/zod'; import { arrayOfStringsSchema, keyMetricSchema, @@ -48,6 +48,15 @@ export const entityDefinitionSchema = z.object({ ), }) ), + installStatus: z.optional( + z.union([ + z.literal('installing'), + z.literal('upgrading'), + z.literal('installed'), + z.literal('failed'), + ]) + ), + installStartedAt: z.optional(z.string()), }); export type EntityDefinition = z.infer; diff --git a/x-pack/packages/kbn-entities-schema/tsconfig.json b/x-pack/packages/kbn-entities-schema/tsconfig.json index f722f3587e7a2..ecde0c1e3a46e 100644 --- a/x-pack/packages/kbn-entities-schema/tsconfig.json +++ b/x-pack/packages/kbn-entities-schema/tsconfig.json @@ -11,8 +11,10 @@ "**/*.ts" ], "exclude": [ - "target/**/*" + "target/**/*", + "node_modules", ], "kbn_references": [ + "@kbn/zod", ] } diff --git a/x-pack/packages/ml/aiops_log_pattern_analysis/constants.ts b/x-pack/packages/ml/aiops_log_pattern_analysis/constants.ts new file mode 100644 index 0000000000000..e88944a83b8bb --- /dev/null +++ b/x-pack/packages/ml/aiops_log_pattern_analysis/constants.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const EMBEDDABLE_PATTERN_ANALYSIS_TYPE = 'aiopsPatternAnalysisEmbeddable' as const; + +export const PATTERN_ANALYSIS_DATA_VIEW_REF_NAME = 'aiopsPatternAnalysisEmbeddableDataViewId'; diff --git a/x-pack/packages/ml/aiops_log_pattern_analysis/embeddable.ts b/x-pack/packages/ml/aiops_log_pattern_analysis/embeddable.ts index 57c6b144c15d0..f236c24cfe6a2 100644 --- a/x-pack/packages/ml/aiops_log_pattern_analysis/embeddable.ts +++ b/x-pack/packages/ml/aiops_log_pattern_analysis/embeddable.ts @@ -5,16 +5,13 @@ * 2.0. */ -import type { Query, AggregateQuery, Filter } from '@kbn/es-query'; -import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { SavedSearch, VIEW_MODE } from '@kbn/saved-search-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; -export interface EmbeddablePatternAnalysisInput { +export interface EmbeddablePatternAnalysisInput { dataView: DataView; savedSearch?: SavedSearch | null; - query?: T; - filters?: Filter[]; embeddingOrigin?: string; - switchToDocumentView?: () => void; + switchToDocumentView?: () => Promise; lastReloadRequestTime?: number; } diff --git a/x-pack/packages/ml/aiops_log_pattern_analysis/tsconfig.json b/x-pack/packages/ml/aiops_log_pattern_analysis/tsconfig.json index afc6d3b1e0631..fb51a4d8c1b30 100644 --- a/x-pack/packages/ml/aiops_log_pattern_analysis/tsconfig.json +++ b/x-pack/packages/ml/aiops_log_pattern_analysis/tsconfig.json @@ -20,7 +20,6 @@ "@kbn/config-schema", "@kbn/i18n", "@kbn/ml-runtime-field-utils", - "@kbn/es-query", "@kbn/saved-search-plugin", "@kbn/data-views-plugin", "@kbn/ml-is-populated-object", diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/get_log_rate_analysis_parameters_from_alert.ts b/x-pack/packages/ml/aiops_log_rate_analysis/get_log_rate_analysis_parameters_from_alert.ts index cfd347324a57f..4de3ca83ce702 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/get_log_rate_analysis_parameters_from_alert.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/get_log_rate_analysis_parameters_from_alert.ts @@ -11,7 +11,7 @@ export interface GetLogRateAnalysisParametersFromAlertArgs { alertStartedAt: string; alertEndedAt?: string; timeSize?: number; - timeUnit?: moment.unitOfTime.DurationConstructor; + timeUnit?: string; } export const getLogRateAnalysisParametersFromAlert = ({ @@ -20,12 +20,7 @@ export const getLogRateAnalysisParametersFromAlert = ({ timeSize, timeUnit, }: GetLogRateAnalysisParametersFromAlertArgs) => { - // Identify `intervalFactor` to adjust time ranges based on alert settings. - // The default time ranges for `initialAnalysisStart` are suitable for a `1m` lookback. - // If an alert would have a `5m` lookback, this would result in a factor of `5`. - const lookbackDuration = - timeSize && timeUnit ? moment.duration(timeSize, timeUnit) : moment.duration(1, 'm'); - const intervalFactor = Math.max(1, lookbackDuration.asSeconds() / 60); + const intervalFactor = getIntervalFactor(timeSize, timeUnit); const alertStart = moment(alertStartedAt); const alertEnd = alertEndedAt ? moment(alertEndedAt) : undefined; @@ -43,6 +38,21 @@ export const getLogRateAnalysisParametersFromAlert = ({ }; }; +// Identify `intervalFactor` to adjust time ranges based on alert settings. +// The default time ranges for `initialAnalysisStart` are suitable for a `1m` lookback. +// If an alert would have a `5m` lookback, this would result in a factor of `5`. +export const getIntervalFactor = (timeSize?: number, timeUnit?: string) => { + const lookbackDuration = + timeSize && timeUnit + ? moment.duration( + timeSize, + // workaround to cast the string based time unit to moment's format. + timeUnit as unknown as moment.unitOfTime.DurationConstructor | undefined + ) + : moment.duration(1, 'm'); + return Math.max(1, lookbackDuration.asSeconds() / 60); +}; + interface GetParameterHelperArgs { alertStart: Moment; intervalFactor: number; diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_log_rate_analysis_for_alert.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_log_rate_analysis_for_alert.ts new file mode 100644 index 0000000000000..3ba57139901f8 --- /dev/null +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_log_rate_analysis_for_alert.ts @@ -0,0 +1,213 @@ +/* + * 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 moment from 'moment'; +import { queue } from 'async'; +import { chunk } from 'lodash'; + +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import { withSpan } from '@kbn/apm-utils'; +import type { ElasticsearchClient } from '@kbn/core/server'; +import type { SignificantItem } from '@kbn/ml-agg-utils'; +import { getSampleProbability } from '@kbn/ml-random-sampler-utils'; + +import type { AiopsLogRateAnalysisSchema } from '../api/schema'; +import { getIntervalFactor } from '../get_log_rate_analysis_parameters_from_alert'; +import { getSwappedWindowParameters } from '../get_swapped_window_parameters'; +import { getLogRateChange } from '../get_log_rate_change'; +import { getBaselineAndDeviationRates } from '../get_baseline_and_deviation_rates'; +import { getLogRateAnalysisTypeForCounts } from '../get_log_rate_analysis_type_for_counts'; +import { LOG_RATE_ANALYSIS_TYPE } from '../log_rate_analysis_type'; + +import { fetchIndexInfo } from './fetch_index_info'; +import { fetchSignificantCategories } from './fetch_significant_categories'; +import { fetchSignificantTermPValues } from './fetch_significant_term_p_values'; + +const MAX_CONCURRENT_QUERIES = 5; +const CHUNK_SIZE = 50; + +interface QueueItem { + fn: typeof fetchSignificantCategories | typeof fetchSignificantTermPValues; + fieldNames: string[]; +} + +/** + * Runs log rate analysis data on an index given some alert metadata. + */ +export async function fetchLogRateAnalysisForAlert({ + esClient, + abortSignal, + arguments: args, +}: { + esClient: ElasticsearchClient; + abortSignal?: AbortSignal; + arguments: { + index: string; + alertStartedAt: string; + alertRuleParameterTimeSize?: number; + alertRuleParameterTimeUnit?: string; + timefield?: string; + searchQuery?: estypes.QueryDslQueryContainer; + }; +}) { + const { alertStartedAt, timefield = '@timestamp' } = args; + const alertStart = moment(alertStartedAt); + + const intervalFactor = getIntervalFactor( + args.alertRuleParameterTimeSize, + args.alertRuleParameterTimeUnit + ); + + // The deviation time range is 1 lookback duration before the alert start. + // The baseline time range is 2 lookback durations before the deviation time range. + const windowParameters = { + baselineMin: alertStart + .clone() + .subtract(3 * intervalFactor, 'minutes') + .valueOf(), + baselineMax: alertStart + .clone() + .subtract(1 * intervalFactor, 'minutes') + .valueOf(), + deviationMin: alertStart + .clone() + .subtract(1 * intervalFactor, 'minutes') + .valueOf(), + deviationMax: alertStart.valueOf(), + }; + + const { searchQuery = { match_all: {} } } = args; + + // Step 1: Get field candidates and total doc counts. + const indexInfoParams: AiopsLogRateAnalysisSchema = { + index: args.index, + start: windowParameters.baselineMin, + end: windowParameters.deviationMax, + searchQuery: JSON.stringify(searchQuery), + timeFieldName: timefield, + ...windowParameters, + }; + + const indexInfo = await withSpan( + { name: 'fetch_index_info', type: 'aiops-log-rate-analysis-for-alert' }, + () => + fetchIndexInfo({ + esClient, + abortSignal, + arguments: { + ...indexInfoParams, + textFieldCandidatesOverrides: ['message', 'error.message'], + }, + }) + ); + const { textFieldCandidates, keywordFieldCandidates } = indexInfo; + + const logRateAnalysisType = getLogRateAnalysisTypeForCounts({ + baselineCount: indexInfo.baselineTotalDocCount, + deviationCount: indexInfo.deviationTotalDocCount, + windowParameters, + }); + + // Just in case the log rate analysis type is 'dip', we need to swap + // the window parameters for the analysis. + const analysisWindowParameters = + logRateAnalysisType === LOG_RATE_ANALYSIS_TYPE.SPIKE + ? windowParameters + : getSwappedWindowParameters(windowParameters); + + // Step 2: Identify significant items. + // The following code will fetch significant categories and term p-values + // using an async queue. The field candidates will be passed on as chunks + // of 50 fields with up to 5 concurrent queries. This is to prevent running + // into bucket limit issues if we'd throw possibly hundreds of field candidates + // into a single query. + + const significantItems: SignificantItem[] = []; + + // Set up the queue: A queue item is an object with the function to call and + // the field names to be passed to the function. This is done so we can push + // queries for both keyword fields (using significant_terms/p-values) and + // text fields (using categorize_text + custom code to identify significance) + // into the same queue. + const significantItemsQueue = queue(async function ({ fn, fieldNames }: QueueItem) { + significantItems.push( + ...(await fn({ + esClient, + abortSignal, + arguments: { + ...indexInfoParams, + ...analysisWindowParameters, + fieldNames, + sampleProbability: getSampleProbability( + indexInfo.deviationTotalDocCount + indexInfo.baselineTotalDocCount + ), + }, + })) + ); + }, MAX_CONCURRENT_QUERIES); + + // Push the actual items to the queue. We don't need to chunk the text fields + // since they are just `message` and `error.message`. + significantItemsQueue.push( + [ + { fn: fetchSignificantCategories, fieldNames: textFieldCandidates }, + ...chunk(keywordFieldCandidates, CHUNK_SIZE).map((fieldNames) => ({ + fn: fetchSignificantTermPValues, + fieldNames, + })), + ], + (err) => { + if (err) significantItemsQueue.kill(); + } + ); + + // Wait for the queue to finish. + await withSpan( + { name: 'fetch_significant_items', type: 'aiops-log-rate-analysis-for-alert' }, + () => significantItemsQueue.drain() + ); + + // RETURN DATA + // Adapt the raw significant items data for contextual insights. + return { + logRateAnalysisType, + significantItems: significantItems + .map(({ fieldName, fieldValue, type, doc_count: docCount, bg_count: bgCount }) => { + const { baselineBucketRate, deviationBucketRate } = getBaselineAndDeviationRates( + logRateAnalysisType, + // Normalize the amount of baseline buckets based on treating the + // devation duration as 1 bucket. + (windowParameters.baselineMax - windowParameters.baselineMin) / + (windowParameters.deviationMax - windowParameters.deviationMin), + 1, + docCount, + bgCount + ); + + const fieldType = type === 'keyword' ? 'metadata' : 'log message pattern'; + + const data = { + fieldType, + fieldName, + fieldValue: String(fieldValue).substring(0, 140), + logRateChange: getLogRateChange( + logRateAnalysisType, + baselineBucketRate, + deviationBucketRate + ).message, + }; + + return { + logRateChangeSort: bgCount > 0 ? docCount / bgCount : docCount, + data, + }; + }) + .sort((a, b) => b.logRateChangeSort - a.logRateChangeSort) + .map((d) => d.data), + }; +} diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/tsconfig.json b/x-pack/packages/ml/aiops_log_rate_analysis/tsconfig.json index 711cbfb57a15b..66b978764464e 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/tsconfig.json +++ b/x-pack/packages/ml/aiops_log_rate_analysis/tsconfig.json @@ -31,5 +31,6 @@ "@kbn/ml-string-hash", "@kbn/ml-response-stream", "@kbn/i18n", + "@kbn/apm-utils", ] } diff --git a/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx b/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx index a859b1d95103f..22c904e63561e 100644 --- a/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx +++ b/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx @@ -51,7 +51,7 @@ export const InferenceFlyout: React.FC = ({ }, [inferenceEndpointError]); const onChangingInferenceEndpoint = useCallback( - (value) => { + (value: any) => { setInferenceEndpointId(value); onInferenceEndpointChange(value); }, diff --git a/x-pack/packages/ml/trained_models_utils/index.ts b/x-pack/packages/ml/trained_models_utils/index.ts index 293f6662f5011..c6137faf6f76a 100644 --- a/x-pack/packages/ml/trained_models_utils/index.ts +++ b/x-pack/packages/ml/trained_models_utils/index.ts @@ -36,4 +36,5 @@ export { LATEST_ELSER_MODEL_ID, LATEST_E5_MODEL_ID, ElserModels, + isLocalModel, } from './src/constants/trained_models'; diff --git a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts index 4d065fb062cb5..caf4ce56b3482 100644 --- a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts +++ b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts @@ -278,9 +278,15 @@ export type InferenceServiceSettings = export type InferenceAPIConfigResponse = { // Refers to a deployment id - model_id: string; + inference_id: string; task_type: 'sparse_embedding' | 'text_embedding'; task_settings: { model?: string; }; } & InferenceServiceSettings; + +export function isLocalModel( + model: InferenceServiceSettings +): model is LocalInferenceServiceSettings { + return ['elser', 'elasticsearch'].includes((model as LocalInferenceServiceSettings).service); +} diff --git a/x-pack/packages/observability/observability_utils/README.md b/x-pack/packages/observability/observability_utils/README.md new file mode 100644 index 0000000000000..bd74c0bdffb47 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/README.md @@ -0,0 +1,5 @@ +# @kbn/observability-utils + +This package contains utilities for Observability plugins. It's a separate package to get out of dependency hell. You can put anything in here that is stateless and has no dependency on other plugins (either directly or via other packages). + +The utility functions should be used via direct imports to minimize impact on bundle size and limit the risk on importing browser code to the server and vice versa. diff --git a/x-pack/packages/observability/observability_utils/es/client/create_observability_es_client.ts b/x-pack/packages/observability/observability_utils/es/client/create_observability_es_client.ts new file mode 100644 index 0000000000000..2e57653365b0b --- /dev/null +++ b/x-pack/packages/observability/observability_utils/es/client/create_observability_es_client.ts @@ -0,0 +1,66 @@ +/* + * 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 { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { ESSearchRequest, InferSearchResponseOf } from '@kbn/es-types'; +import { withSpan } from '@kbn/apm-utils'; + +type SearchRequest = ESSearchRequest & { + index: string | string[]; + track_total_hits: number | boolean; + size: number | boolean; +}; + +/** + * An Elasticsearch Client with a fully typed `search` method and built-in + * APM instrumentation. + */ +export interface ObservabilityElasticsearchClient { + search( + operationName: string, + parameters: TSearchRequest + ): Promise>; + client: ElasticsearchClient; +} + +export function createObservabilityEsClient({ + client, + logger, + plugin, +}: { + client: ElasticsearchClient; + logger: Logger; + plugin: string; +}): ObservabilityElasticsearchClient { + return { + client, + search( + operationName: string, + parameters: SearchRequest + ) { + logger.trace(() => `Request (${operationName}):\n${JSON.stringify(parameters, null, 2)}`); + // wraps the search operation in a named APM span for better analysis + // (otherwise it would just be a _search span) + return withSpan( + { + name: operationName, + labels: { + plugin, + }, + }, + () => { + return client.search(parameters) as unknown as Promise< + InferSearchResponseOf + >; + } + ).then((response) => { + logger.trace(() => `Response (${operationName}):\n${JSON.stringify(response, null, 2)}`); + return response; + }); + }, + }; +} diff --git a/x-pack/packages/observability/observability_utils/es/queries/kql_query.ts b/x-pack/packages/observability/observability_utils/es/queries/kql_query.ts new file mode 100644 index 0000000000000..2f560157cc8c6 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/es/queries/kql_query.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. + */ +import type { estypes } from '@elastic/elasticsearch'; +import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; + +export function kqlQuery(kql?: string): estypes.QueryDslQueryContainer[] { + if (!kql) { + return []; + } + + const ast = fromKueryExpression(kql); + return [toElasticsearchQuery(ast)]; +} diff --git a/x-pack/packages/observability/observability_utils/es/queries/range_query.ts b/x-pack/packages/observability/observability_utils/es/queries/range_query.ts new file mode 100644 index 0000000000000..d73476354c377 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/es/queries/range_query.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 { estypes } from '@elastic/elasticsearch'; + +export function rangeQuery( + start?: number, + end?: number, + field = '@timestamp' +): estypes.QueryDslQueryContainer[] { + return [ + { + range: { + [field]: { + gte: start, + lte: end, + format: 'epoch_millis', + }, + }, + }, + ]; +} diff --git a/x-pack/packages/observability/observability_utils/es/queries/term_query.ts b/x-pack/packages/observability/observability_utils/es/queries/term_query.ts new file mode 100644 index 0000000000000..dfaeb737bf8b7 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/es/queries/term_query.ts @@ -0,0 +1,24 @@ +/* + * 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 { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; + +interface TermQueryOpts { + queryEmptyString: boolean; +} + +export function termQuery( + field: T, + value: string | boolean | number | undefined | null, + opts: TermQueryOpts = { queryEmptyString: true } +): QueryDslQueryContainer[] { + if (value === null || value === undefined || (!opts.queryEmptyString && value === '')) { + return []; + } + + return [{ term: { [field]: value } }]; +} diff --git a/x-pack/packages/observability/observability_utils/hooks/use_abort_controller.ts b/x-pack/packages/observability/observability_utils/hooks/use_abort_controller.ts new file mode 100644 index 0000000000000..a383e7b81b4d9 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/hooks/use_abort_controller.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 { useEffect, useState } from 'react'; + +export function useAbortController() { + const [controller, setController] = useState(() => new AbortController()); + + useEffect(() => { + return () => { + controller.abort(); + }; + }, [controller]); + + return { + signal: controller.signal, + refresh: () => { + setController(() => new AbortController()); + }, + }; +} diff --git a/x-pack/packages/observability/observability_utils/hooks/use_abortable_async.ts b/x-pack/packages/observability/observability_utils/hooks/use_abortable_async.ts new file mode 100644 index 0000000000000..433ca877b0f62 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/hooks/use_abortable_async.ts @@ -0,0 +1,87 @@ +/* + * 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 { isPromise } from '@kbn/std'; +import { useEffect, useMemo, useRef, useState } from 'react'; + +interface State { + error?: Error; + value?: T; + loading: boolean; +} + +export type AbortableAsyncState = (T extends Promise + ? State + : State) & { refresh: () => void }; + +export function useAbortableAsync( + fn: ({}: { signal: AbortSignal }) => T | Promise, + deps: any[], + options?: { clearValueOnNext?: boolean; defaultValue?: () => T } +): AbortableAsyncState { + const clearValueOnNext = options?.clearValueOnNext; + + const controllerRef = useRef(new AbortController()); + + const [refreshId, setRefreshId] = useState(0); + + const [error, setError] = useState(); + const [loading, setLoading] = useState(false); + const [value, setValue] = useState(options?.defaultValue); + + useEffect(() => { + controllerRef.current.abort(); + + const controller = new AbortController(); + controllerRef.current = controller; + + if (clearValueOnNext) { + setValue(undefined); + setError(undefined); + } + + try { + const response = fn({ signal: controller.signal }); + if (isPromise(response)) { + setLoading(true); + response + .then((nextValue) => { + setError(undefined); + setValue(nextValue); + }) + .catch((err) => { + setValue(undefined); + setError(err); + }) + .finally(() => setLoading(false)); + } else { + setError(undefined); + setValue(response); + setLoading(false); + } + } catch (err) { + setValue(undefined); + setError(err); + setLoading(false); + } + + return () => { + controller.abort(); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, deps.concat(refreshId, clearValueOnNext)); + + return useMemo>(() => { + return { + error, + loading, + value, + refresh: () => { + setRefreshId((id) => id + 1); + }, + } as unknown as AbortableAsyncState; + }, [error, value, loading]); +} diff --git a/x-pack/packages/observability/observability_utils/hooks/use_theme.ts b/x-pack/packages/observability/observability_utils/hooks/use_theme.ts new file mode 100644 index 0000000000000..d0b4ce61edef4 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/hooks/use_theme.ts @@ -0,0 +1,12 @@ +/* + * 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 { useEuiTheme } from '@elastic/eui'; + +export function useTheme() { + return useEuiTheme().euiTheme; +} diff --git a/x-pack/packages/observability/observability_utils/jest.config.js b/x-pack/packages/observability/observability_utils/jest.config.js new file mode 100644 index 0000000000000..c9dff28ed6cec --- /dev/null +++ b/x-pack/packages/observability/observability_utils/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/observability/observability_utils'], +}; diff --git a/x-pack/packages/observability/observability_utils/kibana.jsonc b/x-pack/packages/observability/observability_utils/kibana.jsonc new file mode 100644 index 0000000000000..096b2565d533f --- /dev/null +++ b/x-pack/packages/observability/observability_utils/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/observability-utils", + "owner": "@elastic/observability-ui" +} diff --git a/x-pack/packages/observability/observability_utils/object/flatten_object.test.ts b/x-pack/packages/observability/observability_utils/object/flatten_object.test.ts new file mode 100644 index 0000000000000..deb7ed998c478 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/object/flatten_object.test.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { flattenObject } from './flatten_object'; + +describe('flattenObject', () => { + it('flattens deeply nested objects', () => { + expect( + flattenObject({ + first: { + second: { + third: 'third', + }, + }, + }) + ).toEqual({ + 'first.second.third': 'third', + }); + }); + + it('does not flatten arrays', () => { + expect( + flattenObject({ + simpleArray: ['0', '1', '2'], + complexArray: [{ one: 'one', two: 'two', three: 'three' }], + nested: { + array: [0, 1, 2], + }, + }) + ).toEqual({ + simpleArray: ['0', '1', '2'], + complexArray: [{ one: 'one', two: 'two', three: 'three' }], + 'nested.array': [0, 1, 2], + }); + }); +}); diff --git a/x-pack/packages/observability/observability_utils/object/flatten_object.ts b/x-pack/packages/observability/observability_utils/object/flatten_object.ts new file mode 100644 index 0000000000000..c83ae8a102d4a --- /dev/null +++ b/x-pack/packages/observability/observability_utils/object/flatten_object.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +type PlainObject = Record; + +/** + * Flattens an object into key-value pairs with dots as separators. + * + * @param obj + * @param prefix + * @param result + * @returns + */ +export function flattenObject( + obj: PlainObject, + prefix: string = '', + result: PlainObject = {} +): PlainObject { + for (const key in obj) { + if (Object.hasOwn(obj, key)) { + const newKey = prefix ? `${prefix}.${key}` : key; + // If the property value is an object and not an array or null, recurse + // (array keys are not flattened because that gets a little weird I think) + if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) { + flattenObject(obj[key], newKey, result); + } else { + // Otherwise, add the value to the result object + result[newKey] = obj[key]; + } + } + } + return result; +} diff --git a/x-pack/packages/observability/observability_utils/object/merge_plain_object.test.ts b/x-pack/packages/observability/observability_utils/object/merge_plain_object.test.ts new file mode 100644 index 0000000000000..02049f1a756c2 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/object/merge_plain_object.test.ts @@ -0,0 +1,40 @@ +/* + * 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 { mergePlainObjects } from './merge_plain_objects'; + +describe('mergePlainObjects', () => { + it('recursively merges plain objects', () => { + expect( + mergePlainObjects({}, { foo: { bar: 'baz' } }, { foo: { baz: 'rab', bar: 'baz' } }) + ).toEqual({ + foo: { + bar: 'baz', + baz: 'rab', + }, + }); + }); + + it('overrides arrays', () => { + expect(mergePlainObjects({ myArray: [0, 1, 2, 3] }, { myArray: [4, 5, 6] })).toEqual({ + myArray: [4, 5, 6], + }); + }); + + it('overrides all primitives', () => { + expect( + mergePlainObjects( + { number: 'number', boolean: 'boolean', string: 'string', null: null }, + { number: 'num', boolean: 'bool', string: 'str' } + ) + ).toEqual({ + number: 'num', + boolean: 'bool', + string: 'str', + null: null, + }); + }); +}); diff --git a/x-pack/packages/observability/observability_utils/object/merge_plain_objects.ts b/x-pack/packages/observability/observability_utils/object/merge_plain_objects.ts new file mode 100644 index 0000000000000..e7c1042ac6581 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/object/merge_plain_objects.ts @@ -0,0 +1,84 @@ +/* + * 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 { RequiredKeys } from 'utility-types'; +import { isPlainObject, mergeWith, MergeWithCustomizer } from 'lodash'; + +type DeepOverwrite = U extends Record + ? Omit> & { + [K in keyof U]: K extends keyof T ? DeepOverwrite : U[K]; + } + : U extends undefined + ? T + : U; + +type DeepPartialPlainObjects = T extends Record + ? Partial> & + Partial<{ + [TKey in keyof T]: DeepPartialPlainObjects; + }> + : T; + +type Mergable = Record; + +type MergeRecursively = TMergables extends [ + infer THead, + ...infer TTail +] + ? TTail extends Mergable[] + ? DeepOverwrite> + : THead + : TMergables extends [infer THead] + ? THead + : TMergables extends [] + ? {} + : {}; + +const customMergeFunction: MergeWithCustomizer = (value, sourceValue) => { + if (isPlainObject(sourceValue)) { + return mergeWith(value, sourceValue, customMergeFunction); + } + return sourceValue; +}; + +function mergePlainObjectsOnly(...sources: Mergable[]) { + return mergeWith({}, ...sources.concat(customMergeFunction)); +} + +export function mergePlainObjects | undefined>(t1: T1): T1; + +export function mergePlainObjects>( + t1: T1, + t2: T2 +): MergeRecursively<[T1, T2]>; + +export function mergePlainObjects< + T1 extends Mergable, + T2 extends DeepPartialPlainObjects, + T3 extends DeepPartialPlainObjects +>(t1: T1, t2: T2, t3: T3): MergeRecursively<[T1, T2, T3]>; + +export function mergePlainObjects< + T1 extends Mergable, + T2 extends DeepPartialPlainObjects, + T3 extends DeepPartialPlainObjects, + T4 extends DeepPartialPlainObjects +>(t1: T1, t2: T2, t3: T4): MergeRecursively<[T1, T2, T3, T4]>; +/** + * Merges plain objects. It does two things over merge: + * + * - it expects the objects to be extensions of the type of + * the source object, to provide type autocompletions + * - arrays are not merged but overridden + * + * @param sources + * @returns + */ +export function mergePlainObjects(...sources: Array>) { + const merged = mergePlainObjectsOnly(...sources); + + return merged; +} diff --git a/x-pack/packages/observability/observability_utils/package.json b/x-pack/packages/observability/observability_utils/package.json new file mode 100644 index 0000000000000..06f6e37858927 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/observability-utils", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/observability/observability_utils/tsconfig.json b/x-pack/packages/observability/observability_utils/tsconfig.json new file mode 100644 index 0000000000000..2ed47d10cfad9 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/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/std", + "@kbn/core", + "@kbn/es-types", + "@kbn/apm-utils", + "@kbn/es-query", + ] +} diff --git a/x-pack/packages/security-solution/common/index.ts b/x-pack/packages/security-solution/common/index.ts new file mode 100644 index 0000000000000..ba5d797648f13 --- /dev/null +++ b/x-pack/packages/security-solution/common/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { HostDetailsButton } from './src/cells/renderers/host'; + +export * from './src/flyout'; +export * from './src/cells/renderers'; diff --git a/x-pack/packages/security-solution/common/jest.config.js b/x-pack/packages/security-solution/common/jest.config.js new file mode 100644 index 0000000000000..7047e229df092 --- /dev/null +++ b/x-pack/packages/security-solution/common/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/security-solution/common'], +}; diff --git a/x-pack/packages/security-solution/common/kibana.jsonc b/x-pack/packages/security-solution/common/kibana.jsonc new file mode 100644 index 0000000000000..708feab435425 --- /dev/null +++ b/x-pack/packages/security-solution/common/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-browser", + "id": "@kbn/security-solution-common", + "owner": "@elastic/security-threat-hunting-investigations" +} diff --git a/x-pack/packages/security-solution/common/package.json b/x-pack/packages/security-solution/common/package.json new file mode 100644 index 0000000000000..ce355e927c3df --- /dev/null +++ b/x-pack/packages/security-solution/common/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/security-solution-common", + "version": "1.0.0", + "description": "security solution common components which can be used in multiple plugins such as custom discover and timeline", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/discover.ts b/x-pack/packages/security-solution/common/src/cells/renderers/discover.ts new file mode 100644 index 0000000000000..8d0393a3c6f2b --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/discover.ts @@ -0,0 +1,24 @@ +/* + * 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 { DataGridCellValueElementProps } from '@kbn/unified-data-table'; +import { ComponentType, PropsWithChildren } from 'react'; +import { HostCellWithFlyoutRenderer } from './host'; + +export type DiscoverCellRenderer = ComponentType>; + +const RENDERERS: Record = { + 'host.name': HostCellWithFlyoutRenderer, +}; + +interface GetRendererArgs { + fieldName: string; +} + +export const getDiscoverCellRenderer = ({ fieldName }: GetRendererArgs) => { + return RENDERERS[fieldName]; +}; diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/get.ts b/x-pack/packages/security-solution/common/src/cells/renderers/get.ts new file mode 100644 index 0000000000000..3102c520e31db --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/get.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { getDiscoverCellRenderer } from './discover'; +export type { DiscoverCellRenderer } from './discover'; diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/host/button.test.tsx b/x-pack/packages/security-solution/common/src/cells/renderers/host/button.test.tsx new file mode 100644 index 0000000000000..d49af3ed50518 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/host/button.test.tsx @@ -0,0 +1,30 @@ +/* + * 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 { HostDetailsButton } from './button'; +import { render, screen } from '@testing-library/react'; + +const onClickMock = jest.fn(); +const TestComponent = () => { + return {'Test'}; +}; + +describe('Host Button', () => { + it('should render as button with link formatting', () => { + render(); + expect(screen.getByTestId('host-details-button')).toBeVisible(); + expect(screen.getByTestId('host-details-button')).toHaveAttribute('type', 'button'); + expect(screen.getByTestId('host-details-button')).toHaveClass('euiLink'); + }); + + it('should perform onClick Correctly', () => { + render(); + screen.getByTestId('host-details-button').click(); + expect(onClickMock).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/host/button.tsx b/x-pack/packages/security-solution/common/src/cells/renderers/host/button.tsx new file mode 100644 index 0000000000000..b478ee17bf9d4 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/host/button.tsx @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { SyntheticEvent } from 'react'; +import { EuiLink } from '@elastic/eui'; + +interface HostDetailsButtonProps { + children?: React.ReactNode; + onClick?: (e: SyntheticEvent) => void; + title?: string; +} + +export const HostDetailsButton: React.FC = ({ + children, + onClick, + title, +}) => { + return ( + + {children} + + ); +}; diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/host/index.tsx b/x-pack/packages/security-solution/common/src/cells/renderers/host/index.tsx new file mode 100644 index 0000000000000..a39397b233d60 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/host/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './button'; +export * from './with_expandable_flyout'; diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.test.tsx b/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.test.tsx new file mode 100644 index 0000000000000..0568c656cdbe5 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + HostCellWithFlyoutRenderer, + HostCellWithFlyoutRendererProps, +} from './with_expandable_flyout'; +import React from 'react'; +import { render, screen } from '@testing-library/react'; + +const renderTestComponents = (props?: Partial) => { + const finalProps: HostCellWithFlyoutRendererProps = { + rowIndex: 0, + columnId: 'test', + setCellProps: jest.fn(), + isExpandable: false, + isExpanded: true, + isDetails: false, + colIndex: 0, + fieldFormats: {} as HostCellWithFlyoutRendererProps['fieldFormats'], + dataView: {} as HostCellWithFlyoutRendererProps['dataView'], + closePopover: jest.fn(), + row: { + id: '1', + raw: { + _source: { + host: { + name: 'test-host-name', + }, + }, + }, + flattened: { + 'host.name': 'test-host-name', + }, + }, + ...props, + }; + return render(); +}; + +describe('With Expandable Flyout', () => { + it('should open Expandable Flyout on Click', () => { + renderTestComponents(); + + expect(screen.getByTestId('host-details-button')).toBeVisible(); + screen.getByTestId('host-details-button').click(); + expect(screen.getByTestId('host-name-flyout')).toBeVisible(); + expect(screen.getByText('Host Flyout Header - test-host-name')).toBeVisible(); + }); +}); diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.tsx b/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.tsx new file mode 100644 index 0000000000000..f870fd9f7d04e --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/host/with_expandable_flyout.tsx @@ -0,0 +1,66 @@ +/* + * 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 { getFieldValue } from '@kbn/discover-utils'; +import type { PropsWithChildren } from 'react'; +import type { DataGridCellValueElementProps } from '@kbn/unified-data-table'; +import { + ExpandableFlyout, + type ExpandableFlyoutProps, + useExpandableFlyoutApi, + withExpandableFlyoutProvider, +} from '@kbn/expandable-flyout'; +import { HostRightPanel, HostRightPanelProps } from '../../../flyout/panels'; +import { HostDetailsButton } from './button'; + +export type HostCellWithFlyoutRendererProps = PropsWithChildren; + +const HostCellWithFlyoutRendererComp = React.memo(function HostCellWithFlyoutRendererComp( + props: HostCellWithFlyoutRendererProps +) { + const hostName = getFieldValue(props.row, 'host.name'); + + const { openFlyout } = useExpandableFlyoutApi(); + + const onClick = useCallback(() => { + openFlyout({ + right: { + id: `host-panel-${hostName}-${props.rowIndex}`, + params: { + hostName, + }, + } as HostRightPanelProps, + }); + }, [openFlyout, hostName, props.rowIndex]); + + const panels: ExpandableFlyoutProps['registeredPanels'] = useMemo(() => { + return [ + { + key: `host-panel-${hostName}-${props.rowIndex}`, + component: (panelProps) => { + return ; + }, + }, + ]; + }, [hostName, props.rowIndex]); + + return ( + <> + + {hostName} + + ); +}); + +export const HostCellWithFlyoutRenderer = withExpandableFlyoutProvider( + HostCellWithFlyoutRendererComp +); diff --git a/x-pack/packages/security-solution/common/src/cells/renderers/index.ts b/x-pack/packages/security-solution/common/src/cells/renderers/index.ts new file mode 100644 index 0000000000000..e42333a710c04 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/cells/renderers/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 * from './get'; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.test.tsx similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.test.tsx index 483ee3d378bbd..cc282eb1156b5 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.test.tsx @@ -13,12 +13,12 @@ import { EXPANDABLE_PANEL_CONTENT_TEST_ID, EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, -} from './test_ids'; -import { ThemeProvider } from 'styled-components'; -import { getMockTheme } from '../../../common/lib/kibana/kibana_react.mock'; +} from '../test_ids'; +import { ThemeProvider } from '@emotion/react'; import { ExpandablePanel } from './expandable_panel'; -const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); +const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; + const TEST_ID = 'test-id'; const defaultProps = { header: { diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.tsx similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.tsx index aa97446f701e1..4f1890e58554f 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/expandable_panel.tsx @@ -102,7 +102,7 @@ export const ExpandablePanel: FC> = > = diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_body.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.test.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.test.tsx index e58d586a063b5..f0565fe1df43f 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; import { FlyoutError } from './flyout_error'; -import { FLYOUT_ERROR_TEST_ID } from './test_ids'; +import { FLYOUT_ERROR_TEST_ID } from '../test_ids'; describe('', () => { it('should render error title and body', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.tsx index 9ebef345540fe..f319d80dafe12 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_error.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiEmptyPrompt, EuiFlexItem } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { FLYOUT_ERROR_TEST_ID } from './test_ids'; +import { FLYOUT_ERROR_TEST_ID } from '../test_ids'; /** * Use this when you need to show an error state in the flyout @@ -21,7 +21,7 @@ export const FlyoutError: React.VFC = () => ( title={

@@ -30,7 +30,7 @@ export const FlyoutError: React.VFC = () => ( body={

diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_footer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_header_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.test.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.test.tsx index a164db8a6ce01..d55e85b3e978b 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { FLYOUT_LOADING_TEST_ID } from './test_ids'; +import { FLYOUT_LOADING_TEST_ID } from '../test_ids'; import { FlyoutLoading } from './flyout_loading'; describe('', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.tsx index 0c98957dd929b..cffe17c8ccbf1 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_loading.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import { css } from '@emotion/react'; -import { FLYOUT_LOADING_TEST_ID } from './test_ids'; +import { FLYOUT_LOADING_TEST_ID } from '../test_ids'; export interface FlyoutLoadingProps { /** diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.test.tsx similarity index 78% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.test.tsx index 321245ccde86e..d010796008880 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.test.tsx @@ -8,39 +8,61 @@ import type { FC, PropsWithChildren } from 'react'; import React from 'react'; import { act, render } from '@testing-library/react'; -import { TestProviders } from '../../../common/mock'; import { FlyoutNavigation } from './flyout_navigation'; import { COLLAPSE_DETAILS_BUTTON_TEST_ID, EXPAND_DETAILS_BUTTON_TEST_ID, HEADER_ACTIONS_TEST_ID, -} from './test_ids'; -import type { ExpandableFlyoutState } from '@kbn/expandable-flyout'; +} from '../test_ids'; import { + ExpandableFlyoutApi, + ExpandableFlyoutProvider, + ExpandableFlyoutState, useExpandableFlyoutApi, - type ExpandableFlyoutApi, useExpandableFlyoutState, } from '@kbn/expandable-flyout'; +import { I18nProvider } from '@kbn/i18n-react'; const expandDetails = jest.fn(); - -const ExpandableFlyoutTestProviders: FC> = ({ children }) => { - return {children}; -}; +const mockFlyoutCloseLeftPanel = jest.fn(); jest.mock('@kbn/expandable-flyout', () => ({ - useExpandableFlyoutApi: jest.fn(), + useExpandableFlyoutApi: jest.fn(() => { + return { + closeFlyout: jest.fn(), + closeLeftPanel: jest.fn(), + closePreviewPanel: jest.fn(), + closeRightPanel: jest.fn(), + previousPreviewPanel: jest.fn(), + openFlyout: jest.fn(), + openLeftPanel: jest.fn(), + openPreviewPanel: jest.fn(), + openRightPanel: jest.fn(), + }; + }), useExpandableFlyoutState: jest.fn(), ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}, + withExpandableFlyoutProvider: (Component: React.ComponentType) => { + return (props: T) => { + return ; + }; + }, + ExpandableFlyout: jest.fn(), })); -const flyoutContextValue = { - closeLeftPanel: jest.fn(), -} as unknown as ExpandableFlyoutApi; +const ExpandableFlyoutTestProviders: FC> = ({ children }) => { + return ( + + {children} + + ); +}; describe('', () => { beforeEach(() => { - jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + jest.mocked(useExpandableFlyoutApi).mockReturnValue({ + closeLeftPanel: mockFlyoutCloseLeftPanel, + } as unknown as ExpandableFlyoutApi); jest.mocked(useExpandableFlyoutState).mockReturnValue({} as unknown as ExpandableFlyoutState); }); @@ -75,7 +97,7 @@ describe('', () => { expect(queryByTestId(EXPAND_DETAILS_BUTTON_TEST_ID)).not.toBeInTheDocument(); getByTestId(COLLAPSE_DETAILS_BUTTON_TEST_ID).click(); - expect(flyoutContextValue.closeLeftPanel).toHaveBeenCalled(); + expect(mockFlyoutCloseLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.tsx similarity index 91% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.tsx index 35e684e35613a..c67f20119031e 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_navigation.tsx @@ -23,7 +23,7 @@ import { COLLAPSE_DETAILS_BUTTON_TEST_ID, EXPAND_DETAILS_BUTTON_TEST_ID, HEADER_NAVIGATION_BUTTON_TEST_ID, -} from './test_ids'; +} from '../test_ids'; export interface FlyoutNavigationProps { /** @@ -62,14 +62,14 @@ export const FlyoutNavigation: FC = memo( size="s" data-test-subj={COLLAPSE_DETAILS_BUTTON_TEST_ID} aria-label={i18n.translate( - 'xpack.securitySolution.flyout.right.header.collapseDetailButtonAriaLabel', + 'securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel', { defaultMessage: 'Collapse details', } )} > @@ -86,14 +86,14 @@ export const FlyoutNavigation: FC = memo( size="s" data-test-subj={EXPAND_DETAILS_BUTTON_TEST_ID} aria-label={i18n.translate( - 'xpack.securitySolution.flyout.right.header.expandDetailButtonAriaLabel', + 'securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel', { defaultMessage: 'Expand details', } )} > diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.stories.tsx similarity index 98% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.stories.tsx index 063e9fe9ef38f..867430167a349 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { EuiLink } from '@elastic/eui'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { FlyoutTitle } from './flyout_title'; const FixWidthWrapper = styled.div` diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.test.tsx similarity index 98% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.test.tsx index 1f2d0c128f411..3fde2b034219b 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.test.tsx @@ -12,7 +12,7 @@ import { TITLE_HEADER_ICON_TEST_ID, TITLE_HEADER_TEXT_TEST_ID, TITLE_LINK_ICON_TEST_ID, -} from './test_ids'; +} from '../test_ids'; const title = 'test title'; const TEST_ID = 'test'; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx b/x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx rename to x-pack/packages/security-solution/common/src/flyout/common/components/flyout_title.tsx diff --git a/x-pack/packages/security-solution/common/src/flyout/common/components/index.ts b/x-pack/packages/security-solution/common/src/flyout/common/components/index.ts new file mode 100644 index 0000000000000..4624ae2f70c55 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/flyout/common/components/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { FlyoutFooter } from './flyout_footer'; +export { FlyoutError } from './flyout_error'; +export { FlyoutLoading } from './flyout_loading'; +export { FlyoutNavigation } from './flyout_navigation'; +export { FlyoutTitle } from './flyout_title'; +export { FlyoutBody } from './flyout_body'; +export { FlyoutHeader } from './flyout_header'; +export { FlyoutHeaderTabs } from './flyout_header_tabs'; +export { ExpandablePanel } from './expandable_panel'; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts b/x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts rename to x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts index 9df26dbfb694d..60ccb0a234fde 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts +++ b/x-pack/packages/security-solution/common/src/flyout/common/test_ids.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PREFIX } from '../test_ids'; +export const PREFIX = 'securitySolutionFlyout' as const; export const FLYOUT_ERROR_TEST_ID = `${PREFIX}Error` as const; export const FLYOUT_LOADING_TEST_ID = `${PREFIX}Loading` as const; diff --git a/x-pack/packages/security-solution/common/src/flyout/index.tsx b/x-pack/packages/security-solution/common/src/flyout/index.tsx new file mode 100644 index 0000000000000..e919538d497c6 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/flyout/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './common/components'; +export * from './common/test_ids'; +export { HostRightPanel } from './panels'; diff --git a/x-pack/packages/security-solution/common/src/flyout/panels/host/right/index.tsx b/x-pack/packages/security-solution/common/src/flyout/panels/host/right/index.tsx new file mode 100644 index 0000000000000..d877695f5b170 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/flyout/panels/host/right/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FlyoutPanelProps } from '@kbn/expandable-flyout'; +import React from 'react'; +import { + FlyoutBody, + FlyoutFooter, + FlyoutHeader, + FlyoutNavigation, +} from '../../../common/components'; +// import { getEntityTableColumns } from './columns'; +// import type { BasicEntityData, EntityTableRows } from './types'; + +export interface HostRightPanelParamProps extends Record { + hostName: string; +} + +export interface HostRightPanelProps extends FlyoutPanelProps { + key: 'host'; + params: HostRightPanelParamProps; +} + +export const HostRightPanel = (props: HostRightPanelParamProps) => { + return ( + <> + + {`Host Flyout Header - ${props.hostName}`} + {'Host Flyout'} + {'Host Flyout Footer'} + + ); +}; diff --git a/x-pack/packages/security-solution/common/src/flyout/panels/index.ts b/x-pack/packages/security-solution/common/src/flyout/panels/index.ts new file mode 100644 index 0000000000000..3134078ebdf7f --- /dev/null +++ b/x-pack/packages/security-solution/common/src/flyout/panels/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './host/right'; +export * from './keys'; diff --git a/x-pack/packages/security-solution/common/src/flyout/panels/keys.ts b/x-pack/packages/security-solution/common/src/flyout/panels/keys.ts new file mode 100644 index 0000000000000..fe06cf652d016 --- /dev/null +++ b/x-pack/packages/security-solution/common/src/flyout/panels/keys.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 const HOST_PANEL = 'host-panel'; diff --git a/x-pack/packages/security-solution/common/tsconfig.json b/x-pack/packages/security-solution/common/tsconfig.json new file mode 100644 index 0000000000000..fb0d3709961d8 --- /dev/null +++ b/x-pack/packages/security-solution/common/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@testing-library/jest-dom", + "@testing-library/react", + "@emotion/react/types/css-prop" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "kbn_references": [ + "@kbn/unified-data-table", + "@kbn/discover-utils", + "@kbn/expandable-flyout", + "@kbn/i18n", + "@kbn/i18n-react" + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx deleted file mode 100644 index 07af65877da01..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { mockAllowedValues } from '../../mock/allowed_values/mock_allowed_values'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { EcsAllowedValues } from '.'; - -describe('EcsAllowedValues', () => { - describe('when `allowedValues` exists', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it renders the allowed values', () => { - expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( - mockAllowedValues.map(({ name }) => `${name}`).join('') - ); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); - }); - }); - - describe('when `allowedValues` is undefined', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it does NOT render the allowed values', () => { - expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); - }); - - test('it renders the placeholder', () => { - expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx deleted file mode 100644 index 92ad91e91b4cf..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import { EMPTY_PLACEHOLDER } from '../helpers'; -import { CodeSuccess } from '../../styles'; -import type { AllowedValue } from '../../types'; - -const EcsAllowedValueFlexItem = styled(EuiFlexItem)` - margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; -`; - -interface Props { - allowedValues: AllowedValue[] | undefined; -} - -const EcsAllowedValuesComponent: React.FC = ({ allowedValues }) => - allowedValues == null ? ( - {EMPTY_PLACEHOLDER} - ) : ( - - {allowedValues.map((x, i) => ( - - {x.name} - - ))} - - ); - -EcsAllowedValuesComponent.displayName = 'EcsAllowedValuesComponent'; - -export const EcsAllowedValues = React.memo(EcsAllowedValuesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx deleted file mode 100644 index 1dad2a79d9651..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx +++ /dev/null @@ -1,274 +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 { render, screen } from '@testing-library/react'; -import { omit } from 'lodash/fp'; -import React from 'react'; - -import { SAME_FAMILY } from '../../data_quality_panel/same_family/translations'; -import { - eventCategory, - someField, - eventCategoryWithUnallowedValues, -} from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { - DOCUMENT_VALUES_ACTUAL, - ECS_DESCRIPTION, - ECS_MAPPING_TYPE_EXPECTED, - ECS_VALUES_EXPECTED, - FIELD, - INDEX_MAPPING_TYPE_ACTUAL, -} from '../translations'; -import { EnrichedFieldMetadata } from '../../types'; -import { EMPTY_PLACEHOLDER, getCommonTableColumns } from '.'; - -describe('getCommonTableColumns', () => { - test('it returns the expected column configuration', () => { - expect(getCommonTableColumns().map((x) => omit('render', x))).toEqual([ - { field: 'indexFieldName', name: FIELD, sortable: true, truncateText: false, width: '20%' }, - { - field: 'type', - name: ECS_MAPPING_TYPE_EXPECTED, - sortable: true, - truncateText: false, - width: '15%', - }, - { - field: 'indexFieldType', - name: INDEX_MAPPING_TYPE_ACTUAL, - sortable: true, - truncateText: false, - width: '15%', - }, - { - field: 'allowed_values', - name: ECS_VALUES_EXPECTED, - sortable: false, - truncateText: false, - width: '15%', - }, - { - field: 'indexInvalidValues', - name: DOCUMENT_VALUES_ACTUAL, - sortable: false, - truncateText: false, - width: '15%', - }, - { - field: 'description', - name: ECS_DESCRIPTION, - sortable: false, - truncateText: false, - width: '20%', - }, - ]); - }); - - describe('type column render()', () => { - test('it renders the expected type', () => { - const columns = getCommonTableColumns(); - const typeColumnRender = columns[1].render; - const expected = 'keyword'; - - render( - - {typeColumnRender != null && typeColumnRender(eventCategory.type, eventCategory)} - - ); - - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(expected); - }); - - test('it renders an empty placeholder when type is undefined', () => { - const columns = getCommonTableColumns(); - const typeColumnRender = columns[1].render; - - render( - - {typeColumnRender != null && typeColumnRender(undefined, eventCategory)} - - ); - - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(EMPTY_PLACEHOLDER); - }); - }); - - describe('indexFieldType column render()', () => { - describe("when the index field type does NOT match the ECS type, but it's in the SAME family", () => { - const indexFieldType = 'wildcard'; - - beforeEach(() => { - const columns = getCommonTableColumns(); - const indexFieldTypeColumnRender = columns[2].render; - - const withTypeMismatchSameFamily: EnrichedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType, // this index has a mapping of `wildcard` instead of `keyword` - isInSameFamily: true, // `wildcard` and `keyword` are in the same family - }; - - render( - - {indexFieldTypeColumnRender != null && - indexFieldTypeColumnRender( - withTypeMismatchSameFamily.indexFieldType, - withTypeMismatchSameFamily - )} - - ); - }); - - test('it renders the index field with a "success" style', () => { - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(indexFieldType); - }); - - test('it renders the same family badge', () => { - expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY); - }); - }); - - describe("when the index field type does NOT match the ECS type, but it's in a DIFFERENT family", () => { - const indexFieldType = 'text'; - - test('it renders the expected type with danger styling', () => { - const columns = getCommonTableColumns(); - const indexFieldTypeColumnRender = columns[2].render; - - const withTypeMismatchDifferentFamily: EnrichedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType, // this index has a mapping of `text` instead of `keyword` - isInSameFamily: false, // `text` and `wildcard` are not in the same family - }; - - render( - - {indexFieldTypeColumnRender != null && - indexFieldTypeColumnRender( - withTypeMismatchDifferentFamily.indexFieldType, - withTypeMismatchDifferentFamily - )} - - ); - - expect(screen.getByTestId('codeDanger')).toHaveTextContent(indexFieldType); - }); - }); - - describe('when the index field matches the ECS type', () => { - test('it renders the expected type with success styling', () => { - const columns = getCommonTableColumns(); - const indexFieldTypeColumnRender = columns[2].render; - - render( - - {indexFieldTypeColumnRender != null && - indexFieldTypeColumnRender(eventCategory.indexFieldType, eventCategory)} - - ); - - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(eventCategory.indexFieldType); - }); - }); - }); - - describe('allowed_values column render()', () => { - test('it renders the expected allowed values when provided', () => { - const columns = getCommonTableColumns(); - const allowedValuesolumnRender = columns[3].render; - - const expectedAllowedValuesNames = - eventCategory.allowed_values != null - ? eventCategory.allowed_values.map((x) => x.name).join('') - : 'unexpected'; - - render( - - {allowedValuesolumnRender != null && - allowedValuesolumnRender(eventCategory.allowed_values, eventCategory)} - - ); - - expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent(expectedAllowedValuesNames); - }); - - test('it renders a placeholder when allowed values is undefined', () => { - const columns = getCommonTableColumns(); - const allowedValuesolumnRender = columns[3].render; - - const withUndefinedAllowedValues: EnrichedFieldMetadata = { - ...eventCategory, - allowed_values: undefined, - }; - - render( - - {allowedValuesolumnRender != null && - allowedValuesolumnRender(undefined, withUndefinedAllowedValues)} - - ); - - expect(screen.getByTestId('ecsAllowedValuesEmpty')).toHaveTextContent(EMPTY_PLACEHOLDER); - }); - }); - - describe('indexInvalidValues column render()', () => { - test('it renders the expected index invalid values', () => { - const columns = getCommonTableColumns(); - const indexInvalidValuesRender = columns[4].render; - - render( - - {indexInvalidValuesRender != null && - indexInvalidValuesRender( - eventCategoryWithUnallowedValues.indexInvalidValues, - eventCategoryWithUnallowedValues - )} - - ); - - expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( - 'an_invalid_category (2)theory (1)' - ); - }); - }); - - describe('description column render()', () => { - test('it renders the expected description', () => { - const columns = getCommonTableColumns(); - const descriptionolumnRender = columns[5].render; - const expectedDescription = 'this is a test'; - - const withDescription: EnrichedFieldMetadata = { - ...eventCategory, - description: expectedDescription, - }; - - render( - - {descriptionolumnRender != null && - descriptionolumnRender(withDescription.description, withDescription)} - - ); - - expect(screen.getByTestId('description')).toHaveTextContent(expectedDescription); - }); - - test('it renders a placeholder when description is undefined', () => { - const columns = getCommonTableColumns(); - const descriptionolumnRender = columns[5].render; - - render( - - {descriptionolumnRender != null && descriptionolumnRender(undefined, someField)} - - ); - - expect(screen.getByTestId('emptyDescription')).toHaveTextContent(EMPTY_PLACEHOLDER); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.tsx deleted file mode 100644 index 2e0d2506d6e0f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.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 type { EuiTableFieldDataColumnType } from '@elastic/eui'; -import { EuiCode } from '@elastic/eui'; -import React from 'react'; - -import { SameFamily } from '../../data_quality_panel/same_family'; -import { EcsAllowedValues } from '../ecs_allowed_values'; -import { getIsInSameFamily } from '../../helpers'; -import { IndexInvalidValues } from '../index_invalid_values'; -import { CodeDanger, CodeSuccess } from '../../styles'; -import * as i18n from '../translations'; -import type { AllowedValue, EnrichedFieldMetadata, UnallowedValueCount } from '../../types'; - -export const EMPTY_PLACEHOLDER = '--'; - -export const getCommonTableColumns = (): Array< - EuiTableFieldDataColumnType -> => [ - { - field: 'indexFieldName', - name: i18n.FIELD, - sortable: true, - truncateText: false, - width: '20%', - }, - { - field: 'type', - name: i18n.ECS_MAPPING_TYPE_EXPECTED, - render: (type: string | undefined) => ( - - {type != null ? type : EMPTY_PLACEHOLDER} - - ), - sortable: true, - truncateText: false, - width: '15%', - }, - { - field: 'indexFieldType', - name: i18n.INDEX_MAPPING_TYPE_ACTUAL, - render: (_, x) => { - // if custom field or ecs based field with mapping match - if (!x.hasEcsMetadata || x.indexFieldType === x.type) { - return {x.indexFieldType}; - } - - // mapping mismatch due to same family - if (getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType })) { - return ( -

- {x.indexFieldType} - -
- ); - } - - // mapping mismatch - return {x.indexFieldType}; - }, - sortable: true, - truncateText: false, - width: '15%', - }, - { - field: 'allowed_values', - name: i18n.ECS_VALUES_EXPECTED, - render: (allowedValues: AllowedValue[] | undefined) => ( - - ), - sortable: false, - truncateText: false, - width: '15%', - }, - { - field: 'indexInvalidValues', - name: i18n.DOCUMENT_VALUES_ACTUAL, - render: (indexInvalidValues: UnallowedValueCount[]) => ( - - ), - sortable: false, - truncateText: false, - width: '15%', - }, - { - field: 'description', - name: i18n.ECS_DESCRIPTION, - render: (description: string | undefined) => - description != null ? ( - {description} - ) : ( - {EMPTY_PLACEHOLDER} - ), - sortable: false, - truncateText: false, - width: '20%', - }, -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx deleted file mode 100644 index 367ff38fa1093..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.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 { render, screen } from '@testing-library/react'; -import { omit } from 'lodash/fp'; -import React from 'react'; - -import { SAME_FAMILY } from '../../data_quality_panel/same_family/translations'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { eventCategory } from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { EcsBasedFieldMetadata } from '../../types'; -import { getIncompatibleMappingsTableColumns } from '.'; - -describe('getIncompatibleMappingsTableColumns', () => { - test('it returns the expected column configuration', () => { - const columns = getIncompatibleMappingsTableColumns().map((x) => omit('render', x)); - - expect(columns).toEqual([ - { - field: 'indexFieldName', - name: 'Field', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'type', - name: 'ECS mapping type (expected)', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'indexFieldType', - name: 'Index mapping type (actual)', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: 'ECS description', - sortable: false, - truncateText: false, - width: '25%', - }, - ]); - }); - - describe('type column render()', () => { - test('it renders the expected type', () => { - const columns = getIncompatibleMappingsTableColumns(); - const typeColumnRender = columns[1].render; - const expected = 'keyword'; - - render( - - {typeColumnRender != null && typeColumnRender(eventCategory.type, eventCategory)} - - ); - - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(expected); - }); - }); - - describe('indexFieldType column render()', () => { - describe("when the index field type does NOT match the ECS type, but it's in the SAME family", () => { - const indexFieldType = 'wildcard'; - - beforeEach(() => { - const columns = getIncompatibleMappingsTableColumns(); - const indexFieldTypeColumnRender = columns[2].render; - - const withTypeMismatchSameFamily: EcsBasedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType, // this index has a mapping of `wildcard` instead of `keyword` - isInSameFamily: true, // `wildcard` and `keyword` are in the same family - }; - - render( - - {indexFieldTypeColumnRender != null && - indexFieldTypeColumnRender( - withTypeMismatchSameFamily.indexFieldType, - withTypeMismatchSameFamily - )} - - ); - }); - - test('it renders the expected type with a "success" style', () => { - expect(screen.getByTestId('codeSuccess')).toHaveTextContent(indexFieldType); - }); - - test('it renders the same family badge', () => { - expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY); - }); - }); - - describe("when the index field type does NOT match the ECS type, but it's in a DIFFERENT family", () => { - const indexFieldType = 'text'; - - test('it renders the expected type with danger styling', () => { - const columns = getIncompatibleMappingsTableColumns(); - const indexFieldTypeColumnRender = columns[2].render; - - const withTypeMismatchDifferentFamily: EcsBasedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType, // this index has a mapping of `text` instead of `keyword` - isInSameFamily: false, // `text` and `wildcard` are not in the same family - }; - - render( - - {indexFieldTypeColumnRender != null && - indexFieldTypeColumnRender( - withTypeMismatchDifferentFamily.indexFieldType, - withTypeMismatchDifferentFamily - )} - - ); - - expect(screen.getByTestId('codeDanger')).toHaveTextContent(indexFieldType); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx deleted file mode 100644 index 70078ab7ccc16..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx +++ /dev/null @@ -1,59 +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 type { EuiTableFieldDataColumnType } from '@elastic/eui'; -import React from 'react'; - -import { SameFamily } from '../../data_quality_panel/same_family'; -import { CodeDanger, CodeSuccess } from '../../styles'; -import * as i18n from '../translations'; -import type { EcsBasedFieldMetadata } from '../../types'; - -export const EMPTY_PLACEHOLDER = '--'; - -export const getIncompatibleMappingsTableColumns = (): Array< - EuiTableFieldDataColumnType -> => [ - { - field: 'indexFieldName', - name: i18n.FIELD, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'type', - name: i18n.ECS_MAPPING_TYPE_EXPECTED, - render: (type: string) => {type}, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'indexFieldType', - name: i18n.INDEX_MAPPING_TYPE_ACTUAL, - render: (indexFieldType: string, x) => - x.isInSameFamily ? ( -
- {indexFieldType} - -
- ) : ( - {indexFieldType} - ), - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: i18n.ECS_DESCRIPTION, - sortable: false, - truncateText: false, - width: '25%', - }, -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx deleted file mode 100644 index d9897cfa3d399..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx +++ /dev/null @@ -1,359 +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 { render, screen } from '@testing-library/react'; -import { omit } from 'lodash/fp'; -import React from 'react'; - -import { - getCustomTableColumns, - getEcsCompliantTableColumns, - getIncompatibleValuesTableColumns, -} from './helpers'; -import { - eventCategory, - eventCategoryWithUnallowedValues, - someField, -} from '../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestProviders } from '../mock/test_providers/test_providers'; - -describe('helpers', () => { - describe('getCustomTableColumns', () => { - test('it returns the expected columns', () => { - expect(getCustomTableColumns().map((x) => omit('render', x))).toEqual([ - { - field: 'indexFieldName', - name: 'Field', - sortable: true, - truncateText: false, - width: '50%', - }, - { - field: 'indexFieldType', - name: 'Index mapping type', - sortable: true, - truncateText: false, - width: '50%', - }, - ]); - }); - - describe('indexFieldType render()', () => { - test('it renders the indexFieldType', () => { - const columns = getCustomTableColumns(); - const indexFieldTypeRender = columns[1].render; - - render( - - <> - {indexFieldTypeRender != null && - indexFieldTypeRender(someField.indexFieldType, someField)} - - - ); - - expect(screen.getByTestId('indexFieldType')).toHaveTextContent(someField.indexFieldType); - }); - }); - }); - - describe('getEcsCompliantTableColumns', () => { - test('it returns the expected columns', () => { - expect(getEcsCompliantTableColumns().map((x) => omit('render', x))).toEqual([ - { - field: 'indexFieldName', - name: 'Field', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'type', - name: 'ECS mapping type', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'allowed_values', - name: 'ECS values', - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: 'ECS description', - sortable: false, - truncateText: false, - width: '25%', - }, - ]); - }); - - describe('type render()', () => { - describe('when `type` exists', () => { - beforeEach(() => { - const columns = getEcsCompliantTableColumns(); - const typeRender = columns[1].render; - - render( - - <>{typeRender != null && typeRender(eventCategory.type, eventCategory)} - - ); - }); - - test('it renders the expected `type`', () => { - expect(screen.getByTestId('type')).toHaveTextContent('keyword'); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('typePlaceholder')).not.toBeInTheDocument(); - }); - }); - }); - - describe('allowed values render()', () => { - describe('when `allowedValues` exists', () => { - beforeEach(() => { - const columns = getEcsCompliantTableColumns(); - const allowedValuesRender = columns[2].render; - - render( - - <> - {allowedValuesRender != null && - allowedValuesRender(eventCategory.allowed_values, eventCategory)} - - - ); - }); - - test('it renders the expected `AllowedValue` names', () => { - expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( - eventCategory.allowed_values?.map(({ name }) => name).join('') ?? '' - ); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); - }); - }); - - describe('when `allowedValues` is undefined', () => { - const withUndefinedAllowedValues = { - ...eventCategory, - allowed_values: undefined, // <-- - }; - - beforeEach(() => { - const columns = getEcsCompliantTableColumns(); - const allowedValuesRender = columns[2].render; - - render( - - <> - {allowedValuesRender != null && - allowedValuesRender( - withUndefinedAllowedValues.allowed_values, - withUndefinedAllowedValues - )} - - - ); - }); - - test('it does NOT render the `AllowedValue` names', () => { - expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); - }); - - test('it renders the placeholder', () => { - expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); - }); - }); - }); - - describe('description render()', () => { - describe('when `description` exists', () => { - beforeEach(() => { - const columns = getEcsCompliantTableColumns(); - const descriptionRender = columns[3].render; - - render( - - <> - {descriptionRender != null && - descriptionRender(eventCategory.description, eventCategory)} - - - ); - }); - - test('it renders the expected `description`', () => { - expect(screen.getByTestId('description')).toHaveTextContent( - eventCategory.description?.replaceAll('\n', ' ') ?? '' - ); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); - }); - }); - }); - }); - - describe('getIncompatibleValuesTableColumns', () => { - test('it returns the expected columns', () => { - expect(getIncompatibleValuesTableColumns().map((x) => omit('render', x))).toEqual([ - { - field: 'indexFieldName', - name: 'Field', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'allowed_values', - name: 'ECS values (expected)', - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'indexInvalidValues', - name: 'Document values (actual)', - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: 'ECS description', - sortable: false, - truncateText: false, - width: '25%', - }, - ]); - }); - - describe('allowed values render()', () => { - describe('when `allowedValues` exists', () => { - beforeEach(() => { - const columns = getIncompatibleValuesTableColumns(); - const allowedValuesRender = columns[1].render; - - render( - - <> - {allowedValuesRender != null && - allowedValuesRender(eventCategory.allowed_values, eventCategory)} - - - ); - }); - - test('it renders the expected `AllowedValue` names', () => { - expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( - eventCategory.allowed_values?.map(({ name }) => name).join('') ?? '' - ); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); - }); - }); - - describe('when `allowedValues` is undefined', () => { - const withUndefinedAllowedValues = { - ...eventCategory, - allowed_values: undefined, // <-- - }; - - beforeEach(() => { - const columns = getIncompatibleValuesTableColumns(); - const allowedValuesRender = columns[1].render; - - render( - - <> - {allowedValuesRender != null && - allowedValuesRender( - withUndefinedAllowedValues.allowed_values, - withUndefinedAllowedValues - )} - - - ); - }); - - test('it does NOT render the `AllowedValue` names', () => { - expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); - }); - - test('it renders the placeholder', () => { - expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); - }); - }); - }); - - describe('indexInvalidValues render()', () => { - describe('when `indexInvalidValues` is populated', () => { - beforeEach(() => { - const columns = getIncompatibleValuesTableColumns(); - const indexInvalidValuesRender = columns[2].render; - - render( - - <> - {indexInvalidValuesRender != null && - indexInvalidValuesRender( - eventCategoryWithUnallowedValues.indexInvalidValues, - eventCategoryWithUnallowedValues - )} - - - ); - }); - - test('it renders the expected `indexInvalidValues`', () => { - expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( - 'an_invalid_category (2)theory (1)' - ); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); - }); - }); - - describe('when `indexInvalidValues` is empty', () => { - beforeEach(() => { - const columns = getIncompatibleValuesTableColumns(); - const indexInvalidValuesRender = columns[2].render; - - render( - - <> - {indexInvalidValuesRender != null && - indexInvalidValuesRender(eventCategory.indexInvalidValues, eventCategory)} - - - ); - }); - - test('it does NOT render the index invalid values', () => { - expect(screen.queryByTestId('indexInvalidValues')).not.toBeInTheDocument(); - }); - - test('it renders the placeholder', () => { - expect(screen.getByTestId('emptyPlaceholder')).toBeInTheDocument(); - }); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx deleted file mode 100644 index a9f5c17034833..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx +++ /dev/null @@ -1,122 +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 type { EuiTableFieldDataColumnType } from '@elastic/eui'; -import { EuiCode } from '@elastic/eui'; -import React from 'react'; - -import { EcsAllowedValues } from './ecs_allowed_values'; -import { IndexInvalidValues } from './index_invalid_values'; -import { CodeSuccess } from '../styles'; -import * as i18n from './translations'; -import type { - AllowedValue, - CustomFieldMetadata, - EcsBasedFieldMetadata, - UnallowedValueCount, -} from '../types'; - -export const EMPTY_PLACEHOLDER = '--'; - -export const getCustomTableColumns = (): Array< - EuiTableFieldDataColumnType -> => [ - { - field: 'indexFieldName', - name: i18n.FIELD, - sortable: true, - truncateText: false, - width: '50%', - }, - { - field: 'indexFieldType', - name: i18n.INDEX_MAPPING_TYPE, - render: (indexFieldType: string) => ( - {indexFieldType} - ), - sortable: true, - truncateText: false, - width: '50%', - }, -]; - -export const getEcsCompliantTableColumns = (): Array< - EuiTableFieldDataColumnType -> => [ - { - field: 'indexFieldName', - name: i18n.FIELD, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'type', - name: i18n.ECS_MAPPING_TYPE, - render: (type: string) => {type}, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'allowed_values', - name: i18n.ECS_VALUES, - render: (allowedValues: AllowedValue[] | undefined) => ( - - ), - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: i18n.ECS_DESCRIPTION, - render: (description: string) => {description}, - sortable: false, - truncateText: false, - width: '25%', - }, -]; - -export const getIncompatibleValuesTableColumns = (): Array< - EuiTableFieldDataColumnType -> => [ - { - field: 'indexFieldName', - name: i18n.FIELD, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'allowed_values', - name: i18n.ECS_VALUES_EXPECTED, - render: (allowedValues: AllowedValue[] | undefined) => ( - - ), - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'indexInvalidValues', - name: i18n.DOCUMENT_VALUES_ACTUAL, - render: (indexInvalidValues: UnallowedValueCount[]) => ( - - ), - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'description', - name: i18n.ECS_DESCRIPTION, - sortable: false, - truncateText: false, - width: '25%', - }, -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx deleted file mode 100644 index 8732f27702bc2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../data_quality_panel/tabs/incompatible_tab/translations'; -import { eventCategory } from '../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestProviders } from '../mock/test_providers/test_providers'; -import { CompareFieldsTable } from '.'; -import { getIncompatibleMappingsTableColumns } from './get_incompatible_mappings_table_columns'; - -describe('CompareFieldsTable', () => { - describe('rendering', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it renders the expected title', () => { - expect(screen.getByTestId('title')).toHaveTextContent('Incompatible field mappings - foo'); - }); - - test('it renders the table', () => { - expect(screen.getByTestId('table')).toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx deleted file mode 100644 index 460663fb28790..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx +++ /dev/null @@ -1,60 +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 type { EuiTableFieldDataColumnType, Search } from '@elastic/eui'; -import { EuiInMemoryTable, EuiTitle, EuiSpacer } from '@elastic/eui'; -import React, { useMemo } from 'react'; - -import * as i18n from './translations'; -import type { EnrichedFieldMetadata } from '../types'; - -const search: Search = { - box: { - incremental: true, - placeholder: i18n.SEARCH_FIELDS, - schema: true, - }, -}; - -interface Props { - enrichedFieldMetadata: T[]; - getTableColumns: () => Array>; - title: string; -} - -const CompareFieldsTableComponent = ({ - enrichedFieldMetadata, - getTableColumns, - title, -}: Props): React.ReactElement => { - const columns = useMemo(() => getTableColumns(), [getTableColumns]); - - return ( - <> - - {title} - - - - - ); -}; - -CompareFieldsTableComponent.displayName = 'CompareFieldsTableComponent'; - -export const CompareFieldsTable = React.memo( - CompareFieldsTableComponent - // React.memo doesn't pass generics through so - // this is a cheap fix without sacrificing type safety -) as typeof CompareFieldsTableComponent; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx deleted file mode 100644 index 6a93d3f90a24d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx +++ /dev/null @@ -1,49 +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 { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_PLACEHOLDER } from '../helpers'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { UnallowedValueCount } from '../../types'; -import { IndexInvalidValues } from '.'; - -describe('IndexInvalidValues', () => { - test('it renders a placeholder with the expected content when `indexInvalidValues` is empty', () => { - render( - - - - ); - - expect(screen.getByTestId('emptyPlaceholder')).toHaveTextContent(EMPTY_PLACEHOLDER); - }); - - test('it renders the expected field names and counts when the index has invalid values', () => { - const indexInvalidValues: UnallowedValueCount[] = [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ]; - - render( - - - - ); - - expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( - 'an_invalid_category (2)theory (1)' - ); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx deleted file mode 100644 index 2b58ea98b8b28..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx +++ /dev/null @@ -1,46 +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 { EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import { EMPTY_PLACEHOLDER } from '../helpers'; -import { CodeDanger } from '../../styles'; -import type { UnallowedValueCount } from '../../types'; - -const IndexInvalidValueFlexItem = styled(EuiFlexItem)` - margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; -`; - -interface Props { - indexInvalidValues: UnallowedValueCount[]; -} - -const IndexInvalidValuesComponent: React.FC = ({ indexInvalidValues }) => - indexInvalidValues.length === 0 ? ( - {EMPTY_PLACEHOLDER} - ) : ( - - {indexInvalidValues.map(({ fieldName, count }, i) => ( - -
- {fieldName}{' '} - - {'('} - {count} - {')'} - -
-
- ))} -
- ); - -IndexInvalidValuesComponent.displayName = 'IndexInvalidValuesComponent'; - -export const IndexInvalidValues = React.memo(IndexInvalidValuesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/constants.ts deleted file mode 100644 index a53c50edc1084..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/constants.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EcsFlat } from '@elastic/ecs'; -import { EcsFieldMetadata } from './types'; - -export const EcsFlatTyped = EcsFlat as unknown as Record; -export type EcsFlatTyped = typeof EcsFlatTyped; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx deleted file mode 100644 index 7fd0a3f3b133d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx +++ /dev/null @@ -1,152 +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 { EcsFlatTyped } from '../../constants'; -import { getUnallowedValueRequestItems, getValidValues, hasAllowedValues } from './helpers'; - -describe('helpers', () => { - describe('hasAllowedValues', () => { - test('it returns true for a field that has `allowed_values`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'event.category', - }) - ).toBe(true); - }); - - test('it returns false for a field that does NOT have `allowed_values`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'host.name', - }) - ).toBe(false); - }); - - test('it returns false for a field that does NOT exist in `ecsMetadata`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'does.NOT.exist', - }) - ).toBe(false); - }); - }); - - describe('getValidValues', () => { - test('it returns the expected valid values', () => { - expect(getValidValues(EcsFlatTyped['event.category'])).toEqual( - expect.arrayContaining([ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ]) - ); - }); - - test('it returns an empty array when the `field` does NOT have `allowed_values`', () => { - expect(getValidValues(EcsFlatTyped['host.name'])).toEqual([]); - }); - - test('it returns an empty array when `field` is undefined', () => { - expect(getValidValues(undefined)).toEqual([]); - }); - }); - - describe('getUnallowedValueRequestItems', () => { - test('it returns the expected request items', () => { - expect( - getUnallowedValueRequestItems({ - ecsMetadata: EcsFlatTyped, - indexName: 'auditbeat-*', - }) - ).toEqual([ - { - indexName: 'auditbeat-*', - indexFieldName: 'event.category', - allowedValues: expect.arrayContaining([ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ]), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.kind', - allowedValues: expect.arrayContaining([ - 'alert', - 'enrichment', - 'event', - 'metric', - 'state', - 'pipeline_error', - 'signal', - ]), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.outcome', - allowedValues: expect.arrayContaining(['failure', 'success', 'unknown']), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.type', - allowedValues: expect.arrayContaining([ - 'access', - 'admin', - 'allowed', - 'change', - 'connection', - 'creation', - 'deletion', - 'denied', - 'end', - 'error', - 'group', - 'indicator', - 'info', - 'installation', - 'protocol', - 'start', - 'user', - ]), - }, - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx deleted file mode 100644 index fd356b9fe60d5..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx +++ /dev/null @@ -1,42 +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 type { EcsFlatTyped } from '../../constants'; -import type { EcsFieldMetadata, UnallowedValueRequestItem } from '../../types'; - -export const hasAllowedValues = ({ - ecsMetadata, - fieldName, -}: { - ecsMetadata: EcsFlatTyped; - fieldName: string; -}): boolean => (ecsMetadata[fieldName]?.allowed_values?.length ?? 0) > 0; - -export const getValidValues = (field?: EcsFieldMetadata): string[] => - field?.allowed_values?.flatMap(({ name }) => name) ?? []; - -export const getUnallowedValueRequestItems = ({ - ecsMetadata, - indexName, -}: { - ecsMetadata: EcsFlatTyped; - indexName: string; -}): UnallowedValueRequestItem[] => - Object.keys(ecsMetadata).reduce( - (acc, fieldName) => - hasAllowedValues({ ecsMetadata, fieldName }) - ? [ - ...acc, - { - indexName, - indexFieldName: fieldName, - allowedValues: getValidValues(ecsMetadata[fieldName]), - }, - ] - : acc, - [] - ); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx deleted file mode 100644 index 78ae37d4fea64..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx +++ /dev/null @@ -1,114 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../../helpers'; -import { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../types'; -import { Props, DataQualityDetails } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const patternIndexNames: Record = { - 'auditbeat-*': [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-custom-index-1', - ], - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], - 'packetbeat-*': [ - '.ds-packetbeat-8.5.3-2023.02.04-000001', - '.ds-packetbeat-8.6.1-2023.02.04-000001', - ], -}; - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: jest.fn(), - formatBytes, - formatNumber, - getGroupByFieldsOnClick: jest.fn(), - ilmPhases, - isAssistantEnabled: true, - openCreateCaseFlyout: jest.fn(), - patternIndexNames, - patternRollups, - patterns, - baseTheme: DARK_THEME, - updatePatternIndexNames: jest.fn(), - updatePatternRollup: jest.fn(), -}; - -describe('DataQualityDetails', () => { - describe('when ILM phases are provided', () => { - beforeEach(async () => { - jest.clearAllMocks(); - - render( - - - - ); - - await waitFor(() => {}); // wait for PatternComponent state updates - }); - - test('it renders the storage details', () => { - expect(screen.getByTestId('storageDetails')).toBeInTheDocument(); - }); - - test('it renders the indices details', () => { - expect(screen.getByTestId('indicesDetails')).toBeInTheDocument(); - }); - }); - - describe('when ILM phases are are empty', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders an empty prompt when ilmPhases is empty', () => { - expect(screen.getByTestId('ilmPhasesEmptyPrompt')).toBeInTheDocument(); - }); - - test('it does NOT render the storage details', () => { - expect(screen.queryByTestId('storageDetails')).not.toBeInTheDocument(); - }); - - test('it does NOT render the indices details', () => { - expect(screen.queryByTestId('indicesDetails')).not.toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx deleted file mode 100644 index 9b2dff03e30c1..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx +++ /dev/null @@ -1,140 +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 type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; - -import React, { useCallback, useState } from 'react'; - -import { IlmPhasesEmptyPrompt } from '../../../ilm_phases_empty_prompt'; -import { IndicesDetails } from './indices_details'; -import { StorageDetails } from './storage_details'; -import { PatternRollup, SelectedIndex } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - baseTheme: Theme; - canUserCreateAndReadCases: () => boolean; - endDate?: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhases: string[]; - isAssistantEnabled: boolean; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patternIndexNames: Record; - patternRollups: Record; - patterns: string[]; - startDate?: string | null; - theme?: PartialTheme; - updatePatternIndexNames: ({ - indexNames, - pattern, - }: { - indexNames: string[]; - pattern: string; - }) => void; - updatePatternRollup: (patternRollup: PatternRollup) => void; -} - -const DataQualityDetailsComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - endDate, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhases, - isAssistantEnabled, - openCreateCaseFlyout, - patternIndexNames, - patternRollups, - patterns, - startDate, - theme, - baseTheme, - updatePatternIndexNames, - updatePatternRollup, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const [selectedIndex, setSelectedIndex] = useState(null); - - const onIndexSelected = useCallback(async ({ indexName, pattern }: SelectedIndex) => { - setSelectedIndex({ indexName, pattern }); - }, []); - - if (isILMAvailable && ilmPhases.length === 0) { - return ; - } - - return ( - <> - - - - - ); -}; - -DataQualityDetailsComponent.displayName = 'DataQualityDetailsComponent'; -export const DataQualityDetails = React.memo(DataQualityDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx deleted file mode 100644 index 672f5ed76b664..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx +++ /dev/null @@ -1,96 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../../../helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../../types'; -import { Props, IndicesDetails } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const patternIndexNames: Record = { - 'auditbeat-*': [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-custom-index-1', - ], - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], - 'packetbeat-*': [ - '.ds-packetbeat-8.5.3-2023.02.04-000001', - '.ds-packetbeat-8.6.1-2023.02.04-000001', - ], -}; - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: jest.fn(), - formatBytes, - formatNumber, - getGroupByFieldsOnClick: jest.fn(), - ilmPhases, - isAssistantEnabled: true, - openCreateCaseFlyout: jest.fn(), - patternIndexNames, - patternRollups, - patterns, - selectedIndex: null, - setSelectedIndex: jest.fn(), - baseTheme: DARK_THEME, - updatePatternIndexNames: jest.fn(), - updatePatternRollup: jest.fn(), -}; - -describe('IndicesDetails', () => { - beforeEach(async () => { - jest.clearAllMocks(); - - render( - - - - ); - - await waitFor(() => {}); - }); - - describe('rendering patterns', () => { - patterns.forEach((pattern) => { - test(`it renders the ${pattern} pattern`, () => { - expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); - }); - }); - }); - - describe('rendering spacers', () => { - test('it renders the expected number of spacers', () => { - expect(screen.getAllByTestId('bodyPatternSpacer')).toHaveLength(patterns.length - 1); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx deleted file mode 100644 index 3bfbe9065ebea..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx +++ /dev/null @@ -1,123 +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 type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React from 'react'; - -import { Pattern } from '../../../pattern'; -import { PatternRollup, SelectedIndex } from '../../../../types'; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - canUserCreateAndReadCases: () => boolean; - endDate?: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhases: string[]; - isAssistantEnabled: boolean; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patternIndexNames: Record; - patternRollups: Record; - patterns: string[]; - selectedIndex: SelectedIndex | null; - setSelectedIndex: (selectedIndex: SelectedIndex | null) => void; - startDate?: string | null; - theme?: PartialTheme; - baseTheme: Theme; - updatePatternIndexNames: ({ - indexNames, - pattern, - }: { - indexNames: string[]; - pattern: string; - }) => void; - updatePatternRollup: (patternRollup: PatternRollup) => void; -} - -const IndicesDetailsComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - endDate, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhases, - isAssistantEnabled, - openCreateCaseFlyout, - patternIndexNames, - patternRollups, - patterns, - selectedIndex, - setSelectedIndex, - startDate, - theme, - baseTheme, - updatePatternIndexNames, - updatePatternRollup, -}) => ( -
- {patterns.map((pattern, i) => ( - - - {patterns[i + 1] && } - - ))} -
-); - -IndicesDetailsComponent.displayName = 'IndicesDetailsComponent'; - -export const IndicesDetails = React.memo(IndicesDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts deleted file mode 100644 index 650b70586d19f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts +++ /dev/null @@ -1,516 +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 numeral from '@elastic/numeral'; -import { euiThemeVars } from '@kbn/ui-theme'; - -import { EMPTY_STAT } from '../../../../helpers'; -import { - DEFAULT_INDEX_COLOR, - getFillColor, - getFlattenedBuckets, - getGroupFromPath, - getLayersMultiDimensional, - getLegendItems, - getLegendItemsForPattern, - getPathToFlattenedBucketMap, - getPatternLegendItem, - getPatternSizeInBytes, -} from './helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { PatternRollup } from '../../../../types'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -/** a valid `PatternRollup` that has an undefined `sizeInBytes` */ -const noSizeInBytes: Record = { - 'valid-*': { - docsCount: 19127, - error: null, - ilmExplain: null, - ilmExplainPhaseCounts: { - hot: 1, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 2, - }, - indices: 3, - pattern: 'valid-*', - results: undefined, - sizeInBytes: undefined, // <-- - stats: null, - }, -}; - -describe('helpers', () => { - describe('getPatternSizeInBytes', () => { - test('it returns the expected size when the pattern exists in the rollup', () => { - const pattern = 'auditbeat-*'; - - expect(getPatternSizeInBytes({ pattern, patternRollups })).toEqual( - auditbeatWithAllResults.sizeInBytes - ); - }); - - test('it returns undefined when the pattern exists in the rollup, but does not have a sizeInBytes', () => { - const pattern = 'valid-*'; - - expect(getPatternSizeInBytes({ pattern, patternRollups: noSizeInBytes })).toBeUndefined(); - }); - - test('it returns undefined when the pattern does NOT exist in the rollup', () => { - const pattern = 'does-not-exist-*'; - - expect(getPatternSizeInBytes({ pattern, patternRollups })).toBeUndefined(); - }); - }); - - describe('getPatternLegendItem', () => { - test('it returns the expected legend item', () => { - const pattern = 'auditbeat-*'; - - expect(getPatternLegendItem({ pattern, patternRollups })).toEqual({ - color: null, - ilmPhase: null, - index: null, - pattern, - sizeInBytes: auditbeatWithAllResults.sizeInBytes, - docsCount: auditbeatWithAllResults.docsCount, - }); - }); - }); - - describe('getLegendItemsForPattern', () => { - test('it returns the expected legend items', () => { - const pattern = 'auditbeat-*'; - const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, - }); - - expect(getLegendItemsForPattern({ pattern, flattenedBuckets })).toEqual([ - { - color: euiThemeVars.euiColorSuccess, - ilmPhase: 'hot', - index: '.ds-auditbeat-8.6.1-2023.02.07-000001', - pattern: 'auditbeat-*', - sizeInBytes: 18791790, - docsCount: 19123, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: 'unmanaged', - index: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 28409, - docsCount: 4, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: 'unmanaged', - index: 'auditbeat-custom-empty-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 247, - docsCount: 0, - }, - ]); - }); - - test('it returns the expected legend items when isILMAvailable is false', () => { - const pattern = 'auditbeat-*'; - const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: false, - patternRollups, - }); - expect(getLegendItemsForPattern({ pattern, flattenedBuckets })).toEqual([ - { - color: euiThemeVars.euiColorSuccess, - ilmPhase: null, - index: '.ds-auditbeat-8.6.1-2023.02.07-000001', - pattern: 'auditbeat-*', - sizeInBytes: 18791790, - docsCount: 19123, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: null, - index: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 28409, - docsCount: 4, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: null, - index: 'auditbeat-custom-empty-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 247, - docsCount: 0, - }, - ]); - }); - }); - - describe('getLegendItems', () => { - test('it returns the expected legend items', () => { - const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, - }); - - expect(getLegendItems({ flattenedBuckets, patterns, patternRollups })).toEqual([ - { - color: null, - ilmPhase: null, - index: null, - pattern: '.alerts-security.alerts-default', - sizeInBytes: 29717961631, - docsCount: 26093, - }, - { - color: euiThemeVars.euiColorSuccess, - ilmPhase: 'hot', - index: '.internal.alerts-security.alerts-default-000001', - pattern: '.alerts-security.alerts-default', - sizeInBytes: 0, - docsCount: 26093, - }, - { - color: null, - ilmPhase: null, - index: null, - pattern: 'auditbeat-*', - sizeInBytes: 18820446, - docsCount: 19127, - }, - { - color: euiThemeVars.euiColorSuccess, - ilmPhase: 'hot', - index: '.ds-auditbeat-8.6.1-2023.02.07-000001', - pattern: 'auditbeat-*', - sizeInBytes: 18791790, - docsCount: 19123, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: 'unmanaged', - index: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 28409, - docsCount: 4, - }, - { - color: euiThemeVars.euiColorDanger, - ilmPhase: 'unmanaged', - index: 'auditbeat-custom-empty-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 247, - docsCount: 0, - }, - { - color: null, - ilmPhase: null, - index: null, - pattern: 'packetbeat-*', - sizeInBytes: 1096520898, - docsCount: 3258632, - }, - { - color: euiThemeVars.euiColorPrimary, - ilmPhase: 'hot', - index: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 584326147, - docsCount: 1630289, - }, - { - color: euiThemeVars.euiColorPrimary, - ilmPhase: 'hot', - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 512194751, - docsCount: 1628343, - }, - ]); - }); - }); - - describe('getFlattenedBuckets', () => { - test('it returns the expected flattened buckets', () => { - expect( - getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, - }) - ).toEqual([ - { - ilmPhase: 'hot', - incompatible: 0, - indexName: '.internal.alerts-security.alerts-default-000001', - pattern: '.alerts-security.alerts-default', - sizeInBytes: 0, - docsCount: 26093, - }, - { - ilmPhase: 'hot', - incompatible: 0, - indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', - pattern: 'auditbeat-*', - sizeInBytes: 18791790, - docsCount: 19123, - }, - { - ilmPhase: 'unmanaged', - incompatible: 1, - indexName: 'auditbeat-custom-empty-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 247, - docsCount: 0, - }, - { - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 28409, - docsCount: 4, - }, - { - ilmPhase: 'hot', - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 512194751, - docsCount: 1628343, - }, - { - ilmPhase: 'hot', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 584326147, - docsCount: 1630289, - }, - ]); - }); - - test('it returns the expected flattened buckets when isILMAvailable is false', () => { - expect( - getFlattenedBuckets({ - ilmPhases, - isILMAvailable: false, - patternRollups, - }) - ).toEqual([ - { - docsCount: 26093, - ilmPhase: undefined, - incompatible: 0, - indexName: '.internal.alerts-security.alerts-default-000001', - pattern: '.alerts-security.alerts-default', - sizeInBytes: 0, - }, - { - docsCount: 19123, - ilmPhase: undefined, - incompatible: 0, - indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', - pattern: 'auditbeat-*', - sizeInBytes: 18791790, - }, - { - docsCount: 0, - ilmPhase: undefined, - incompatible: 1, - indexName: 'auditbeat-custom-empty-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 247, - }, - { - docsCount: 4, - ilmPhase: undefined, - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - sizeInBytes: 28409, - }, - { - docsCount: 1628343, - ilmPhase: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 512194751, - }, - { - docsCount: 1630289, - ilmPhase: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - sizeInBytes: 584326147, - }, - ]); - }); - }); - - describe('getFillColor', () => { - test('it returns success when `incompatible` is zero', () => { - const incompatible = 0; - - expect(getFillColor(incompatible)).toEqual(euiThemeVars.euiColorSuccess); - }); - - test('it returns danger when `incompatible` is greater than 0', () => { - const incompatible = 1; - - expect(getFillColor(incompatible)).toEqual(euiThemeVars.euiColorDanger); - }); - - test('it returns the default color when `incompatible` is undefined', () => { - const incompatible = undefined; - - expect(getFillColor(incompatible)).toEqual(DEFAULT_INDEX_COLOR); - }); - }); - - describe('getPathToFlattenedBucketMap', () => { - test('it returns the expected map', () => { - const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, - }); - - expect(getPathToFlattenedBucketMap(flattenedBuckets)).toEqual({ - '.alerts-security.alerts-default.internal.alerts-security.alerts-default-000001': { - pattern: '.alerts-security.alerts-default', - indexName: '.internal.alerts-security.alerts-default-000001', - ilmPhase: 'hot', - incompatible: 0, - sizeInBytes: 0, - docsCount: 26093, - }, - 'auditbeat-*.ds-auditbeat-8.6.1-2023.02.07-000001': { - pattern: 'auditbeat-*', - indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', - ilmPhase: 'hot', - incompatible: 0, - sizeInBytes: 18791790, - docsCount: 19123, - }, - 'auditbeat-*auditbeat-custom-empty-index-1': { - pattern: 'auditbeat-*', - indexName: 'auditbeat-custom-empty-index-1', - ilmPhase: 'unmanaged', - incompatible: 1, - sizeInBytes: 247, - docsCount: 0, - }, - 'auditbeat-*auditbeat-custom-index-1': { - pattern: 'auditbeat-*', - indexName: 'auditbeat-custom-index-1', - ilmPhase: 'unmanaged', - incompatible: 3, - sizeInBytes: 28409, - docsCount: 4, - }, - 'packetbeat-*.ds-packetbeat-8.6.1-2023.02.04-000001': { - pattern: 'packetbeat-*', - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - ilmPhase: 'hot', - sizeInBytes: 512194751, - docsCount: 1628343, - }, - 'packetbeat-*.ds-packetbeat-8.5.3-2023.02.04-000001': { - docsCount: 1630289, - pattern: 'packetbeat-*', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - ilmPhase: 'hot', - sizeInBytes: 584326147, - }, - }); - }); - }); - - describe('getGroupFromPath', () => { - it('returns the expected group from the path', () => { - expect( - getGroupFromPath([ - { - index: 0, - value: '__null_small_multiples_key__', - }, - { - index: 0, - value: '__root_key__', - }, - { - index: 0, - value: 'auditbeat-*', - }, - { - index: 1, - value: 'auditbeat-custom-empty-index-1', - }, - ]) - ).toEqual('auditbeat-*'); - }); - - it('returns undefined when path is an empty array', () => { - expect(getGroupFromPath([])).toBeUndefined(); - }); - - it('returns undefined when path is an array with only one value', () => { - expect( - getGroupFromPath([{ index: 0, value: '__null_small_multiples_key__' }]) - ).toBeUndefined(); - }); - }); - - describe('getLayersMultiDimensional', () => { - const layer0FillColor = 'transparent'; - const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, - }); - const pathToFlattenedBucketMap = getPathToFlattenedBucketMap(flattenedBuckets); - - it('returns the expected number of layers', () => { - expect( - getLayersMultiDimensional({ - valueFormatter: formatBytes, - layer0FillColor, - pathToFlattenedBucketMap, - }).length - ).toEqual(2); - }); - - it('returns the expected fillLabel valueFormatter function', () => { - getLayersMultiDimensional({ - valueFormatter: formatBytes, - layer0FillColor, - pathToFlattenedBucketMap, - }).forEach((x) => expect(x.fillLabel.valueFormatter(123)).toEqual('123B')); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts deleted file mode 100644 index 3eaf493222cb0..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts +++ /dev/null @@ -1,241 +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 type { Datum, Key, ArrayNode } from '@elastic/charts'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { orderBy } from 'lodash/fp'; - -import { getDocsCount, getSizeInBytes } from '../../../../helpers'; -import { getIlmPhase } from '../../../pattern/helpers'; -import { PatternRollup } from '../../../../types'; - -export interface LegendItem { - color: string | null; - ilmPhase: string | null; - index: string | null; - pattern: string; - sizeInBytes: number | undefined; - docsCount: number; -} - -export interface FlattenedBucket { - ilmPhase: string | undefined; - incompatible: number | undefined; - indexName: string | undefined; - pattern: string; - sizeInBytes: number | undefined; - docsCount: number; -} - -export const getPatternSizeInBytes = ({ - pattern, - patternRollups, -}: { - pattern: string; - patternRollups: Record; -}): number | undefined => { - if (patternRollups[pattern] != null) { - return patternRollups[pattern].sizeInBytes; - } else { - return undefined; - } -}; - -export const getPatternDocsCount = ({ - pattern, - patternRollups, -}: { - pattern: string; - patternRollups: Record; -}): number => { - if (patternRollups[pattern] != null) { - return patternRollups[pattern].docsCount ?? 0; - } else { - return 0; - } -}; - -export const getPatternLegendItem = ({ - pattern, - patternRollups, -}: { - pattern: string; - patternRollups: Record; -}): LegendItem => ({ - color: null, - ilmPhase: null, - index: null, - pattern, - sizeInBytes: getPatternSizeInBytes({ pattern, patternRollups }), - docsCount: getPatternDocsCount({ pattern, patternRollups }), -}); - -export const getLegendItemsForPattern = ({ - pattern, - flattenedBuckets, -}: { - pattern: string; - flattenedBuckets: FlattenedBucket[]; -}): LegendItem[] => - orderBy( - ['sizeInBytes'], - ['desc'], - flattenedBuckets - .filter((x) => x.pattern === pattern) - .map((flattenedBucket) => ({ - color: getFillColor(flattenedBucket.incompatible), - ilmPhase: flattenedBucket.ilmPhase ?? null, - index: flattenedBucket.indexName ?? null, - pattern: flattenedBucket.pattern, - sizeInBytes: flattenedBucket.sizeInBytes, - docsCount: flattenedBucket.docsCount, - })) - ); - -export const getLegendItems = ({ - patterns, - flattenedBuckets, - patternRollups, -}: { - patterns: string[]; - flattenedBuckets: FlattenedBucket[]; - patternRollups: Record; -}): LegendItem[] => - patterns.reduce( - (acc, pattern) => [ - ...acc, - getPatternLegendItem({ pattern, patternRollups }), - ...getLegendItemsForPattern({ pattern, flattenedBuckets }), - ], - [] - ); - -export const getFlattenedBuckets = ({ - ilmPhases, - isILMAvailable, - patternRollups, -}: { - ilmPhases: string[]; - isILMAvailable: boolean; - patternRollups: Record; -}): FlattenedBucket[] => - Object.values(patternRollups).reduce((acc, patternRollup) => { - // enables fast lookup of valid phase names: - const ilmPhasesMap = ilmPhases.reduce>( - (phasesMap, phase) => ({ ...phasesMap, [phase]: 0 }), - {} - ); - const { ilmExplain, pattern, results, stats } = patternRollup; - - if (((isILMAvailable && ilmExplain != null) || !isILMAvailable) && stats != null) { - return [ - ...acc, - ...Object.entries(stats).reduce((validStats, [indexName]) => { - const ilmPhase = getIlmPhase(ilmExplain?.[indexName], isILMAvailable); - const isSelectedPhase = - (isILMAvailable && ilmPhase != null && ilmPhasesMap[ilmPhase] != null) || - !isILMAvailable; - - if (isSelectedPhase) { - const incompatible = - results != null && results[indexName] != null - ? results[indexName].incompatible - : undefined; - const sizeInBytes = getSizeInBytes({ indexName, stats }); - const docsCount = getDocsCount({ stats, indexName }); - return [ - ...validStats, - { - ilmPhase, - incompatible, - indexName, - pattern, - sizeInBytes, - docsCount, - }, - ]; - } else { - return validStats; - } - }, []), - ]; - } - - return acc; - }, []); - -const groupByRollup = (d: Datum) => d.pattern; // the treemap is grouped by this field - -export const DEFAULT_INDEX_COLOR = euiThemeVars.euiColorPrimary; - -export const getFillColor = (incompatible: number | undefined): string => { - if (incompatible === 0) { - return euiThemeVars.euiColorSuccess; - } else if (incompatible != null && incompatible > 0) { - return euiThemeVars.euiColorDanger; - } else { - return DEFAULT_INDEX_COLOR; - } -}; - -export const getPathToFlattenedBucketMap = ( - flattenedBuckets: FlattenedBucket[] -): Record => - flattenedBuckets.reduce>( - (acc, { pattern, indexName, ...remaining }) => ({ - ...acc, - [`${pattern}${indexName}`]: { pattern, indexName, ...remaining }, - }), - {} - ); - -/** - * Extracts the first group name from the data representing the second group - */ -export const getGroupFromPath = (path: ArrayNode['path']): string | undefined => { - const OFFSET_FROM_END = 2; // The offset from the end of the path array containing the group - const groupIndex = path.length - OFFSET_FROM_END; - return groupIndex > 0 ? path[groupIndex].value : undefined; -}; - -export const getLayersMultiDimensional = ({ - valueFormatter, - layer0FillColor, - pathToFlattenedBucketMap, -}: { - valueFormatter: (value: number) => string; - layer0FillColor: string; - pathToFlattenedBucketMap: Record; -}) => { - return [ - { - fillLabel: { - valueFormatter, - }, - groupByRollup, - nodeLabel: (ilmPhase: Datum) => ilmPhase, - shape: { - fillColor: layer0FillColor, - }, - }, - { - fillLabel: { - valueFormatter, - }, - groupByRollup: (d: Datum) => d.indexName, - nodeLabel: (indexName: Datum) => indexName, - shape: { - fillColor: (indexName: Key, _sortIndex: number, node: Pick) => { - const pattern = getGroupFromPath(node.path) ?? ''; - const flattenedBucket = pathToFlattenedBucketMap[`${pattern}${indexName}`]; - - return getFillColor(flattenedBucket?.incompatible); - }, - }, - }, - ]; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx deleted file mode 100644 index a3ff3665cf6ed..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx +++ /dev/null @@ -1,64 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../../../helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../../types'; -import { Props, StorageDetails } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const onIndexSelected = jest.fn(); - -const defaultProps: Props = { - formatBytes, - formatNumber, - ilmPhases, - onIndexSelected, - patternRollups, - patterns, - baseTheme: DARK_THEME, -}; - -describe('StorageDetails', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders the treemap', () => { - expect(screen.getByTestId('storageTreemap').querySelector('.echChart')).toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx deleted file mode 100644 index a6a96e1b23aa2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx +++ /dev/null @@ -1,75 +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 type { PartialTheme, Theme } from '@elastic/charts'; -import React, { useCallback, useMemo } from 'react'; - -import { getFlattenedBuckets } from './helpers'; -import { StorageTreemap } from '../../../storage_treemap'; -import { DEFAULT_MAX_CHART_HEIGHT, StorageTreemapContainer } from '../../../tabs/styles'; -import { PatternRollup, SelectedIndex } from '../../../../types'; -import { useDataQualityContext } from '../../../data_quality_context'; -import { DOCS_UNIT } from './translations'; - -export interface Props { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhases: string[]; - onIndexSelected: ({ indexName, pattern }: SelectedIndex) => void; - patternRollups: Record; - patterns: string[]; - theme?: PartialTheme; - baseTheme: Theme; -} - -const StorageDetailsComponent: React.FC = ({ - formatBytes, - formatNumber, - ilmPhases, - onIndexSelected, - patternRollups, - patterns, - theme, - baseTheme, -}) => { - const { isILMAvailable } = useDataQualityContext(); - - const flattenedBuckets = useMemo( - () => - getFlattenedBuckets({ - ilmPhases, - isILMAvailable, - patternRollups, - }), - [ilmPhases, isILMAvailable, patternRollups] - ); - const accessor = flattenedBuckets[0]?.sizeInBytes != null ? 'sizeInBytes' : 'docsCount'; - const valueFormatter = useCallback( - (d: number) => - accessor === 'sizeInBytes' ? formatBytes(d) : `${formatNumber(d)} ${DOCS_UNIT(d)}`, - [accessor, formatBytes, formatNumber] - ); - - return ( - - - - ); -}; - -StorageDetailsComponent.displayName = 'StorageDetailsComponent'; -export const StorageDetails = React.memo(StorageDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx deleted file mode 100644 index 1b8dad1c42ef7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx +++ /dev/null @@ -1,109 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../helpers'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { Body } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases: string[] = ['hot', 'warm', 'unmanaged']; - -describe('IndexInvalidValues', () => { - test('it renders the data quality summary', async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.getByTestId('dataQualitySummary')).toBeInTheDocument(); - }); - }); - - describe('patterns', () => { - const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'logs-*', 'packetbeat-*']; - - patterns.forEach((pattern) => { - test(`it renders the '${pattern}' pattern`, async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); - }); - }); - }); - - test('it renders the expected number of spacers', async () => { - render( - - - - ); - - const items = await screen.findAllByTestId('bodyPatternSpacer'); - await waitFor(() => { - expect(items).toHaveLength(patterns.length - 1); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx deleted file mode 100644 index c36e34fc803e2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx +++ /dev/null @@ -1,144 +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 type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React from 'react'; - -import { DataQualityDetails } from './data_quality_details'; -import { DataQualitySummary } from '../data_quality_summary'; -import { useResultsRollup } from '../../use_results_rollup'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - baseTheme: Theme; - canUserCreateAndReadCases: () => boolean; - endDate?: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhases: string[]; - isAssistantEnabled: boolean; - lastChecked: string; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patterns: string[]; - setLastChecked: (lastChecked: string) => void; - startDate?: string | null; - theme?: PartialTheme; -} - -const BodyComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - endDate, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhases, - isAssistantEnabled, - lastChecked, - openCreateCaseFlyout, - patterns, - setLastChecked, - startDate, - theme, - baseTheme, -}) => { - const { - onCheckCompleted, - patternIndexNames, - patternRollups, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - totalSizeInBytes, - updatePatternIndexNames, - updatePatternRollup, - } = useResultsRollup({ - ilmPhases, - patterns, - }); - - return ( - - - - - - - - - - - ); -}; - -export const Body = React.memo(BodyComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.test.tsx deleted file mode 100644 index 43cc7ec6051c6..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.test.tsx +++ /dev/null @@ -1,69 +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 { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { DataQualityProvider, useDataQualityContext } from '.'; - -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockHttpFetch = jest.fn(); -const { toasts } = notificationServiceMock.createSetupContract(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const ContextWrapper: FC> = ({ children }) => ( - - {children} - -); - -describe('DataQualityContext', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - test('it throws an error when useDataQualityContext hook is used without a DataQualityContext', () => { - const { result } = renderHook(useDataQualityContext); - - expect(result.error).toEqual( - new Error('useDataQualityContext must be used within a DataQualityProvider') - ); - }); - - test('it should return the httpFetch function', async () => { - const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); - const httpFetch = await result.current.httpFetch; - - const path = '/path/to/resource'; - httpFetch(path); - - expect(mockHttpFetch).toBeCalledWith(path); - }); - - test('it should return the telemetry events', async () => { - const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); - const telemetryEvents = await result.current.telemetryEvents; - - expect(telemetryEvents).toEqual(mockTelemetryEvents); - }); - - test('it should return the isILMAvailable param', async () => { - const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); - const isILMAvailable = await result.current.isILMAvailable; - - expect(isILMAvailable).toEqual(true); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx deleted file mode 100644 index 57dd5230721a0..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx +++ /dev/null @@ -1,51 +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 type { PropsWithChildren } from 'react'; -import type { HttpHandler } from '@kbn/core-http-browser'; -import type { IToasts } from '@kbn/core-notifications-browser'; -import type { TelemetryEvents } from '../../types'; - -interface DataQualityProviderProps { - httpFetch: HttpHandler; - isILMAvailable: boolean; - telemetryEvents: TelemetryEvents; - toasts: IToasts; -} - -const DataQualityContext = React.createContext(undefined); - -export const DataQualityProvider: React.FC> = ({ - children, - httpFetch, - toasts, - isILMAvailable, - telemetryEvents, -}) => { - const value = useMemo( - () => ({ - httpFetch, - toasts, - isILMAvailable, - telemetryEvents, - }), - [httpFetch, toasts, isILMAvailable, telemetryEvents] - ); - - return {children}; -}; - -export const useDataQualityContext = () => { - const context = React.useContext(DataQualityContext); - - if (context == null) { - throw new Error('useDataQualityContext must be used within a DataQualityProvider'); - } - - return context; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.test.tsx deleted file mode 100644 index 5085db2a93e51..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.test.tsx +++ /dev/null @@ -1,212 +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 { act, render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { IndexToCheck } from '../../../types'; -import { CheckStatus, EMPTY_LAST_CHECKED_DATE } from '.'; - -const indexToCheck: IndexToCheck = { - pattern: 'auditbeat-*', - indexName: '.ds-auditbeat-8.6.1-2023.02.13-000001', -}; -const checkAllIndiciesChecked = 2; -const checkAllTotalIndiciesToCheck = 3; - -describe('CheckStatus', () => { - describe('when `indexToCheck` is not null', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it renders progress with the expected max value', () => { - expect(screen.getByTestId('progress')).toHaveAttribute( - 'max', - String(checkAllTotalIndiciesToCheck) - ); - }); - - test('it renders progress with the expected current value', () => { - expect(screen.getByTestId('progress')).toHaveAttribute( - 'value', - String(checkAllIndiciesChecked) - ); - }); - - test('it renders the expected "checking " message', () => { - expect(screen.getByTestId('checking')).toHaveTextContent( - `Checking ${indexToCheck.indexName}` - ); - }); - - test('it does NOT render the last checked message', () => { - expect(screen.queryByTestId('lastChecked')).not.toBeInTheDocument(); - }); - }); - - describe('when `indexToCheck` is null', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it does NOT render the progress bar', () => { - expect(screen.queryByTestId('progress')).not.toBeInTheDocument(); - }); - - test('it does NOT render the "checking " message', () => { - expect(screen.queryByTestId('checking')).not.toBeInTheDocument(); - }); - - test('it renders the expected last checked message', () => { - expect(screen.getByTestId('lastChecked')).toHaveTextContent(EMPTY_LAST_CHECKED_DATE); - }); - }); - - test('it renders the errors popover when errors have occurred', () => { - const errorSummary = [ - { - pattern: '.alerts-security.alerts-default', - indexName: null, - error: 'Error loading stats: Error: Forbidden', - }, - ]; - - render( - - - - ); - - expect(screen.getByTestId('errorsPopover')).toBeInTheDocument(); - }); - - test('it does NOT render the errors popover when errors have NOT occurred', () => { - render( - - - - ); - - expect(screen.queryByTestId('errorsPopover')).not.toBeInTheDocument(); - }); - - test('it invokes the `setLastChecked` callback when indexToCheck is not null', () => { - jest.useFakeTimers(); - const date = '2023-03-28T22:27:28.159Z'; - jest.setSystemTime(new Date(date)); - - const setLastChecked = jest.fn(); - - render( - - - - ); - - expect(setLastChecked).toBeCalledWith(date); - jest.useRealTimers(); - }); - - test('it updates the formatted date', async () => { - jest.useFakeTimers(); - const date = '2023-03-28T23:27:28.159Z'; - jest.setSystemTime(new Date(date)); - - const { rerender } = render( - - - - ); - - // re-render with an updated `lastChecked` - const lastChecked = '2023-03-28T22:27:28.159Z'; - - act(() => { - jest.advanceTimersByTime(1000 * 61); - }); - - rerender( - - - - ); - - act(() => { - // once again, advance time - jest.advanceTimersByTime(1000 * 61); - }); - - expect(await screen.getByTestId('lastChecked')).toHaveTextContent('Last checked: an hour ago'); - jest.useRealTimers(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx deleted file mode 100644 index 9245b0adee84c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx +++ /dev/null @@ -1,106 +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 { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiSpacer, EuiText } from '@elastic/eui'; -import React, { useEffect, useState } from 'react'; -import moment from 'moment'; - -import { ErrorsPopover } from '../errors_popover'; -import * as i18n from '../../../translations'; -import type { ErrorSummary, IndexToCheck } from '../../../types'; - -export const EMPTY_LAST_CHECKED_DATE = '--'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - checkAllIndiciesChecked: number; - checkAllTotalIndiciesToCheck: number; - errorSummary: ErrorSummary[]; - indexToCheck: IndexToCheck | null; - lastChecked: string; - setLastChecked: (lastChecked: string) => void; -} - -const CheckStatusComponent: React.FC = ({ - addSuccessToast, - checkAllIndiciesChecked, - checkAllTotalIndiciesToCheck, - errorSummary, - indexToCheck, - lastChecked, - setLastChecked, -}) => { - const [formattedDate, setFormattedDate] = useState(EMPTY_LAST_CHECKED_DATE); - - useEffect(() => { - // update the lastCheckedDate whenever the next to check is updated - if (indexToCheck != null) { - setLastChecked(new Date().toISOString()); - } - }, [indexToCheck, setLastChecked]); - - useEffect(() => { - // immediately update the formatted date when lastCheckedDate is updated - if (moment(lastChecked).isValid()) { - setFormattedDate(moment(lastChecked).fromNow()); - } - - // periodically update the formatted date as time passes - const intervalId = setInterval(() => { - if (moment(lastChecked).isValid()) { - setFormattedDate(moment(lastChecked).fromNow()); - } - }, 10000); - - return () => clearInterval(intervalId); - }, [lastChecked]); - - return ( - - {indexToCheck != null && ( - <> - - - {i18n.CHECKING(indexToCheck.indexName)} - - - - - - - - - - )} - - - {indexToCheck == null && ( - - {i18n.LAST_CHECKED} - {': '} - {formattedDate} - - )} - - {errorSummary.length > 0 && ( -
- -
- )} -
-
- ); -}; - -CheckStatusComponent.displayName = 'CheckStatusComponent'; - -export const CheckStatus = React.memo(CheckStatusComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx deleted file mode 100644 index 064ec92a1ca81..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx +++ /dev/null @@ -1,97 +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 userEvent from '@testing-library/user-event'; -import { act, render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { ErrorsPopover } from '.'; - -const mockCopyToClipboard = jest.fn((value) => true); -jest.mock('@elastic/eui', () => { - const original = jest.requireActual('@elastic/eui'); - return { - ...original, - copyToClipboard: (value: string) => mockCopyToClipboard(value), - }; -}); - -const errorSummary = [ - { - pattern: '.alerts-security.alerts-default', - indexName: null, - error: 'Error loading stats: Error: Forbidden', - }, -]; - -describe('ErrorsPopover', () => { - beforeEach(() => { - document.execCommand = jest.fn(); - }); - - test('it disables the view errors button when `errorSummary` is empty', () => { - render( - - - - ); - - expect(screen.getByTestId('viewErrors')).toBeDisabled(); - }); - - test('it enables the view errors button when `errorSummary` is NOT empty', () => { - render( - - - - ); - - expect(screen.getByTestId('viewErrors')).not.toBeDisabled(); - }); - - describe('popover content', () => { - const addSuccessToast = jest.fn(); - - beforeEach(() => { - jest.resetAllMocks(); - - render( - - - - ); - - const viewErrorsButton = screen.getByTestId('viewErrors'); - - act(() => { - userEvent.click(viewErrorsButton); - }); - }); - - test('it renders the expected callout content', () => { - expect(screen.getByTestId('callout')).toHaveTextContent( - "ErrorsSome indices were not checked for Data QualityErrors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for accessThe following privileges are required to check an index:monitor or manageview_index_metadatareadCopy to clipboard" - ); - }); - - test('it invokes `addSuccessToast` when the copy button is clicked', () => { - const copyToClipboardButton = screen.getByTestId('copyToClipboard'); - act(() => { - userEvent.click(copyToClipboardButton, undefined, { skipPointerEventsCheck: true }); - }); - - expect(addSuccessToast).toBeCalledWith({ title: 'Copied errors to the clipboard' }); - }); - - test('it renders the expected error summary text in the errors viewer', () => { - expect(screen.getByTestId('errorsViewer').textContent?.includes(errorSummary[0].error)).toBe( - true - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx deleted file mode 100644 index 8f80e3fa3cab5..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx +++ /dev/null @@ -1,121 +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 { - copyToClipboard, - EuiButtonEmpty, - EuiCallOut, - EuiCode, - EuiPopover, - EuiSpacer, -} from '@elastic/eui'; -import React, { useCallback, useMemo, useState } from 'react'; -import styled from 'styled-components'; - -import { ErrorsViewer } from '../errors_viewer'; -import { ERRORS_CONTAINER_MAX_WIDTH } from '../errors_viewer/helpers'; -import { - getErrorsMarkdownTable, - getErrorsMarkdownTableRows, -} from '../../index_properties/markdown/helpers'; -import * as i18n from './translations'; -import type { ErrorSummary } from '../../../types'; -import { ERROR, INDEX, PATTERN } from '../errors_viewer/translations'; - -const CallOut = styled(EuiCallOut)` - max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; -`; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - errorSummary: ErrorSummary[]; -} - -const ErrorsPopoverComponent: React.FC = ({ addSuccessToast, errorSummary }) => { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const onClick = useCallback(() => setIsPopoverOpen((isOpen) => !isOpen), []); - const closePopover = useCallback(() => setIsPopoverOpen(false), []); - - const onCopy = useCallback(() => { - const markdown = getErrorsMarkdownTable({ - errorSummary, - getMarkdownTableRows: getErrorsMarkdownTableRows, - headerNames: [PATTERN, INDEX, ERROR], - title: i18n.ERRORS, - }); - copyToClipboard(markdown); - - closePopover(); - - addSuccessToast({ - title: i18n.COPIED_ERRORS_TOAST_TITLE, - }); - }, [addSuccessToast, closePopover, errorSummary]); - - const button = useMemo( - () => ( - - {i18n.VIEW_ERRORS} - - ), - [errorSummary.length, onClick] - ); - - return ( - - -

{i18n.ERRORS_CALLOUT_SUMMARY}

- -

{i18n.ERRORS_MAY_OCCUR}

- - {i18n.THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} -
    -
  • - {i18n.MONITOR} {i18n.OR} {i18n.MANAGE} -
  • -
  • - {i18n.VIEW_INDEX_METADATA} -
  • -
  • - {i18n.READ} -
  • -
- - - {i18n.COPY_TO_CLIPBOARD} - -
- - - - -
- ); -}; - -ErrorsPopoverComponent.displayName = 'ErrorsPopoverComponent'; - -export const ErrorsPopover = React.memo(ErrorsPopoverComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/translations.ts deleted file mode 100644 index 310f69ab5d584..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/translations.ts +++ /dev/null @@ -1,87 +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 COPIED_ERRORS_TOAST_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.toasts.copiedErrorsToastTitle', - { - defaultMessage: 'Copied errors to the clipboard', - } -); - -export const COPY_TO_CLIPBOARD = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsPopover.copyToClipboardButton', - { - defaultMessage: 'Copy to clipboard', - } -); - -export const ERRORS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsPopover.errorsTitle', - { - defaultMessage: 'Errors', - } -); - -export const ERRORS_CALLOUT_SUMMARY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsPopover.errorsCalloutSummary', - { - defaultMessage: 'Some indices were not checked for Data Quality', - } -); - -export const ERRORS_MAY_OCCUR = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errors.errorMayOccurLabel', - { - defaultMessage: - "Errors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for access", - } -); - -export const MANAGE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errors.manage', - { - defaultMessage: 'manage', - } -); - -export const MONITOR = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errors.monitor', - { - defaultMessage: 'monitor', - } -); - -export const OR = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errors.or', { - defaultMessage: 'or', -}); - -export const READ = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errors.read', { - defaultMessage: 'read', -}); - -export const THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errors.theFollowingPrivilegesLabel', - { - defaultMessage: 'The following privileges are required to check an index:', - } -); - -export const VIEW_ERRORS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsPopover.viewErrorsButton', - { - defaultMessage: 'View errors', - } -); - -export const VIEW_INDEX_METADATA = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errors.viewIndexMetadata', - { - defaultMessage: 'view_index_metadata', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx deleted file mode 100644 index 1954e92ae5fc7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx +++ /dev/null @@ -1,122 +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 { render, screen } from '@testing-library/react'; -import { omit } from 'lodash/fp'; -import React from 'react'; - -import { getErrorsViewerTableColumns } from './helpers'; -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { ErrorSummary } from '../../../types'; - -const errorSummary: ErrorSummary[] = [ - { - pattern: '.alerts-security.alerts-default', - indexName: null, - error: 'Error loading stats: Error: Forbidden', - }, - { - error: - 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', - indexName: 'auditbeat-7.2.1-2023.02.13-000001', - pattern: 'auditbeat-*', - }, -]; - -const noIndexName: ErrorSummary = errorSummary[0]; // <-- indexName: null -const hasIndexName: ErrorSummary = errorSummary[1]; - -describe('helpers', () => { - describe('getCommonTableColumns', () => { - test('it returns the expected column configuration', () => { - const columns = getErrorsViewerTableColumns().map((x) => omit('render', x)); - - expect(columns).toEqual([ - { - field: 'pattern', - name: 'Pattern', - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'indexName', - name: 'Index', - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'error', - name: 'Error', - sortable: false, - truncateText: false, - width: '50%', - }, - ]); - }); - - describe('indexName column render()', () => { - describe('when the `ErrorSummary` has an `indexName`', () => { - beforeEach(() => { - const columns = getErrorsViewerTableColumns(); - const indexNameRender = columns[1].render; - - render( - - {indexNameRender != null && indexNameRender(hasIndexName.indexName, hasIndexName)} - - ); - }); - - test('it renders the expected `indexName`', () => { - expect(screen.getByTestId('indexName')).toHaveTextContent(String(hasIndexName.indexName)); - }); - - test('it does NOT render the placeholder', () => { - expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); - }); - }); - - describe('when the `ErrorSummary` does NOT have an `indexName`', () => { - beforeEach(() => { - const columns = getErrorsViewerTableColumns(); - const indexNameRender = columns[1].render; - - render( - - {indexNameRender != null && indexNameRender(noIndexName.indexName, noIndexName)} - - ); - }); - - test('it does NOT render `indexName`', () => { - expect(screen.queryByTestId('indexName')).not.toBeInTheDocument(); - }); - - test('it renders the placeholder', () => { - expect(screen.getByTestId('emptyPlaceholder')).toBeInTheDocument(); - }); - }); - }); - - describe('indexName error render()', () => { - test('it renders the expected `error`', () => { - const columns = getErrorsViewerTableColumns(); - const indexNameRender = columns[2].render; - - render( - - {indexNameRender != null && indexNameRender(hasIndexName.error, hasIndexName)} - - ); - - expect(screen.getByTestId('error')).toHaveTextContent(hasIndexName.error); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx deleted file mode 100644 index 35a4a74cca875..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx +++ /dev/null @@ -1,49 +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 type { EuiTableFieldDataColumnType } from '@elastic/eui'; -import { EuiCode } from '@elastic/eui'; -import React from 'react'; - -import * as i18n from './translations'; -import type { ErrorSummary } from '../../../types'; - -export const EMPTY_PLACEHOLDER = '--'; - -export const ERRORS_CONTAINER_MAX_WIDTH = 600; // px -export const ERRORS_CONTAINER_MIN_WIDTH = 450; // px - -export const getErrorsViewerTableColumns = (): Array> => [ - { - field: 'pattern', - name: i18n.PATTERN, - sortable: true, - truncateText: false, - width: '25%', - }, - { - field: 'indexName', - name: i18n.INDEX, - render: (indexName: string | null) => - indexName != null && indexName !== '' ? ( - {indexName} - ) : ( - {EMPTY_PLACEHOLDER} - ), - sortable: false, - truncateText: false, - width: '25%', - }, - { - field: 'error', - name: i18n.ERROR, - render: (errorText) => {errorText}, - sortable: false, - truncateText: false, - width: '50%', - }, -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx deleted file mode 100644 index a1b6346eb2b8d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx +++ /dev/null @@ -1,77 +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 { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { ERROR, INDEX, PATTERN } from './translations'; -import { ErrorSummary } from '../../../types'; -import { ErrorsViewer } from '.'; - -interface ExpectedColumns { - id: string; - expected: string; -} - -const errorSummary: ErrorSummary[] = [ - { - pattern: '.alerts-security.alerts-default', - indexName: null, - error: 'Error loading stats: Error: Forbidden', - }, - { - error: - 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', - indexName: 'auditbeat-7.2.1-2023.02.13-000001', - pattern: 'auditbeat-*', - }, -]; - -describe('ErrorsViewer', () => { - const expectedColumns: ExpectedColumns[] = [ - { - id: 'pattern', - expected: PATTERN, - }, - { - id: 'indexName', - expected: INDEX, - }, - { - id: 'error', - expected: ERROR, - }, - ]; - - expectedColumns.forEach(({ id, expected }, i) => { - test(`it renders the expected '${id}' column header`, () => { - render( - - - - ); - - expect(screen.getByTestId(`tableHeaderCell_${id}_${i}`)).toHaveTextContent(expected); - }); - }); - - test(`it renders the expected the errors`, () => { - render( - - - - ); - - expect( - screen - .getAllByTestId('error') - .map((x) => x.textContent ?? '') - .reduce((acc, x) => acc.concat(x), '') - ).toEqual(`${errorSummary[0].error}${errorSummary[1].error}`); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx deleted file mode 100644 index 2336abe79c651..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx +++ /dev/null @@ -1,46 +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 { EuiInMemoryTable } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - -import { - ERRORS_CONTAINER_MAX_WIDTH, - ERRORS_CONTAINER_MIN_WIDTH, - getErrorsViewerTableColumns, -} from './helpers'; -import type { ErrorSummary } from '../../../types'; - -const ErrorsViewerContainer = styled.div` - max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; - min-width: ${ERRORS_CONTAINER_MIN_WIDTH}px; -`; - -interface Props { - errorSummary: ErrorSummary[]; -} - -const ErrorsViewerComponent: React.FC = ({ errorSummary }) => { - const columns = useMemo(() => getErrorsViewerTableColumns(), []); - - return ( - - - - ); -}; - -ErrorsViewerComponent.displayName = 'ErrorsViewerComponent'; - -export const ErrorsViewer = React.memo(ErrorsViewerComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/translations.ts deleted file mode 100644 index a044922748cdf..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/translations.ts +++ /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'; - -export const ERROR = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsViewerTable.errorColumn', - { - defaultMessage: 'Error', - } -); - -export const INDEX = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsViewerTable.indexColumn', - { - defaultMessage: 'Index', - } -); - -export const PATTERN = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorsViewerTable.patternColumn', - { - defaultMessage: 'Pattern', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.tsx deleted file mode 100644 index a8eba4981e7e1..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.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 numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../helpers'; -import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../types'; -import { Props, DataQualitySummary } from '.'; -import { - getTotalDocsCount, - getTotalIncompatible, - getTotalIndices, - getTotalIndicesChecked, - getTotalSizeInBytes, -} from '../../use_results_rollup/helpers'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const patternIndexNames: Record = { - 'auditbeat-*': [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-custom-index-1', - ], - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], - 'packetbeat-*': [ - '.ds-packetbeat-8.5.3-2023.02.04-000001', - '.ds-packetbeat-8.6.1-2023.02.04-000001', - ], -}; - -const lastChecked = '2023-03-28T23:27:28.159Z'; - -const totalDocsCount = getTotalDocsCount(patternRollups); -const totalIncompatible = getTotalIncompatible(patternRollups); -const totalIndices = getTotalIndices(patternRollups); -const totalIndicesChecked = getTotalIndicesChecked(patternRollups); -const totalSizeInBytes = getTotalSizeInBytes(patternRollups); - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: jest.fn(), - formatBytes, - formatNumber, - ilmPhases, - lastChecked, - openCreateCaseFlyout: jest.fn(), - patternIndexNames, - patternRollups, - patterns, - setLastChecked: jest.fn(), - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - totalSizeInBytes, - onCheckCompleted: jest.fn(), -}; - -describe('DataQualitySummary', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders the summary actions', () => { - expect(screen.getByTestId('summaryActions')).toBeInTheDocument(); - }); - - test('it renders the stats rollup', () => { - expect(screen.getByTestId('statsRollup')).toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx deleted file mode 100644 index d3f9ad9d23303..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx +++ /dev/null @@ -1,115 +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 { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - -import { getErrorSummaries } from '../../helpers'; -import { StatsRollup } from '../pattern/pattern_summary/stats_rollup'; -import { SummaryActions } from './summary_actions'; -import type { OnCheckCompleted, PatternRollup } from '../../types'; - -const MAX_SUMMARY_ACTIONS_CONTAINER_WIDTH = 400; -const MIN_SUMMARY_ACTIONS_CONTAINER_WIDTH = 235; - -const SummaryActionsContainerFlexItem = styled(EuiFlexItem)` - max-width: ${MAX_SUMMARY_ACTIONS_CONTAINER_WIDTH}px; - min-width: ${MIN_SUMMARY_ACTIONS_CONTAINER_WIDTH}px; - padding-right: ${({ theme }) => theme.eui.euiSizeXL}; -`; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - canUserCreateAndReadCases: () => boolean; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhases: string[]; - lastChecked: string; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patternIndexNames: Record; - patternRollups: Record; - patterns: string[]; - setLastChecked: (lastChecked: string) => void; - totalDocsCount: number | undefined; - totalIncompatible: number | undefined; - totalIndices: number | undefined; - totalIndicesChecked: number | undefined; - totalSizeInBytes: number | undefined; - onCheckCompleted: OnCheckCompleted; -} - -const DataQualitySummaryComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - formatBytes, - formatNumber, - ilmPhases, - lastChecked, - openCreateCaseFlyout, - patternIndexNames, - patternRollups, - patterns, - setLastChecked, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - totalSizeInBytes, - onCheckCompleted, -}) => { - const errorSummary = useMemo(() => getErrorSummaries(patternRollups), [patternRollups]); - - return ( - - - - - - - - - - - - ); -}; - -export const DataQualitySummary = React.memo(DataQualitySummaryComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.test.tsx deleted file mode 100644 index 02b04225a544e..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.test.tsx +++ /dev/null @@ -1,104 +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 userEvent from '@testing-library/user-event'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { Props, Actions } from '.'; - -const mockCopyToClipboard = jest.fn((value) => true); -jest.mock('@elastic/eui', () => { - const original = jest.requireActual('@elastic/eui'); - return { - ...original, - copyToClipboard: (value: string) => mockCopyToClipboard(value), - }; -}); - -const ilmPhases = ['hot', 'warm', 'unmanaged']; - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: () => true, - getMarkdownComments: () => [], - ilmPhases, - openCreateCaseFlyout: jest.fn(), -}; - -describe('Actions', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('when the action buttons are clicked', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it invokes openCreateCaseFlyout when the add to new case button is clicked', () => { - const button = screen.getByTestId('addToNewCase'); - - userEvent.click(button); - - expect(defaultProps.openCreateCaseFlyout).toBeCalled(); - }); - - test('it invokes addSuccessToast when the copy to clipboard button is clicked', () => { - const button = screen.getByTestId('copyToClipboard'); - - userEvent.click(button); - - expect(defaultProps.addSuccessToast).toBeCalledWith({ - title: 'Copied results to the clipboard', - }); - }); - }); - - test('it disables the add to new case button when the user cannot create cases', () => { - const canUserCreateAndReadCases = () => false; - - render( - - - - ); - - const button = screen.getByTestId('addToNewCase'); - - expect(button).toBeDisabled(); - }); - - test('it disables the add to new case button when `ilmPhases` is empty', () => { - render( - - - - ); - - const button = screen.getByTestId('addToNewCase'); - - expect(button).toBeDisabled(); - }); - - test('it disables the copy to clipboard button when `ilmPhases` is empty', () => { - render( - - - - ); - - const button = screen.getByTestId('copyToClipboard'); - - expect(button).toBeDisabled(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.tsx deleted file mode 100644 index 549f420c3fa9d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/actions/index.tsx +++ /dev/null @@ -1,98 +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 { copyToClipboard, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React, { useCallback } from 'react'; - -import { - ADD_TO_NEW_CASE, - COPIED_RESULTS_TOAST_TITLE, - COPY_TO_CLIPBOARD, -} from '../../../../translations'; -import { useAddToNewCase } from '../../../../use_add_to_new_case'; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - canUserCreateAndReadCases: () => boolean; - getMarkdownComments: () => string[]; - ilmPhases: string[]; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; -} - -const ActionsComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - getMarkdownComments, - ilmPhases, - openCreateCaseFlyout, -}) => { - const { disabled: addToNewCaseDisabled, onAddToNewCase } = useAddToNewCase({ - canUserCreateAndReadCases, - openCreateCaseFlyout, - }); - - const onClickAddToCase = useCallback( - () => onAddToNewCase([getMarkdownComments().join('\n')]), - [getMarkdownComments, onAddToNewCase] - ); - - const onCopy = useCallback(() => { - const markdown = getMarkdownComments().join('\n'); - copyToClipboard(markdown); - - addSuccessToast({ - title: COPIED_RESULTS_TOAST_TITLE, - }); - }, [addSuccessToast, getMarkdownComments]); - - const addToNewCaseContextMenuOnClick = useCallback(() => { - onClickAddToCase(); - }, [onClickAddToCase]); - - const disableAll = ilmPhases.length === 0; - - return ( - - - - {ADD_TO_NEW_CASE} - - - - - - {COPY_TO_CLIPBOARD} - - - - ); -}; - -ActionsComponent.displayName = 'ActionsComponent'; - -export const Actions = React.memo(ActionsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.test.ts deleted file mode 100644 index 70d522f18177a..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.test.ts +++ /dev/null @@ -1,317 +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 { EcsVersion } from '@elastic/ecs'; - -import { checkIndex, EMPTY_PARTITIONED_FIELD_METADATA } from './check_index'; -import { EMPTY_STAT } from '../../../../helpers'; -import { mockMappingsResponse } from '../../../../mock/mappings_response/mock_mappings_response'; -import { mockUnallowedValuesResponse } from '../../../../mock/unallowed_values/mock_unallowed_values'; -import { UnallowedValueRequestItem } from '../../../../types'; -import { EcsFlatTyped } from '../../../../constants'; - -let mockFetchMappings = jest.fn( - ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => - new Promise((resolve) => { - resolve(mockMappingsResponse); // happy path - }) -); - -jest.mock('../../../../use_mappings/helpers', () => ({ - fetchMappings: ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => - mockFetchMappings({ - abortController, - patternOrIndexName, - }), -})); - -const mockFetchUnallowedValues = jest.fn( - ({ - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => new Promise((resolve) => resolve(mockUnallowedValuesResponse)) -); - -jest.mock('../../../../use_unallowed_values/helpers', () => { - const original = jest.requireActual('../../../../use_unallowed_values/helpers'); - - return { - ...original, - fetchUnallowedValues: ({ - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => - mockFetchUnallowedValues({ - abortController, - indexName, - requestItems, - }), - }; -}); - -describe('checkIndex', () => { - const defaultBytesFormat = '0,0.[0]b'; - const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - - const defaultNumberFormat = '0,0.[000]'; - const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - - const indexName = 'auditbeat-custom-index-1'; - const pattern = 'auditbeat-*'; - const httpFetch = jest.fn(); - - describe('when `checkIndex` successfully completes the check', () => { - const onCheckCompleted = jest.fn(); - - beforeEach(async () => { - jest.clearAllMocks(); - - await checkIndex({ - abortController: new AbortController(), - batchId: 'batch-id', - checkAllStartTime: Date.now(), - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: false, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - }); - - test('it invokes onCheckCompleted with a null `error`', () => { - expect(onCheckCompleted.mock.calls[0][0].error).toBeNull(); - }); - - test('it invokes onCheckCompleted with the expected `indexName`', () => { - expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); - }); - - test('it invokes onCheckCompleted with the non-default `partitionedFieldMetadata`', () => { - expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).not.toEqual( - EMPTY_PARTITIONED_FIELD_METADATA - ); - }); - - test('it invokes onCheckCompleted with the expected`pattern`', () => { - expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); - }); - - test('it invokes onCheckCompleted with the expected `version`', () => { - expect(onCheckCompleted.mock.calls[0][0].version).toEqual(EcsVersion); - }); - }); - - describe('happy path, when the signal is aborted', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - test('it does NOT invoke onCheckCompleted', async () => { - const onCheckCompleted = jest.fn(); - - const abortController = new AbortController(); - abortController.abort(); - - await checkIndex({ - abortController, - batchId: 'batch-id', - checkAllStartTime: Date.now(), - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: false, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - - expect(onCheckCompleted).not.toBeCalled(); - }); - }); - - describe('when an error occurs', () => { - const onCheckCompleted = jest.fn(); - const error = 'simulated fetch mappings error'; - - beforeEach(async () => { - jest.clearAllMocks(); - - mockFetchMappings = jest.fn( - ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => new Promise((_, reject) => reject(new Error(error))) - ); - - await checkIndex({ - abortController: new AbortController(), - batchId: 'batch-id', - checkAllStartTime: Date.now(), - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: false, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - }); - - test('it invokes onCheckCompleted with the expected `error`', () => { - expect(onCheckCompleted.mock.calls[0][0].error).toEqual(error); - }); - - test('it invokes onCheckCompleted with the expected `indexName`', () => { - expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); - }); - - test('it invokes onCheckCompleted with null `partitionedFieldMetadata`', () => { - expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).toBeNull(); - }); - - test('it invokes onCheckCompleted with the expected `pattern`', () => { - expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); - }); - - test('it invokes onCheckCompleted with the expected `version`', () => { - expect(onCheckCompleted.mock.calls[0][0].version).toEqual(EcsVersion); - }); - }); - - describe('when an error occurs, but the error does not have a toString', () => { - const onCheckCompleted = jest.fn(); - - beforeEach(async () => { - jest.clearAllMocks(); - - mockFetchMappings = jest.fn( - ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - // eslint-disable-next-line prefer-promise-reject-errors - }) => new Promise((_, reject) => reject(undefined)) - ); - - await checkIndex({ - abortController: new AbortController(), - batchId: 'batch-id', - checkAllStartTime: Date.now(), - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: false, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - }); - - test('it invokes onCheckCompleted with the fallback `error`', () => { - expect(onCheckCompleted.mock.calls[0][0].error).toEqual( - `An error occurred checking index ${indexName}` - ); - }); - - test('it invokes onCheckCompleted with the expected `indexName`', () => { - expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); - }); - - test('it invokes onCheckCompleted with null `partitionedFieldMetadata`', () => { - expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).toBeNull(); - }); - - test('it invokes onCheckCompleted with the expected `pattern`', () => { - expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); - }); - - test('it invokes onCheckCompleted with the expected `version`', () => { - expect(onCheckCompleted.mock.calls[0][0].version).toEqual(EcsVersion); - }); - }); - - describe('when an error occurs, and the signal is aborted', () => { - const onCheckCompleted = jest.fn(); - const abortController = new AbortController(); - abortController.abort(); - - const error = 'simulated fetch mappings error'; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - test('it does NOT invoke onCheckCompleted', async () => { - mockFetchMappings = jest.fn( - ({ - // eslint-disable-next-line @typescript-eslint/no-shadow - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => new Promise((_, reject) => reject(new Error(error))) - ); - - await checkIndex({ - abortController, - batchId: 'batch-id', - checkAllStartTime: Date.now(), - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: false, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - - expect(onCheckCompleted).not.toBeCalled(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.ts deleted file mode 100644 index a9216b9d09fdd..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/check_index.ts +++ /dev/null @@ -1,124 +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 type { HttpHandler } from '@kbn/core-http-browser'; -import { getUnallowedValueRequestItems } from '../../../allowed_values/helpers'; -import { - getMappingsProperties, - getSortedPartitionedFieldMetadata, -} from '../../../index_properties/helpers'; -import * as i18n from './translations'; -import type { OnCheckCompleted, PartitionedFieldMetadata } from '../../../../types'; -import { fetchMappings } from '../../../../use_mappings/helpers'; -import { fetchUnallowedValues, getUnallowedValues } from '../../../../use_unallowed_values/helpers'; -import { EcsFlatTyped } from '../../../../constants'; - -export const EMPTY_PARTITIONED_FIELD_METADATA: PartitionedFieldMetadata = { - all: [], - custom: [], - ecsCompliant: [], - incompatible: [], - sameFamily: [], -}; - -export async function checkIndex({ - abortController, - batchId, - checkAllStartTime, - ecsMetadata, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck, - onCheckCompleted, - pattern, - version, -}: { - abortController: AbortController; - batchId: string; - checkAllStartTime: number; - ecsMetadata: EcsFlatTyped; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - httpFetch: HttpHandler; - indexName: string; - isLastCheck: boolean; - onCheckCompleted: OnCheckCompleted; - pattern: string; - version: string; -}) { - try { - const startTime = Date.now(); - const indexes = await fetchMappings({ - abortController, - httpFetch, - patternOrIndexName: indexName, - }); - - const requestItems = getUnallowedValueRequestItems({ - ecsMetadata, - indexName, - }); - - const searchResults = await fetchUnallowedValues({ - abortController, - httpFetch, - indexName, - requestItems, - }); - - const unallowedValues = getUnallowedValues({ - requestItems, - searchResults, - }); - - const mappingsProperties = getMappingsProperties({ - indexes, - indexName, - }); - - const partitionedFieldMetadata = - getSortedPartitionedFieldMetadata({ - ecsMetadata, - loadingMappings: false, - mappingsProperties, - unallowedValues, - }) ?? EMPTY_PARTITIONED_FIELD_METADATA; - - if (!abortController.signal.aborted) { - onCheckCompleted({ - checkAllStartTime, - batchId, - error: null, - formatBytes, - formatNumber, - indexName, - partitionedFieldMetadata, - pattern, - requestTime: Date.now() - startTime, - version, - isLastCheck, - }); - } - } catch (error) { - if (!abortController.signal.aborted) { - onCheckCompleted({ - checkAllStartTime, - batchId, - error: error != null ? error.message : i18n.AN_ERROR_OCCURRED_CHECKING_INDEX(indexName), - formatBytes, - formatNumber, - indexName, - partitionedFieldMetadata: null, - pattern, - version, - isLastCheck, - }); - } - } -} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts deleted file mode 100644 index 5f96cfa9953a6..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts +++ /dev/null @@ -1,107 +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 { getAllIndicesToCheck, getIndexDocsCountFromRollup, getIndexToCheck } from './helpers'; -import { mockPacketbeatPatternRollup } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; - -const patternIndexNames: Record = { - 'packetbeat-*': [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - ], - 'auditbeat-*': [ - 'auditbeat-7.17.9-2023.02.13-000001', - 'auditbeat-custom-index-1', - '.ds-auditbeat-8.6.1-2023.02.13-000001', - ], - 'logs-*': [ - '.ds-logs-endpoint.alerts-default-2023.02.24-000001', - '.ds-logs-endpoint.events.process-default-2023.02.24-000001', - ], - 'remote:*': [], - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], -}; - -describe('helpers', () => { - describe('getIndexToCheck', () => { - test('it returns the expected `IndexToCheck`', () => { - expect( - getIndexToCheck({ - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - }) - ).toEqual({ - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - }); - }); - }); - - describe('getAllIndicesToCheck', () => { - test('it returns the sorted collection of `IndexToCheck`', () => { - expect(getAllIndicesToCheck(patternIndexNames)).toEqual([ - { - indexName: '.internal.alerts-security.alerts-default-000001', - pattern: '.alerts-security.alerts-default', - }, - { - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - }, - { - indexName: 'auditbeat-7.17.9-2023.02.13-000001', - pattern: 'auditbeat-*', - }, - { - indexName: '.ds-auditbeat-8.6.1-2023.02.13-000001', - pattern: 'auditbeat-*', - }, - { - indexName: '.ds-logs-endpoint.events.process-default-2023.02.24-000001', - pattern: 'logs-*', - }, - { - indexName: '.ds-logs-endpoint.alerts-default-2023.02.24-000001', - pattern: 'logs-*', - }, - { - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - { - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - ]); - }); - }); - - describe('getIndexDocsCountFromRollup', () => { - test('it returns the expected count when the `patternRollup` has `stats`', () => { - expect( - getIndexDocsCountFromRollup({ - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - patternRollup: mockPacketbeatPatternRollup, - }) - ).toEqual(1628343); - }); - - test('it returns zero when the `patternRollup` `stats` is null', () => { - const patternRollup = { - ...mockPacketbeatPatternRollup, - stats: null, // <-- - }; - - expect( - getIndexDocsCountFromRollup({ - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - patternRollup, - }) - ).toEqual(0); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts deleted file mode 100644 index ede3184350e58..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts +++ /dev/null @@ -1,62 +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 { orderBy } from 'lodash/fp'; - -import { getDocsCount } from '../../../../helpers'; -import type { IndexToCheck, MeteringStatsIndex, PatternRollup } from '../../../../types'; - -export const getIndexToCheck = ({ - indexName, - pattern, -}: { - indexName: string; - pattern: string; -}): IndexToCheck => { - return { - pattern, - indexName, - }; -}; - -export const getAllIndicesToCheck = ( - patternIndexNames: Record -): IndexToCheck[] => { - const allPatterns: string[] = Object.keys(patternIndexNames); - - // sort the patterns A-Z: - const sortedPatterns = [...allPatterns].sort((a, b) => { - return a.localeCompare(b); - }); - - // return all `IndexToCheck` sorted first by pattern A-Z: - return sortedPatterns.reduce((acc, pattern) => { - const indexNames = patternIndexNames[pattern]; - const indicesToCheck = indexNames.map((indexName) => - getIndexToCheck({ indexName, pattern }) - ); - - const sortedIndicesToCheck = orderBy(['indexName'], ['desc'], indicesToCheck); - - return [...acc, ...sortedIndicesToCheck]; - }, []); -}; - -export const getIndexDocsCountFromRollup = ({ - indexName, - patternRollup, -}: { - indexName: string; - patternRollup: PatternRollup; -}): number => { - const stats: Record | null = patternRollup?.stats ?? null; - - return getDocsCount({ - indexName, - stats, - }); -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx deleted file mode 100644 index fbf0be3354a53..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx +++ /dev/null @@ -1,423 +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 numeral from '@elastic/numeral'; -import userEvent from '@testing-library/user-event'; -import { act, render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { mockMappingsResponse } from '../../../../mock/mappings_response/mock_mappings_response'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { mockUnallowedValuesResponse } from '../../../../mock/unallowed_values/mock_unallowed_values'; -import { CANCEL, CHECK_ALL } from '../../../../translations'; -import { - OnCheckCompleted, - PartitionedFieldMetadata, - UnallowedValueRequestItem, -} from '../../../../types'; -import { CheckAll } from '.'; -import { EMPTY_STAT } from '../../../../helpers'; - -const defaultBytesFormat = '0,0.[0]b'; -const mockFormatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const mockFormatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const mockFetchMappings = jest.fn( - ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => - new Promise((resolve) => { - resolve(mockMappingsResponse); // happy path - }) -); - -jest.mock('../../../../use_mappings/helpers', () => ({ - fetchMappings: ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => - mockFetchMappings({ - abortController, - patternOrIndexName, - }), -})); - -const mockFetchUnallowedValues = jest.fn( - ({ - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => new Promise((resolve) => resolve(mockUnallowedValuesResponse)) -); - -jest.mock('../../../../use_unallowed_values/helpers', () => { - const original = jest.requireActual('../../../../use_unallowed_values/helpers'); - - return { - ...original, - fetchUnallowedValues: ({ - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => - mockFetchUnallowedValues({ - abortController, - indexName, - requestItems, - }), - }; -}); - -const patternIndexNames = { - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], - 'auditbeat-*': [ - 'auditbeat-7.3.2-2023.03.27-000001', - '.ds-auditbeat-8.6.1-2023.03.29-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-7.10.2-2023.03.27-000001', - 'auditbeat-7.2.1-2023.03.27-000001', - 'auditbeat-custom-index-1', - ], - 'logs-*': [ - '.ds-logs-endpoint.events.process-default-2023.03.27-000001', - '.ds-logs-endpoint.alerts-default-2023.03.27-000001', - ], - 'packetbeat-*': [ - '.ds-packetbeat-8.6.1-2023.03.27-000001', - '.ds-packetbeat-8.5.3-2023.03.27-000001', - ], -}; - -const ilmPhases: string[] = ['hot', 'warm', 'unmanaged']; - -describe('CheckAll', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - test('it renders the expected button text when a check is NOT running', () => { - render( - - - - ); - - expect(screen.getByTestId('checkAll')).toHaveTextContent(CHECK_ALL); - }); - - test('it renders a disabled button when ILM available and ilmPhases is an empty array', () => { - render( - - - - ); - - expect(screen.getByTestId('checkAll').hasAttribute('disabled')).toBeTruthy(); - }); - - test('it renders the expected button when ILM is NOT available', () => { - render( - - - - ); - - expect(screen.getByTestId('checkAll').hasAttribute('disabled')).toBeFalsy(); - }); - - test('it renders the expected button text when a check is running', () => { - render( - - - - ); - - const button = screen.getByTestId('checkAll'); - - userEvent.click(button); // <-- START the check - - expect(screen.getByTestId('checkAll')).toHaveTextContent(CANCEL); - }); - - describe('formatNumber', () => { - test('it renders a comma-separated `value` via the `defaultNumberFormat`', async () => { - /** stores the result of invoking `CheckAll`'s `formatNumber` function */ - let formatNumberResult = ''; - - const onCheckCompleted: OnCheckCompleted = jest.fn( - ({ - formatBytes, - formatNumber, - }: { - error: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata | null; - pattern: string; - version: string; - }) => { - const value = 123456789; // numeric input to `CheckAll`'s `formatNumber` function - - formatNumberResult = formatNumber(value); - } - ); - - render( - - - - ); - - const button = screen.getByTestId('checkAll'); - - userEvent.click(button); // <-- START the check - - await waitFor(() => { - expect(formatNumberResult).toEqual('123,456,789'); // a comma-separated `value`, because it's numeric - }); - }); - - test('it renders an empty stat placeholder when `value` is undefined', async () => { - /** stores the result of invoking `CheckAll`'s `formatNumber` function */ - let formatNumberResult = ''; - - const onCheckCompleted: OnCheckCompleted = jest.fn( - ({ - formatBytes, - formatNumber, - }: { - error: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata | null; - pattern: string; - version: string; - }) => { - const value = undefined; // undefined input to `CheckAll`'s `formatNumber` function - - formatNumberResult = formatNumber(value); - } - ); - - render( - - - - ); - - const button = screen.getByTestId('checkAll'); - - userEvent.click(button); // <-- START the check - - await waitFor(() => { - expect(formatNumberResult).toEqual(EMPTY_STAT); // a placeholder, because `value` is undefined - }); - }); - }); - - describe('when a running check is cancelled', () => { - const setCheckAllIndiciesChecked = jest.fn(); - const setCheckAllTotalIndiciesToCheck = jest.fn(); - - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - - const button = screen.getByTestId('checkAll'); - - userEvent.click(button); // <-- START the check - - userEvent.click(button); // <-- STOP the check - }); - - test('it invokes `setCheckAllIndiciesChecked` twice: when the check was started, and when it was cancelled', () => { - expect(setCheckAllIndiciesChecked).toHaveBeenCalledTimes(2); - }); - - test('it invokes `setCheckAllTotalIndiciesToCheck` with the expected index count when the check is STARTED', () => { - expect(setCheckAllTotalIndiciesToCheck.mock.calls[0][0]).toEqual(11); - }); - - test('it invokes `setCheckAllTotalIndiciesToCheck` with the expected index count when the check is STOPPED', () => { - expect(setCheckAllTotalIndiciesToCheck.mock.calls[1][0]).toEqual(0); - }); - }); - - describe('when all checks have completed', () => { - const setIndexToCheck = jest.fn(); - const onCheckCompleted = jest.fn(); - beforeEach(async () => { - jest.clearAllMocks(); - jest.useFakeTimers(); - - render( - - - - ); - - const button = screen.getByTestId('checkAll'); - - userEvent.click(button); // <-- start the check - - const totalIndexNames = Object.values(patternIndexNames).reduce( - (total, indices) => total + indices.length, - 0 - ); - - // simulate the wall clock advancing - for (let i = 0; i < totalIndexNames + 1; i++) { - act(() => { - jest.advanceTimersByTime(1000 * 10); - }); - - await waitFor(() => {}); - } - }); - - afterEach(() => { - jest.useRealTimers(); - }); - - test('it invokes setIndexToCheck with `null` after all the checks have completed', () => { - expect(setIndexToCheck).toBeCalledWith(null); - }); - - test('it invokes onCheckAllCompleted after all the checks have completed', () => { - expect(onCheckCompleted).toHaveBeenCalled(); - }); - - // test all the patterns - Object.entries(patternIndexNames).forEach((pattern) => { - const [patternName, indexNames] = pattern; - - // test each index in the pattern - indexNames.forEach((indexName) => { - test(`it invokes setIndexToCheck with the expected value for the '${patternName}' pattern's index, named '${indexName}'`, () => { - expect(setIndexToCheck).toBeCalledWith({ - indexName, - pattern: patternName, - }); - }); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx deleted file mode 100644 index 5155c2a07f9cf..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx +++ /dev/null @@ -1,176 +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 { EcsVersion } from '@elastic/ecs'; - -import { EuiButton } from '@elastic/eui'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; -import { v4 as uuidv4 } from 'uuid'; - -import { checkIndex } from './check_index'; -import { useDataQualityContext } from '../../../data_quality_context'; -import { getAllIndicesToCheck } from './helpers'; -import * as i18n from '../../../../translations'; -import type { IndexToCheck, OnCheckCompleted } from '../../../../types'; -import { EcsFlatTyped } from '../../../../constants'; - -const CheckAllButton = styled(EuiButton)` - width: 112px; -`; - -async function wait(ms: number) { - const delay = () => - new Promise((resolve) => - setTimeout(() => { - resolve(''); - }, ms) - ); - - return delay(); -} - -interface Props { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhases: string[]; - incrementCheckAllIndiciesChecked: () => void; - onCheckCompleted: OnCheckCompleted; - patternIndexNames: Record; - patterns: string[]; - setCheckAllIndiciesChecked: (checkAllIndiciesChecked: number) => void; - setCheckAllTotalIndiciesToCheck: (checkAllTotalIndiciesToCheck: number) => void; - setIndexToCheck: (indexToCheck: IndexToCheck | null) => void; -} - -const DELAY_AFTER_EVERY_CHECK_COMPLETES = 3000; // ms - -const CheckAllComponent: React.FC = ({ - formatBytes, - formatNumber, - ilmPhases, - incrementCheckAllIndiciesChecked, - onCheckCompleted, - patternIndexNames, - patterns, - setCheckAllIndiciesChecked, - setCheckAllTotalIndiciesToCheck, - setIndexToCheck, -}) => { - const { httpFetch, isILMAvailable } = useDataQualityContext(); - const abortController = useRef(new AbortController()); - const [isRunning, setIsRunning] = useState(false); - - const cancelIfRunning = useCallback(() => { - if (isRunning) { - if (!abortController.current.signal.aborted) { - setIndexToCheck(null); - setIsRunning(false); - setCheckAllIndiciesChecked(0); - setCheckAllTotalIndiciesToCheck(0); - abortController.current.abort(); - } - } - }, [isRunning, setCheckAllIndiciesChecked, setCheckAllTotalIndiciesToCheck, setIndexToCheck]); - - const onClick = useCallback(() => { - async function beginCheck() { - const allIndicesToCheck = getAllIndicesToCheck(patternIndexNames); - const startTime = Date.now(); - const batchId = uuidv4(); - let checked = 0; - - setCheckAllIndiciesChecked(0); - setCheckAllTotalIndiciesToCheck(allIndicesToCheck.length); - - for (const { indexName, pattern } of allIndicesToCheck) { - if (!abortController.current.signal.aborted) { - setIndexToCheck({ - indexName, - pattern, - }); - - await checkIndex({ - abortController: abortController.current, - batchId, - checkAllStartTime: startTime, - ecsMetadata: EcsFlatTyped, - formatBytes, - formatNumber, - httpFetch, - indexName, - isLastCheck: - allIndicesToCheck.length > 0 ? checked === allIndicesToCheck.length - 1 : true, - onCheckCompleted, - pattern, - version: EcsVersion, - }); - - if (!abortController.current.signal.aborted) { - await wait(DELAY_AFTER_EVERY_CHECK_COMPLETES); - incrementCheckAllIndiciesChecked(); - checked++; - } - } - } - - if (!abortController.current.signal.aborted) { - setIndexToCheck(null); - setIsRunning(false); - } - } - - if (isRunning) { - cancelIfRunning(); - } else { - abortController.current = new AbortController(); - setIsRunning(true); - beginCheck(); - } - }, [ - cancelIfRunning, - formatBytes, - formatNumber, - httpFetch, - incrementCheckAllIndiciesChecked, - isRunning, - onCheckCompleted, - patternIndexNames, - setCheckAllIndiciesChecked, - setCheckAllTotalIndiciesToCheck, - setIndexToCheck, - ]); - - useEffect(() => { - return () => { - // cancel any checks in progress when the patterns or ilm phases change - cancelIfRunning(); - }; - }, [cancelIfRunning, ilmPhases, patterns]); - - useEffect(() => { - return () => { - abortController.current.abort(); - }; - }, [abortController]); - - const disabled = isILMAvailable && ilmPhases.length === 0; - - return ( - - {isRunning ? i18n.CANCEL : i18n.CHECK_ALL} - - ); -}; - -export const CheckAll = React.memo(CheckAllComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts deleted file mode 100644 index 219d1039ac290..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const AN_ERROR_OCCURRED_CHECKING_INDEX = (indexName: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.checkAllErrorCheckingIndexMessage', - { - values: { indexName }, - defaultMessage: 'An error occurred checking index {indexName}', - } - ); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx deleted file mode 100644 index 7d139121afbc4..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx +++ /dev/null @@ -1,128 +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 numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import React from 'react'; - -import { EMPTY_STAT } from '../../../helpers'; -import { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../types'; -import { Props, SummaryActions } from '.'; -import { - getTotalDocsCount, - getTotalIncompatible, - getTotalIndices, - getTotalIndicesChecked, - getTotalSizeInBytes, -} from '../../../use_results_rollup/helpers'; - -const mockCopyToClipboard = jest.fn((value) => true); -jest.mock('@elastic/eui', () => { - const original = jest.requireActual('@elastic/eui'); - return { - ...original, - copyToClipboard: (value: string) => mockCopyToClipboard(value), - }; -}); - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const patternIndexNames: Record = { - 'auditbeat-*': [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-custom-index-1', - ], - '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], - 'packetbeat-*': [ - '.ds-packetbeat-8.5.3-2023.02.04-000001', - '.ds-packetbeat-8.6.1-2023.02.04-000001', - ], -}; - -const lastChecked = '2023-03-28T23:27:28.159Z'; - -const totalDocsCount = getTotalDocsCount(patternRollups); -const totalIncompatible = getTotalIncompatible(patternRollups); -const totalIndices = getTotalIndices(patternRollups); -const totalIndicesChecked = getTotalIndicesChecked(patternRollups); -const totalSizeInBytes = getTotalSizeInBytes(patternRollups); - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: () => true, - errorSummary: [], - formatBytes, - formatNumber, - ilmPhases, - lastChecked, - openCreateCaseFlyout: jest.fn(), - onCheckCompleted: jest.fn(), - patternIndexNames, - patternRollups, - patterns, - setLastChecked: jest.fn(), - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - sizeInBytes: totalSizeInBytes, -}; - -describe('SummaryActions', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders the check all button', () => { - expect(screen.getByTestId('checkAll')).toBeInTheDocument(); - }); - - test('it renders the check status indicator', () => { - expect(screen.getByTestId('checkStatus')).toBeInTheDocument(); - }); - - test('it renders the actions', () => { - expect(screen.getByTestId('actions')).toBeInTheDocument(); - }); - - test('it invokes addSuccessToast when the copy to clipboard button is clicked', () => { - const button = screen.getByTestId('copyToClipboard'); - - userEvent.click(button); - - expect(defaultProps.addSuccessToast).toBeCalledWith({ - title: 'Copied results to the clipboard', - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx deleted file mode 100644 index ed9aeaa8f59d8..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx +++ /dev/null @@ -1,279 +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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { sortBy } from 'lodash/fp'; -import React, { useCallback, useState } from 'react'; - -import { CheckAll } from './check_all'; -import { CheckStatus } from '../check_status'; -import { ERROR, INDEX, PATTERN } from '../errors_viewer/translations'; -import { ERRORS } from '../errors_popover/translations'; -import { - getDataQualitySummaryMarkdownComment, - getErrorsMarkdownTable, - getErrorsMarkdownTableRows, - getPatternSummaryMarkdownComment, - getSummaryTableMarkdownHeader, - getSummaryTableMarkdownRow, -} from '../../index_properties/markdown/helpers'; -import { defaultSort, getSummaryTableItems } from '../../pattern/helpers'; -import { Actions } from './actions'; -import type { - DataQualityCheckResult, - ErrorSummary, - IndexToCheck, - OnCheckCompleted, - PatternRollup, -} from '../../../types'; -import { getSizeInBytes } from '../../../helpers'; -import { useDataQualityContext } from '../../data_quality_context'; - -export const getResultsSortedByDocsCount = ( - results: Record | undefined -): DataQualityCheckResult[] => - results != null ? sortBy('docsCount', Object.values(results)).reverse() : []; - -export const getAllMarkdownCommentsFromResults = ({ - formatBytes, - formatNumber, - isILMAvailable, - patternIndexNames, - patternRollup, -}: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - isILMAvailable: boolean; - patternIndexNames: Record; - patternRollup: PatternRollup; -}): string[] => { - const results = patternRollup.results; - const sortedResults = getResultsSortedByDocsCount(results); - - const summaryTableItems = getSummaryTableItems({ - ilmExplain: patternRollup.ilmExplain, - indexNames: patternIndexNames[patternRollup.pattern] ?? [], - isILMAvailable, - pattern: patternRollup.pattern, - patternDocsCount: patternRollup.docsCount ?? 0, - results: patternRollup.results, - sortByColumn: defaultSort.sort.field, - sortByDirection: defaultSort.sort.direction, - stats: patternRollup.stats, - }); - - const summaryTableMarkdownRows: string[] = summaryTableItems.map((item) => { - const result: DataQualityCheckResult | undefined = - patternRollup.results != null ? patternRollup.results[item.indexName] : undefined; - const sizeInBytes = getSizeInBytes({ indexName: item.indexName, stats: patternRollup.stats }); - - return getSummaryTableMarkdownRow({ - docsCount: item.docsCount, - formatBytes, - formatNumber, - ilmPhase: item.ilmPhase, - indexName: item.indexName, - incompatible: result?.incompatible, - isILMAvailable, - patternDocsCount: patternRollup.docsCount ?? 0, - sizeInBytes, - }).trim(); - }); - - const initialComments: string[] = - summaryTableMarkdownRows.length > 0 - ? [getSummaryTableMarkdownHeader(isILMAvailable), ...summaryTableMarkdownRows] - : []; - - return sortedResults.reduce( - (acc, result) => [...acc, ...result.markdownComments], - initialComments - ); -}; - -export const getAllMarkdownComments = ({ - formatBytes, - formatNumber, - isILMAvailable, - patternIndexNames, - patternRollups, -}: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - isILMAvailable: boolean; - patternIndexNames: Record; - patternRollups: Record; -}): string[] => { - const allPatterns: string[] = Object.keys(patternRollups); - - // sort the patterns A-Z: - const sortedPatterns = [...allPatterns].sort((a, b) => { - return a.localeCompare(b); - }); - - return sortedPatterns.reduce( - (acc, pattern) => [ - ...acc, - getPatternSummaryMarkdownComment({ - formatBytes, - formatNumber, - patternRollup: patternRollups[pattern], - }), - ...getAllMarkdownCommentsFromResults({ - formatBytes, - formatNumber, - isILMAvailable, - patternRollup: patternRollups[pattern], - patternIndexNames, - }), - ], - [] - ); -}; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - canUserCreateAndReadCases: () => boolean; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - errorSummary: ErrorSummary[]; - ilmPhases: string[]; - lastChecked: string; - onCheckCompleted: OnCheckCompleted; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patternIndexNames: Record; - patternRollups: Record; - patterns: string[]; - setLastChecked: (lastChecked: string) => void; - totalDocsCount: number | undefined; - totalIncompatible: number | undefined; - totalIndices: number | undefined; - totalIndicesChecked: number | undefined; - sizeInBytes: number | undefined; -} - -const SummaryActionsComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - formatBytes, - formatNumber, - errorSummary, - ilmPhases, - lastChecked, - onCheckCompleted, - openCreateCaseFlyout, - patternIndexNames, - patternRollups, - patterns, - setLastChecked, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - sizeInBytes, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const [indexToCheck, setIndexToCheck] = useState(null); - const [checkAllIndiciesChecked, setCheckAllIndiciesChecked] = useState(0); - const [checkAllTotalIndiciesToCheck, setCheckAllTotalIndiciesToCheck] = useState(0); - const incrementCheckAllIndiciesChecked = useCallback(() => { - setCheckAllIndiciesChecked((current) => current + 1); - }, []); - - const getMarkdownComments = useCallback( - (): string[] => [ - getDataQualitySummaryMarkdownComment({ - formatBytes, - formatNumber, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - sizeInBytes, - }), - ...getAllMarkdownComments({ - formatBytes, - formatNumber, - isILMAvailable, - patternIndexNames, - patternRollups, - }), - getErrorsMarkdownTable({ - errorSummary, - getMarkdownTableRows: getErrorsMarkdownTableRows, - headerNames: [PATTERN, INDEX, ERROR], - title: ERRORS, - }), - ], - [ - errorSummary, - formatBytes, - formatNumber, - isILMAvailable, - patternIndexNames, - patternRollups, - sizeInBytes, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - ] - ); - - return ( - <> - - - - - - - - - - - - - - - ); -}; - -SummaryActionsComponent.displayName = 'SummaryActionsComponent'; - -export const SummaryActions = React.memo(SummaryActionsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx deleted file mode 100644 index f57d9f52737d7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx +++ /dev/null @@ -1,26 +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 { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { ErrorEmptyPrompt } from '.'; - -describe('ErrorEmptyPrompt', () => { - test('it renders the expected content', () => { - const title = 'This is the title of this work'; - - render( - - - - ); - - expect(screen.getByTestId('errorEmptyPrompt').textContent?.includes(title)).toBe(true); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx deleted file mode 100644 index 3214b704dc685..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiCallOut, EuiCode } from '@elastic/eui'; -import React from 'react'; - -import * as i18n from '../data_quality_summary/errors_popover/translations'; - -interface Props { - title: string; -} - -const ErrorEmptyPromptComponent: React.FC = ({ title }) => ( - -

{i18n.ERRORS_MAY_OCCUR}

- - {i18n.THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} -
    -
  • - {i18n.MONITOR} {i18n.OR} {i18n.MANAGE} -
  • -
  • - {i18n.VIEW_INDEX_METADATA} -
  • -
  • - {i18n.READ} -
  • -
-
-); - -export const ErrorEmptyPrompt = React.memo(ErrorEmptyPromptComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx deleted file mode 100644 index 6efe7579d7325..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx +++ /dev/null @@ -1,86 +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 { - IlmExplainLifecycleLifecycleExplain, - IlmExplainLifecycleLifecycleExplainManaged, - IlmExplainLifecycleLifecycleExplainUnmanaged, -} from '@elastic/elasticsearch/lib/api/types'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { IlmPhaseCounts } from '.'; -import { getIlmExplainPhaseCounts } from '../pattern/helpers'; - -const hot: IlmExplainLifecycleLifecycleExplainManaged = { - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536751379, - time_since_index_creation: '3.98d', - lifecycle_date_millis: 1675536751379, - age: '3.98d', - phase: 'hot', - phase_time_millis: 1675536751809, - action: 'rollover', - action_time_millis: 1675536751809, - step: 'check-rollover-ready', - step_time_millis: 1675536751809, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, -}; -const warm = { - ...hot, - phase: 'warm', -}; -const cold = { - ...hot, - phase: 'cold', -}; -const frozen = { - ...hot, - phase: 'frozen', -}; - -const managed: Record = { - hot, - warm, - cold, - frozen, -}; - -const unmanaged: IlmExplainLifecycleLifecycleExplainUnmanaged = { - index: 'foo', - managed: false, -}; - -const ilmExplain: Record = { - ...managed, - [unmanaged.index]: unmanaged, -}; - -const ilmExplainPhaseCounts = getIlmExplainPhaseCounts(ilmExplain); - -const pattern = 'packetbeat-*'; - -describe('IlmPhaseCounts', () => { - test('it renders the expected counts', () => { - render( - - - - ); - - expect(screen.getByTestId('ilmPhaseCounts')).toHaveTextContent( - 'hot (1)unmanaged (1)warm (1)cold (1)frozen (1)' - ); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx deleted file mode 100644 index b24014bb400e6..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx +++ /dev/null @@ -1,48 +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 { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import { getPatternIlmPhaseDescription } from '../../helpers'; -import type { IlmExplainPhaseCounts, IlmPhase } from '../../types'; - -const PhaseCountsFlexGroup = styled(EuiFlexGroup)` - display: inline-flex; -`; - -export const phases: IlmPhase[] = ['hot', 'unmanaged', 'warm', 'cold', 'frozen']; - -interface Props { - ilmExplainPhaseCounts: IlmExplainPhaseCounts; - pattern: string; -} - -const IlmPhaseCountsComponent: React.FC = ({ ilmExplainPhaseCounts, pattern }) => ( - - {phases.map((phase) => - ilmExplainPhaseCounts[phase] != null && ilmExplainPhaseCounts[phase] > 0 ? ( - - - {`${phase} (${ilmExplainPhaseCounts[phase]})`} - - - ) : null - )} - -); - -IlmPhaseCountsComponent.displayName = 'IlmPhaseCountsComponent'; - -export const IlmPhaseCounts = React.memo(IlmPhaseCountsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts deleted file mode 100644 index 2ef3eb9c1c190..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts +++ /dev/null @@ -1,291 +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 { - getMappingsProperties, - getSortedPartitionedFieldMetadata, - hasAllDataFetchingCompleted, -} from './helpers'; -import { mockIndicesGetMappingIndexMappingRecords } from '../../mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record'; -import { mockMappingsProperties } from '../../mock/mappings_properties/mock_mappings_properties'; -import { EcsFlatTyped } from '../../constants'; - -describe('helpers', () => { - describe('getSortedPartitionedFieldMetadata', () => { - test('it returns null when mappings are loading', () => { - expect( - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings: true, // <-- - mappingsProperties: mockMappingsProperties, - unallowedValues: {}, - }) - ).toBeNull(); - }); - - test('it returns null when `unallowedValues` is null', () => { - expect( - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings: false, - mappingsProperties: mockMappingsProperties, - unallowedValues: null, // <-- - }) - ).toBeNull(); - }); - - describe('when `mappingsProperties` is unknown', () => { - const incompatibleFieldMetadata = { - ...EcsFlatTyped['@timestamp'], - hasEcsMetadata: true, - indexFieldName: '@timestamp', - indexFieldType: '-', - indexInvalidValues: [], - isEcsCompliant: false, - isInSameFamily: false, - }; - const expected = { - all: [incompatibleFieldMetadata], - custom: [], - ecsCompliant: [], - incompatible: [incompatibleFieldMetadata], - sameFamily: [], - }; - - test('it returns a `PartitionedFieldMetadata` with an `incompatible` `@timestamp` when `mappingsProperties` is undefined', () => { - expect( - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings: false, - mappingsProperties: undefined, // <-- - unallowedValues: {}, - }) - ).toEqual(expected); - }); - - test('it returns a `PartitionedFieldMetadata` with an `incompatible` `@timestamp` when `mappingsProperties` is null', () => { - expect( - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings: false, - mappingsProperties: null, // <-- - unallowedValues: {}, - }) - ).toEqual(expected); - }); - }); - - test('it returns the expected sorted field metadata', () => { - const unallowedValues = { - 'event.category': [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }; - - expect( - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings: false, - mappingsProperties: mockMappingsProperties, - unallowedValues, - }) - ).toMatchObject({ - all: expect.arrayContaining([ - expect.objectContaining({ - name: expect.any(String), - flat_name: expect.any(String), - dashed_name: expect.any(String), - description: expect.any(String), - hasEcsMetadata: true, - isEcsCompliant: expect.any(Boolean), - isInSameFamily: expect.any(Boolean), - }), - ]), - ecsCompliant: expect.arrayContaining([ - expect.objectContaining({ - name: expect.any(String), - flat_name: expect.any(String), - dashed_name: expect.any(String), - description: expect.any(String), - hasEcsMetadata: true, - isEcsCompliant: true, - isInSameFamily: false, - }), - ]), - custom: expect.arrayContaining([ - expect.objectContaining({ - indexFieldName: expect.any(String), - indexFieldType: expect.any(String), - indexInvalidValues: expect.any(Array), - hasEcsMetadata: expect.any(Boolean), - isEcsCompliant: expect.any(Boolean), - isInSameFamily: expect.any(Boolean), - }), - ]), - incompatible: expect.arrayContaining([ - expect.objectContaining({ - name: expect.any(String), - flat_name: expect.any(String), - dashed_name: expect.any(String), - description: expect.any(String), - hasEcsMetadata: expect.any(Boolean), - isEcsCompliant: false, - isInSameFamily: false, - }), - ]), - sameFamily: [], - }); - }); - }); - - describe('getMappingsProperties', () => { - test('it returns the expected mapping properties', () => { - expect( - getMappingsProperties({ - indexes: mockIndicesGetMappingIndexMappingRecords, - indexName: 'auditbeat-custom-index-1', - }) - ).toEqual({ - '@timestamp': { - type: 'date', - }, - event: { - properties: { - category: { - ignore_above: 1024, - type: 'keyword', - }, - }, - }, - host: { - properties: { - name: { - fields: { - keyword: { - ignore_above: 256, - type: 'keyword', - }, - }, - type: 'text', - }, - }, - }, - some: { - properties: { - field: { - fields: { - keyword: { - ignore_above: 256, - type: 'keyword', - }, - }, - type: 'text', - }, - }, - }, - source: { - properties: { - ip: { - fields: { - keyword: { - ignore_above: 256, - type: 'keyword', - }, - }, - type: 'text', - }, - port: { - type: 'long', - }, - }, - }, - }); - }); - - test('it returns null when `indexes` is null', () => { - expect( - getMappingsProperties({ - indexes: null, // <-- - indexName: 'auditbeat-custom-index-1', - }) - ).toBeNull(); - }); - - test('it returns null when `indexName` does not exist in `indexes`', () => { - expect( - getMappingsProperties({ - indexes: mockIndicesGetMappingIndexMappingRecords, - indexName: 'does-not-exist', // <-- - }) - ).toBeNull(); - }); - - test('it returns null when `properties` does not exist in the mappings', () => { - const missingProperties = { - ...mockIndicesGetMappingIndexMappingRecords, - foozle: { - mappings: {}, // <-- does not have a `properties` - }, - }; - - expect( - getMappingsProperties({ - indexes: missingProperties, - indexName: 'foozle', - }) - ).toBeNull(); - }); - }); - - describe('hasAllDataFetchingCompleted', () => { - test('it returns false when both the mappings and unallowed values are loading', () => { - expect( - hasAllDataFetchingCompleted({ - loadingMappings: true, - loadingUnallowedValues: true, - }) - ).toBe(false); - }); - - test('it returns false when mappings are loading, and unallowed values are NOT loading', () => { - expect( - hasAllDataFetchingCompleted({ - loadingMappings: true, - loadingUnallowedValues: false, - }) - ).toBe(false); - }); - - test('it returns false when mappings are NOT loading, and unallowed values are loading', () => { - expect( - hasAllDataFetchingCompleted({ - loadingMappings: false, - loadingUnallowedValues: true, - }) - ).toBe(false); - }); - - test('it returns true when both the mappings and unallowed values have finished loading', () => { - expect( - hasAllDataFetchingCompleted({ - loadingMappings: false, - loadingUnallowedValues: false, - }) - ).toBe(true); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts deleted file mode 100644 index e47d18685615f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts +++ /dev/null @@ -1,101 +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 type { - IndicesGetMappingIndexMappingRecord, - MappingProperty, -} from '@elastic/elasticsearch/lib/api/types'; -import { sortBy } from 'lodash/fp'; -import { EcsFlatTyped } from '../../constants'; - -import { - getEnrichedFieldMetadata, - getFieldTypes, - getMissingTimestampFieldMetadata, - getPartitionedFieldMetadata, -} from '../../helpers'; -import type { PartitionedFieldMetadata, UnallowedValueCount } from '../../types'; - -export const ALL_TAB_ID = 'allTab'; -export const ECS_COMPLIANT_TAB_ID = 'ecsCompliantTab'; -export const CUSTOM_TAB_ID = 'customTab'; -export const INCOMPATIBLE_TAB_ID = 'incompatibleTab'; -export const SAME_FAMILY_TAB_ID = 'sameFamilyTab'; -export const SUMMARY_TAB_ID = 'summaryTab'; - -export const EMPTY_METADATA: PartitionedFieldMetadata = { - all: [], - ecsCompliant: [], - custom: [], - incompatible: [], - sameFamily: [], -}; - -export const getSortedPartitionedFieldMetadata = ({ - ecsMetadata, - loadingMappings, - mappingsProperties, - unallowedValues, -}: { - ecsMetadata: EcsFlatTyped; - loadingMappings: boolean; - mappingsProperties: Record | null | undefined; - unallowedValues: Record | null; -}): PartitionedFieldMetadata | null => { - if (loadingMappings || unallowedValues == null) { - return null; - } - - // this covers scenario when we try to check an empty index - // or index without required @timestamp field in the mapping - // - // we create an artifical incompatible timestamp field metadata - // so that we can signal to user that the incompatibility is due to missing timestamp - if (mappingsProperties == null) { - const missingTimestampFieldMetadata = getMissingTimestampFieldMetadata(); - return { - ...EMPTY_METADATA, - all: [missingTimestampFieldMetadata], - incompatible: [missingTimestampFieldMetadata], - }; - } - - const fieldTypes = getFieldTypes(mappingsProperties); - - const enrichedFieldMetadata = sortBy( - 'indexFieldName', - fieldTypes.map((fieldMetadata) => - getEnrichedFieldMetadata({ ecsMetadata, fieldMetadata, unallowedValues }) - ) - ); - - const partitionedFieldMetadata = getPartitionedFieldMetadata(enrichedFieldMetadata); - - return partitionedFieldMetadata; -}; - -export const getMappingsProperties = ({ - indexes, - indexName, -}: { - indexes: Record | null; - indexName: string; -}): Record | null => { - if (indexes != null && indexes[indexName] != null) { - return indexes[indexName].mappings.properties ?? null; - } - - return null; -}; - -export const hasAllDataFetchingCompleted = ({ - loadingMappings, - loadingUnallowedValues, -}: { - loadingMappings: boolean; - loadingUnallowedValues: boolean; -}): boolean => loadingMappings === false && loadingUnallowedValues === false; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx deleted file mode 100644 index 973f5dde95e45..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx +++ /dev/null @@ -1,275 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { HttpHandler } from '@kbn/core-http-browser'; -import { render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../helpers'; -import { mockMappingsResponse } from '../../mock/mappings_response/mock_mappings_response'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { mockUnallowedValuesResponse } from '../../mock/unallowed_values/mock_unallowed_values'; -import { LOADING_MAPPINGS, LOADING_UNALLOWED_VALUES } from './translations'; -import { UnallowedValueRequestItem } from '../../types'; -import { IndexProperties, Props } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const pattern = 'auditbeat-*'; -const patternRollup = auditbeatWithAllResults; - -const mockFetchMappings = jest.fn( - ({ - abortController, - httpFetch, - patternOrIndexName, - }: { - abortController: AbortController; - httpFetch: HttpHandler; - patternOrIndexName: string; - }) => - new Promise((resolve) => { - resolve(mockMappingsResponse); // happy path - }) -); - -jest.mock('../../use_mappings/helpers', () => ({ - fetchMappings: ({ - abortController, - httpFetch, - patternOrIndexName, - }: { - abortController: AbortController; - httpFetch: HttpHandler; - patternOrIndexName: string; - }) => - mockFetchMappings({ - abortController, - httpFetch, - patternOrIndexName, - }), -})); - -const mockFetchUnallowedValues = jest.fn( - ({ - abortController, - httpFetch, - indexName, - requestItems, - }: { - abortController: AbortController; - httpFetch: HttpHandler; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => new Promise((resolve) => resolve(mockUnallowedValuesResponse)) -); - -jest.mock('../../use_unallowed_values/helpers', () => { - const original = jest.requireActual('../../use_unallowed_values/helpers'); - - return { - ...original, - fetchUnallowedValues: ({ - abortController, - httpFetch, - indexName, - requestItems, - }: { - abortController: AbortController; - httpFetch: HttpHandler; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => - mockFetchUnallowedValues({ - abortController, - httpFetch, - indexName, - requestItems, - }), - }; -}); - -const defaultProps: Props = { - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: jest.fn(), - docsCount: auditbeatWithAllResults.docsCount ?? 0, - formatBytes, - formatNumber, - getGroupByFieldsOnClick: jest.fn(), - indexId: '1xxx', - ilmPhase: 'hot', - indexName: 'auditbeat-custom-index-1', - isAssistantEnabled: true, - openCreateCaseFlyout: jest.fn(), - pattern, - patternRollup, - baseTheme: DARK_THEME, - updatePatternRollup: jest.fn(), -}; - -describe('IndexProperties', () => { - test('it renders the tab content', async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.getByTestId('incompatibleTab')).toBeInTheDocument(); - }); - }); - - describe('when an error occurs loading mappings', () => { - const abortController = new AbortController(); - abortController.abort(); - - const error = 'simulated fetch mappings error'; - - beforeEach(() => { - jest.resetAllMocks(); - }); - - test('it displays the expected empty prompt content', async () => { - mockFetchMappings.mockImplementation( - ({ - // eslint-disable-next-line @typescript-eslint/no-shadow - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => new Promise((_, reject) => reject(new Error(error))) - ); - - render( - - - - ); - - await waitFor(() => { - expect( - screen - .getByTestId('errorEmptyPrompt') - .textContent?.includes('Unable to load index mappings') - ).toBe(true); - }); - }); - }); - - describe('when an error occurs loading unallowed values', () => { - const abortController = new AbortController(); - abortController.abort(); - - const error = 'simulated fetch unallowed values error'; - - beforeEach(() => { - jest.resetAllMocks(); - }); - - test('it displays the expected empty prompt content', async () => { - mockFetchUnallowedValues.mockImplementation( - ({ - // eslint-disable-next-line @typescript-eslint/no-shadow - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => new Promise((_, reject) => reject(new Error(error))) - ); - - render( - - - - ); - - await waitFor(() => { - expect( - screen - .getByTestId('errorEmptyPrompt') - .textContent?.includes('Unable to load unallowed values') - ).toBe(true); - }); - }); - }); - - describe('when mappings are loading', () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - test('it displays the expected loading prompt content', async () => { - mockFetchMappings.mockImplementation( - ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => new Promise(() => {}) // <-- will never resolve or reject - ); - - render( - - - - ); - - await waitFor(() => { - expect( - screen.getByTestId('loadingEmptyPrompt').textContent?.includes(LOADING_MAPPINGS) - ).toBe(true); - }); - }); - }); - - describe('when unallowed values are loading', () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - test('it displays the expected loading prompt content', async () => { - mockFetchUnallowedValues.mockImplementation( - ({ - abortController, - indexName, - requestItems, - }: { - abortController: AbortController; - indexName: string; - requestItems: UnallowedValueRequestItem[]; - }) => new Promise(() => {}) // <-- will never resolve or reject - ); - - render( - - - - ); - - await waitFor(() => { - expect( - screen.getByTestId('loadingEmptyPrompt').textContent?.includes(LOADING_UNALLOWED_VALUES) - ).toBe(true); - }); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx deleted file mode 100644 index a9dce4dafc741..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx +++ /dev/null @@ -1,354 +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 { EcsVersion } from '@elastic/ecs'; -import type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { EuiSpacer, EuiTab, EuiTabs } from '@elastic/eui'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { v4 as uuidv4 } from 'uuid'; - -import { getUnallowedValueRequestItems } from '../allowed_values/helpers'; -import { ErrorEmptyPrompt } from '../error_empty_prompt'; -import { - EMPTY_METADATA, - getMappingsProperties, - getSortedPartitionedFieldMetadata, - hasAllDataFetchingCompleted, - INCOMPATIBLE_TAB_ID, -} from './helpers'; -import { LoadingEmptyPrompt } from '../loading_empty_prompt'; -import { getIndexPropertiesContainerId } from '../pattern/helpers'; -import { getTabs } from '../tabs/helpers'; -import { - getAllIncompatibleMarkdownComments, - getIncompatibleValuesFields, - getIncompatibleMappingsFields, - getSameFamilyFields, -} from '../tabs/incompatible_tab/helpers'; -import * as i18n from './translations'; -import type { IlmPhase, PartitionedFieldMetadata, PatternRollup } from '../../types'; -import { useAddToNewCase } from '../../use_add_to_new_case'; -import { useMappings } from '../../use_mappings'; -import { useUnallowedValues } from '../../use_unallowed_values'; -import { useDataQualityContext } from '../data_quality_context'; -import { formatStorageResult, postStorageResult, getSizeInBytes } from '../../helpers'; -import { EcsFlatTyped } from '../../constants'; - -const EMPTY_MARKDOWN_COMMENTS: string[] = []; - -export interface Props { - addSuccessToast: (toast: { title: string }) => void; - canUserCreateAndReadCases: () => boolean; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - docsCount: number; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhase: IlmPhase | undefined; - indexId: string | null | undefined; - indexName: string; - isAssistantEnabled: boolean; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - pattern: string; - patternRollup: PatternRollup | undefined; - theme?: PartialTheme; - baseTheme: Theme; - updatePatternRollup: (patternRollup: PatternRollup) => void; -} - -const IndexPropertiesComponent: React.FC = ({ - addSuccessToast, - baseTheme, - canUserCreateAndReadCases, - docsCount, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhase, - indexId, - indexName, - isAssistantEnabled, - openCreateCaseFlyout, - pattern, - patternRollup, - theme, - updatePatternRollup, -}) => { - const { error: mappingsError, indexes, loading: loadingMappings } = useMappings(indexName); - const { telemetryEvents, isILMAvailable, httpFetch, toasts } = useDataQualityContext(); - - const requestItems = useMemo( - () => - getUnallowedValueRequestItems({ - ecsMetadata: EcsFlatTyped, - indexName, - }), - [indexName] - ); - - const { - error: unallowedValuesError, - loading: loadingUnallowedValues, - unallowedValues, - requestTime, - } = useUnallowedValues({ indexName, requestItems }); - - const mappingsProperties = useMemo( - () => - getMappingsProperties({ - indexes, - indexName, - }), - [indexName, indexes] - ); - - const partitionedFieldMetadata: PartitionedFieldMetadata | null = useMemo( - () => - getSortedPartitionedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - loadingMappings, - mappingsProperties, - unallowedValues, - }), - [loadingMappings, mappingsProperties, unallowedValues] - ); - - const { disabled: addToNewCaseDisabled, onAddToNewCase } = useAddToNewCase({ - canUserCreateAndReadCases, - indexName, - openCreateCaseFlyout, - }); - - const [selectedTabId, setSelectedTabId] = useState(INCOMPATIBLE_TAB_ID); - - const tabs = useMemo( - () => - getTabs({ - addSuccessToast, - addToNewCaseDisabled, - formatBytes, - formatNumber, - docsCount, - getGroupByFieldsOnClick, - ilmPhase, - isAssistantEnabled, - indexName, - onAddToNewCase, - partitionedFieldMetadata: partitionedFieldMetadata ?? EMPTY_METADATA, - pattern, - patternDocsCount: patternRollup?.docsCount ?? 0, - setSelectedTabId, - stats: patternRollup?.stats ?? null, - theme, - baseTheme, - }), - [ - addSuccessToast, - addToNewCaseDisabled, - docsCount, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhase, - indexName, - isAssistantEnabled, - onAddToNewCase, - partitionedFieldMetadata, - pattern, - patternRollup?.docsCount, - patternRollup?.stats, - theme, - baseTheme, - ] - ); - - const onSelectedTabChanged = useCallback((id: string) => { - setSelectedTabId(id); - }, []); - - const selectedTabContent = useMemo( - () => ( - <> - - {tabs.find((obj) => obj.id === selectedTabId)?.content} - - ), - [selectedTabId, tabs] - ); - - const renderTabs = useCallback( - () => - tabs.map((tab, index) => ( - onSelectedTabChanged(tab.id)} - > - {tab.name} - - )), - [onSelectedTabChanged, selectedTabId, tabs] - ); - - useEffect(() => { - if (hasAllDataFetchingCompleted({ loadingMappings, loadingUnallowedValues })) { - const error: string | null = mappingsError ?? unallowedValuesError; - const indexIncompatible: number | undefined = - error == null && partitionedFieldMetadata != null - ? partitionedFieldMetadata.incompatible.length - : undefined; - - const indexSameFamily: number | undefined = - error == null && partitionedFieldMetadata != null - ? partitionedFieldMetadata.sameFamily.length - : undefined; - - if (patternRollup != null) { - const markdownComments = - partitionedFieldMetadata != null - ? getAllIncompatibleMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount: patternRollup.docsCount ?? 0, - sizeInBytes: patternRollup.sizeInBytes, - }) - : EMPTY_MARKDOWN_COMMENTS; - - const checkedAt = partitionedFieldMetadata ? Date.now() : undefined; - - const updatedRollup = { - ...patternRollup, - results: { - ...patternRollup.results, - [indexName]: { - docsCount, - error, - ilmPhase, - incompatible: indexIncompatible, - indexName, - markdownComments, - pattern, - sameFamily: indexSameFamily, - checkedAt, - }, - }, - }; - updatePatternRollup(updatedRollup); - - if (indexName && requestTime != null && requestTime > 0 && partitionedFieldMetadata) { - const report = { - batchId: uuidv4(), - ecsVersion: EcsVersion, - errorCount: error ? 1 : 0, - ilmPhase, - indexId, - indexName, - isCheckAll: false, - numberOfDocuments: docsCount, - numberOfFields: partitionedFieldMetadata.all.length, - numberOfIncompatibleFields: indexIncompatible, - numberOfEcsFields: partitionedFieldMetadata.ecsCompliant.length, - numberOfCustomFields: partitionedFieldMetadata.custom.length, - numberOfIndices: 1, - numberOfIndicesChecked: 1, - numberOfSameFamily: indexSameFamily, - sizeInBytes: getSizeInBytes({ stats: patternRollup.stats, indexName }), - timeConsumedMs: requestTime, - sameFamilyFields: getSameFamilyFields(partitionedFieldMetadata.sameFamily), - unallowedMappingFields: getIncompatibleMappingsFields( - partitionedFieldMetadata.incompatible - ), - unallowedValueFields: getIncompatibleValuesFields( - partitionedFieldMetadata.incompatible - ), - }; - telemetryEvents.reportDataQualityIndexChecked?.(report); - - const result = updatedRollup.results[indexName]; - if (result) { - const storageResult = formatStorageResult({ result, report, partitionedFieldMetadata }); - postStorageResult({ storageResult, httpFetch, toasts }); - } - } - } - } - }, [ - docsCount, - formatBytes, - formatNumber, - httpFetch, - ilmPhase, - indexId, - indexName, - isILMAvailable, - loadingMappings, - loadingUnallowedValues, - mappingsError, - partitionedFieldMetadata, - pattern, - patternRollup, - requestTime, - telemetryEvents, - toasts, - unallowedValuesError, - updatePatternRollup, - ]); - - if (mappingsError != null) { - return ; - } else if (unallowedValuesError != null) { - return ; - } - - if (loadingMappings) { - return ; - } else if (loadingUnallowedValues) { - return ; - } - - return indexes != null ? ( -
- {renderTabs()} - {selectedTabContent} -
- ) : null; -}; -IndexPropertiesComponent.displayName = 'IndexPropertiesComponent'; - -export const IndexProperties = React.memo(IndexPropertiesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts deleted file mode 100644 index 8c14a214cabf3..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts +++ /dev/null @@ -1,723 +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 numeral from '@elastic/numeral'; - -import { - ECS_MAPPING_TYPE_EXPECTED, - FIELD, - INDEX_MAPPING_TYPE_ACTUAL, -} from '../../../compare_fields_table/translations'; -import { ERRORS } from '../../data_quality_summary/errors_popover/translations'; -import { ERROR, INDEX, PATTERN } from '../../data_quality_summary/errors_viewer/translations'; -import { - escape, - escapePreserveNewlines, - getAllowedValues, - getCodeFormattedValue, - getCustomMarkdownTableRows, - getDataQualitySummaryMarkdownComment, - getErrorsMarkdownTable, - getErrorsMarkdownTableRows, - getHeaderSeparator, - getIlmExplainPhaseCountsMarkdownComment, - getIncompatibleMappingsMarkdownTableRows, - getIncompatibleValuesMarkdownTableRows, - getIndexInvalidValues, - getMarkdownComment, - getMarkdownTable, - getMarkdownTableHeader, - getPatternSummaryMarkdownComment, - getResultEmoji, - getSameFamilyBadge, - getStatsRollupMarkdownComment, - getSummaryMarkdownComment, - getSummaryTableMarkdownComment, - getSummaryTableMarkdownHeader, - getSummaryTableMarkdownRow, - getTabCountsMarkdownComment, -} from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; -import { mockAllowedValues } from '../../../mock/allowed_values/mock_allowed_values'; -import { - eventCategory, - mockCustomFields, - mockIncompatibleMappings, - sourceIpWithTextMapping, -} from '../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { - auditbeatNoResults, - auditbeatWithAllResults, -} from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { SAME_FAMILY } from '../../same_family/translations'; -import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../../tabs/incompatible_tab/translations'; -import { - EcsBasedFieldMetadata, - ErrorSummary, - PatternRollup, - UnallowedValueCount, -} from '../../../types'; - -const errorSummary: ErrorSummary[] = [ - { - pattern: '.alerts-security.alerts-default', - indexName: null, - error: 'Error loading stats: Error: Forbidden', - }, - { - error: - 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', - indexName: 'auditbeat-7.2.1-2023.02.13-000001', - pattern: 'auditbeat-*', - }, -]; - -const indexName = 'auditbeat-custom-index-1'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -describe('helpers', () => { - describe('escape', () => { - test('it returns undefined when `content` is undefined', () => { - expect(escape(undefined)).toBeUndefined(); - }); - - test("it returns the content unmodified when there's nothing to escape", () => { - const content = "there's nothing to escape in this content"; - expect(escape(content)).toEqual(content); - }); - - test('it replaces all newlines in the content with spaces', () => { - const content = '\nthere were newlines in the beginning, middle,\nand end\n'; - expect(escape(content)).toEqual(' there were newlines in the beginning, middle, and end '); - }); - - test('it escapes all column separators in the content with spaces', () => { - const content = '|there were column separators in the beginning, middle,|and end|'; - expect(escape(content)).toEqual( - '\\|there were column separators in the beginning, middle,\\|and end\\|' - ); - }); - - test('it escapes content containing BOTH newlines and column separators', () => { - const content = - '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; - expect(escape(content)).toEqual( - '\\| there were newlines and column separators in the beginning, middle, \\|and end\\| ' - ); - }); - }); - - describe('escapePreserveNewlines', () => { - test('it returns undefined when `content` is undefined', () => { - expect(escapePreserveNewlines(undefined)).toBeUndefined(); - }); - - test("it returns the content unmodified when there's nothing to escape", () => { - const content = "there's (also) nothing to escape in this content"; - expect(escapePreserveNewlines(content)).toEqual(content); - }); - - test('it escapes all column separators in the content with spaces', () => { - const content = '|there were column separators in the beginning, middle,|and end|'; - expect(escapePreserveNewlines(content)).toEqual( - '\\|there were column separators in the beginning, middle,\\|and end\\|' - ); - }); - - test('it does NOT escape newlines in the content', () => { - const content = - '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; - expect(escapePreserveNewlines(content)).toEqual( - '\\|\nthere were newlines and column separators in the beginning, middle,\n\\|and end\\|\n' - ); - }); - }); - - describe('getHeaderSeparator', () => { - test('it returns a sequence of dashes equal to the length of the header, plus two additional dashes to pad each end of the cntent', () => { - const content = '0123456789'; // content.length === 10 - const expected = '------------'; // expected.length === 12 - - expect(getHeaderSeparator(content)).toEqual(expected); - }); - }); - - describe('getMarkdownTableHeader', () => { - const headerNames = [ - '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n', - 'A second column', - 'A third column', - ]; - - test('it returns the expected table header', () => { - expect(getMarkdownTableHeader(headerNames)).toEqual( - '\n| \\| there were newlines and column separators in the beginning, middle, \\|and end\\| | A second column | A third column | \n|----------------------------------------------------------------------------------|-----------------|----------------|' - ); - }); - }); - - describe('getCodeFormattedValue', () => { - test('it returns the expected placeholder when `value` is undefined', () => { - expect(getCodeFormattedValue(undefined)).toEqual('`--`'); - }); - - test('it returns the content formatted as markdown code', () => { - const value = 'foozle'; - - expect(getCodeFormattedValue(value)).toEqual('`foozle`'); - }); - - test('it escapes content such that `value` may be included in a markdown table cell', () => { - const value = - '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; - - expect(getCodeFormattedValue(value)).toEqual( - '`\\| there were newlines and column separators in the beginning, middle, \\|and end\\| `' - ); - }); - }); - - describe('getAllowedValues', () => { - test('it returns the expected placeholder when `allowedValues` is undefined', () => { - expect(getAllowedValues(undefined)).toEqual('`--`'); - }); - - test('it joins the `allowedValues` `name`s as a markdown-code-formatted, comma separated, string', () => { - expect(getAllowedValues(mockAllowedValues)).toEqual( - '`authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web`' - ); - }); - }); - - describe('getIndexInvalidValues', () => { - test('it returns the expected placeholder when `indexInvalidValues` is empty', () => { - expect(getIndexInvalidValues([])).toEqual('`--`'); - }); - - test('it returns markdown-code-formatted `fieldName`s, and their associated `count`s', () => { - const indexInvalidValues: UnallowedValueCount[] = [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ]; - - expect(getIndexInvalidValues(indexInvalidValues)).toEqual( - `\`an_invalid_category\` (2), \`theory\` (1)` - ); - }); - }); - - describe('getCustomMarkdownTableRows', () => { - test('it returns the expected table rows', () => { - expect(getCustomMarkdownTableRows(mockCustomFields)).toEqual( - '| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |' - ); - }); - }); - - describe('getSameFamilyBadge', () => { - test('it returns the expected badge text when the field is in the same family', () => { - const inSameFamily = { - ...eventCategory, - isInSameFamily: true, - }; - - expect(getSameFamilyBadge(inSameFamily)).toEqual(`\`${SAME_FAMILY}\``); - }); - - test('it returns an empty string when the field is NOT the same family', () => { - const notInSameFamily = { - ...eventCategory, - isInSameFamily: false, - }; - - expect(getSameFamilyBadge(notInSameFamily)).toEqual(''); - }); - }); - - describe('getIncompatibleMappingsMarkdownTableRows', () => { - test('it returns the expected table rows when the field is in the same family', () => { - const eventCategoryWithWildcard: EcsBasedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType: 'wildcard', // this index has a mapping of `wildcard` instead of `keyword` - isInSameFamily: true, // `wildcard` and `keyword` are in the same family - }; - - expect( - getIncompatibleMappingsMarkdownTableRows([ - eventCategoryWithWildcard, - sourceIpWithTextMapping, - ]) - ).toEqual( - '| event.category | `keyword` | `wildcard` `same family` |\n| source.ip | `ip` | `text` |' - ); - }); - - test('it returns the expected table rows when the field is NOT in the same family', () => { - const eventCategoryWithText: EcsBasedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType: 'text', // this index has a mapping of `text` instead of `keyword` - isInSameFamily: false, // `text` and `keyword` are NOT in the same family - }; - - expect( - getIncompatibleMappingsMarkdownTableRows([eventCategoryWithText, sourceIpWithTextMapping]) - ).toEqual('| event.category | `keyword` | `text` |\n| source.ip | `ip` | `text` |'); - }); - }); - - describe('getIncompatibleValuesMarkdownTableRows', () => { - test('it returns the expected table rows', () => { - expect( - getIncompatibleValuesMarkdownTableRows([ - { - ...eventCategory, - hasEcsMetadata: true, - indexInvalidValues: [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ], - isEcsCompliant: false, - }, - ]) - ).toEqual( - '| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |' - ); - }); - }); - - describe('getMarkdownComment', () => { - test('it returns the expected markdown comment', () => { - const suggestedAction = - '|\nthere were newlines and column separators in this suggestedAction beginning, middle,\n|and end|\n'; - const title = - '|\nthere were newlines and column separators in this title beginning, middle,\n|and end|\n'; - - expect(getMarkdownComment({ suggestedAction, title })).toEqual( - '#### \\| there were newlines and column separators in this title beginning, middle, \\|and end\\| \n\n\\|\nthere were newlines and column separators in this suggestedAction beginning, middle,\n\\|and end\\|\n' - ); - }); - }); - - describe('getErrorsMarkdownTableRows', () => { - test('it returns the expected markdown table rows', () => { - expect(getErrorsMarkdownTableRows(errorSummary)).toEqual( - '| .alerts-security.alerts-default | -- | `Error loading stats: Error: Forbidden` |\n| auditbeat-* | auditbeat-7.2.1-2023.02.13-000001 | `Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden` |' - ); - }); - }); - - describe('getErrorsMarkdownTable', () => { - test('it returns the expected table contents', () => { - expect( - getErrorsMarkdownTable({ - errorSummary, - getMarkdownTableRows: getErrorsMarkdownTableRows, - headerNames: [PATTERN, INDEX, ERROR], - title: ERRORS, - }) - ).toEqual( - `## Errors\n\nSome indices were not checked for Data Quality\n\nErrors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for access\n\nThe following privileges are required to check an index:\n- \`monitor\` or \`manage\`\n- \`view_index_metadata\`\n- \`read\`\n\n\n| Pattern | Index | Error | \n|---------|-------|-------|\n| .alerts-security.alerts-default | -- | \`Error loading stats: Error: Forbidden\` |\n| auditbeat-* | auditbeat-7.2.1-2023.02.13-000001 | \`Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden\` |\n` - ); - }); - - test('it returns an empty string when the error summary is empty', () => { - expect( - getErrorsMarkdownTable({ - errorSummary: [], // <-- empty - getMarkdownTableRows: getErrorsMarkdownTableRows, - headerNames: [PATTERN, INDEX, ERROR], - title: ERRORS, - }) - ).toEqual(''); - }); - }); - - describe('getMarkdownTable', () => { - test('it returns the expected table contents', () => { - expect( - getMarkdownTable({ - enrichedFieldMetadata: mockIncompatibleMappings, - getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, - headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], - title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), - }) - ).toEqual( - '#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n' - ); - }); - - test('it returns an empty string when `enrichedFieldMetadata` is empty', () => { - expect( - getMarkdownTable({ - enrichedFieldMetadata: [], // <-- empty - getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, - headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], - title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), - }) - ).toEqual(''); - }); - }); - - describe('getSummaryMarkdownComment', () => { - test('it returns the expected markdown comment', () => { - expect(getSummaryMarkdownComment(indexName)).toEqual('### auditbeat-custom-index-1\n'); - }); - }); - - describe('getTabCountsMarkdownComment', () => { - test('it returns a comment with the expected counts', () => { - expect(getTabCountsMarkdownComment(mockPartitionedFieldMetadata)).toBe( - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n' - ); - }); - }); - - describe('getResultEmoji', () => { - test('it returns the expected placeholder when `incompatible` is undefined', () => { - expect(getResultEmoji(undefined)).toEqual('--'); - }); - - test('it returns a ✅ when the incompatible count is zero', () => { - expect(getResultEmoji(0)).toEqual('✅'); - }); - - test('it returns a ❌ when the incompatible count is NOT zero', () => { - expect(getResultEmoji(1)).toEqual('❌'); - }); - }); - - describe('getSummaryTableMarkdownHeader', () => { - test('it returns the expected header', () => { - const isILMAvailable = true; - expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|' - ); - }); - - test('it returns the expected header when isILMAvailable is false', () => { - const isILMAvailable = false; - expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|' - ); - }); - - test('it returns the expected header when displayDocSize is false', () => { - const isILMAvailable = false; - expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|' - ); - }); - }); - - describe('getSummaryTableMarkdownRow', () => { - test('it returns the expected row when all values are provided', () => { - expect( - getSummaryTableMarkdownRow({ - docsCount: 4, - formatBytes, - formatNumber, - incompatible: 3, - ilmPhase: 'unmanaged', - isILMAvailable: true, - indexName: 'auditbeat-custom-index-1', - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual('| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n'); - }); - - test('it returns the expected row when optional values are NOT provided', () => { - expect( - getSummaryTableMarkdownRow({ - docsCount: 4, - formatBytes, - formatNumber, - incompatible: undefined, // <-- - ilmPhase: undefined, // <-- - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- | -- | 27.7KB |\n'); - }); - - test('it returns the expected row when isILMAvailable is false', () => { - expect( - getSummaryTableMarkdownRow({ - docsCount: 4, - formatBytes, - formatNumber, - incompatible: undefined, // <-- - ilmPhase: undefined, // <-- - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- |\n'); - }); - - test('it returns the expected row when sizeInBytes is undefined', () => { - expect( - getSummaryTableMarkdownRow({ - docsCount: 4, - formatBytes, - formatNumber, - incompatible: undefined, // <-- - ilmPhase: undefined, // <-- - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- |\n'); - }); - }); - - describe('getSummaryTableMarkdownComment', () => { - test('it returns the expected comment', () => { - expect( - getSummaryTableMarkdownComment({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual( - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n' - ); - }); - - test('it returns the expected comment when isILMAvailable is false', () => { - expect( - getSummaryTableMarkdownComment({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual( - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n' - ); - }); - - test('it returns the expected comment when sizeInBytes is undefined', () => { - expect( - getSummaryTableMarkdownComment({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual( - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n' - ); - }); - }); - - describe('getStatsRollupMarkdownComment', () => { - test('it returns the expected comment', () => { - expect( - getStatsRollupMarkdownComment({ - docsCount: 57410, - formatBytes, - formatNumber, - incompatible: 3, - indices: 25, - indicesChecked: 1, - sizeInBytes: 28413, - }) - ).toEqual( - '| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 3 | 1 | 25 | 27.7KB | 57,410 |\n' - ); - }); - - test('it returns the expected comment when optional values are undefined', () => { - expect( - getStatsRollupMarkdownComment({ - docsCount: 0, - formatBytes, - formatNumber, - incompatible: undefined, - indices: undefined, - indicesChecked: undefined, - sizeInBytes: undefined, - }) - ).toEqual( - '| Incompatible fields | Indices checked | Indices | Docs |\n|---------------------|-----------------|---------|------|\n| -- | -- | -- | 0 |\n' - ); - }); - }); - - describe('getDataQualitySummaryMarkdownComment', () => { - test('it returns the expected comment', () => { - expect( - getDataQualitySummaryMarkdownComment({ - formatBytes, - formatNumber, - totalDocsCount: 3343719, - totalIncompatible: 4, - totalIndices: 30, - totalIndicesChecked: 2, - sizeInBytes: 4294967296, - }) - ).toEqual( - '# Data quality\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 2 | 30 | 4GB | 3,343,719 |\n\n' - ); - }); - - test('it returns the expected comment when optional values are undefined', () => { - expect( - getDataQualitySummaryMarkdownComment({ - formatBytes, - formatNumber, - totalDocsCount: undefined, - totalIncompatible: undefined, - totalIndices: undefined, - totalIndicesChecked: undefined, - sizeInBytes: undefined, - }) - ).toEqual( - '# Data quality\n\n| Incompatible fields | Indices checked | Indices | Docs |\n|---------------------|-----------------|---------|------|\n| -- | -- | -- | 0 |\n\n' - ); - }); - }); - - describe('getIlmExplainPhaseCountsMarkdownComment', () => { - test('it returns the expected comment when _all_ of the counts are greater than zero', () => { - expect( - getIlmExplainPhaseCountsMarkdownComment({ - hot: 99, - warm: 8, - unmanaged: 77, - cold: 6, - frozen: 55, - }) - ).toEqual('`hot(99)` `warm(8)` `unmanaged(77)` `cold(6)` `frozen(55)`'); - }); - - test('it returns the expected comment when _some_ of the counts are greater than zero', () => { - expect( - getIlmExplainPhaseCountsMarkdownComment({ - hot: 9, - warm: 0, - unmanaged: 2, - cold: 1, - frozen: 0, - }) - ).toEqual('`hot(9)` `unmanaged(2)` `cold(1)`'); - }); - - test('it returns the expected comment when _none_ of the counts are greater than zero', () => { - expect( - getIlmExplainPhaseCountsMarkdownComment({ - hot: 0, - warm: 0, - unmanaged: 0, - cold: 0, - frozen: 0, - }) - ).toEqual(''); - }); - }); - - describe('getPatternSummaryMarkdownComment', () => { - test('it returns the expected comment when the rollup contains results for all of the indices in the pattern', () => { - expect( - getPatternSummaryMarkdownComment({ - formatBytes, - formatNumber, - patternRollup: auditbeatWithAllResults, - }) - ).toEqual( - '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 19,127 |\n\n' - ); - }); - - test('it returns the expected comment when the rollup contains no results', () => { - expect( - getPatternSummaryMarkdownComment({ - formatBytes, - formatNumber, - patternRollup: auditbeatNoResults, - }) - ).toEqual( - '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| -- | 0 | 3 | 17.9MB | 19,127 |\n\n' - ); - }); - - test('it returns the expected comment when the rollup does NOT have `ilmExplainPhaseCounts`', () => { - const noIlmExplainPhaseCounts: PatternRollup = { - ...auditbeatWithAllResults, - ilmExplainPhaseCounts: undefined, // <-- - }; - - expect( - getPatternSummaryMarkdownComment({ - formatBytes, - formatNumber, - patternRollup: noIlmExplainPhaseCounts, - }) - ).toEqual( - '## auditbeat-*\n\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 19,127 |\n\n' - ); - }); - - test('it returns the expected comment when `docsCount` is undefined', () => { - const noDocsCount: PatternRollup = { - ...auditbeatWithAllResults, - docsCount: undefined, // <-- - }; - - expect( - getPatternSummaryMarkdownComment({ - formatBytes, - formatNumber, - patternRollup: noDocsCount, - }) - ).toEqual( - '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 0 |\n\n' - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts deleted file mode 100644 index bdbfdba4ddb35..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts +++ /dev/null @@ -1,416 +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 { - ERRORS_MAY_OCCUR, - ERRORS_CALLOUT_SUMMARY, - MANAGE, - MONITOR, - OR, - READ, - THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED, - VIEW_INDEX_METADATA, -} from '../../data_quality_summary/errors_popover/translations'; -import { - EMPTY_STAT, - getTotalPatternIncompatible, - getTotalPatternIndicesChecked, -} from '../../../helpers'; -import { SAME_FAMILY } from '../../same_family/translations'; -import { HOT, WARM, COLD, FROZEN, UNMANAGED } from '../../../ilm_phases_empty_prompt/translations'; -import * as i18n from '../translations'; -import type { - AllowedValue, - CustomFieldMetadata, - EcsBasedFieldMetadata, - EnrichedFieldMetadata, - ErrorSummary, - IlmExplainPhaseCounts, - IlmPhase, - PartitionedFieldMetadata, - PatternRollup, - UnallowedValueCount, -} from '../../../types'; -import { getDocsCountPercent } from '../../summary_table/helpers'; -import { - DOCS, - ILM_PHASE, - INCOMPATIBLE_FIELDS, - INDEX, - INDICES, - INDICES_CHECKED, - RESULT, - SIZE, -} from '../../summary_table/translations'; -import { DATA_QUALITY_TITLE } from '../../../translations'; - -export const EMPTY_PLACEHOLDER = '--'; - -export const TRIPLE_BACKTICKS = '```'; - -export const ECS_FIELD_REFERENCE_URL = - 'https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html'; - -/** The documentation link shown in the `Data Quality` dashboard */ -export const ECS_REFERENCE_URL = 'https://www.elastic.co/guide/en/ecs/current/ecs-reference.html'; -export const MAPPING_URL = - 'https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html'; - -export const escape = (content: string | undefined): string | undefined => - content != null ? content.replaceAll('\n', ' ').replaceAll('|', '\\|') : content; - -export const escapePreserveNewlines = (content: string | undefined): string | undefined => - content != null ? content.replaceAll('|', '\\|') : content; - -export const getHeaderSeparator = (headerText: string): string => '-'.repeat(headerText.length + 2); // 2 extra, for the spaces on both sides of the column name - -export const getMarkdownTableHeader = (headerNames: string[]) => ` -| ${headerNames.map((name) => `${escape(name)} | `).join('')} -|${headerNames.map((name) => `${getHeaderSeparator(name)}|`).join('')}`; - -export const getCodeFormattedValue = (value: string | undefined) => - `\`${escape(value ?? EMPTY_PLACEHOLDER)}\``; - -export const getAllowedValues = (allowedValues: AllowedValue[] | undefined): string => - allowedValues == null - ? getCodeFormattedValue(undefined) - : allowedValues.map((x) => getCodeFormattedValue(x.name)).join(', '); - -export const getIndexInvalidValues = (indexInvalidValues: UnallowedValueCount[]): string => - indexInvalidValues.length === 0 - ? getCodeFormattedValue(undefined) - : indexInvalidValues - .map(({ fieldName, count }) => `${getCodeFormattedValue(escape(fieldName))} (${count})`) - .join(', '); // newlines are instead joined with spaces - -export const getCustomMarkdownTableRows = (customFieldMetadata: CustomFieldMetadata[]): string => - customFieldMetadata - .map( - (x) => - `| ${escape(x.indexFieldName)} | ${getCodeFormattedValue( - x.indexFieldType - )} | ${getAllowedValues(undefined)} |` - ) - .join('\n'); - -export const getSameFamilyBadge = (ecsBasedFieldMetadata: EcsBasedFieldMetadata): string => - ecsBasedFieldMetadata.isInSameFamily ? getCodeFormattedValue(SAME_FAMILY) : ''; - -export const getIncompatibleMappingsMarkdownTableRows = ( - incompatibleMappings: EcsBasedFieldMetadata[] -): string => - incompatibleMappings - .map( - (x) => - `| ${escape(x.indexFieldName)} | ${getCodeFormattedValue(x.type)} | ${getCodeFormattedValue( - x.indexFieldType - )} ${getSameFamilyBadge(x)} |` - ) - .join('\n'); - -export const getIncompatibleValuesMarkdownTableRows = ( - incompatibleValues: EcsBasedFieldMetadata[] -): string => - incompatibleValues - .map( - (x) => - `| ${escape(x.indexFieldName)} | ${getAllowedValues( - x.allowed_values - )} | ${getIndexInvalidValues(x.indexInvalidValues)} |` - ) - .join('\n'); - -export const getMarkdownComment = ({ - suggestedAction, - title, -}: { - suggestedAction: string; - title: string; -}): string => - `#### ${escape(title)} - -${escapePreserveNewlines(suggestedAction)}`; - -export const getErrorsMarkdownTableRows = (errorSummary: ErrorSummary[]): string => - errorSummary - .map( - ({ pattern, indexName, error }) => - `| ${escape(pattern)} | ${escape(indexName ?? EMPTY_PLACEHOLDER)} | ${getCodeFormattedValue( - error - )} |` - ) - .join('\n'); - -export const getErrorsMarkdownTable = ({ - errorSummary, - getMarkdownTableRows, - headerNames, - title, -}: { - errorSummary: ErrorSummary[]; - getMarkdownTableRows: (errorSummary: ErrorSummary[]) => string; - headerNames: string[]; - title: string; -}): string => - errorSummary.length > 0 - ? `## ${escape(title)} - -${ERRORS_CALLOUT_SUMMARY} - -${ERRORS_MAY_OCCUR} - -${THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} -- \`${MONITOR}\` ${OR} \`${MANAGE}\` -- \`${VIEW_INDEX_METADATA}\` -- \`${READ}\` - -${getMarkdownTableHeader(headerNames)} -${getMarkdownTableRows(errorSummary)} -` - : ''; - -export const getMarkdownTable = ({ - enrichedFieldMetadata, - getMarkdownTableRows, - headerNames, - title, -}: { - enrichedFieldMetadata: T; - getMarkdownTableRows: (enrichedFieldMetadata: T) => string; - headerNames: string[]; - title: string; -}): string => - enrichedFieldMetadata.length > 0 - ? `#### ${escape(title)} - -${getMarkdownTableHeader(headerNames)} -${getMarkdownTableRows(enrichedFieldMetadata)} -` - : ''; - -export const getSummaryMarkdownComment = (indexName: string) => - `### ${escape(indexName)} -`; - -export const getTabCountsMarkdownComment = ( - partitionedFieldMetadata: PartitionedFieldMetadata -): string => - `### **${i18n.INCOMPATIBLE_FIELDS}** ${getCodeFormattedValue( - `${partitionedFieldMetadata.incompatible.length}` - )} **${i18n.SAME_FAMILY}** ${getCodeFormattedValue( - `${partitionedFieldMetadata.sameFamily.length}` - )} **${i18n.CUSTOM_FIELDS}** ${getCodeFormattedValue( - `${partitionedFieldMetadata.custom.length}` - )} **${i18n.ECS_COMPLIANT_FIELDS}** ${getCodeFormattedValue( - `${partitionedFieldMetadata.ecsCompliant.length}` - )} **${i18n.ALL_FIELDS}** ${getCodeFormattedValue(`${partitionedFieldMetadata.all.length}`)} -`; - -export const getResultEmoji = (incompatible: number | undefined): string => { - if (incompatible == null) { - return EMPTY_PLACEHOLDER; - } else { - return incompatible === 0 ? '✅' : '❌'; - } -}; - -export const getSummaryTableMarkdownHeader = (includeDocSize: boolean): string => - includeDocSize - ? `| ${RESULT} | ${INDEX} | ${DOCS} | ${INCOMPATIBLE_FIELDS} | ${ILM_PHASE} | ${SIZE} | -|${getHeaderSeparator(RESULT)}|${getHeaderSeparator(INDEX)}|${getHeaderSeparator( - DOCS - )}|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( - ILM_PHASE - )}|${getHeaderSeparator(SIZE)}|` - : `| ${RESULT} | ${INDEX} | ${DOCS} | ${INCOMPATIBLE_FIELDS} | -|${getHeaderSeparator(RESULT)}|${getHeaderSeparator(INDEX)}|${getHeaderSeparator( - DOCS - )}|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|`; - -export const getSummaryTableMarkdownRow = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - incompatible, - indexName, - isILMAvailable, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - incompatible: number | undefined; - indexName: string; - isILMAvailable: boolean; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string => - isILMAvailable && Number.isInteger(sizeInBytes) - ? `| ${getResultEmoji(incompatible)} | ${escape(indexName)} | ${formatNumber( - docsCount - )} (${getDocsCountPercent({ - docsCount, - patternDocsCount, - })}) | ${incompatible ?? EMPTY_PLACEHOLDER} | ${ - ilmPhase != null ? getCodeFormattedValue(ilmPhase) : EMPTY_PLACEHOLDER - } | ${formatBytes(sizeInBytes)} | -` - : `| ${getResultEmoji(incompatible)} | ${escape(indexName)} | ${formatNumber( - docsCount - )} (${getDocsCountPercent({ - docsCount, - patternDocsCount, - })}) | ${incompatible ?? EMPTY_PLACEHOLDER} | -`; - -export const getSummaryTableMarkdownComment = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isILMAvailable: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string => - `${getSummaryTableMarkdownHeader(isILMAvailable)} -${getSummaryTableMarkdownRow({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - incompatible: partitionedFieldMetadata.incompatible.length, - patternDocsCount, - sizeInBytes, -})} -`; - -export const getStatsRollupMarkdownComment = ({ - docsCount, - formatBytes, - formatNumber, - incompatible, - indices, - indicesChecked, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - incompatible: number | undefined; - indices: number | undefined; - indicesChecked: number | undefined; - sizeInBytes: number | undefined; -}): string => - Number.isInteger(sizeInBytes) - ? `| ${INCOMPATIBLE_FIELDS} | ${INDICES_CHECKED} | ${INDICES} | ${SIZE} | ${DOCS} | -|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( - INDICES_CHECKED - )}|${getHeaderSeparator(INDICES)}|${getHeaderSeparator(SIZE)}|${getHeaderSeparator(DOCS)}| -| ${incompatible ?? EMPTY_STAT} | ${indicesChecked ?? EMPTY_STAT} | ${ - indices ?? EMPTY_STAT - } | ${formatBytes(sizeInBytes)} | ${formatNumber(docsCount)} | -` - : `| ${INCOMPATIBLE_FIELDS} | ${INDICES_CHECKED} | ${INDICES} | ${DOCS} | -|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( - INDICES_CHECKED - )}|${getHeaderSeparator(INDICES)}|${getHeaderSeparator(DOCS)}| -| ${incompatible ?? EMPTY_STAT} | ${indicesChecked ?? EMPTY_STAT} | ${ - indices ?? EMPTY_STAT - } | ${formatNumber(docsCount)} | -`; - -export const getDataQualitySummaryMarkdownComment = ({ - formatBytes, - formatNumber, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - sizeInBytes, -}: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - totalDocsCount: number | undefined; - totalIncompatible: number | undefined; - totalIndices: number | undefined; - totalIndicesChecked: number | undefined; - sizeInBytes: number | undefined; -}): string => - `# ${DATA_QUALITY_TITLE} - -${getStatsRollupMarkdownComment({ - docsCount: totalDocsCount ?? 0, - formatBytes, - formatNumber, - incompatible: totalIncompatible, - indices: totalIndices, - indicesChecked: totalIndicesChecked, - sizeInBytes, -})} -`; - -export const getIlmExplainPhaseCountsMarkdownComment = ({ - hot, - warm, - unmanaged, - cold, - frozen, -}: IlmExplainPhaseCounts): string => - [ - hot > 0 ? getCodeFormattedValue(`${HOT}(${hot})`) : '', - warm > 0 ? getCodeFormattedValue(`${WARM}(${warm})`) : '', - unmanaged > 0 ? getCodeFormattedValue(`${UNMANAGED}(${unmanaged})`) : '', - cold > 0 ? getCodeFormattedValue(`${COLD}(${cold})`) : '', - frozen > 0 ? getCodeFormattedValue(`${FROZEN}(${frozen})`) : '', - ] - .filter((x) => x !== '') // prevents extra whitespace - .join(' '); - -export const getPatternSummaryMarkdownComment = ({ - formatBytes, - formatNumber, - patternRollup, - patternRollup: { docsCount, indices, ilmExplainPhaseCounts, pattern, results }, -}: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - patternRollup: PatternRollup; -}): string => - `## ${escape(pattern)} -${ - ilmExplainPhaseCounts != null - ? getIlmExplainPhaseCountsMarkdownComment(ilmExplainPhaseCounts) - : '' -} - -${getStatsRollupMarkdownComment({ - docsCount: docsCount ?? 0, - formatBytes, - formatNumber, - incompatible: getTotalPatternIncompatible(results), - indices, - indicesChecked: getTotalPatternIndicesChecked(patternRollup), - sizeInBytes: patternRollup.sizeInBytes, -})} -`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/translations.ts deleted file mode 100644 index e519cb234c62e..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/translations.ts +++ /dev/null @@ -1,486 +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 ADD_TO_NEW_CASE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.addToNewCaseButton', - { - defaultMessage: 'Add to new case', - } -); - -export const ALL_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allFieldsLabel', - { - defaultMessage: 'All fields', - } -); - -export const ALL_CALLOUT = (version: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCallout', { - values: { version }, - defaultMessage: - "All mappings for the fields in this index, including fields that comply with the Elastic Common Schema (ECS), version {version}, and fields that don't", - }); - -export const ALL_CALLOUT_TITLE = (fieldCount: number) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutTitle', - { - values: { fieldCount }, - defaultMessage: - 'All {fieldCount} {fieldCount, plural, =1 {field mapping} other {field mappings}}', - } - ); - -export const ALL_EMPTY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutEmptyContent', - { - defaultMessage: 'This index does not contain any mappings', - } -); - -export const ALL_EMPTY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutEmptyTitle', - { - defaultMessage: 'No mappings', - } -); - -export const ALL_FIELDS_TABLE_TITLE = (indexName: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.allTab.allFieldsTableTitle', { - values: { indexName }, - defaultMessage: 'All fields - {indexName}', - }); - -export const SUMMARY_MARKDOWN_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.summaryMarkdownTitle', - { - defaultMessage: 'Data quality', - } -); - -export const SUMMARY_MARKDOWN_DESCRIPTION = ({ - ecsFieldReferenceUrl, - ecsReferenceUrl, - indexName, - mappingUrl, - version, -}: { - ecsFieldReferenceUrl: string; - ecsReferenceUrl: string; - indexName: string; - mappingUrl: string; - version: string; -}) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.summaryMarkdownDescription', - { - values: { ecsFieldReferenceUrl, ecsReferenceUrl, indexName, mappingUrl, version }, - defaultMessage: - 'The `{indexName}` index has [mappings]({mappingUrl}) or field values that are different than the [Elastic Common Schema]({ecsReferenceUrl}) (ECS), version `{version}` [definitions]({ecsFieldReferenceUrl}).', - } - ); - -export const COPY_TO_CLIPBOARD = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.copyToClipboardButton', - { - defaultMessage: 'Copy to clipboard', - } -); - -export const CUSTOM_FIELDS_TABLE_TITLE = (indexName: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.customTab.customFieldsTableTitle', - { - values: { indexName }, - defaultMessage: 'Custom fields - {indexName}', - } - ); - -export const CUSTOM_DETECTION_ENGINE_RULES_WORK = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.custonDetectionEngineRulesWorkMessage', - { - defaultMessage: '✅ Custom detection engine rules work', - } -); - -export const DOCS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.docsLabel', - { - defaultMessage: 'Docs', - } -); - -export const ECS_COMPLIANT_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantFieldsLabel', - { - defaultMessage: 'ECS compliant fields', - } -); - -export const ECS_COMPLIANT_CALLOUT = ({ - fieldCount, - version, -}: { - fieldCount: number; - version: string; -}) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantCallout', - { - values: { fieldCount, version }, - defaultMessage: - 'The {fieldCount, plural, =1 {index mapping type and document values for this field comply} other {index mapping types and document values of these fields comply}} with the Elastic Common Schema (ECS), version {version}', - } - ); - -export const ECS_COMPLIANT_CALLOUT_TITLE = (fieldCount: number) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantCalloutTitle', - { - values: { fieldCount }, - defaultMessage: '{fieldCount} ECS compliant {fieldCount, plural, =1 {field} other {fields}}', - } - ); - -export const ECS_COMPLIANT_EMPTY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantEmptyContent', - { - defaultMessage: - 'None of the field mappings in this index comply with the Elastic Common Schema (ECS). The index must (at least) contain an @timestamp date field.', - } -); - -export const ECS_VERSION_MARKDOWN_COMMENT = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsVersionMarkdownComment', - { - defaultMessage: 'Elastic Common Schema (ECS) version', - } -); - -export const INDEX = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.indexMarkdown', - { - defaultMessage: 'Index', - } -); - -export const ECS_COMPLIANT_EMPTY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantEmptyTitle', - { - defaultMessage: 'No ECS compliant Mappings', - } -); - -export const ECS_COMPLIANT_MAPPINGS_ARE_FULLY_SUPPORTED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantMappingsAreFullySupportedMessage', - { - defaultMessage: '✅ ECS compliant mappings and field values are fully supported', - } -); - -export const ERROR_LOADING_MAPPINGS_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMappingsTitle', - { - defaultMessage: 'Unable to load index mappings', - } -); - -export const ERROR_LOADING_MAPPINGS_BODY = (error: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMappingsBody', - { - values: { error }, - defaultMessage: 'There was a problem loading mappings: {error}', - } - ); - -export const ERROR_LOADING_UNALLOWED_VALUES_BODY = (error: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingUnallowedValuesBody', - { - values: { error }, - defaultMessage: 'There was a problem loading unallowed values: {error}', - } - ); - -export const ERROR_LOADING_UNALLOWED_VALUES_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingUnallowedValuesTitle', - { - defaultMessage: 'Unable to load unallowed values', - } -); - -export const ECS_COMPLIANT_FIELDS_TABLE_TITLE = (indexName: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.customTab.ecsComplaintFieldsTableTitle', - { - values: { indexName }, - defaultMessage: 'ECS complaint fields - {indexName}', - } - ); - -export const LOADING_MAPPINGS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingMappingsPrompt', - { - defaultMessage: 'Loading mappings', - } -); - -export const LOADING_UNALLOWED_VALUES = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingUnallowedValuesPrompt', - { - defaultMessage: 'Loading unallowed values', - } -); - -export const SUMMARY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.summaryTab', - { - defaultMessage: 'Summary', - } -); - -export const MISSING_TIMESTAMP_CALLOUT = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.missingTimestampCallout', - { - defaultMessage: - 'Consider adding an @timestamp (date) field mapping to this index, as required by the Elastic Common Schema (ECS), because:', - } -); - -export const MISSING_TIMESTAMP_CALLOUT_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.missingTimestampCalloutTitle', - { - defaultMessage: 'Missing an @timestamp (date) field mapping for this index', - } -); - -export const CUSTOM_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customFieldsLabel', - { - defaultMessage: 'Custom fields', - } -); - -export const CUSTOM_CALLOUT = ({ fieldCount, version }: { fieldCount: number; version: string }) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customCallout', { - values: { fieldCount, version }, - defaultMessage: - '{fieldCount, plural, =1 {This field is not} other {These fields are not}} defined by the Elastic Common Schema (ECS), version {version}.', - }); - -export const SAME_FAMILY_CALLOUT = ({ - fieldCount, - version, -}: { - fieldCount: number; - version: string; -}) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyCallout', - { - values: { fieldCount, version }, - defaultMessage: - "{fieldCount, plural, =1 {This field is} other {These fields are}} defined by the Elastic Common Schema (ECS), version {version}, but {fieldCount, plural, =1 {its mapping type doesn't} other {their mapping types don't}} exactly match.", - } - ); - -export const CUSTOM_CALLOUT_TITLE = (fieldCount: number) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customCalloutTitle', - { - values: { fieldCount }, - defaultMessage: - '{fieldCount} Custom {fieldCount, plural, =1 {field mapping} other {field mappings}}', - } - ); - -export const SAME_FAMILY_CALLOUT_TITLE = (fieldCount: number) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyCalloutTitle', - { - values: { fieldCount }, - defaultMessage: - '{fieldCount} Same family {fieldCount, plural, =1 {field mapping} other {field mappings}}', - } - ); - -export const CUSTOM_EMPTY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customEmptyContent', - { - defaultMessage: 'All the field mappings in this index are defined by the Elastic Common Schema', - } -); - -export const CUSTOM_EMPTY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customEmptyTitle', - { - defaultMessage: 'All field mappings defined by ECS', - } -); - -export const INCOMPATIBLE_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleFieldsTab', - { - defaultMessage: 'Incompatible fields', - } -); - -export const INCOMPATIBLE_CALLOUT = (version: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout', - { - values: { version }, - defaultMessage: - "Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version {version}.", - } - ); - -export const FIELDS_WITH_MAPPINGS_SAME_FAMILY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout.fieldsWithMappingsSameFamilyLabel', - { - defaultMessage: - 'Fields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics.', - } -); - -export const WHEN_A_FIELD_IS_INCOMPATIBLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout.whenAFieldIsIncompatibleLabel', - { - defaultMessage: 'When a field is incompatible:', - } -); - -export const INCOMPATIBLE_CALLOUT_TITLE = (fieldCount: number) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCalloutTitle', - { - values: { fieldCount }, - defaultMessage: '{fieldCount} incompatible {fieldCount, plural, =1 {field} other {fields}}', - } - ); - -export const INCOMPATIBLE_EMPTY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleEmptyContent', - { - defaultMessage: - 'All of the field mappings and document values in this index are compliant with the Elastic Common Schema (ECS).', - } -); - -export const INCOMPATIBLE_EMPTY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleEmptyTitle', - { - defaultMessage: 'All field mappings and values are ECS compliant', - } -); - -export const DETECTION_ENGINE_RULES_WILL_WORK = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.detectionEngineRulesWillWorkMessage', - { - defaultMessage: '✅ Detection engine rules will work for these fields', - } -); - -export const DETECTION_ENGINE_RULES_MAY_NOT_MATCH = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.detectionEngineRulesWontWorkMessage', - { - defaultMessage: - '❌ Detection engine rules referencing these fields may not match them correctly', - } -); - -export const OTHER_APP_CAPABILITIES_WORK_PROPERLY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.otherAppCapabilitiesWorkProperlyMessage', - { - defaultMessage: '✅ Other app capabilities work properly', - } -); - -export const SAME_FAMILY_EMPTY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyEmptyContent', - { - defaultMessage: - 'All of the field mappings and document values in this index are compliant with the Elastic Common Schema (ECS).', - } -); - -export const SAME_FAMILY_EMPTY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyEmptyTitle', - { - defaultMessage: 'All field mappings and values are ECS compliant', - } -); - -export const PAGES_DISPLAY_EVENTS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesDisplayEventsMessage', - { - defaultMessage: '✅ Pages display events and fields correctly', - } -); - -export const PAGES_MAY_NOT_DISPLAY_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesMayNotDisplayFieldsMessage', - { - defaultMessage: '🌕 Some pages and features may not display these fields', - } -); - -export const PAGES_MAY_NOT_DISPLAY_EVENTS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesMayNotDisplayEventsMessage', - { - defaultMessage: - '❌ Pages may not display some events or fields due to unexpected field mappings or values', - } -); - -export const PRE_BUILT_DETECTION_ENGINE_RULES_WORK = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.preBuiltDetectionEngineRulesWorkMessage', - { - defaultMessage: '✅ Pre-built detection engine rules work', - } -); - -export const ECS_IS_A_PERMISSIVE_SCHEMA = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsIsAPermissiveSchemaMessage', - { - defaultMessage: - 'ECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.', - } -); - -export const SAME_FAMILY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyTab', - { - defaultMessage: 'Same family', - } -); - -export const SOMETIMES_INDICES_CREATED_BY_OLDER = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sometimesIndicesCreatedByOlderDescription', - { - defaultMessage: - 'Sometimes, indices created by older integrations will have mappings or values that were, but are no longer compliant.', - } -); - -export const MAPPINGS_THAT_CONFLICT_WITH_ECS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.mappingThatConflictWithEcsMessage', - { - defaultMessage: "❌ Mappings or field values that don't comply with ECS are not supported", - } -); - -export const UNKNOWN = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.unknownCategoryLabel', - { - defaultMessage: 'Unknown', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts deleted file mode 100644 index efc4f3a5a5092..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts +++ /dev/null @@ -1,1017 +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 { - IlmExplainLifecycleLifecycleExplain, - IlmExplainLifecycleLifecycleExplainManaged, - IlmExplainLifecycleLifecycleExplainUnmanaged, -} from '@elastic/elasticsearch/lib/api/types'; - -import { - defaultSort, - getIlmPhase, - getIndexPropertiesContainerId, - getIlmExplainPhaseCounts, - getIndexIncompatible, - getPageIndex, - getPhaseCount, - getSummaryTableItems, - isManaged, - shouldCreateIndexNames, - shouldCreatePatternRollup, -} from './helpers'; -import { mockIlmExplain } from '../../mock/ilm_explain/mock_ilm_explain'; -import { mockDataQualityCheckResult } from '../../mock/data_quality_check_result/mock_index'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from '../../mock/stats/mock_stats'; -import { IndexSummaryTableItem } from '../summary_table/helpers'; -import { DataQualityCheckResult } from '../../types'; -import { getIndexNames, getTotalDocsCount } from '../../helpers'; - -const hot: IlmExplainLifecycleLifecycleExplainManaged = { - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536751379, - time_since_index_creation: '3.98d', - lifecycle_date_millis: 1675536751379, - age: '3.98d', - phase: 'hot', - phase_time_millis: 1675536751809, - action: 'rollover', - action_time_millis: 1675536751809, - step: 'check-rollover-ready', - step_time_millis: 1675536751809, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, -}; -const warm = { - ...hot, - phase: 'warm', -}; -const cold = { - ...hot, - phase: 'cold', -}; -const frozen = { - ...hot, - phase: 'frozen', -}; -const other = { - ...hot, - phase: 'other', // not a valid phase -}; - -const managed: Record = { - hot, - warm, - cold, - frozen, -}; - -const unmanaged: IlmExplainLifecycleLifecycleExplainUnmanaged = { - index: 'michael', - managed: false, -}; - -describe('helpers', () => { - const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; - - describe('isManaged', () => { - test('it returns true when the `ilmExplainRecord` `managed` property is true', () => { - const ilmExplain = mockIlmExplain[indexName]; - - expect(isManaged(ilmExplain)).toBe(true); - }); - - test('it returns false when the `ilmExplainRecord` is undefined', () => { - expect(isManaged(undefined)).toBe(false); - }); - }); - - describe('getPhaseCount', () => { - test('it returns the expected count when an index with the specified `ilmPhase` exists in the `IlmExplainLifecycleLifecycleExplain` record', () => { - expect( - getPhaseCount({ - ilmExplain: mockIlmExplain, - ilmPhase: 'hot', // this phase is in the record - indexName, // valid index name - }) - ).toEqual(1); - }); - - test('it returns zero when `ilmPhase` is null', () => { - expect( - getPhaseCount({ - ilmExplain: null, - ilmPhase: 'hot', - indexName, - }) - ).toEqual(0); - }); - - test('it returns zero when the `indexName` does NOT exist in the `IlmExplainLifecycleLifecycleExplain` record', () => { - expect( - getPhaseCount({ - ilmExplain: mockIlmExplain, - ilmPhase: 'hot', - indexName: 'invalid', // this index does NOT exist - }) - ).toEqual(0); - }); - - test('it returns zero when the specified `ilmPhase` does NOT exist in the `IlmExplainLifecycleLifecycleExplain` record', () => { - expect( - getPhaseCount({ - ilmExplain: mockIlmExplain, - ilmPhase: 'warm', // this phase is NOT in the record - indexName, // valid index name - }) - ).toEqual(0); - }); - - describe('when `ilmPhase` is `unmanaged`', () => { - test('it returns the expected count for an `unmanaged` index', () => { - const index = 'auditbeat-custom-index-1'; - const ilmExplainRecord: IlmExplainLifecycleLifecycleExplain = { - index, - managed: false, - }; - const ilmExplain = { - [index]: ilmExplainRecord, - }; - - expect( - getPhaseCount({ - ilmExplain, - ilmPhase: 'unmanaged', // ilmPhase is unmanaged - indexName: index, // an unmanaged index - }) - ).toEqual(1); - }); - - test('it returns zero for a managed index', () => { - expect( - getPhaseCount({ - ilmExplain: mockIlmExplain, - ilmPhase: 'unmanaged', // ilmPhase is unmanaged - indexName, // a managed (`hot`) index - }) - ).toEqual(0); - }); - }); - }); - - describe('getIlmPhase', () => { - const isILMAvailable = true; - test('it returns undefined when the `ilmExplainRecord` is undefined', () => { - expect(getIlmPhase(undefined, isILMAvailable)).toBeUndefined(); - }); - - describe('when the `ilmExplainRecord` is a `IlmExplainLifecycleLifecycleExplainManaged` record', () => { - Object.keys(managed).forEach((phase) => - test(`it returns the expected phase when 'phase' is '${phase}'`, () => { - expect(getIlmPhase(managed[phase], isILMAvailable)).toEqual(phase); - }) - ); - - test(`it returns undefined when the 'phase' is unknown`, () => { - expect(getIlmPhase(other, isILMAvailable)).toBeUndefined(); - }); - }); - - describe('when the `ilmExplainRecord` is a `IlmExplainLifecycleLifecycleExplainUnmanaged` record', () => { - test('it returns `unmanaged`', () => { - expect(getIlmPhase(unmanaged, isILMAvailable)).toEqual('unmanaged'); - }); - }); - }); - - describe('getIlmExplainPhaseCounts', () => { - test('it returns the expected counts (all zeros) when `ilmExplain` is null', () => { - expect(getIlmExplainPhaseCounts(null)).toEqual({ - cold: 0, - frozen: 0, - hot: 0, - unmanaged: 0, - warm: 0, - }); - }); - - test('it returns the expected counts', () => { - const ilmExplain: Record = { - ...managed, - [unmanaged.index]: unmanaged, - }; - - expect(getIlmExplainPhaseCounts(ilmExplain)).toEqual({ - cold: 1, - frozen: 1, - hot: 1, - unmanaged: 1, - warm: 1, - }); - }); - }); - - describe('getIndexIncompatible', () => { - test('it returns undefined when `results` is undefined', () => { - expect( - getIndexIncompatible({ - indexName, - results: undefined, // <-- - }) - ).toBeUndefined(); - }); - - test('it returns undefined when `indexName` is not in the `results`', () => { - expect( - getIndexIncompatible({ - indexName: 'not_in_the_results', // <-- - results: mockDataQualityCheckResult, - }) - ).toBeUndefined(); - }); - - test('it returns the expected count', () => { - expect( - getIndexIncompatible({ - indexName: 'auditbeat-custom-index-1', - results: mockDataQualityCheckResult, - }) - ).toEqual(3); - }); - }); - - describe('getSummaryTableItems', () => { - const indexNames = [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - 'auditbeat-custom-index-1', - ]; - const pattern = 'auditbeat-*'; - const patternDocsCount = 4; - const results: Record = { - 'auditbeat-custom-index-1': { - docsCount: 4, - error: null, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - markdownComments: [ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase |\n|--------|-------|------|---------------------|-----------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` |\n\n', - '### **Incompatible fields** `3` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - "#### 3 incompatible fields, 0 fields with mappings in the same family\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.1.\n\nIncompatible fields with mappings in the same family have exactly the same search behavior but may have different space usage or performance characteristics.\n\nWhen an incompatible field is not in the same family:\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n", - '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2),\n`theory` (1) |\n\n', - ], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: 1706526408000, - }, - }; - const isILMAvailable = true; - - test('it returns the expected summary table items', () => { - expect( - getSummaryTableItems({ - ilmExplain: mockIlmExplain, - indexNames, - isILMAvailable, - pattern, - patternDocsCount, - results, - sortByColumn: defaultSort.sort.field, - sortByDirection: defaultSort.sort.direction, - stats: mockStats, - }) - ).toEqual([ - { - docsCount: 1630289, - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 733175040, - checkedAt: undefined, - }, - { - docsCount: 1628343, - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 731583142, - checkedAt: undefined, - }, - { - docsCount: 4, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 28413, - checkedAt: 1706526408000, - }, - ]); - }); - - test('it returns the expected summary table items when isILMAvailable is false', () => { - expect( - getSummaryTableItems({ - ilmExplain: mockIlmExplain, - indexNames, - isILMAvailable: false, - pattern, - patternDocsCount, - results, - sortByColumn: defaultSort.sort.field, - sortByDirection: defaultSort.sort.direction, - stats: mockStats, - }) - ).toEqual([ - { - docsCount: 1630289, - ilmPhase: undefined, - incompatible: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 733175040, - checkedAt: undefined, - }, - { - docsCount: 1628343, - ilmPhase: undefined, - incompatible: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 731583142, - checkedAt: undefined, - }, - { - docsCount: 4, - ilmPhase: undefined, - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 28413, - checkedAt: 1706526408000, - }, - ]); - }); - - test('it returns the expected summary table items when `sortByDirection` is ascending', () => { - expect( - getSummaryTableItems({ - ilmExplain: mockIlmExplain, - indexNames, - isILMAvailable, - pattern, - patternDocsCount, - results, - sortByColumn: defaultSort.sort.field, - sortByDirection: 'asc', // <-- ascending - stats: mockStats, - }) - ).toEqual([ - { - docsCount: 4, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 28413, - checkedAt: 1706526408000, - }, - { - docsCount: 1628343, - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 731583142, - checkedAt: undefined, - }, - { - docsCount: 1630289, - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: 733175040, - checkedAt: undefined, - }, - ]); - }); - - test('it returns the expected summary table items when data is unavailable', () => { - expect( - getSummaryTableItems({ - ilmExplain: null, // <-- no data - indexNames, - isILMAvailable, - pattern, - patternDocsCount, - results: undefined, // <-- no data - sortByColumn: defaultSort.sort.field, - sortByDirection: defaultSort.sort.direction, - stats: null, // <-- no data - }) - ).toEqual([ - { - docsCount: 0, - ilmPhase: undefined, - incompatible: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: undefined, - checkedAt: undefined, - }, - { - docsCount: 0, - ilmPhase: undefined, - incompatible: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: undefined, - checkedAt: undefined, - }, - { - docsCount: 0, - ilmPhase: undefined, - incompatible: undefined, - indexName: 'auditbeat-custom-index-1', - pattern: 'auditbeat-*', - patternDocsCount: 4, - sizeInBytes: undefined, - checkedAt: undefined, - }, - ]); - }); - }); - - describe('shouldCreateIndexNames', () => { - const indexNames = [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - 'auditbeat-custom-index-1', - ]; - const isILMAvailable = true; - - test('returns true when `indexNames` does NOT exist, and the required `stats` and `ilmExplain` are available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: mockIlmExplain, - indexNames: undefined, - isILMAvailable, - newIndexNames: [], - stats: mockStats, - }) - ).toBe(true); - }); - - test('returns true when `isILMAvailable` is false, and the required `stats` is available, and `ilmExplain` is not available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: null, - indexNames: undefined, - isILMAvailable: false, - newIndexNames: [], - stats: mockStats, - }) - ).toBe(true); - }); - - test('returns false when `indexNames` exists, and the required `stats` and `ilmExplain` are available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: mockIlmExplain, - indexNames, - isILMAvailable, - newIndexNames: indexNames, - stats: mockStats, - }) - ).toBe(false); - }); - - test('returns false when `indexNames` does NOT exist, `stats` is NOT available, and `ilmExplain` is available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: mockIlmExplain, - indexNames: undefined, - isILMAvailable, - newIndexNames: [], - stats: null, - }) - ).toBe(false); - }); - - test('returns false when `indexNames` does NOT exist, `stats` is available, and `ilmExplain` is NOT available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: null, - indexNames: undefined, - isILMAvailable, - newIndexNames: [], - stats: mockStats, - }) - ).toBe(false); - }); - - test('returns false when `indexNames` does NOT exist, `stats` is NOT available, and `ilmExplain` is NOT available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: null, - indexNames: undefined, - isILMAvailable, - newIndexNames: [], - stats: null, - }) - ).toBe(false); - }); - - test('returns false when `indexNames` exists, `stats` is NOT available, and `ilmExplain` is NOT available', () => { - expect( - shouldCreateIndexNames({ - ilmExplain: null, - indexNames, - isILMAvailable, - newIndexNames: [], - stats: null, - }) - ).toBe(false); - }); - }); - - describe('shouldCreatePatternRollup', () => { - const isILMAvailable = true; - const newIndexNames = getIndexNames({ - stats: mockStats, - ilmExplain: mockIlmExplain, - ilmPhases: ['hot', 'unmanaged'], - isILMAvailable, - }); - const newDocsCount = getTotalDocsCount({ indexNames: newIndexNames, stats: mockStats }); - test('it returns false when the `patternRollup.docsCount` equals newDocsCount', () => { - expect( - shouldCreatePatternRollup({ - error: null, - ilmExplain: mockIlmExplain, - isILMAvailable, - newDocsCount: auditbeatWithAllResults.docsCount as number, - patternRollup: auditbeatWithAllResults, - stats: mockStats, - }) - ).toBe(false); - }); - - test('it returns true when all data and ILMExplain were loaded', () => { - expect( - shouldCreatePatternRollup({ - error: null, - ilmExplain: mockIlmExplain, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: mockStats, - }) - ).toBe(true); - }); - - test('it returns true when all data was loaded and ILM is not available', () => { - expect( - shouldCreatePatternRollup({ - error: null, - ilmExplain: null, - isILMAvailable: false, - newDocsCount, - patternRollup: undefined, - stats: mockStats, - }) - ).toBe(true); - }); - - test('it returns false when `stats`, but NOT `ilmExplain` was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: null, - ilmExplain: null, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: mockStats, - }) - ).toBe(false); - }); - - test('it returns false when `stats` was NOT loaded, and `ilmExplain` was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: null, - ilmExplain: mockIlmExplain, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: null, - }) - ).toBe(false); - }); - - test('it returns true if an error occurred, and NO data was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: 'whoops', - ilmExplain: null, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: null, - }) - ).toBe(true); - }); - - test('it returns true if an error occurred, and just `stats` was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: 'something went', - ilmExplain: null, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: mockStats, - }) - ).toBe(true); - }); - - test('it returns true if an error occurred, and just `ilmExplain` was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: 'horribly wrong', - ilmExplain: mockIlmExplain, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: null, - }) - ).toBe(true); - }); - - test('it returns true if an error occurred, and all data was loaded', () => { - expect( - shouldCreatePatternRollup({ - error: 'over here', - ilmExplain: mockIlmExplain, - isILMAvailable, - newDocsCount, - patternRollup: undefined, - stats: mockStats, - }) - ).toBe(true); - }); - }); - - describe('getIndexPropertiesContainerId', () => { - const pattern = 'auditbeat-*'; - - test('it returns the expected id', () => { - expect(getIndexPropertiesContainerId({ indexName, pattern })).toEqual( - 'index-properties-container-auditbeat-*.ds-packetbeat-8.6.1-2023.02.04-000001' - ); - }); - }); - - describe('getPageIndex', () => { - const getPageIndexArgs: { - indexName: string; - items: IndexSummaryTableItem[]; - pageSize: number; - } = { - indexName: 'auditbeat-7.17.9-2023.04.09-000001', // <-- on page 2 of 3 (page index 1) - items: [ - { - docsCount: 48077, - incompatible: undefined, - indexName: 'auditbeat-7.14.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 43357342, - checkedAt: 1706526408000, - }, - { - docsCount: 48068, - incompatible: undefined, - indexName: 'auditbeat-7.3.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 32460397, - checkedAt: 1706526408000, - }, - { - docsCount: 48064, - incompatible: undefined, - indexName: 'auditbeat-7.11.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 42782794, - checkedAt: 1706526408000, - }, - { - docsCount: 47868, - incompatible: undefined, - indexName: 'auditbeat-7.6.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 31575964, - checkedAt: 1706526408000, - }, - { - docsCount: 47827, - incompatible: 20, - indexName: 'auditbeat-7.15.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 44130657, - checkedAt: 1706526408000, - }, - { - docsCount: 47642, - incompatible: undefined, - indexName: '.ds-auditbeat-8.4.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 42412521, - checkedAt: 1706526408000, - }, - { - docsCount: 47545, - incompatible: undefined, - indexName: 'auditbeat-7.16.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41423244, - checkedAt: 1706526408000, - }, - { - docsCount: 47531, - incompatible: undefined, - indexName: 'auditbeat-7.5.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 32394133, - checkedAt: 1706526408000, - }, - { - docsCount: 47530, - incompatible: undefined, - indexName: 'auditbeat-7.12.1-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 43015519, - checkedAt: 1706526408000, - }, - { - docsCount: 47520, - incompatible: undefined, - indexName: '.ds-auditbeat-8.0.1-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 42230604, - checkedAt: 1706526408000, - }, - { - docsCount: 47496, - incompatible: undefined, - indexName: '.ds-auditbeat-8.2.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41710968, - checkedAt: 1706526408000, - }, - { - docsCount: 47486, - incompatible: undefined, - indexName: '.ds-auditbeat-8.5.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 42295944, - checkedAt: 1706526408000, - }, - { - docsCount: 47486, - incompatible: undefined, - indexName: '.ds-auditbeat-8.3.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41761321, - checkedAt: 1706526408000, - }, - { - docsCount: 47460, - incompatible: undefined, - indexName: 'auditbeat-7.2.1-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 30481198, - checkedAt: 1706526408000, - }, - { - docsCount: 47439, - incompatible: undefined, - indexName: 'auditbeat-7.17.9-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41554041, - checkedAt: 1706526408000, - }, - { - docsCount: 47395, - incompatible: undefined, - indexName: 'auditbeat-7.9.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 42815907, - checkedAt: 1706526408000, - }, - { - docsCount: 47394, - incompatible: undefined, - indexName: '.ds-auditbeat-8.7.0-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41157112, - checkedAt: 1706526408000, - }, - { - docsCount: 47372, - incompatible: undefined, - indexName: 'auditbeat-7.4.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 31626792, - checkedAt: 1706526408000, - }, - { - docsCount: 47369, - incompatible: undefined, - indexName: 'auditbeat-7.13.4-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41828969, - checkedAt: 1706526408000, - }, - { - docsCount: 47348, - incompatible: undefined, - indexName: 'auditbeat-7.7.1-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 40010773, - checkedAt: 1706526408000, - }, - { - docsCount: 47339, - incompatible: undefined, - indexName: 'auditbeat-7.10.2-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 43480570, - checkedAt: 1706526408000, - }, - { - docsCount: 47325, - incompatible: undefined, - indexName: '.ds-auditbeat-8.1.3-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 41822475, - checkedAt: 1706526408000, - }, - { - docsCount: 47294, - incompatible: undefined, - indexName: 'auditbeat-7.8.0-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 43018490, - checkedAt: 1706526408000, - }, - { - docsCount: 24276, - incompatible: undefined, - indexName: '.ds-auditbeat-8.6.1-2023.04.09-000001', - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 23579440, - checkedAt: 1706526408000, - }, - { - docsCount: 4, - incompatible: undefined, - indexName: 'auditbeat-custom-index-1', - ilmPhase: 'unmanaged', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 28409, - checkedAt: 1706526408000, - }, - { - docsCount: 0, - incompatible: undefined, - indexName: 'auditbeat-custom-empty-index-1', - ilmPhase: 'unmanaged', - pattern: 'auditbeat-*', - patternDocsCount: 1118155, - sizeInBytes: 247, - checkedAt: 1706526408000, - }, - ], - pageSize: 10, - }; - - test('it returns the expected page index', () => { - expect(getPageIndex(getPageIndexArgs)).toEqual(1); - }); - - test('it returns the expected page index for the first item', () => { - const firstItemIndexName = 'auditbeat-7.14.2-2023.04.09-000001'; - - expect( - getPageIndex({ - ...getPageIndexArgs, - indexName: firstItemIndexName, - }) - ).toEqual(0); - }); - - test('it returns the expected page index for the last item', () => { - const lastItemIndexName = 'auditbeat-custom-empty-index-1'; - - expect( - getPageIndex({ - ...getPageIndexArgs, - indexName: lastItemIndexName, - }) - ).toEqual(2); - }); - - test('it returns null when the index cannot be found', () => { - expect( - getPageIndex({ - ...getPageIndexArgs, - indexName: 'does_not_exist', // <-- this index is not in the items - }) - ).toBeNull(); - }); - - test('it returns null when `pageSize` is zero', () => { - expect( - getPageIndex({ - ...getPageIndexArgs, - pageSize: 0, // <-- invalid - }) - ).toBeNull(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts deleted file mode 100644 index 1c64e1eb00958..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts +++ /dev/null @@ -1,258 +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 type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; -import { isEqual, orderBy } from 'lodash/fp'; - -import type { IndexSummaryTableItem } from '../summary_table/helpers'; -import type { - IlmPhase, - IlmExplainPhaseCounts, - DataQualityCheckResult, - PatternRollup, - SortConfig, - MeteringStatsIndex, -} from '../../types'; -import { getDocsCount, getSizeInBytes } from '../../helpers'; - -export const isManaged = ( - ilmExplainRecord: IlmExplainLifecycleLifecycleExplain | undefined -): boolean => ilmExplainRecord?.managed === true; - -export const getPhaseCount = ({ - ilmExplain, - ilmPhase, - indexName, -}: { - ilmExplain: Record | null; - ilmPhase: IlmPhase; - indexName: string; -}): number => { - const ilmExplainRecord = ilmExplain != null ? ilmExplain[indexName] : undefined; - - if (ilmPhase === 'unmanaged') { - return isManaged(ilmExplainRecord) ? 0 : 1; - } else if (ilmExplainRecord != null && 'phase' in ilmExplainRecord) { - return ilmExplainRecord.phase === ilmPhase ? 1 : 0; - } - - return 0; -}; - -export const getIlmPhase = ( - ilmExplainRecord: IlmExplainLifecycleLifecycleExplain | undefined, - isILMAvailable: boolean -): IlmPhase | undefined => { - if (ilmExplainRecord == null || !isILMAvailable) { - return undefined; - } - - if ('phase' in ilmExplainRecord) { - const phase = ilmExplainRecord.phase; - - switch (phase) { - case 'hot': - return 'hot'; - case 'warm': - return 'warm'; - case 'cold': - return 'cold'; - case 'frozen': - return 'frozen'; - default: - return undefined; - } - } else { - return 'unmanaged'; - } -}; - -export const getIlmExplainPhaseCounts = ( - ilmExplain: Record | null -): IlmExplainPhaseCounts => { - const indexNames = ilmExplain != null ? Object.keys(ilmExplain) : []; - - return indexNames.reduce( - (acc, indexName) => ({ - hot: - acc.hot + - getPhaseCount({ - ilmExplain, - ilmPhase: 'hot', - indexName, - }), - warm: - acc.warm + - getPhaseCount({ - ilmExplain, - ilmPhase: 'warm', - indexName, - }), - cold: - acc.cold + - getPhaseCount({ - ilmExplain, - ilmPhase: 'cold', - indexName, - }), - frozen: - acc.frozen + - getPhaseCount({ - ilmExplain, - ilmPhase: 'frozen', - indexName, - }), - unmanaged: - acc.unmanaged + - getPhaseCount({ - ilmExplain, - ilmPhase: 'unmanaged', - indexName, - }), - }), - { - hot: 0, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 0, - } - ); -}; - -export const getIndexIncompatible = ({ - indexName, - results, -}: { - indexName: string; - results: Record | undefined; -}): number | undefined => { - if (results == null || results[indexName] == null) { - return undefined; - } - - return results[indexName].incompatible; -}; - -export const getSummaryTableItems = ({ - ilmExplain, - indexNames, - isILMAvailable, - pattern, - patternDocsCount, - results, - sortByColumn, - sortByDirection, - stats, -}: { - ilmExplain: Record | null; - indexNames: string[]; - isILMAvailable: boolean; - pattern: string; - patternDocsCount: number; - results: Record | undefined; - sortByColumn: string; - sortByDirection: 'desc' | 'asc'; - stats: Record | null; -}): IndexSummaryTableItem[] => { - const summaryTableItems = indexNames.map((indexName) => ({ - docsCount: getDocsCount({ stats, indexName }), - incompatible: getIndexIncompatible({ indexName, results }), - indexName, - ilmPhase: - isILMAvailable && ilmExplain != null - ? getIlmPhase(ilmExplain[indexName], isILMAvailable) - : undefined, - pattern, - patternDocsCount, - sizeInBytes: getSizeInBytes({ stats, indexName }), - checkedAt: results?.[indexName]?.checkedAt, - })); - - return orderBy([sortByColumn], [sortByDirection], summaryTableItems); -}; - -export const shouldCreateIndexNames = ({ - ilmExplain, - indexNames, - isILMAvailable, - newIndexNames, - stats, -}: { - ilmExplain: Record | null; - indexNames: string[] | undefined; - isILMAvailable: boolean; - newIndexNames: string[]; - stats: Record | null; -}): boolean => { - return ( - !isEqual(newIndexNames, indexNames) && - stats != null && - ((isILMAvailable && ilmExplain != null) || !isILMAvailable) - ); -}; - -export const shouldCreatePatternRollup = ({ - error, - ilmExplain, - isILMAvailable, - newDocsCount, - patternRollup, - stats, -}: { - error: string | null; - ilmExplain: Record | null; - isILMAvailable: boolean; - newDocsCount: number; - patternRollup: PatternRollup | undefined; - stats: Record | null; -}): boolean => { - if (patternRollup?.docsCount === newDocsCount) { - return false; - } - - const allDataLoaded: boolean = - stats != null && ((isILMAvailable && ilmExplain != null) || !isILMAvailable); - const errorOccurred: boolean = error != null; - - return allDataLoaded || errorOccurred; -}; - -export const getIndexPropertiesContainerId = ({ - indexName, - pattern, -}: { - indexName: string; - pattern: string; -}): string => `index-properties-container-${pattern}${indexName}`; - -export const defaultSort: SortConfig = { - sort: { - direction: 'desc', - field: 'docsCount', - }, -}; - -export const MIN_PAGE_SIZE = 10; - -export const getPageIndex = ({ - indexName, - items, - pageSize, -}: { - indexName: string; - items: IndexSummaryTableItem[]; - pageSize: number; -}): number | null => { - const index = items.findIndex((x) => x.indexName === indexName); - - if (index !== -1 && pageSize !== 0) { - return Math.floor(index / pageSize); - } else { - return null; - } -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx deleted file mode 100644 index e927c969ae976..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx +++ /dev/null @@ -1,88 +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 { DARK_THEME } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import React, { ComponentProps } from 'react'; - -import { EMPTY_STAT } from '../../helpers'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { Pattern } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -jest.mock('../../use_stats', () => ({ - useStats: jest.fn(() => ({ - stats: {}, - error: null, - loading: false, - })), -})); - -jest.mock('../../use_ilm_explain', () => ({ - useIlmExplain: jest.fn(() => ({ - error: null, - ilmExplain: {}, - loading: false, - })), -})); - -const defaultProps: ComponentProps = { - pattern: '', - addSuccessToast: jest.fn(), - canUserCreateAndReadCases: jest.fn(), - formatBytes, - formatNumber, - getGroupByFieldsOnClick: jest.fn(), - ilmPhases: ['hot', 'warm', 'unmanaged'], - indexNames: undefined, - isAssistantEnabled: true, - openCreateCaseFlyout: jest.fn(), - patternRollup: undefined, - selectedIndex: null, - setSelectedIndex: jest.fn(), - baseTheme: DARK_THEME, - updatePatternIndexNames: jest.fn(), - updatePatternRollup: jest.fn(), -}; - -describe('pattern', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - test('it renders the remote clusters callout when the pattern includes a colon', () => { - const pattern = 'remote:*'; // <-- a colon in the pattern indicates the use of cross cluster search - - render( - - - - ); - - expect(screen.getByTestId('remoteClustersCallout')).toBeInTheDocument(); - }); - - test('it does NOT render the remote clusters callout when the pattern does NOT include a colon', () => { - const pattern = 'auditbeat-*'; // <-- no colon in the pattern - - render( - - - - ); - - expect(screen.queryByTestId('remoteClustersCallout')).not.toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx deleted file mode 100644 index d54e2bf12fae4..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx +++ /dev/null @@ -1,382 +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 type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { euiThemeVars } from '@kbn/ui-theme'; -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import styled from 'styled-components'; - -import { ErrorEmptyPrompt } from '../error_empty_prompt'; -import { - defaultSort, - getIlmExplainPhaseCounts, - getIlmPhase, - getPageIndex, - getSummaryTableItems, - MIN_PAGE_SIZE, - shouldCreateIndexNames, - shouldCreatePatternRollup, -} from './helpers'; -import { - getDocsCount, - getIndexId, - getIndexNames, - getTotalDocsCount, - getTotalPatternIncompatible, - getTotalPatternIndicesChecked, - getTotalSizeInBytes, -} from '../../helpers'; -import { IndexProperties } from '../index_properties'; -import { LoadingEmptyPrompt } from '../loading_empty_prompt'; -import { PatternSummary } from './pattern_summary'; -import { RemoteClustersCallout } from '../remote_clusters_callout'; -import { SummaryTable } from '../summary_table'; -import { getSummaryTableColumns } from '../summary_table/helpers'; -import * as i18n from './translations'; -import type { PatternRollup, SelectedIndex, SortConfig } from '../../types'; -import { useIlmExplain } from '../../use_ilm_explain'; -import { useStats } from '../../use_stats'; -import { useDataQualityContext } from '../data_quality_context'; - -const IndexPropertiesContainer = styled.div` - margin-bottom: ${euiThemeVars.euiSizeS}; - width: 100%; -`; - -const EMPTY_INDEX_NAMES: string[] = []; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - baseTheme: Theme; - canUserCreateAndReadCases: () => boolean; - endDate?: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhases: string[]; - indexNames: string[] | undefined; - isAssistantEnabled: boolean; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - pattern: string; - patternRollup: PatternRollup | undefined; - selectedIndex: SelectedIndex | null; - setSelectedIndex: (selectedIndex: SelectedIndex | null) => void; - startDate?: string | null; - theme?: PartialTheme; - updatePatternIndexNames: ({ - indexNames, - pattern, - }: { - indexNames: string[]; - pattern: string; - }) => void; - updatePatternRollup: (patternRollup: PatternRollup, requestTime?: number) => void; -} - -const PatternComponent: React.FC = ({ - addSuccessToast, - canUserCreateAndReadCases, - endDate, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - indexNames, - ilmPhases, - isAssistantEnabled, - openCreateCaseFlyout, - pattern, - patternRollup, - selectedIndex, - setSelectedIndex, - startDate, - theme, - baseTheme, - updatePatternIndexNames, - updatePatternRollup, -}) => { - const containerRef = useRef(null); - const { isILMAvailable } = useDataQualityContext(); - const [sorting, setSorting] = useState(defaultSort); - const [pageIndex, setPageIndex] = useState(0); - const [pageSize, setPageSize] = useState(MIN_PAGE_SIZE); - - const { - error: statsError, - loading: loadingStats, - stats, - } = useStats({ pattern, startDate, endDate }); - const { error: ilmExplainError, loading: loadingIlmExplain, ilmExplain } = useIlmExplain(pattern); - - const loading = useMemo( - () => loadingStats || loadingIlmExplain, - [loadingIlmExplain, loadingStats] - ); - const error = useMemo(() => statsError ?? ilmExplainError, [ilmExplainError, statsError]); - - const [itemIdToExpandedRowMap, setItemIdToExpandedRowMap] = useState< - Record - >({}); - - const toggleExpanded = useCallback( - (indexName: string) => { - if (itemIdToExpandedRowMap[indexName]) { - setItemIdToExpandedRowMap({}); - } else { - setItemIdToExpandedRowMap({ - [indexName]: ( - - - - ), - }); - } - }, - [ - itemIdToExpandedRowMap, - addSuccessToast, - canUserCreateAndReadCases, - formatBytes, - formatNumber, - stats, - getGroupByFieldsOnClick, - ilmExplain, - isILMAvailable, - isAssistantEnabled, - openCreateCaseFlyout, - pattern, - patternRollup, - theme, - baseTheme, - updatePatternRollup, - ] - ); - - const ilmExplainPhaseCounts = useMemo( - () => (isILMAvailable ? getIlmExplainPhaseCounts(ilmExplain) : undefined), - [ilmExplain, isILMAvailable] - ); - - const items = useMemo( - () => - getSummaryTableItems({ - ilmExplain, - indexNames: indexNames ?? EMPTY_INDEX_NAMES, - isILMAvailable, - pattern, - patternDocsCount: patternRollup?.docsCount ?? 0, - results: patternRollup?.results, - sortByColumn: sorting.sort.field, - sortByDirection: sorting.sort.direction, - stats, - }), - [ - ilmExplain, - indexNames, - isILMAvailable, - pattern, - patternRollup?.docsCount, - patternRollup?.results, - sorting.sort.direction, - sorting.sort.field, - stats, - ] - ); - - useEffect(() => { - const newIndexNames = getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }); - const newDocsCount = getTotalDocsCount({ indexNames: newIndexNames, stats }); - - if ( - shouldCreateIndexNames({ - indexNames, - ilmExplain, - isILMAvailable, - newIndexNames, - stats, - }) - ) { - updatePatternIndexNames({ - indexNames: newIndexNames, - pattern, - }); - } - - if ( - shouldCreatePatternRollup({ - error, - ilmExplain, - isILMAvailable, - newDocsCount, - patternRollup, - stats, - }) - ) { - updatePatternRollup({ - docsCount: newDocsCount, - error, - ilmExplain, - ilmExplainPhaseCounts, - indices: getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }).length, - pattern, - results: undefined, - sizeInBytes: isILMAvailable - ? getTotalSizeInBytes({ - indexNames: getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }), - stats, - }) ?? 0 - : undefined, - stats, - }); - } - }, [ - error, - ilmExplain, - ilmExplainPhaseCounts, - ilmPhases, - indexNames, - isILMAvailable, - pattern, - patternRollup, - stats, - updatePatternIndexNames, - updatePatternRollup, - ]); - - useEffect(() => { - if (selectedIndex?.pattern === pattern) { - const selectedPageIndex = getPageIndex({ - indexName: selectedIndex.indexName, - items, - pageSize, - }); - - if (selectedPageIndex != null) { - setPageIndex(selectedPageIndex); - } - - if (itemIdToExpandedRowMap[selectedIndex.indexName] == null) { - toggleExpanded(selectedIndex.indexName); // expand the selected index - } - - containerRef.current?.scrollIntoView(); - setSelectedIndex(null); - } - }, [ - itemIdToExpandedRowMap, - items, - pageSize, - pattern, - selectedIndex, - setSelectedIndex, - toggleExpanded, - ]); - - return ( - - - - - - - - {!loading && pattern.includes(':') && ( - <> - - - - )} - - {!loading && error != null && ( - - )} - - {loading && } - - {!loading && error == null && ( -
- -
- )} -
-
- ); -}; - -export const Pattern = React.memo(PatternComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx deleted file mode 100644 index 722f56ca721d8..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx +++ /dev/null @@ -1,64 +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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React from 'react'; - -import type { IlmExplainPhaseCounts } from '../../../types'; -import { PatternLabel } from './pattern_label'; -import { StatsRollup } from './stats_rollup'; - -interface Props { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; - incompatible: number | undefined; - indices: number | undefined; - indicesChecked: number | undefined; - pattern: string; - patternDocsCount: number; - patternSizeInBytes: number | undefined; -} - -const PatternSummaryComponent: React.FC = ({ - formatBytes, - formatNumber, - ilmExplainPhaseCounts, - incompatible, - indices, - indicesChecked, - pattern, - patternDocsCount, - patternSizeInBytes, -}) => ( - - - - - - - - - -); - -export const PatternSummary = React.memo(PatternSummaryComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.test.ts deleted file mode 100644 index dfa285d60b40a..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.test.ts +++ /dev/null @@ -1,97 +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 { getResultToolTip, showResult } from './helpers'; -import { ALL_PASSED, SOME_FAILED, SOME_UNCHECKED } from './translations'; - -describe('helpers', () => { - describe('getResultToolTip', () => { - test('it returns the expected tool tip when `incompatible` is undefined', () => { - expect(getResultToolTip(undefined)).toEqual(SOME_UNCHECKED); - }); - - test('it returns the expected tool tip when `incompatible` is zero', () => { - expect(getResultToolTip(0)).toEqual(ALL_PASSED); - }); - - test('it returns the expected tool tip when `incompatible` is non-zero', () => { - expect(getResultToolTip(1)).toEqual(SOME_FAILED); - }); - }); - - describe('showResult', () => { - test('it returns true when `incompatible` is defined, and `indicesChecked` equals `indices`', () => { - const incompatible = 0; // none of the indices checked had incompatible fields - const indicesChecked = 2; // all indices were checked - const indices = 2; // total indices - - expect( - showResult({ - incompatible, - indices, - indicesChecked, - }) - ).toBe(true); - }); - - test('it returns false when `incompatible` is defined, and `indices` does NOT equal `indicesChecked`', () => { - const incompatible = 0; // the one index checked (so far) didn't have any incompatible fields - const indicesChecked = 1; // only one index has been checked so far - const indices = 2; // total indices - - expect( - showResult({ - incompatible, - indices, - indicesChecked, - }) - ).toBe(false); - }); - - test('it returns false when `incompatible` is undefined', () => { - const incompatible = undefined; // a state of undefined indicates there are no results - const indicesChecked = 1; // all indices were checked - const indices = 1; // total indices - - expect( - showResult({ - incompatible, - indices, - indicesChecked, - }) - ).toBe(false); - }); - - test('it returns false when `indices` is undefined', () => { - const incompatible = 0; // none of the indices checked had incompatible fields - const indicesChecked = 2; // all indices were checked - const indices = undefined; // the total number of indices is unknown - - expect( - showResult({ - incompatible, - indices, - indicesChecked, - }) - ).toBe(false); - }); - - test('it returns false when `indicesChecked` is undefined', () => { - const incompatible = 0; // none of the indices checked had incompatible fields - const indicesChecked = undefined; // no indices were checked - const indices = 2; // total indices - - expect( - showResult({ - incompatible, - indices, - indicesChecked, - }) - ).toBe(false); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.ts deleted file mode 100644 index 8b3ad21adcbfd..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.ts +++ /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 * as i18n from './translations'; - -export const getResultToolTip = (incompatible: number | undefined): string => { - if (incompatible == null) { - return i18n.SOME_UNCHECKED; - } else if (incompatible === 0) { - return i18n.ALL_PASSED; - } else { - return i18n.SOME_FAILED; - } -}; - -export const showResult = ({ - incompatible, - indices, - indicesChecked, -}: { - incompatible: number | undefined; - indices: number | undefined; - indicesChecked: number | undefined; -}): boolean => - incompatible != null && indices != null && indicesChecked != null && indices === indicesChecked; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx deleted file mode 100644 index 24a23c55e83ac..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx +++ /dev/null @@ -1,74 +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 { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiToolTip, EuiIcon } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import { getResultToolTip, showResult } from './helpers'; -import { IlmPhaseCounts } from '../../../ilm_phase_counts'; -import { getResultIcon, getResultIconColor } from '../../../summary_table/helpers'; -import * as i18n from '../translations'; -import type { IlmExplainPhaseCounts } from '../../../../types'; - -const ResultContainer = styled.div` - margin-right: ${({ theme }) => theme.eui.euiSizeS}; -`; - -interface Props { - incompatible: number | undefined; - indices: number | undefined; - indicesChecked: number | undefined; - ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; - pattern: string; -} - -const PatternLabelComponent: React.FC = ({ - ilmExplainPhaseCounts, - incompatible, - indices, - indicesChecked, - pattern, -}) => ( - <> - - - - {showResult({ - incompatible, - indices, - indicesChecked, - }) && ( - - - - )} - - - - - - -

{pattern}

-
-
-
-
- - - {ilmExplainPhaseCounts && ( - - )} - -); - -PatternLabelComponent.displayName = 'PatternLabelComponent'; - -export const PatternLabel = React.memo(PatternLabelComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/translations.ts deleted file mode 100644 index 165dc45b3f1c0..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/translations.ts +++ /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'; - -export const ALL_PASSED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.allPassedTooltip', - { - defaultMessage: 'All indices matching this pattern passed the data quality checks', - } -); - -export const SOME_FAILED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.someFailedTooltip', - { - defaultMessage: 'Some indices matching this pattern failed the data quality checks', - } -); - -export const SOME_UNCHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.someUncheckedTooltip', - { - defaultMessage: 'Some indices matching this pattern have not been checked for data quality', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx deleted file mode 100644 index 8925eb8118dc5..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx +++ /dev/null @@ -1,160 +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 { EuiFlexGroup, EuiFlexItem, EuiStat, EuiToolTip } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - -import { EMPTY_STAT, getIncompatibleStatColor } from '../../../../helpers'; -import { StatLabel } from '../../../stat_label'; -import * as i18n from '../../../stat_label/translations'; - -const IndicesStatContainer = styled.div` - min-width: 100px; -`; - -const DocsContainer = styled.div` - min-width: 155px; -`; - -const STAT_TITLE_SIZE = 's'; - -interface Props { - docsCount: number | undefined; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - incompatible: number | undefined; - indices: number | undefined; - indicesChecked: number | undefined; - pattern?: string; - sizeInBytes: number | undefined; -} - -const StatsRollupComponent: React.FC = ({ - docsCount, - formatBytes, - formatNumber, - incompatible, - indices, - indicesChecked, - pattern, - sizeInBytes, -}) => { - const incompatibleDescription = useMemo( - () => , - [] - ); - const indicesCheckedDescription = useMemo( - () => , - [] - ); - const sizeDescription = useMemo(() => , []); - const docsDescription = useMemo(() => , []); - const indicesDescription = useMemo(() => , []); - - return ( - - - - - - - - - - - - - - - - - - - - - - - - {sizeInBytes != null && ( - - - - - - - - )} - - - - - - - - - - ); -}; - -StatsRollupComponent.displayName = 'StatsRollupComponent'; - -export const StatsRollup = React.memo(StatsRollupComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/translations.ts deleted file mode 100644 index 244fc257d2797..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/translations.ts +++ /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'; - -export const DOCS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.docsLabel', - { - defaultMessage: 'Docs', - } -); - -export const INDICES = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.indicesLabel', - { - defaultMessage: 'Indices', - } -); - -export const PATTERN_OR_INDEX_TOOLTIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.patternOrIndexTooltip', - { - defaultMessage: 'A pattern or specific index', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/translations.ts deleted file mode 100644 index aaf11b1ad405c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/translations.ts +++ /dev/null @@ -1,24 +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 ERROR_LOADING_METADATA_TITLE = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMetadataTitle', - { - values: { pattern }, - defaultMessage: "Indices matching the {pattern} pattern won't be checked", - } - ); - -export const LOADING_STATS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingStatsPrompt', - { - defaultMessage: 'Loading stats', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx deleted file mode 100644 index 0c4a439f999bc..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { SAME_FAMILY } from './translations'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { SameFamily } from '.'; - -describe('SameFamily', () => { - test('it renders a badge with the expected content', () => { - render( - - - - ); - - expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.tsx deleted file mode 100644 index d3c7cf3c2da61..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.tsx +++ /dev/null @@ -1,26 +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 { EuiBadge } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -const SameFamilyBadge = styled(EuiBadge)` - margin: ${({ theme }) => `0 ${theme.eui.euiSizeXS}`}; -`; - -import * as i18n from './translations'; - -const SameFamilyComponent: React.FC = () => ( - - {i18n.SAME_FAMILY} - -); - -SameFamilyComponent.displayName = 'SameFamilyComponent'; - -export const SameFamily = React.memo(SameFamilyComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/translations.ts deleted file mode 100644 index b26a7386e8e4b..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/translations.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const SAME_FAMILY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.sameFamilyBadgeLabel', - { - defaultMessage: 'same family', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx deleted file mode 100644 index 32402b49b570c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import styled from 'styled-components'; - -const Line1 = styled.span` - display: block; -`; - -const Line2 = styled.span` - display: inline-block; -`; - -const EMPTY = ' '; - -interface Props { - line1?: string; - line2?: string; -} - -export const StatLabel: React.FC = ({ line1 = EMPTY, line2 = EMPTY }) => ( - <> - {line1} - {line2} - -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/translations.ts deleted file mode 100644 index 99701d32f722a..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/translations.ts +++ /dev/null @@ -1,199 +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 CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.checkedLabel', - { - defaultMessage: 'checked', - } -); - -export const CUSTOM = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.customLabel', - { - defaultMessage: 'Custom', - } -); - -export const CUSTOM_INDEX_TOOL_TIP = (indexName: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.statLabels.customIndexToolTip', { - values: { indexName }, - defaultMessage: 'A count of the custom field mappings in the {indexName} index', - }); - -export const CUSTOM_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.customPatternToolTip', - { - values: { pattern }, - defaultMessage: - 'The total count of custom field mappings, in indices matching the {pattern} pattern', - } - ); - -export const DOCS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.docsLabel', - { - defaultMessage: 'Docs', - } -); - -export const FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.fieldsLabel', - { - defaultMessage: 'fields', - } -); - -export const INCOMPATIBLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.incompatibleLabel', - { - defaultMessage: 'Incompatible', - } -); - -export const INCOMPATIBLE_INDEX_TOOL_TIP = (indexName: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.incompatibleIndexToolTip', - { - values: { indexName }, - defaultMessage: 'Mappings and values incompatible with ECS, in the {indexName} index', - } - ); - -export const INCOMPATIBLE_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.incompatiblePatternToolTip', - { - values: { pattern }, - defaultMessage: - 'The total count of fields incompatible with ECS, in indices matching the {pattern} pattern', - } - ); - -export const INDEX_DOCS_COUNT_TOOL_TIP = (indexName: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indexDocsCountToolTip', - { - values: { indexName }, - defaultMessage: 'A count of the docs in the {indexName} index', - } - ); - -export const INDEX_DOCS_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indexDocsPatternToolTip', - { - values: { pattern }, - defaultMessage: 'The total count of docs, in indices matching the {pattern} pattern', - } - ); - -export const INDICES = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indicesLabel', - { - defaultMessage: 'Indices', - } -); - -export const SAME_FAMILY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.sameFamilyLabel', - { - defaultMessage: 'Same family', - } -); - -export const SAME_FAMILY_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.sameFamilyPatternToolTip', - { - values: { pattern }, - defaultMessage: - 'The total count of fields in the same family as the type specified by ECS, in indices matching the {pattern} pattern', - } - ); - -export const SIZE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.sizeLabel', - { - defaultMessage: 'Size', - } -); - -export const INDICES_SIZE_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indicesSizePatternToolTip', - { - values: { pattern }, - defaultMessage: - 'The total size of the primary indices matching the {pattern} pattern (does not include replicas)', - } - ); - -export const TOTAL_COUNT_OF_INDICES_CHECKED_MATCHING_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalCountOfIndicesCheckedMatchingPatternToolTip', - { - values: { pattern }, - defaultMessage: 'The total count of indices checked that match the {pattern} pattern', - } - ); - -export const TOTAL_COUNT_OF_INDICES_MATCHING_PATTERN_TOOL_TIP = (pattern: string) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalCountOfIndicesMatchingPatternToolTip', - { - values: { pattern }, - defaultMessage: 'The total count of indices matching the {pattern} pattern', - } - ); - -export const TOTAL_DOCS_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalDocsToolTip', - { - defaultMessage: 'The total count of docs, in all indices', - } -); - -export const TOTAL_INCOMPATIBLE_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIncompatibleToolTip', - { - defaultMessage: - 'The total count of fields incompatible with ECS, in all indices that were checked', - } -); - -export const TOTAL_INDICES_CHECKED_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIndicesCheckedToolTip', - { - defaultMessage: 'The total count of all indices checked', - } -); - -export const TOTAL_INDICES_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIndicesToolTip', - { - defaultMessage: 'The total count of all indices', - } -); - -export const TOTAL_SAME_FAMILY_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalSameFamilyToolTip', - { - defaultMessage: - 'The total count of fields in the same family as the ECS type, in all indices that were checked', - } -); - -export const TOTAL_SIZE_TOOL_TIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalSizeToolTip', - { - defaultMessage: 'The total size of all primary indices (does not include replicas)', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx deleted file mode 100644 index c01e21e5d3dd4..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx +++ /dev/null @@ -1,156 +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 { DARK_THEME, Settings } from '@elastic/charts'; -import numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import React from 'react'; - -import { - FlattenedBucket, - getFlattenedBuckets, - getLegendItems, -} from '../body/data_quality_details/storage_details/helpers'; -import { EMPTY_STAT } from '../../helpers'; -import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import type { Props } from '.'; -import { StorageTreemap } from '.'; -import { DEFAULT_MAX_CHART_HEIGHT } from '../tabs/styles'; -import { NO_DATA_LABEL } from './translations'; -import { PatternRollup } from '../../types'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const ilmPhases = ['hot', 'warm', 'unmanaged']; -const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; - -const patternRollups: Record = { - '.alerts-security.alerts-default': alertIndexWithAllResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, -}; - -const flattenedBuckets = getFlattenedBuckets({ - ilmPhases, - isILMAvailable: true, - patternRollups, -}); - -const onIndexSelected = jest.fn(); - -const defaultProps: Props = { - accessor: 'sizeInBytes', - flattenedBuckets, - maxChartHeight: DEFAULT_MAX_CHART_HEIGHT, - onIndexSelected, - patternRollups, - patterns, - baseTheme: DARK_THEME, - valueFormatter: formatBytes, -}; - -jest.mock('@elastic/charts', () => { - const actual = jest.requireActual('@elastic/charts'); - return { - ...actual, - Settings: jest.fn().mockReturnValue(null), - }; -}); - -describe('StorageTreemap', () => { - describe('when data is provided', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders the treemap', () => { - expect(screen.getByTestId('storageTreemap').querySelector('.echChart')).toBeInTheDocument(); - }); - - test('it renders the legend with the expected overflow-y style', () => { - expect(screen.getByTestId('legend')).toHaveClass('eui-yScroll'); - }); - - test('it uses a theme with the expected `minFontSize` to show more labels at various screen resolutions', () => { - expect((Settings as jest.Mock).mock.calls[0][0].theme[0].partition.minFontSize).toEqual(4); - }); - - describe('legend items', () => { - const allLegendItems = getLegendItems({ patterns, flattenedBuckets, patternRollups }); - - describe('pattern legend items', () => { - const justPatterns = allLegendItems.filter((x) => x.ilmPhase == null); - - justPatterns.forEach(({ ilmPhase, index, pattern, sizeInBytes }) => { - test(`it renders the expend legend item for pattern: ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { - expect( - screen.getByTestId(`chart-legend-item-${ilmPhase}${pattern}${index}`) - ).toHaveTextContent(`${pattern}${formatBytes(sizeInBytes)}`); - }); - }); - }); - - describe('index legend items', () => { - const justIndices = allLegendItems.filter((x) => x.ilmPhase != null); - - justIndices.forEach(({ ilmPhase, index, pattern, sizeInBytes }) => { - test(`it renders the expend legend item for index: ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { - expect( - screen.getByTestId(`chart-legend-item-${ilmPhase}${pattern}${index}`) - ).toHaveTextContent(`${index}${formatBytes(sizeInBytes)}`); - }); - - test(`it invokes onIndexSelected() with the expected values for ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { - const legendItem = screen.getByTestId( - `chart-legend-item-${ilmPhase}${pattern}${index}` - ); - - userEvent.click(legendItem); - - expect(onIndexSelected).toBeCalledWith({ indexName: index, pattern }); - }); - }); - }); - }); - }); - - describe('when the response does NOT have data', () => { - const emptyFlattenedBuckets: FlattenedBucket[] = []; - - beforeEach(() => { - render( - - - - ); - }); - - test('it does NOT render the treemap', () => { - expect(screen.queryByTestId('storageTreemap')).not.toBeInTheDocument(); - }); - - test('it does NOT render the legend', () => { - expect(screen.queryByTestId('legend')).not.toBeInTheDocument(); - }); - - test('it renders the "no data" message', () => { - expect(screen.getByText(NO_DATA_LABEL)).toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx deleted file mode 100644 index 2edd59be93df7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx +++ /dev/null @@ -1,208 +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 { isEmpty } from 'lodash/fp'; -import type { - Datum, - ElementClickListener, - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { Chart, Partition, PartitionLayout, Settings } from '@elastic/charts'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import { i18n } from '@kbn/i18n'; -import { - FlattenedBucket, - getLayersMultiDimensional, - getLegendItems, - getPathToFlattenedBucketMap, -} from '../body/data_quality_details/storage_details/helpers'; -import { ChartLegendItem } from '../../ecs_summary_donut_chart/chart_legend/chart_legend_item'; -import { NoData } from './no_data'; -import { ChartFlexItem, LegendContainer } from '../tabs/styles'; -import { PatternRollup, SelectedIndex } from '../../types'; - -export const DEFAULT_MIN_CHART_HEIGHT = 240; // px -export const LEGEND_WIDTH = 220; // px -export const LEGEND_TEXT_WITH = 120; // px - -export interface Props { - accessor: 'sizeInBytes' | 'docsCount'; - baseTheme: Theme; - flattenedBuckets: FlattenedBucket[]; - maxChartHeight?: number; - minChartHeight?: number; - onIndexSelected: ({ indexName, pattern }: SelectedIndex) => void; - patternRollups: Record; - patterns: string[]; - theme?: PartialTheme; - valueFormatter: (value: number) => string; -} - -interface GetGroupByFieldsResult { - pattern: string; - indexName: string; -} - -export const getGroupByFieldsOnClick = ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > -): GetGroupByFieldsResult => { - const flattened = elements.flat(2); - - const pattern = - flattened.length > 0 && 'groupByRollup' in flattened[0] && flattened[0].groupByRollup != null - ? `${flattened[0].groupByRollup}` - : ''; - - const indexName = - flattened.length > 1 && 'groupByRollup' in flattened[1] && flattened[1].groupByRollup != null - ? `${flattened[1].groupByRollup}` - : ''; - - return { - pattern, - indexName, - }; -}; - -const StorageTreemapComponent: React.FC = ({ - accessor, - baseTheme, - flattenedBuckets, - maxChartHeight, - minChartHeight = DEFAULT_MIN_CHART_HEIGHT, - onIndexSelected, - patternRollups, - patterns, - theme = {}, - valueFormatter, -}: Props) => { - const fillColor = useMemo( - () => theme?.background?.color ?? baseTheme.background.color, - [theme?.background?.color, baseTheme.background.color] - ); - - const treemapTheme = useMemo( - () => ({ - partition: { - fillLabel: { valueFont: { fontWeight: 700 } }, - idealFontSizeJump: 1.15, - maxFontSize: 16, - minFontSize: 4, - sectorLineStroke: fillColor, // draws the light or dark "lines" between partitions - sectorLineWidth: 1.5, - }, - }), - [fillColor] - ); - - const onElementClick: ElementClickListener = useCallback( - (event) => { - const { indexName, pattern } = getGroupByFieldsOnClick(event); - - if (!isEmpty(indexName) && !isEmpty(pattern)) { - onIndexSelected({ indexName, pattern }); - } - }, - [onIndexSelected] - ); - - const pathToFlattenedBucketMap = getPathToFlattenedBucketMap(flattenedBuckets); - - const layers = useMemo( - () => - getLayersMultiDimensional({ - valueFormatter, - layer0FillColor: fillColor, - pathToFlattenedBucketMap, - }), - [fillColor, valueFormatter, pathToFlattenedBucketMap] - ); - - const valueAccessor = useCallback((d: Datum) => d[accessor], [accessor]); - - const legendItems = useMemo( - () => getLegendItems({ patterns, flattenedBuckets, patternRollups }), - [flattenedBuckets, patternRollups, patterns] - ); - - if (flattenedBuckets.length === 0) { - return ; - } - - return ( - - - {flattenedBuckets.length === 0 ? ( - - ) : ( - - - - - )} - - - - - {legendItems.map(({ color, ilmPhase, index, pattern, sizeInBytes, docsCount }) => ( - { - onIndexSelected({ indexName: index, pattern }); - } - : undefined - } - text={index ?? pattern} - textWidth={LEGEND_TEXT_WITH} - /> - ))} - - - - ); -}; - -export const StorageTreemap = React.memo(StorageTreemapComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx deleted file mode 100644 index 0cf39beae7b2d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx +++ /dev/null @@ -1,21 +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 { render, screen } from '@testing-library/react'; -import React from 'react'; - -import * as i18n from '../translations'; - -import { NoData } from '.'; - -describe('NoData', () => { - test('renders the expected "no data" message', () => { - render(); - - expect(screen.getByText(i18n.NO_DATA_LABEL)).toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.tsx deleted file mode 100644 index a5edca17291d2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.tsx +++ /dev/null @@ -1,43 +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 { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import * as i18n from '../translations'; - -const NoDataLabel = styled(EuiText)` - text-align: center; -`; - -interface Props { - reason?: string; -} - -const NoDataComponent: React.FC = ({ reason }) => ( - - - - {i18n.NO_DATA_LABEL} - - - {reason != null && ( - <> - - - {reason} - - - )} - - -); - -NoDataComponent.displayName = 'NoDataComponent'; - -export const NoData = React.memo(NoDataComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx deleted file mode 100644 index 814f0b234b63c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx +++ /dev/null @@ -1,643 +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 { EuiScreenReaderOnly, EuiTableFieldDataColumnType } from '@elastic/eui'; -import numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { omit } from 'lodash/fp'; -import React from 'react'; - -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { EMPTY_STAT } from '../../helpers'; -import { - getDocsCountPercent, - getResultIcon, - getResultIconColor, - getResultToolTip, - getShowPagination, - getSummaryTableColumns, - getSummaryTableILMPhaseColumn, - getSummaryTableSizeInBytesColumn, - getToggleButtonId, - IndexSummaryTableItem, -} from './helpers'; -import { COLLAPSE, EXPAND, FAILED, PASSED, THIS_INDEX_HAS_NOT_BEEN_CHECKED } from './translations'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -describe('helpers', () => { - describe('getResultToolTip', () => { - test('it shows a "this index has not been checked" tool tip when `incompatible` is undefined', () => { - expect(getResultToolTip(undefined)).toEqual(THIS_INDEX_HAS_NOT_BEEN_CHECKED); - }); - - test('it returns Passed when `incompatible` is zero', () => { - expect(getResultToolTip(0)).toEqual(PASSED); - }); - - test('it returns Failed when `incompatible` is NOT zero', () => { - expect(getResultToolTip(1)).toEqual(FAILED); - }); - }); - - describe('getResultIconColor', () => { - test('it returns `ghost` when `incompatible` is undefined', () => { - expect(getResultIconColor(undefined)).toEqual('ghost'); - }); - - test('it returns `success` when `incompatible` is zero', () => { - expect(getResultIconColor(0)).toEqual('success'); - }); - - test('it returns `danger` when `incompatible` is NOT zero', () => { - expect(getResultIconColor(1)).toEqual('danger'); - }); - }); - - describe('getResultIcon', () => { - test('it returns `cross` when `incompatible` is undefined', () => { - expect(getResultIcon(undefined)).toEqual('cross'); - }); - - test('it returns `check` when `incompatible` is zero', () => { - expect(getResultIcon(0)).toEqual('check'); - }); - - test('it returns `cross` when `incompatible` is NOT zero', () => { - expect(getResultIcon(1)).toEqual('cross'); - }); - }); - - describe('getDocsCountPercent', () => { - test('it returns an empty string when `patternDocsCount` is zero', () => { - expect( - getDocsCountPercent({ - docsCount: 0, - patternDocsCount: 0, - }) - ).toEqual(''); - }); - - test('it returns the expected format when when `patternDocsCount` is non-zero, and `locales` is undefined', () => { - expect( - getDocsCountPercent({ - docsCount: 2904, - locales: undefined, - patternDocsCount: 57410, - }) - ).toEqual('5.1%'); - }); - - test('it returns the expected format when when `patternDocsCount` is non-zero, and `locales` is provided', () => { - expect( - getDocsCountPercent({ - docsCount: 2904, - locales: 'en-US', - patternDocsCount: 57410, - }) - ).toEqual('5.1%'); - }); - }); - - describe('getToggleButtonId', () => { - test('it returns the expected id when the button is expanded', () => { - expect( - getToggleButtonId({ - indexName: 'auditbeat-custom-index-1', - isExpanded: true, - pattern: 'auditbeat-*', - }) - ).toEqual('collapseauditbeat-custom-index-1auditbeat-*'); - }); - - test('it returns the expected id when the button is collapsed', () => { - expect( - getToggleButtonId({ - indexName: 'auditbeat-custom-index-1', - isExpanded: false, - pattern: 'auditbeat-*', - }) - ).toEqual('expandauditbeat-custom-index-1auditbeat-*'); - }); - }); - - describe('getSummaryTableColumns', () => { - const indexName = '.ds-auditbeat-8.6.1-2023.02.07-000001'; - const isILMAvailable = true; - - const indexSummaryTableItem: IndexSummaryTableItem = { - indexName, - docsCount: 2796, - incompatible: undefined, - ilmPhase: 'hot', - pattern: 'auditbeat-*', - patternDocsCount: 57410, - sizeInBytes: 103344068, - checkedAt: Date.now(), - }; - - const hasIncompatible: IndexSummaryTableItem = { - ...indexSummaryTableItem, - incompatible: 1, // <-- one incompatible field - }; - - test('it returns the expected column configuration', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }).map((x) => omit('render', x)); - - expect(columns).toEqual([ - { - align: 'right', - isExpander: true, - name: ( - - {'Expand rows'} - - ), - width: '40px', - }, - { - field: 'incompatible', - name: 'Result', - sortable: true, - truncateText: false, - width: '65px', - }, - { field: 'indexName', name: 'Index', sortable: true, truncateText: false, width: '300px' }, - { field: 'docsCount', name: 'Docs', sortable: true, truncateText: false }, - { - field: 'incompatible', - name: 'Incompatible fields', - sortable: true, - truncateText: false, - }, - { field: 'ilmPhase', name: 'ILM Phase', sortable: true, truncateText: false }, - { field: 'sizeInBytes', name: 'Size', sortable: true, truncateText: false }, - { field: 'checkedAt', name: 'Last check', sortable: true, truncateText: false }, - ]); - }); - - describe('expand rows render()', () => { - test('it renders an Expand button when the row is NOT expanded', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const expandRowsRender = (columns[0] as EuiTableFieldDataColumnType) - .render; - - render( - - {expandRowsRender != null && - expandRowsRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - expect(screen.getByLabelText(EXPAND)).toBeInTheDocument(); - }); - - test('it renders a Collapse button when the row is expanded', () => { - const itemIdToExpandedRowMap: Record = { - [indexName]: () => null, - }; - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const expandRowsRender = (columns[0] as EuiTableFieldDataColumnType) - .render; - - render( - - {expandRowsRender != null && - expandRowsRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - expect(screen.getByLabelText(COLLAPSE)).toBeInTheDocument(); - }); - - test('it invokes the `toggleExpanded` with the index name when the button is clicked', () => { - const toggleExpanded = jest.fn(); - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded, - }); - const expandRowsRender = (columns[0] as EuiTableFieldDataColumnType) - .render; - - render( - - {expandRowsRender != null && - expandRowsRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - const button = screen.getByLabelText(EXPAND); - userEvent.click(button); - - expect(toggleExpanded).toBeCalledWith(indexName); - }); - }); - - describe('incompatible render()', () => { - test('it renders a placeholder when incompatible is undefined', () => { - const incompatibleIsUndefined: IndexSummaryTableItem = { - ...indexSummaryTableItem, - incompatible: undefined, // <-- - }; - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const incompatibleRender = ( - columns[1] as EuiTableFieldDataColumnType - ).render; - - render( - - {incompatibleRender != null && - incompatibleRender(incompatibleIsUndefined, incompatibleIsUndefined)} - - ); - - expect(screen.getByTestId('incompatiblePlaceholder')).toHaveTextContent(EMPTY_STAT); - }); - - test('it renders the expected icon when there are incompatible fields', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const incompatibleRender = ( - columns[1] as EuiTableFieldDataColumnType - ).render; - - render( - - {incompatibleRender != null && incompatibleRender(hasIncompatible, hasIncompatible)} - - ); - - expect(screen.getByTestId('resultIcon')).toHaveAttribute('data-euiicon-type', 'cross'); - }); - - test('it renders the expected icon when there are zero fields', () => { - const zeroIncompatible: IndexSummaryTableItem = { - ...indexSummaryTableItem, - incompatible: 0, // <-- one incompatible field - }; - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const incompatibleRender = ( - columns[1] as EuiTableFieldDataColumnType - ).render; - - render( - - {incompatibleRender != null && incompatibleRender(zeroIncompatible, zeroIncompatible)} - - ); - - expect(screen.getByTestId('resultIcon')).toHaveAttribute('data-euiicon-type', 'check'); - }); - }); - - describe('indexName render()', () => { - test('it renders the index name', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const indexNameRender = (columns[2] as EuiTableFieldDataColumnType) - .render; - - render( - - {indexNameRender != null && - indexNameRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - expect(screen.getByTestId('indexName')).toHaveTextContent(indexName); - }); - }); - - describe('docsCount render()', () => { - beforeEach(() => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const docsCountRender = (columns[3] as EuiTableFieldDataColumnType) - .render; - - render( - - {docsCountRender != null && docsCountRender(hasIncompatible, hasIncompatible)} - - ); - }); - - test('it renders the expected value', () => { - expect(screen.getByTestId('docsCount')).toHaveAttribute( - 'value', - String(hasIncompatible.docsCount) - ); - }); - - test('it renders the expected max (progress)', () => { - expect(screen.getByTestId('docsCount')).toHaveAttribute( - 'max', - String(hasIncompatible.patternDocsCount) - ); - }); - }); - - describe('incompatible column render()', () => { - test('it renders the expected value', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const incompatibleRender = ( - columns[4] as EuiTableFieldDataColumnType - ).render; - - render( - - {incompatibleRender != null && incompatibleRender(hasIncompatible, hasIncompatible)} - - ); - - expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('1'); - }); - - test('it renders the expected placeholder when incompatible is undefined', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const incompatibleRender = ( - columns[4] as EuiTableFieldDataColumnType - ).render; - - render( - - {incompatibleRender != null && - incompatibleRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('--'); - }); - }); - - describe('getSummaryTableILMPhaseColumn', () => { - test('it returns the expected column configuration when `isILMAvailable` is true', () => { - const column = getSummaryTableILMPhaseColumn(isILMAvailable); - expect(column.length).toEqual(1); - expect(column[0].name).toEqual('ILM Phase'); - }); - - test('it returns an emptry array when `isILMAvailable` is false', () => { - const column = getSummaryTableILMPhaseColumn(false); - expect(column.length).toEqual(0); - }); - }); - - describe('getSummaryTableSizeInBytesColumn', () => { - test('it returns the expected column configuration when `isILMAvailable` is true', () => { - const column = getSummaryTableSizeInBytesColumn({ - isILMAvailable: true, - formatBytes: jest.fn(), - }); - expect(column.length).toEqual(1); - expect(column[0].name).toEqual('Size'); - }); - - test('it returns an emptry array when `isILMAvailable` is false', () => { - const column = getSummaryTableSizeInBytesColumn({ - isILMAvailable: false, - formatBytes: jest.fn(), - }); - expect(column.length).toEqual(0); - }); - }); - - describe('ilmPhase column render()', () => { - test('it renders the expected ilmPhase badge content', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) - .render; - - render( - - {ilmPhaseRender != null && ilmPhaseRender(hasIncompatible, hasIncompatible)} - - ); - - expect(screen.getByTestId('ilmPhase')).toHaveTextContent('hot'); - }); - - test('it does NOT render the ilmPhase badge when `ilmPhase` is undefined', () => { - const ilmPhaseIsUndefined: IndexSummaryTableItem = { - ...indexSummaryTableItem, - ilmPhase: undefined, // <-- - }; - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) - .render; - - render( - - {ilmPhaseRender != null && ilmPhaseRender(ilmPhaseIsUndefined, ilmPhaseIsUndefined)} - - ); - - expect(screen.queryByTestId('ilmPhase')).not.toBeInTheDocument(); - }); - - test('it does NOT render the ilmPhase badge when `isILMAvailable` is false', () => { - const ilmPhaseIsUndefined: IndexSummaryTableItem = { - ...indexSummaryTableItem, - }; - - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable: false, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) - .render; - - render( - - {ilmPhaseRender != null && ilmPhaseRender(ilmPhaseIsUndefined, ilmPhaseIsUndefined)} - - ); - - expect(screen.queryByTestId('ilmPhase')).not.toBeInTheDocument(); - }); - }); - - describe('sizeInBytes render()', () => { - test('it renders the expected formatted bytes', () => { - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - - const sizeInBytesRender = (columns[6] as EuiTableFieldDataColumnType) - .render; - - render( - - {sizeInBytesRender != null && - sizeInBytesRender(indexSummaryTableItem, indexSummaryTableItem)} - - ); - - expect(screen.getByTestId('sizeInBytes')).toHaveTextContent('98.6MB'); - }); - - test('it should not render sizeInBytes if it is not a number', () => { - const testIndexSummaryTableItem = { ...indexSummaryTableItem, sizeInBytes: undefined }; - const columns = getSummaryTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap: {}, - isILMAvailable, - pattern: 'auditbeat-*', - toggleExpanded: jest.fn(), - }); - - const sizeInBytesRender = (columns[6] as EuiTableFieldDataColumnType) - .render; - - render( - - {sizeInBytesRender != null && - sizeInBytesRender(testIndexSummaryTableItem, testIndexSummaryTableItem)} - - ); - - expect(screen.queryByTestId('sizeInBytes')).toBeNull(); - }); - }); - }); - - describe('getShowPagination', () => { - test('it returns true when `totalItemCount` is greater than `minPageSize`', () => { - expect( - getShowPagination({ - minPageSize: 10, - totalItemCount: 11, - }) - ).toBe(true); - }); - - test('it returns false when `totalItemCount` equals `minPageSize`', () => { - expect( - getShowPagination({ - minPageSize: 10, - totalItemCount: 10, - }) - ).toBe(false); - }); - - test('it returns false when `totalItemCount` is less than `minPageSize`', () => { - expect( - getShowPagination({ - minPageSize: 10, - totalItemCount: 9, - }) - ).toBe(false); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx deleted file mode 100644 index 07c4335c0cd17..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx +++ /dev/null @@ -1,276 +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 { - EuiBasicTableColumn, - EuiText, - EuiBadge, - EuiButtonIcon, - EuiIcon, - EuiProgress, - EuiScreenReaderOnly, - EuiStat, - EuiToolTip, - RIGHT_ALIGNMENT, -} from '@elastic/eui'; -import React from 'react'; -import moment from 'moment'; -import styled from 'styled-components'; - -import { EMPTY_STAT, getIlmPhaseDescription, getIncompatibleStatColor } from '../../helpers'; -import { INCOMPATIBLE_INDEX_TOOL_TIP } from '../stat_label/translations'; -import { INDEX_SIZE_TOOLTIP } from '../../translations'; -import * as i18n from './translations'; -import type { IlmPhase } from '../../types'; - -const STAT_TITLE_SIZE = 'xxs'; - -const EMPTY_DESCRIPTION = ' '; - -const ProgressContainer = styled.div` - width: 150px; -`; - -export interface IndexSummaryTableItem { - docsCount: number; - incompatible: number | undefined; - indexName: string; - ilmPhase: IlmPhase | undefined; - pattern: string; - patternDocsCount: number; - sizeInBytes: number | undefined; - checkedAt: number | undefined; -} - -export const getResultToolTip = (incompatible: number | undefined): string => { - if (incompatible == null) { - return i18n.THIS_INDEX_HAS_NOT_BEEN_CHECKED; - } else if (incompatible === 0) { - return i18n.PASSED; - } else { - return i18n.FAILED; - } -}; - -export const getResultIconColor = ( - incompatible: number | undefined -): 'success' | 'danger' | 'ghost' => { - if (incompatible == null) { - return 'ghost'; - } else if (incompatible === 0) { - return 'success'; - } else { - return 'danger'; - } -}; - -export const getResultIcon = (incompatible: number | undefined): 'check' | 'cross' => - incompatible === 0 ? 'check' : 'cross'; - -export const getDocsCountPercent = ({ - docsCount, - locales, - patternDocsCount, -}: { - docsCount: number; - locales?: string | string[]; - patternDocsCount: number; -}): string => - patternDocsCount !== 0 - ? Number(docsCount / patternDocsCount).toLocaleString(locales, { - style: 'percent', - maximumFractionDigits: 1, - minimumFractionDigits: 1, - }) - : ''; - -export const getToggleButtonId = ({ - indexName, - isExpanded, - pattern, -}: { - indexName: string; - isExpanded: boolean; - pattern: string; -}): string => (isExpanded ? `collapse${indexName}${pattern}` : `expand${indexName}${pattern}`); - -export const getSummaryTableILMPhaseColumn = ( - isILMAvailable: boolean -): Array> => - isILMAvailable - ? [ - { - field: 'ilmPhase', - name: i18n.ILM_PHASE, - render: (_, { ilmPhase }) => - ilmPhase != null ? ( - - - {ilmPhase} - - - ) : null, - sortable: true, - truncateText: false, - }, - ] - : []; - -export const getSummaryTableSizeInBytesColumn = ({ - isILMAvailable, - formatBytes, -}: { - isILMAvailable: boolean; - formatBytes: (value: number | undefined) => string; -}): Array> => - isILMAvailable - ? [ - { - field: 'sizeInBytes', - name: i18n.SIZE, - render: (_, { sizeInBytes }) => - Number.isInteger(sizeInBytes) ? ( - - {formatBytes(sizeInBytes)} - - ) : null, - sortable: true, - truncateText: false, - }, - ] - : []; - -export const getSummaryTableColumns = ({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap, - isILMAvailable, - pattern, - toggleExpanded, -}: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - itemIdToExpandedRowMap: Record; - isILMAvailable: boolean; - pattern: string; - toggleExpanded: (indexName: string) => void; -}): Array> => [ - { - align: RIGHT_ALIGNMENT, - isExpander: true, - name: ( - - {i18n.EXPAND_ROWS} - - ), - render: ({ indexName }: IndexSummaryTableItem) => ( - toggleExpanded(indexName)} - iconType={itemIdToExpandedRowMap[indexName] ? 'arrowDown' : 'arrowRight'} - /> - ), - width: '40px', - }, - { - field: 'incompatible', - name: i18n.RESULT, - render: (_, { incompatible }) => - incompatible != null ? ( - - - - ) : ( - - {EMPTY_STAT} - - ), - sortable: true, - truncateText: false, - width: '65px', - }, - { - field: 'indexName', - name: i18n.INDEX, - render: (_, { indexName }) => ( - - - {indexName} - - - ), - sortable: true, - truncateText: false, - width: '300px', - }, - { - field: 'docsCount', - name: i18n.DOCS, - render: (_, { docsCount, patternDocsCount }) => ( - - - - ), - sortable: true, - truncateText: false, - }, - { - field: 'incompatible', - name: i18n.INCOMPATIBLE_FIELDS, - render: (_, { incompatible, indexName }) => ( - - - - ), - sortable: true, - truncateText: false, - }, - ...getSummaryTableILMPhaseColumn(isILMAvailable), - ...getSummaryTableSizeInBytesColumn({ isILMAvailable, formatBytes }), - { - field: 'checkedAt', - name: i18n.LAST_CHECK, - render: (_, { checkedAt }) => ( - - {checkedAt && moment(checkedAt).isValid() ? moment(checkedAt).fromNow() : EMPTY_STAT} - - ), - sortable: true, - truncateText: false, - }, -]; - -export const getShowPagination = ({ - minPageSize, - totalItemCount, -}: { - minPageSize: number; - totalItemCount: number; -}): boolean => totalItemCount > minPageSize; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx deleted file mode 100644 index 720943b0d2bb8..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx +++ /dev/null @@ -1,90 +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 numeral from '@elastic/numeral'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { EMPTY_STAT } from '../../helpers'; -import { getSummaryTableColumns } from './helpers'; -import { mockIlmExplain } from '../../mock/ilm_explain/mock_ilm_explain'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from '../../mock/stats/mock_stats'; -import { TestProviders } from '../../mock/test_providers/test_providers'; -import { getSummaryTableItems } from '../pattern/helpers'; -import { SortConfig } from '../../types'; -import { Props, SummaryTable } from '.'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const indexNames = [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-empty-index-1', - 'auditbeat-custom-index-1', - '.internal.alerts-security.alerts-default-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - '.ds-packetbeat-8.6.1-2023.02.04-000001', -]; - -export const defaultSort: SortConfig = { - sort: { - direction: 'desc', - field: 'docsCount', - }, -}; - -const pattern = 'auditbeat-*'; - -const items = getSummaryTableItems({ - ilmExplain: mockIlmExplain, - indexNames: indexNames ?? [], - isILMAvailable: true, - pattern, - patternDocsCount: auditbeatWithAllResults?.docsCount ?? 0, - results: auditbeatWithAllResults?.results, - sortByColumn: defaultSort.sort.field, - sortByDirection: defaultSort.sort.direction, - stats: mockStats, -}); - -const defaultProps: Props = { - formatBytes, - formatNumber, - getTableColumns: getSummaryTableColumns, - itemIdToExpandedRowMap: {}, - items, - pageIndex: 0, - pageSize: 10, - pattern, - setPageIndex: jest.fn(), - setPageSize: jest.fn(), - setSorting: jest.fn(), - sorting: defaultSort, - toggleExpanded: jest.fn(), -}; - -describe('SummaryTable', () => { - beforeEach(() => { - jest.clearAllMocks(); - - render( - - - - ); - }); - - test('it renders the summary table', () => { - expect(screen.getByTestId('summaryTable')).toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx deleted file mode 100644 index 6379539f05096..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx +++ /dev/null @@ -1,127 +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 type { CriteriaWithPagination, EuiBasicTableColumn, Pagination } from '@elastic/eui'; -import { EuiInMemoryTable } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import type { IndexSummaryTableItem } from './helpers'; -import { getShowPagination } from './helpers'; -import { defaultSort, MIN_PAGE_SIZE } from '../pattern/helpers'; -import { SortConfig } from '../../types'; -import { useDataQualityContext } from '../data_quality_context'; - -export interface Props { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getTableColumns: ({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap, - isILMAvailable, - pattern, - toggleExpanded, - }: { - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - itemIdToExpandedRowMap: Record; - isILMAvailable: boolean; - pattern: string; - toggleExpanded: (indexName: string) => void; - }) => Array>; - itemIdToExpandedRowMap: Record; - items: IndexSummaryTableItem[]; - pageIndex: number; - pageSize: number; - pattern: string; - setPageIndex: (pageIndex: number) => void; - setPageSize: (pageSize: number) => void; - setSorting: (sortConfig: SortConfig) => void; - sorting: SortConfig; - toggleExpanded: (indexName: string) => void; -} - -const SummaryTableComponent: React.FC = ({ - formatBytes, - formatNumber, - getTableColumns, - itemIdToExpandedRowMap, - items, - pageIndex, - pageSize, - pattern, - setPageIndex, - setPageSize, - setSorting, - sorting, - toggleExpanded, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const columns = useMemo( - () => - getTableColumns({ - formatBytes, - formatNumber, - itemIdToExpandedRowMap, - isILMAvailable, - pattern, - toggleExpanded, - }), - [ - formatBytes, - formatNumber, - getTableColumns, - isILMAvailable, - itemIdToExpandedRowMap, - pattern, - toggleExpanded, - ] - ); - const getItemId = useCallback((item: IndexSummaryTableItem) => item.indexName, []); - - const onChange = useCallback( - ({ page, sort }: CriteriaWithPagination) => { - setSorting({ sort: sort ?? defaultSort.sort }); - setPageIndex(page.index); - setPageSize(page.size); - }, - [setPageIndex, setPageSize, setSorting] - ); - - const pagination: Pagination = useMemo( - () => ({ - pageIndex, - pageSize, - showPerPageOptions: true, - totalItemCount: items.length, - }), - [items, pageIndex, pageSize] - ); - - return ( - - ); -}; - -SummaryTableComponent.displayName = 'SummaryTableComponent'; - -export const SummaryTable = React.memo(SummaryTableComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/translations.ts deleted file mode 100644 index 8d8e4adb9944f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/translations.ts +++ /dev/null @@ -1,126 +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 COLLAPSE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.collapseLabel', - { - defaultMessage: 'Collapse', - } -); - -export const DOCS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.docsColumn', - { - defaultMessage: 'Docs', - } -); - -export const EXPAND = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.expandLabel', - { - defaultMessage: 'Expand', - } -); - -export const EXPAND_ROWS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.expandRowsColumn', - { - defaultMessage: 'Expand rows', - } -); - -export const FAILED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.failedTooltip', - { - defaultMessage: 'Failed', - } -); - -export const ILM_PHASE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.ilmPhaseColumn', - { - defaultMessage: 'ILM Phase', - } -); - -export const INCOMPATIBLE_FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.incompatibleFieldsColumn', - { - defaultMessage: 'Incompatible fields', - } -); - -export const INDICES = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indicesColumn', - { - defaultMessage: 'Indices', - } -); - -export const INDICES_CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indicesCheckedColumn', - { - defaultMessage: 'Indices checked', - } -); - -export const INDEX = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indexColumn', - { - defaultMessage: 'Index', - } -); - -export const INDEX_NAME_LABEL = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indexesNameLabel', - { - defaultMessage: 'Index name', - } -); - -export const INDEX_TOOL_TIP = (pattern: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indexToolTip', { - values: { pattern }, - defaultMessage: 'This index matches the pattern or index name: {pattern}', - }); - -export const PASSED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.passedTooltip', - { - defaultMessage: 'Passed', - } -); - -export const RESULT = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.resultColumn', - { - defaultMessage: 'Result', - } -); - -export const SIZE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.sizeColumn', - { - defaultMessage: 'Size', - } -); - -export const LAST_CHECK = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.lastCheckColumn', - { - defaultMessage: 'Last check', - } -); - -export const THIS_INDEX_HAS_NOT_BEEN_CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.thisIndexHasNotBeenCheckedTooltip', - { - defaultMessage: 'This index has not been checked', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx deleted file mode 100644 index 51988e631fa4d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx +++ /dev/null @@ -1,57 +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 { EcsVersion } from '@elastic/ecs'; -import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; -import React, { useMemo } from 'react'; - -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getCommonTableColumns } from '../../../compare_fields_table/get_common_table_columns'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; -import * as i18n from '../../index_properties/translations'; -import type { PartitionedFieldMetadata } from '../../../types'; - -interface Props { - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata; -} - -const AllTabComponent: React.FC = ({ indexName, partitionedFieldMetadata }) => { - const body = useMemo(() => , []); - const title = useMemo(() => , []); - - return ( - <> - {partitionedFieldMetadata.all.length > 0 ? ( - <> - -

{i18n.ALL_CALLOUT(EcsVersion)}

-
- - - - ) : ( - - )} - - ); -}; - -AllTabComponent.displayName = 'AllTabComponent'; - -export const AllTab = React.memo(AllTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx deleted file mode 100644 index fc2ba0327062f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx +++ /dev/null @@ -1,50 +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 { EcsVersion } from '@elastic/ecs'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../index_properties/translations'; -import { - hostNameKeyword, - someField, -} from '../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { CustomCallout } from '.'; - -const content = 'you are reviewing a pull request'; - -describe('CustomCallout', () => { - beforeEach(() => { - render( - - -
{content}
-
-
- ); - }); - - test('it renders a title with the expected count of custom field mappings', () => { - expect(screen.getByTestId('title')).toHaveTextContent('2 Custom field mappings'); - }); - - test('it includes the ECS version in the main content', () => { - expect(screen.getByTestId('fieldsNotDefinedByEcs')).toHaveTextContent( - `These fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.` - ); - }); - - test('it notes ECS is a permissive schema', () => { - expect(screen.getByTestId('ecsIsPermissive')).toHaveTextContent(ECS_IS_A_PERMISSIVE_SCHEMA); - }); - - test('it renders the children', () => { - expect(screen.getByTestId('children')).toHaveTextContent(content); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx deleted file mode 100644 index 8d1bc0c20a72c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx +++ /dev/null @@ -1,41 +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 { EcsVersion } from '@elastic/ecs'; - -import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import type { CustomFieldMetadata } from '../../../../types'; - -import * as i18n from '../../../index_properties/translations'; - -interface Props { - children?: React.ReactNode; - customFieldMetadata: CustomFieldMetadata[]; -} - -const CustomCalloutComponent: React.FC = ({ children, customFieldMetadata }) => { - const title = useMemo( - () => ( - {i18n.CUSTOM_CALLOUT_TITLE(customFieldMetadata.length)} - ), - [customFieldMetadata.length] - ); - - return ( - -
- {i18n.CUSTOM_CALLOUT({ fieldCount: customFieldMetadata.length, version: EcsVersion })} -
- -
{i18n.ECS_IS_A_PERMISSIVE_SCHEMA}
- {children} -
- ); -}; - -export const CustomCallout = React.memo(CustomCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx deleted file mode 100644 index 590dff6d64a0b..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EcsVersion } from '@elastic/ecs'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { - DETECTION_ENGINE_RULES_MAY_NOT_MATCH, - MAPPINGS_THAT_CONFLICT_WITH_ECS, - PAGES_MAY_NOT_DISPLAY_EVENTS, -} from '../../../index_properties/translations'; -import { - eventCategory, - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - sourceIpWithTextMapping, -} from '../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { EcsBasedFieldMetadata } from '../../../../types'; -import { IncompatibleCallout } from '.'; - -const content = 'Is your name Michael?'; - -const eventCategoryWithWildcard: EcsBasedFieldMetadata = { - ...eventCategory, // `event.category` is a `keyword` per the ECS spec - indexFieldType: 'wildcard', // this index has a mapping of `wildcard` instead of `keyword` - isInSameFamily: true, // `wildcard` and `keyword` are in the same family - isEcsCompliant: false, // wildcard !== keyword -}; - -describe('IncompatibleCallout', () => { - beforeEach(() => { - render( - - -
{content}
-
-
- ); - }); - - test('it renders a title with the expected incompatible and family counts', () => { - expect(screen.getByTestId('title')).toHaveTextContent('4 incompatible fields'); - }); - - test('it includes the ECS version in the main content', () => { - expect(screen.getByTestId('fieldsAreIncompatible')).toHaveTextContent( - `Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.` - ); - }); - - test('it warns rules may not match', () => { - expect(screen.getByTestId('rulesMayNotMatch')).toHaveTextContent( - DETECTION_ENGINE_RULES_MAY_NOT_MATCH - ); - }); - - test('it warns pages may not display events', () => { - expect(screen.getByTestId('pagesMayNotDisplayEvents')).toHaveTextContent( - PAGES_MAY_NOT_DISPLAY_EVENTS - ); - }); - - test("it warns mappings that don't comply with ECS are unsupported", () => { - expect(screen.getByTestId('mappingsThatDontComply')).toHaveTextContent( - MAPPINGS_THAT_CONFLICT_WITH_ECS - ); - }); - - test('it renders the children', () => { - expect(screen.getByTestId('children')).toHaveTextContent(content); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx deleted file mode 100644 index e1080569db4ee..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx +++ /dev/null @@ -1,49 +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 { EcsVersion } from '@elastic/ecs'; - -import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import React, { useMemo } from 'react'; - -import * as i18n from '../../../index_properties/translations'; -import { CalloutItem } from '../../styles'; -import type { EcsBasedFieldMetadata } from '../../../../types'; - -interface Props { - children?: React.ReactNode; - ecsBasedFieldMetadata: EcsBasedFieldMetadata[]; -} - -const IncompatibleCalloutComponent: React.FC = ({ children, ecsBasedFieldMetadata }) => { - const fieldCount = ecsBasedFieldMetadata.length; - const title = useMemo( - () => {i18n.INCOMPATIBLE_CALLOUT_TITLE(fieldCount)}, - [fieldCount] - ); - - return ( - -
{i18n.INCOMPATIBLE_CALLOUT(EcsVersion)}
- - - {i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} - - - {i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} - - - {i18n.MAPPINGS_THAT_CONFLICT_WITH_ECS} - - - {children} -
- ); -}; -IncompatibleCalloutComponent.displayName = 'IncompatibleCalloutComponent'; - -export const IncompatibleCallout = React.memo(IncompatibleCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx deleted file mode 100644 index 1db9e3cb6a494..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import React from 'react'; - -import * as i18n from '../../../index_properties/translations'; -import { CalloutItem } from '../../styles'; - -interface Props { - children?: React.ReactNode; -} - -const MissingTimestampCalloutComponent: React.FC = ({ children }) => ( - -
{i18n.MISSING_TIMESTAMP_CALLOUT}
- - {i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} - {i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} - - {children} -
-); - -MissingTimestampCalloutComponent.displayName = 'MissingTimestampCalloutComponent'; - -export const MissingTimestampCallout = React.memo(MissingTimestampCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx deleted file mode 100644 index 774b0a04ec174..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx +++ /dev/null @@ -1,51 +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 { EcsVersion } from '@elastic/ecs'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { FIELDS_WITH_MAPPINGS_SAME_FAMILY } from '../../../index_properties/translations'; -import { TestProviders } from '../../../../mock/test_providers/test_providers'; -import { SameFamilyCallout } from '.'; -import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; - -const content = 'you are reviewing a pull request'; - -describe('SameFamilyCallout', () => { - beforeEach(() => { - render( - - -
{content}
-
-
- ); - }); - - test('it renders a title with the expected count of same family field mappings', () => { - expect(screen.getByTestId('title')).toHaveTextContent('1 Same family field mapping'); - }); - - test('it includes the ECS version in the main content', () => { - expect(screen.getByTestId('fieldsDefinedByEcs')).toHaveTextContent( - `This field is defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but its mapping type doesn't exactly match.` - ); - }); - - test('it notes fields with mappings have the same behavior, but may have different space usage or performance characteristics', () => { - expect(screen.getByTestId('fieldsWithMappingsSameFamily')).toHaveTextContent( - FIELDS_WITH_MAPPINGS_SAME_FAMILY - ); - }); - - test('it renders the children', () => { - expect(screen.getByTestId('children')).toHaveTextContent(content); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx deleted file mode 100644 index ffec880687c8c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx +++ /dev/null @@ -1,49 +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 { EcsVersion } from '@elastic/ecs'; -import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui'; -import React, { useMemo } from 'react'; - -import * as i18n from '../../../index_properties/translations'; -import type { EcsBasedFieldMetadata } from '../../../../types'; - -interface Props { - children?: React.ReactNode; - ecsBasedFieldMetadata: EcsBasedFieldMetadata[]; -} - -const SameFamilyCalloutComponent: React.FC = ({ children, ecsBasedFieldMetadata }) => { - const title = useMemo( - () => ( - - {i18n.SAME_FAMILY_CALLOUT_TITLE(ecsBasedFieldMetadata.length)} - - ), - [ecsBasedFieldMetadata.length] - ); - - return ( - -
- {i18n.SAME_FAMILY_CALLOUT({ - fieldCount: ecsBasedFieldMetadata.length, - version: EcsVersion, - })} -
- -
- - {i18n.FIELDS_WITH_MAPPINGS_SAME_FAMILY} - -
- {children} -
- ); -}; - -export const SameFamilyCallout = React.memo(SameFamilyCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts deleted file mode 100644 index 31dd9644bbc1d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts +++ /dev/null @@ -1,140 +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 numeral from '@elastic/numeral'; -import { EcsVersion } from '@elastic/ecs'; -import { euiThemeVars } from '@kbn/ui-theme'; - -import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../index_properties/translations'; -import { - getAllCustomMarkdownComments, - getCustomColor, - getCustomMarkdownComment, - showCustomCallout, -} from './helpers'; -import { - hostNameKeyword, - someField, -} from '../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { PartitionedFieldMetadata } from '../../../types'; -import { EMPTY_STAT } from '../../../helpers'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -describe('helpers', () => { - describe('getCustomMarkdownComment', () => { - test('it returns a comment for custom fields with the expected field counts and ECS version', () => { - expect(getCustomMarkdownComment({ customFieldMetadata: [hostNameKeyword, someField] })) - .toEqual(`#### 2 Custom field mappings - -These fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}. - -${ECS_IS_A_PERMISSIVE_SCHEMA} -`); - }); - }); - - describe('showCustomCallout', () => { - test('it returns false when `enrichedFieldMetadata` is empty', () => { - expect(showCustomCallout([])).toBe(false); - }); - - test('it returns true when `enrichedFieldMetadata` is NOT empty', () => { - expect(showCustomCallout([someField])).toBe(true); - }); - }); - - describe('getCustomColor', () => { - test('it returns the expected color when there are custom fields', () => { - expect(getCustomColor(mockPartitionedFieldMetadata)).toEqual(euiThemeVars.euiColorLightShade); - }); - - test('it returns the expected color when custom fields is empty', () => { - const noCustomFields: PartitionedFieldMetadata = { - ...mockPartitionedFieldMetadata, - custom: [], // <-- empty - }; - - expect(getCustomColor(noCustomFields)).toEqual(euiThemeVars.euiTextColor); - }); - }); - - describe('getAllCustomMarkdownComments', () => { - test('it returns the expected comment', () => { - expect( - getAllCustomMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, - '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', - ]); - }); - - test('it returns the expected comment without ILM Phase when isILMAvailable is false', () => { - expect( - getAllCustomMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, - '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', - ]); - }); - - test('it returns the expected comment without Size when Size is undefined', () => { - expect( - getAllCustomMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, - '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts deleted file mode 100644 index f5b6ca7220809..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EcsVersion } from '@elastic/ecs'; -import { euiThemeVars } from '@kbn/ui-theme'; - -import { FIELD, INDEX_MAPPING_TYPE } from '../../../compare_fields_table/translations'; -import { - getSummaryMarkdownComment, - getCustomMarkdownTableRows, - getMarkdownComment, - getMarkdownTable, - getTabCountsMarkdownComment, - getSummaryTableMarkdownComment, -} from '../../index_properties/markdown/helpers'; -import * as i18n from '../../index_properties/translations'; -import { getFillColor } from '../summary_tab/helpers'; -import type { CustomFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; - -export const getCustomMarkdownComment = ({ - customFieldMetadata, -}: { - customFieldMetadata: CustomFieldMetadata[]; -}): string => - getMarkdownComment({ - suggestedAction: `${i18n.CUSTOM_CALLOUT({ - fieldCount: customFieldMetadata.length, - version: EcsVersion, - })} - -${i18n.ECS_IS_A_PERMISSIVE_SCHEMA} -`, - title: i18n.CUSTOM_CALLOUT_TITLE(customFieldMetadata.length), - }); - -export const showCustomCallout = (customFieldMetadata: CustomFieldMetadata[]): boolean => - customFieldMetadata.length > 0; - -export const getCustomColor = (partitionedFieldMetadata: PartitionedFieldMetadata): string => - showCustomCallout(partitionedFieldMetadata.custom) - ? getFillColor('custom') - : euiThemeVars.euiTextColor; - -export const getAllCustomMarkdownComments = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - isILMAvailable: boolean; - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string[] => [ - getSummaryMarkdownComment(indexName), - getSummaryTableMarkdownComment({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - getTabCountsMarkdownComment(partitionedFieldMetadata), - getCustomMarkdownComment({ - customFieldMetadata: partitionedFieldMetadata.custom, - }), - getMarkdownTable({ - enrichedFieldMetadata: partitionedFieldMetadata.custom, - getMarkdownTableRows: getCustomMarkdownTableRows, - headerNames: [FIELD, INDEX_MAPPING_TYPE], - title: i18n.CUSTOM_FIELDS_TABLE_TITLE(indexName), - }), -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx deleted file mode 100644 index b976be6193087..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx +++ /dev/null @@ -1,121 +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 { - copyToClipboard, - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiEmptyPrompt, - EuiSpacer, -} from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import { CustomCallout } from '../callouts/custom_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getCustomTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; -import { getAllCustomMarkdownComments, showCustomCallout } from './helpers'; -import * as i18n from '../../index_properties/translations'; -import { COPIED_RESULTS_TOAST_TITLE } from '../../../translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -} - -const CustomTabComponent: React.FC = ({ - addSuccessToast, - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const markdownComments: string[] = useMemo( - () => - getAllCustomMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - [ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - ] - ); - - const body = useMemo(() => , []); - const title = useMemo(() => , []); - - const onCopy = useCallback(() => { - copyToClipboard(markdownComments.join('\n')); - - addSuccessToast({ - title: COPIED_RESULTS_TOAST_TITLE, - }); - }, [addSuccessToast, markdownComments]); - - return ( - <> - {showCustomCallout(partitionedFieldMetadata.custom) ? ( - <> - - - - - {i18n.COPY_TO_CLIPBOARD} - - - - - - - - - - ) : ( - - )} - - ); -}; - -CustomTabComponent.displayName = 'CustomTabComponent'; - -export const CustomTab = React.memo(CustomTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx deleted file mode 100644 index 855ef75e80b84..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx +++ /dev/null @@ -1,80 +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 { EcsVersion } from '@elastic/ecs'; - -import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getEcsCompliantTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; -import { showMissingTimestampCallout } from '../helpers'; -import { CalloutItem } from '../styles'; -import * as i18n from '../../index_properties/translations'; -import type { PartitionedFieldMetadata } from '../../../types'; - -const EmptyPromptContainer = styled.div` - width: 100%; -`; - -interface Props { - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata; -} - -const EcsCompliantTabComponent: React.FC = ({ indexName, partitionedFieldMetadata }) => { - const emptyPromptBody = useMemo(() => , []); - const title = useMemo(() => , []); - - return ( - <> - {!showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant) ? ( - <> - -

- {i18n.ECS_COMPLIANT_CALLOUT({ - fieldCount: partitionedFieldMetadata.ecsCompliant.length, - version: EcsVersion, - })} -

- {i18n.PRE_BUILT_DETECTION_ENGINE_RULES_WORK} - {i18n.CUSTOM_DETECTION_ENGINE_RULES_WORK} - {i18n.PAGES_DISPLAY_EVENTS} - {i18n.OTHER_APP_CAPABILITIES_WORK_PROPERLY} - {i18n.ECS_COMPLIANT_MAPPINGS_ARE_FULLY_SUPPORTED} -
- - - - ) : ( - - - - )} - - ); -}; - -EcsCompliantTabComponent.displayName = 'EcsCompliantTabComponent'; - -export const EcsCompliantTab = React.memo(EcsCompliantTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx deleted file mode 100644 index 3c04a6473facf..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx +++ /dev/null @@ -1,116 +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 { DARK_THEME } from '@elastic/charts'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { omit } from 'lodash/fp'; - -import { - eventCategory, - timestamp, -} from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { mockStatsAuditbeatIndex } from '../../mock/stats/mock_stats_packetbeat_index'; -import { - getEcsCompliantColor, - getMissingTimestampComment, - getTabs, - showMissingTimestampCallout, -} from './helpers'; - -describe('helpers', () => { - describe('getMissingTimestampComment', () => { - test('it returns the expected comment', () => { - expect(getMissingTimestampComment()).toEqual( - '#### Missing an @timestamp (date) field mapping for this index\n\nConsider adding an @timestamp (date) field mapping to this index, as required by the Elastic Common Schema (ECS), because:\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n' - ); - }); - }); - - describe('showMissingTimestampCallout', () => { - test('it returns true when `enrichedFieldMetadata` is empty', () => { - expect(showMissingTimestampCallout([])).toBe(true); - }); - - test('it returns false when `enrichedFieldMetadata` contains an @timestamp field', () => { - expect(showMissingTimestampCallout([timestamp, eventCategory])).toBe(false); - }); - - test('it returns true when `enrichedFieldMetadata` does NOT contain an @timestamp field', () => { - expect(showMissingTimestampCallout([eventCategory])).toBe(true); - }); - }); - - describe('getEcsCompliantColor', () => { - test('it returns the expected color for the ECS compliant data when the data includes an @timestamp', () => { - expect(getEcsCompliantColor(mockPartitionedFieldMetadata)).toEqual( - euiThemeVars.euiColorSuccess - ); - }); - - test('it returns the expected color for the ECS compliant data does NOT includes an @timestamp', () => { - const noTimestamp = { - ...mockPartitionedFieldMetadata, - ecsCompliant: mockPartitionedFieldMetadata.ecsCompliant.filter( - ({ name }) => name !== '@timestamp' - ), - }; - - expect(getEcsCompliantColor(noTimestamp)).toEqual(euiThemeVars.euiColorDanger); - }); - }); - - describe('getTabs', () => { - test('it returns the expected tabs', () => { - expect( - getTabs({ - addSuccessToast: jest.fn(), - addToNewCaseDisabled: false, - docsCount: 4, - formatBytes: jest.fn(), - formatNumber: jest.fn(), - getGroupByFieldsOnClick: jest.fn(), - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isAssistantEnabled: true, - onAddToNewCase: jest.fn(), - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'auditbeat-*', - patternDocsCount: 57410, - setSelectedTabId: jest.fn(), - stats: mockStatsAuditbeatIndex, - baseTheme: DARK_THEME, - }).map((x) => omit(['append', 'content'], x)) - ).toEqual([ - { - id: 'summaryTab', - name: 'Summary', - }, - { - id: 'incompatibleTab', - name: 'Incompatible fields', - }, - { - id: 'sameFamilyTab', - name: 'Same family', - }, - { - id: 'customTab', - name: 'Custom fields', - }, - { - id: 'ecsCompliantTab', - name: 'ECS compliant fields', - }, - { - id: 'allTab', - name: 'All fields', - }, - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx deleted file mode 100644 index 8790ab12591b3..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx +++ /dev/null @@ -1,230 +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 type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { EuiBadge } from '@elastic/eui'; -import { euiThemeVars } from '@kbn/ui-theme'; -import React from 'react'; - -import { AllTab } from './all_tab'; -import { CustomTab } from './custom_tab'; -import { getCustomColor } from './custom_tab/helpers'; -import { EcsCompliantTab } from './ecs_compliant_tab'; -import { getSizeInBytes } from '../../helpers'; -import { IncompatibleTab } from './incompatible_tab'; -import { getIncompatibleColor, getSameFamilyColor } from './incompatible_tab/helpers'; -import { - ALL_TAB_ID, - ECS_COMPLIANT_TAB_ID, - INCOMPATIBLE_TAB_ID, - SAME_FAMILY_TAB_ID, - SUMMARY_TAB_ID, -} from '../index_properties/helpers'; -import { getMarkdownComment } from '../index_properties/markdown/helpers'; -import * as i18n from '../index_properties/translations'; -import { SameFamilyTab } from './same_family_tab'; -import { SummaryTab } from './summary_tab'; -import { getFillColor } from './summary_tab/helpers'; -import type { - EcsBasedFieldMetadata, - IlmPhase, - MeteringStatsIndex, - PartitionedFieldMetadata, -} from '../../types'; - -export const getMissingTimestampComment = (): string => - getMarkdownComment({ - suggestedAction: `${i18n.MISSING_TIMESTAMP_CALLOUT} - -${i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} -${i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} -`, - title: i18n.MISSING_TIMESTAMP_CALLOUT_TITLE, - }); - -export const showMissingTimestampCallout = ( - ecsBasedFieldMetadata: EcsBasedFieldMetadata[] -): boolean => !ecsBasedFieldMetadata.some((x) => x.name === '@timestamp'); - -export const getEcsCompliantColor = (partitionedFieldMetadata: PartitionedFieldMetadata): string => - showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant) - ? euiThemeVars.euiColorDanger - : getFillColor('ecs-compliant'); - -export const getTabs = ({ - addSuccessToast, - addToNewCaseDisabled, - docsCount, - formatBytes, - formatNumber, - getGroupByFieldsOnClick, - ilmPhase, - indexName, - isAssistantEnabled, - onAddToNewCase, - partitionedFieldMetadata, - pattern, - patternDocsCount, - setSelectedTabId, - stats, - theme, - baseTheme, -}: { - addSuccessToast: (toast: { title: string }) => void; - addToNewCaseDisabled: boolean; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - docsCount: number; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhase: IlmPhase | undefined; - indexName: string; - isAssistantEnabled: boolean; - onAddToNewCase: (markdownComments: string[]) => void; - partitionedFieldMetadata: PartitionedFieldMetadata; - pattern: string; - patternDocsCount: number; - setSelectedTabId: (tabId: string) => void; - stats: Record | null; - theme?: PartialTheme; - baseTheme: Theme; -}) => [ - { - content: ( - - ), - id: SUMMARY_TAB_ID, - name: i18n.SUMMARY, - }, - { - append: ( - - {partitionedFieldMetadata.incompatible.length} - - ), - content: ( - - ), - id: INCOMPATIBLE_TAB_ID, - name: i18n.INCOMPATIBLE_FIELDS, - }, - { - append: ( - {partitionedFieldMetadata.sameFamily.length} - ), - content: ( - - ), - id: SAME_FAMILY_TAB_ID, - name: i18n.SAME_FAMILY, - }, - { - append: ( - - {partitionedFieldMetadata.custom.length} - - ), - content: ( - - ), - id: 'customTab', - name: i18n.CUSTOM_FIELDS, - }, - { - append: ( - - {partitionedFieldMetadata.ecsCompliant.length} - - ), - content: ( - - ), - id: ECS_COMPLIANT_TAB_ID, - name: i18n.ECS_COMPLIANT_FIELDS, - }, - { - append: ( - - {partitionedFieldMetadata.all.length} - - ), - content: , - id: ALL_TAB_ID, - name: i18n.ALL_FIELDS, - }, -]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts deleted file mode 100644 index 34f4bd2448686..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts +++ /dev/null @@ -1,442 +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 numeral from '@elastic/numeral'; -import { EcsVersion } from '@elastic/ecs'; -import { euiThemeVars } from '@kbn/ui-theme'; - -import { - getAllIncompatibleMarkdownComments, - getIncompatibleColor, - getIncompatibleFieldsMarkdownComment, - getIncompatibleFieldsMarkdownTablesComment, - getIncompatibleMappings, - getIncompatibleMappingsFields, - getIncompatibleValues, - getIncompatibleValuesFields, - getSameFamilyColor, - showInvalidCallout, -} from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; -import { - DETECTION_ENGINE_RULES_MAY_NOT_MATCH, - MAPPINGS_THAT_CONFLICT_WITH_ECS, - PAGES_MAY_NOT_DISPLAY_EVENTS, -} from '../../index_properties/translations'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { PartitionedFieldMetadata } from '../../../types'; - -describe('helpers', () => { - describe('getIncompatibleFieldsMarkdownComment', () => { - test('it returns the expected counts and ECS version', () => { - expect(getIncompatibleFieldsMarkdownComment(11)).toEqual(`#### 11 incompatible fields - -Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}. - -${DETECTION_ENGINE_RULES_MAY_NOT_MATCH} -${PAGES_MAY_NOT_DISPLAY_EVENTS} -${MAPPINGS_THAT_CONFLICT_WITH_ECS} -`); - }); - }); - - describe('showInvalidCallout', () => { - test('it returns false when the `enrichedFieldMetadata` is empty', () => { - expect(showInvalidCallout([])).toBe(false); - }); - - test('it returns true when the `enrichedFieldMetadata` is NOT empty', () => { - expect(showInvalidCallout(mockPartitionedFieldMetadata.incompatible)).toBe(true); - }); - }); - - describe('getIncompatibleColor', () => { - test('it returns the expected color', () => { - expect(getIncompatibleColor()).toEqual(euiThemeVars.euiColorDanger); - }); - }); - - describe('getSameFamilyColor', () => { - test('it returns the expected color', () => { - expect(getSameFamilyColor()).toEqual(euiThemeVars.euiColorLightShade); - }); - }); - - describe('getIncompatibleMappings', () => { - test('it (only) returns the mappings where type !== indexFieldType', () => { - expect(getIncompatibleMappings(mockPartitionedFieldMetadata.incompatible)).toEqual([ - { - dashed_name: 'host-name', - description: - 'Name of the host.\nIt can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.', - flat_name: 'host.name', - hasEcsMetadata: true, - ignore_above: 1024, - indexFieldName: 'host.name', - indexFieldType: 'text', - indexInvalidValues: [], - isEcsCompliant: false, - isInSameFamily: false, - level: 'core', - name: 'name', - normalize: [], - short: 'Name of the host.', - type: 'keyword', - }, - { - dashed_name: 'source-ip', - description: 'IP address of the source (IPv4 or IPv6).', - flat_name: 'source.ip', - hasEcsMetadata: true, - indexFieldName: 'source.ip', - indexFieldType: 'text', - indexInvalidValues: [], - isEcsCompliant: false, - isInSameFamily: false, - level: 'core', - name: 'ip', - normalize: [], - short: 'IP address of the source.', - type: 'ip', - }, - ]); - }); - - test('it filters-out ECS complaint fields', () => { - expect(getIncompatibleMappings(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); - }); - }); - - describe('getIncompatibleMappingsFields', () => { - test('it (only) returns the fields where type !== indexFieldType', () => { - expect(getIncompatibleMappingsFields(mockPartitionedFieldMetadata.incompatible)).toEqual([ - 'host.name', - 'source.ip', - ]); - }); - - test('it filters-out ECS complaint fields', () => { - expect(getIncompatibleMappingsFields(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); - }); - }); - - describe('getIncompatibleValues', () => { - test('it (only) returns the mappings with indexInvalidValues', () => { - expect(getIncompatibleValues(mockPartitionedFieldMetadata.incompatible)).toEqual([ - { - allowed_values: [ - { - description: - 'Events in this category are related to the challenge and response process in which credentials are supplied and verified to allow the creation of a session. Common sources for these logs are Windows event logs and ssh logs. Visualize and analyze events in this category to look for failed logins, and other authentication-related activity.', - expected_event_types: ['start', 'end', 'info'], - name: 'authentication', - }, - { - description: - 'Events in the configuration category have to deal with creating, modifying, or deleting the settings or parameters of an application, process, or system.\nExample sources include security policy change logs, configuration auditing logging, and system integrity monitoring.', - expected_event_types: ['access', 'change', 'creation', 'deletion', 'info'], - name: 'configuration', - }, - { - description: - 'The database category denotes events and metrics relating to a data storage and retrieval system. Note that use of this category is not limited to relational database systems. Examples include event logs from MS SQL, MySQL, Elasticsearch, MongoDB, etc. Use this category to visualize and analyze database activity such as accesses and changes.', - expected_event_types: ['access', 'change', 'info', 'error'], - name: 'database', - }, - { - description: - 'Events in the driver category have to do with operating system device drivers and similar software entities such as Windows drivers, kernel extensions, kernel modules, etc.\nUse events and metrics in this category to visualize and analyze driver-related activity and status on hosts.', - expected_event_types: ['change', 'end', 'info', 'start'], - name: 'driver', - }, - { - description: - 'This category is used for events relating to email messages, email attachments, and email network or protocol activity.\nEmails events can be produced by email security gateways, mail transfer agents, email cloud service providers, or mail server monitoring applications.', - expected_event_types: ['info'], - name: 'email', - }, - { - description: - 'Relating to a set of information that has been created on, or has existed on a filesystem. Use this category of events to visualize and analyze the creation, access, and deletions of files. Events in this category can come from both host-based and network-based sources. An example source of a network-based detection of a file transfer would be the Zeek file.log.', - expected_event_types: ['change', 'creation', 'deletion', 'info'], - name: 'file', - }, - { - description: - 'Use this category to visualize and analyze information such as host inventory or host lifecycle events.\nMost of the events in this category can usually be observed from the outside, such as from a hypervisor or a control plane\'s point of view. Some can also be seen from within, such as "start" or "end".\nNote that this category is for information about hosts themselves; it is not meant to capture activity "happening on a host".', - expected_event_types: ['access', 'change', 'end', 'info', 'start'], - name: 'host', - }, - { - description: - 'Identity and access management (IAM) events relating to users, groups, and administration. Use this category to visualize and analyze IAM-related logs and data from active directory, LDAP, Okta, Duo, and other IAM systems.', - expected_event_types: [ - 'admin', - 'change', - 'creation', - 'deletion', - 'group', - 'info', - 'user', - ], - name: 'iam', - }, - { - description: - 'Relating to intrusion detections from IDS/IPS systems and functions, both network and host-based. Use this category to visualize and analyze intrusion detection alerts from systems such as Snort, Suricata, and Palo Alto threat detections.', - expected_event_types: ['allowed', 'denied', 'info'], - name: 'intrusion_detection', - }, - { - description: - 'Malware detection events and alerts. Use this category to visualize and analyze malware detections from EDR/EPP systems such as Elastic Endpoint Security, Symantec Endpoint Protection, Crowdstrike, and network IDS/IPS systems such as Suricata, or other sources of malware-related events such as Palo Alto Networks threat logs and Wildfire logs.', - expected_event_types: ['info'], - name: 'malware', - }, - { - description: - 'Relating to all network activity, including network connection lifecycle, network traffic, and essentially any event that includes an IP address. Many events containing decoded network protocol transactions fit into this category. Use events in this category to visualize or analyze counts of network ports, protocols, addresses, geolocation information, etc.', - expected_event_types: [ - 'access', - 'allowed', - 'connection', - 'denied', - 'end', - 'info', - 'protocol', - 'start', - ], - name: 'network', - }, - { - description: - 'Relating to software packages installed on hosts. Use this category to visualize and analyze inventory of software installed on various hosts, or to determine host vulnerability in the absence of vulnerability scan data.', - expected_event_types: [ - 'access', - 'change', - 'deletion', - 'info', - 'installation', - 'start', - ], - name: 'package', - }, - { - description: - 'Use this category of events to visualize and analyze process-specific information such as lifecycle events or process ancestry.', - expected_event_types: ['access', 'change', 'end', 'info', 'start'], - name: 'process', - }, - { - description: - 'Having to do with settings and assets stored in the Windows registry. Use this category to visualize and analyze activity such as registry access and modifications.', - expected_event_types: ['access', 'change', 'creation', 'deletion'], - name: 'registry', - }, - { - description: - 'The session category is applied to events and metrics regarding logical persistent connections to hosts and services. Use this category to visualize and analyze interactive or automated persistent connections between assets. Data for this category may come from Windows Event logs, SSH logs, or stateless sessions such as HTTP cookie-based sessions, etc.', - expected_event_types: ['start', 'end', 'info'], - name: 'session', - }, - { - description: - "Use this category to visualize and analyze events describing threat actors' targets, motives, or behaviors.", - expected_event_types: ['indicator'], - name: 'threat', - }, - { - description: - 'Relating to vulnerability scan results. Use this category to analyze vulnerabilities detected by Tenable, Qualys, internal scanners, and other vulnerability management sources.', - expected_event_types: ['info'], - name: 'vulnerability', - }, - { - description: - 'Relating to web server access. Use this category to create a dashboard of web server/proxy activity from apache, IIS, nginx web servers, etc. Note: events from network observers such as Zeek http log may also be included in this category.', - expected_event_types: ['access', 'error', 'info'], - name: 'web', - }, - ], - dashed_name: 'event-category', - description: - 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', - example: 'authentication', - flat_name: 'event.category', - ignore_above: 1024, - level: 'core', - name: 'category', - normalize: ['array'], - short: 'Event category. The second categorization field in the hierarchy.', - type: 'keyword', - indexFieldName: 'event.category', - indexFieldType: 'keyword', - indexInvalidValues: [ - { count: 2, fieldName: 'an_invalid_category' }, - { count: 1, fieldName: 'theory' }, - ], - hasEcsMetadata: true, - isEcsCompliant: false, - isInSameFamily: false, - }, - ]); - }); - - test('it filters-out ECS complaint fields', () => { - expect(getIncompatibleValues(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); - }); - }); - - describe('getIncompatibleValuesFields', () => { - test('it (only) returns the fields with indexInvalidValues', () => { - expect(getIncompatibleValuesFields(mockPartitionedFieldMetadata.incompatible)).toEqual([ - 'event.category', - ]); - }); - - test('it filters-out ECS complaint fields', () => { - expect(getIncompatibleValuesFields(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); - }); - }); - - describe('getIncompatibleFieldsMarkdownTablesComment', () => { - test('it returns the expected comment when the index has `incompatibleMappings` and `incompatibleValues`', () => { - expect( - getIncompatibleFieldsMarkdownTablesComment({ - incompatibleMappings: [ - mockPartitionedFieldMetadata.incompatible[1], - mockPartitionedFieldMetadata.incompatible[2], - ], - incompatibleValues: [mockPartitionedFieldMetadata.incompatible[0]], - indexName: 'auditbeat-custom-index-1', - }) - ).toEqual( - '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n' - ); - }); - - test('it returns the expected comment when the index does NOT have `incompatibleMappings` and `incompatibleValues`', () => { - expect( - getIncompatibleFieldsMarkdownTablesComment({ - incompatibleMappings: [], // <-- no `incompatibleMappings` - incompatibleValues: [], // <-- no `incompatibleValues` - indexName: 'auditbeat-custom-index-1', - }) - ).toEqual('\n\n\n'); - }); - }); - - describe('getAllIncompatibleMarkdownComments', () => { - const defaultBytesFormat = '0,0.[0]b'; - const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - - const defaultNumberFormat = '0,0.[000]'; - const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - - test('it returns the expected collection of comments', () => { - expect( - getAllIncompatibleMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - isILMAvailable: true, - indexName: 'auditbeat-custom-index-1', - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n${DETECTION_ENGINE_RULES_MAY_NOT_MATCH}\n${PAGES_MAY_NOT_DISPLAY_EVENTS}\n${MAPPINGS_THAT_CONFLICT_WITH_ECS}\n`, - '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', - ]); - }); - - test('it returns the expected comment when `incompatible` is empty', () => { - const emptyIncompatible: PartitionedFieldMetadata = { - ...mockPartitionedFieldMetadata, - incompatible: [], // <-- empty - }; - - expect( - getAllIncompatibleMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - partitionedFieldMetadata: emptyIncompatible, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - '\n\n\n', - ]); - }); - - test('it returns the expected comment when `isILMAvailable` is false', () => { - const emptyIncompatible: PartitionedFieldMetadata = { - ...mockPartitionedFieldMetadata, - incompatible: [], // <-- empty - }; - - expect( - getAllIncompatibleMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: emptyIncompatible, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 |\n\n', - '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - '\n\n\n', - ]); - }); - - test('it returns the expected comment when `sizeInBytes` is not an integer', () => { - const emptyIncompatible: PartitionedFieldMetadata = { - ...mockPartitionedFieldMetadata, - incompatible: [], // <-- empty - }; - - expect( - getAllIncompatibleMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: false, - partitionedFieldMetadata: emptyIncompatible, - patternDocsCount: 57410, - sizeInBytes: undefined, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 |\n\n', - '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - '\n\n\n', - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts deleted file mode 100644 index 857b53589f163..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts +++ /dev/null @@ -1,191 +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 { EcsVersion } from '@elastic/ecs'; - -import { - getSummaryMarkdownComment, - getIncompatibleMappingsMarkdownTableRows, - getIncompatibleValuesMarkdownTableRows, - getMarkdownComment, - getMarkdownTable, - getSummaryTableMarkdownComment, - getTabCountsMarkdownComment, - escape, -} from '../../index_properties/markdown/helpers'; -import { getFillColor } from '../summary_tab/helpers'; -import * as i18n from '../../index_properties/translations'; -import type { EcsBasedFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; -import { - INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, - INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, -} from './translations'; -import { - FIELD, - ECS_MAPPING_TYPE_EXPECTED, - INDEX_MAPPING_TYPE_ACTUAL, - DOCUMENT_VALUES_ACTUAL, - ECS_VALUES_EXPECTED, -} from '../../../compare_fields_table/translations'; -import { getIsInSameFamily } from '../../../helpers'; - -export const getIncompatibleFieldsMarkdownComment = (incompatible: number): string => - getMarkdownComment({ - suggestedAction: `${i18n.INCOMPATIBLE_CALLOUT(EcsVersion)} - -${i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} -${i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} -${i18n.MAPPINGS_THAT_CONFLICT_WITH_ECS} -`, - title: i18n.INCOMPATIBLE_CALLOUT_TITLE(incompatible), - }); - -export const showInvalidCallout = (ecsBasedFieldMetadata: EcsBasedFieldMetadata[]): boolean => - ecsBasedFieldMetadata.length > 0; - -export const getIncompatibleColor = (): string => getFillColor('incompatible'); - -export const getSameFamilyColor = (): string => getFillColor('same-family'); - -export const getIncompatibleMappings = ( - ecsBasedFieldMetadata: EcsBasedFieldMetadata[] -): EcsBasedFieldMetadata[] => - ecsBasedFieldMetadata.filter( - (x) => - !x.isEcsCompliant && - x.type !== x.indexFieldType && - !getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType }) - ); - -export const getIncompatibleMappingsFields = ( - ecsBasedFieldMetadata: EcsBasedFieldMetadata[] -): string[] => - ecsBasedFieldMetadata.reduce((acc, x) => { - if ( - !x.isEcsCompliant && - x.type !== x.indexFieldType && - !getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType }) - ) { - const field = escape(x.indexFieldName); - if (field != null) { - return [...acc, field]; - } - } - return acc; - }, []); - -export const getSameFamilyFields = (ecsBasedFieldMetadata: EcsBasedFieldMetadata[]): string[] => - ecsBasedFieldMetadata.reduce((acc, x) => { - if (!x.isEcsCompliant && x.type !== x.indexFieldType && x.isInSameFamily) { - const field = escape(x.indexFieldName); - if (field != null) { - return [...acc, field]; - } - } - return acc; - }, []); - -export const getIncompatibleValues = ( - ecsBasedFieldMetadata: EcsBasedFieldMetadata[] -): EcsBasedFieldMetadata[] => - ecsBasedFieldMetadata.filter((x) => !x.isEcsCompliant && x.indexInvalidValues.length > 0); - -export const getIncompatibleValuesFields = ( - ecsBasedFieldMetadata: EcsBasedFieldMetadata[] -): string[] => - ecsBasedFieldMetadata.reduce((acc, x) => { - if (!x.isEcsCompliant && x.indexInvalidValues.length > 0) { - const field = escape(x.indexFieldName); - if (field != null) { - return [...acc, field]; - } - } - return acc; - }, []); - -export const getIncompatibleFieldsMarkdownTablesComment = ({ - incompatibleMappings, - incompatibleValues, - indexName, -}: { - incompatibleMappings: EcsBasedFieldMetadata[]; - incompatibleValues: EcsBasedFieldMetadata[]; - indexName: string; -}): string => ` -${ - incompatibleMappings.length > 0 - ? getMarkdownTable({ - enrichedFieldMetadata: incompatibleMappings, - getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, - headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], - title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), - }) - : '' -} -${ - incompatibleValues.length > 0 - ? getMarkdownTable({ - enrichedFieldMetadata: incompatibleValues, - getMarkdownTableRows: getIncompatibleValuesMarkdownTableRows, - headerNames: [FIELD, ECS_VALUES_EXPECTED, DOCUMENT_VALUES_ACTUAL], - title: INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE(indexName), - }) - : '' -} -`; - -export const getAllIncompatibleMarkdownComments = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isILMAvailable: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string[] => { - const incompatibleMappings = getIncompatibleMappings(partitionedFieldMetadata.incompatible); - const incompatibleValues = getIncompatibleValues(partitionedFieldMetadata.incompatible); - - const incompatibleFieldsMarkdownComment = - partitionedFieldMetadata.incompatible.length > 0 - ? getIncompatibleFieldsMarkdownComment(partitionedFieldMetadata.incompatible.length) - : ''; - - return [ - getSummaryMarkdownComment(indexName), - getSummaryTableMarkdownComment({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - getTabCountsMarkdownComment(partitionedFieldMetadata), - incompatibleFieldsMarkdownComment, - getIncompatibleFieldsMarkdownTablesComment({ - incompatibleMappings, - incompatibleValues, - indexName, - }), - ].filter((x) => x !== ''); -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx deleted file mode 100644 index 94333d57da0b2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx +++ /dev/null @@ -1,205 +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 { NewChat } from '@kbn/elastic-assistant'; -import { - copyToClipboard, - EuiButton, - EuiFlexGroup, - EuiFlexItem, - EuiEmptyPrompt, - EuiSpacer, -} from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import { IncompatibleCallout } from '../callouts/incompatible_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getIncompatibleMappingsTableColumns } from '../../../compare_fields_table/get_incompatible_mappings_table_columns'; -import { getIncompatibleValuesTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; -import { - getAllIncompatibleMarkdownComments, - getIncompatibleMappings, - getIncompatibleValues, - showInvalidCallout, -} from './helpers'; -import * as i18n from '../../index_properties/translations'; -import { CopyToClipboardButton } from '../styles'; -import { - INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, - INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, -} from './translations'; -import { - COPIED_RESULTS_TOAST_TITLE, - DATA_QUALITY_PROMPT_CONTEXT_PILL, - DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP, - DATA_QUALITY_SUGGESTED_USER_PROMPT, -} from '../../../translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; -import { DATA_QUALITY_DASHBOARD_CONVERSATION_ID } from '../summary_tab/callout_summary/translations'; -import { useDataQualityContext } from '../../data_quality_context'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - addToNewCaseDisabled: boolean; - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isAssistantEnabled: boolean; - onAddToNewCase: (markdownComments: string[]) => void; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -} - -const IncompatibleTabComponent: React.FC = ({ - addSuccessToast, - addToNewCaseDisabled, - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isAssistantEnabled, - onAddToNewCase, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const body = useMemo(() => , []); - const title = useMemo(() => , []); - const incompatibleMappings = useMemo( - () => getIncompatibleMappings(partitionedFieldMetadata.incompatible), - [partitionedFieldMetadata.incompatible] - ); - const incompatibleValues = useMemo( - () => getIncompatibleValues(partitionedFieldMetadata.incompatible), - [partitionedFieldMetadata.incompatible] - ); - const markdownComments: string[] = useMemo( - () => - getAllIncompatibleMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - [ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - ] - ); - const onClickAddToCase = useCallback( - () => onAddToNewCase([markdownComments.join('\n')]), - [markdownComments, onAddToNewCase] - ); - const onCopy = useCallback(() => { - copyToClipboard(markdownComments.join('\n')); - - addSuccessToast({ - title: COPIED_RESULTS_TOAST_TITLE, - }); - }, [addSuccessToast, markdownComments]); - - const getPromptContext = useCallback(async () => markdownComments.join('\n'), [markdownComments]); - - return ( -
- {showInvalidCallout(partitionedFieldMetadata.incompatible) ? ( - <> - - - - - {i18n.ADD_TO_NEW_CASE} - - - - - - {i18n.COPY_TO_CLIPBOARD} - - - - - - - - - - <> - {incompatibleMappings.length > 0 && ( - <> - - - - - )} - - - <> - {incompatibleValues.length > 0 && ( - <> - - - - - )} - - - ) : ( - - )} -
- ); -}; - -IncompatibleTabComponent.displayName = 'IncompatibleTabComponent'; - -export const IncompatibleTab = React.memo(IncompatibleTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts deleted file mode 100644 index 0af79eda5e312..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts +++ /dev/null @@ -1,126 +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 numeral from '@elastic/numeral'; -import { EcsVersion } from '@elastic/ecs'; - -import { - getAllSameFamilyMarkdownComments, - getSameFamilyMarkdownComment, - getSameFamilyMarkdownTablesComment, -} from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { mockPartitionedFieldMetadataWithSameFamily } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; - -describe('helpers', () => { - describe('getSameFamilyMarkdownComment', () => { - test('it returns the expected counts and ECS version', () => { - expect(getSameFamilyMarkdownComment(7)).toEqual(`#### 7 Same family field mappings - -These fields are defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but their mapping types don't exactly match. - -Fields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics. -`); - }); - }); - - describe('getSameFamilyMarkdownTablesComment', () => { - test('it returns the expected comment when the index has same family mappings', () => { - const expected = `\n#### Same family field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| agent.type | \`keyword\` | \`constant_keyword\` \`same family\` |\n\n`; - - expect( - getSameFamilyMarkdownTablesComment({ - sameFamilyMappings: [ - { - dashed_name: 'agent-type', - description: - 'Type of the agent.\nThe agent type always stays the same and should be given by the agent used. In case of Filebeat the agent would always be Filebeat also if two Filebeat instances are run on the same machine.', - example: 'filebeat', - flat_name: 'agent.type', - ignore_above: 1024, - level: 'core', - name: 'type', - normalize: [], - short: 'Type of the agent.', - type: 'keyword', - indexFieldName: 'agent.type', - indexFieldType: 'constant_keyword', - indexInvalidValues: [], - hasEcsMetadata: true, - isEcsCompliant: false, - isInSameFamily: true, - }, - ], - indexName: 'auditbeat-custom-index-1', - }) - ).toEqual(expected); - }); - - test('it returns the expected comment when the index does NOT have same family mappings', () => { - expect( - getSameFamilyMarkdownTablesComment({ - sameFamilyMappings: [], - indexName: 'auditbeat-custom-index-1', - }) - ).toEqual('\n\n'); - }); - }); - - describe('getAllSameFamilyMarkdownComments', () => { - const defaultBytesFormat = '0,0.[0]b'; - const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - - const defaultNumberFormat = '0,0.[000]'; - const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - - test('it returns the expected collection of comments', () => { - expect( - getAllSameFamilyMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadataWithSameFamily, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `3` **Same family** `1` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `10`\n', - `#### 1 Same family field mapping\n\nThis field is defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but its mapping type doesn't exactly match.\n\nFields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics.\n`, - '\n#### Same family field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| agent.type | `keyword` | `constant_keyword` `same family` |\n\n', - ]); - }); - - test('it returns the expected comment when `sameFamily` is empty', () => { - expect( - getAllSameFamilyMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - '\n\n', - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts deleted file mode 100644 index d6c8852bb33bb..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts +++ /dev/null @@ -1,111 +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 { EcsVersion } from '@elastic/ecs'; - -import { - FIELD, - ECS_MAPPING_TYPE_EXPECTED, - INDEX_MAPPING_TYPE_ACTUAL, -} from '../../../compare_fields_table/translations'; -import { - getSummaryMarkdownComment, - getIncompatibleMappingsMarkdownTableRows, - getMarkdownComment, - getMarkdownTable, - getSummaryTableMarkdownComment, - getTabCountsMarkdownComment, -} from '../../index_properties/markdown/helpers'; -import * as i18n from '../../index_properties/translations'; -import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; -import type { EcsBasedFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; - -export const getSameFamilyMarkdownComment = (fieldsInSameFamily: number): string => - getMarkdownComment({ - suggestedAction: `${i18n.SAME_FAMILY_CALLOUT({ - fieldCount: fieldsInSameFamily, - version: EcsVersion, - })} - -${i18n.FIELDS_WITH_MAPPINGS_SAME_FAMILY} -`, - title: i18n.SAME_FAMILY_CALLOUT_TITLE(fieldsInSameFamily), - }); - -export const getSameFamilyMappings = ( - enrichedFieldMetadata: EcsBasedFieldMetadata[] -): EcsBasedFieldMetadata[] => enrichedFieldMetadata.filter((x) => x.isInSameFamily); - -export const getSameFamilyMarkdownTablesComment = ({ - sameFamilyMappings, - indexName, -}: { - sameFamilyMappings: EcsBasedFieldMetadata[]; - indexName: string; -}): string => ` -${ - sameFamilyMappings.length > 0 - ? getMarkdownTable({ - enrichedFieldMetadata: sameFamilyMappings, - getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, - headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], - title: SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE(indexName), - }) - : '' -} -`; - -export const getAllSameFamilyMarkdownComments = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isILMAvailable: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string[] => { - const sameFamilyMappings = getSameFamilyMappings(partitionedFieldMetadata.sameFamily); - const fieldsInSameFamily = partitionedFieldMetadata.sameFamily.length; - - const incompatibleFieldsMarkdownComment = - partitionedFieldMetadata.sameFamily.length > 0 - ? getSameFamilyMarkdownComment(fieldsInSameFamily) - : ''; - - return [ - getSummaryMarkdownComment(indexName), - getSummaryTableMarkdownComment({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - getTabCountsMarkdownComment(partitionedFieldMetadata), - incompatibleFieldsMarkdownComment, - getSameFamilyMarkdownTablesComment({ - sameFamilyMappings, - indexName, - }), - ].filter((x) => x !== ''); -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx deleted file mode 100644 index 26295bbbc2ee8..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx +++ /dev/null @@ -1,111 +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 { copyToClipboard, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import { SameFamilyCallout } from '../callouts/same_family_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getIncompatibleMappingsTableColumns } from '../../../compare_fields_table/get_incompatible_mappings_table_columns'; -import { useDataQualityContext } from '../../data_quality_context'; -import { getAllSameFamilyMarkdownComments, getSameFamilyMappings } from './helpers'; -import * as i18n from '../../index_properties/translations'; -import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; -import { COPIED_RESULTS_TOAST_TITLE } from '../../../translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - partitionedFieldMetadata: PartitionedFieldMetadata; - patternDocsCount: number; - sizeInBytes: number | undefined; -} - -const SameFamilyTabComponent: React.FC = ({ - addSuccessToast, - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}) => { - const sameFamilyMappings = useMemo( - () => getSameFamilyMappings(partitionedFieldMetadata.sameFamily), - [partitionedFieldMetadata.sameFamily] - ); - - const { isILMAvailable } = useDataQualityContext(); - const markdownComments: string[] = useMemo( - () => - getAllSameFamilyMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }), - [ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - ] - ); - - const onCopy = useCallback(() => { - copyToClipboard(markdownComments.join('\n')); - - addSuccessToast({ - title: COPIED_RESULTS_TOAST_TITLE, - }); - }, [addSuccessToast, markdownComments]); - - return ( -
- - - {i18n.COPY_TO_CLIPBOARD} - - - - <> - {sameFamilyMappings.length > 0 && ( - <> - - - - - )} - -
- ); -}; - -SameFamilyTabComponent.displayName = 'SameFamilyTabComponent'; - -export const SameFamilyTab = React.memo(SameFamilyTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/styles.tsx deleted file mode 100644 index 2714d1002c40c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/styles.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButtonEmpty, EuiFlexItem, EuiLink } from '@elastic/eui'; -import styled from 'styled-components'; - -export const DEFAULT_LEGEND_HEIGHT = 300; // px -export const DEFAULT_MAX_CHART_HEIGHT = 300; // px - -export const CalloutItem = styled.div` - margin-left: ${({ theme }) => theme.eui.euiSizeS}; -`; - -export const ChartFlexItem = styled(EuiFlexItem)<{ - $maxChartHeight: number | undefined; - $minChartHeight: number; -}>` - ${({ $maxChartHeight }) => ($maxChartHeight != null ? `max-height: ${$maxChartHeight}px;` : '')} - min-height: ${({ $minChartHeight }) => `${$minChartHeight}px`}; -`; - -export const CopyToClipboardButton = styled(EuiButtonEmpty)` - margin-left: ${({ theme }) => theme.eui.euiSizeXS}; -`; - -export const LegendContainer = styled.div<{ - $height?: number; - $width?: number; -}>` - margin-left: ${({ theme }) => theme.eui.euiSizeM}; - margin-top: ${({ theme }) => theme.eui.euiSizeM}; - ${({ $height }) => ($height != null ? `height: ${$height}px;` : '')} - scrollbar-width: thin; - ${({ $width }) => ($width != null ? `width: ${$width}px;` : '')} -`; - -export const StorageTreemapContainer = styled.div` - padding: ${({ theme }) => theme.eui.euiSizeM}; -`; - -export const ChartLegendLink = styled(EuiLink)` - width: 100%; -`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/index.tsx deleted file mode 100644 index 96b110a05807e..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/index.tsx +++ /dev/null @@ -1,163 +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 { NewChat } from '@kbn/elastic-assistant'; -import { copyToClipboard, EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; - -import { MissingTimestampCallout } from '../../callouts/missing_timestamp_callout'; -import { IncompatibleCallout } from '../../callouts/incompatible_callout'; -import { showMissingTimestampCallout } from '../../helpers'; -import { getMarkdownComments } from '../helpers'; -import { showInvalidCallout } from '../../incompatible_tab/helpers'; -import { CopyToClipboardButton } from '../../styles'; -import * as i18n from '../../../index_properties/translations'; -import { - COPIED_RESULTS_TOAST_TITLE, - DATA_QUALITY_PROMPT_CONTEXT_PILL, - DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP, - DATA_QUALITY_SUGGESTED_USER_PROMPT, -} from '../../../../translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../../types'; -import { DATA_QUALITY_DASHBOARD_CONVERSATION_ID } from './translations'; -import { useDataQualityContext } from '../../../data_quality_context'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - addToNewCaseDisabled: boolean; - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isAssistantEnabled: boolean; - onAddToNewCase: (markdownComment: string[]) => void; - partitionedFieldMetadata: PartitionedFieldMetadata; - pattern: string; - patternDocsCount: number; - sizeInBytes: number | undefined; -} - -const CalloutSummaryComponent: React.FC = ({ - addSuccessToast, - addToNewCaseDisabled, - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isAssistantEnabled, - onAddToNewCase, - partitionedFieldMetadata, - pattern, - patternDocsCount, - sizeInBytes, -}) => { - const { isILMAvailable } = useDataQualityContext(); - const markdownComments: string[] = useMemo( - () => - getMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - pattern, - patternDocsCount, - sizeInBytes, - }), - [ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - pattern, - patternDocsCount, - sizeInBytes, - ] - ); - - const onClickAddToCase = useCallback( - () => onAddToNewCase([markdownComments.join('\n')]), - [markdownComments, onAddToNewCase] - ); - - const onCopy = useCallback(() => { - copyToClipboard(markdownComments.join('\n')); - - addSuccessToast({ - title: COPIED_RESULTS_TOAST_TITLE, - }); - }, [addSuccessToast, markdownComments]); - - const getPromptContext = useCallback(async () => markdownComments.join('\n'), [markdownComments]); - - const showActions = - showInvalidCallout(partitionedFieldMetadata.incompatible) || - showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant); - - return ( - <> - {showInvalidCallout(partitionedFieldMetadata.incompatible) && ( - <> - - - - )} - {showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant) && ( - <> - - - - )} - {showActions && ( - <> - - - - {i18n.ADD_TO_NEW_CASE} - - - - - - {i18n.COPY_TO_CLIPBOARD} - - - - - - - - - - - )} - - ); -}; - -CalloutSummaryComponent.displayName = 'CalloutSummaryComponent'; - -export const CalloutSummary = React.memo(CalloutSummaryComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/translations.ts deleted file mode 100644 index 07337268b7d8c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/callout_summary/translations.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const DATA_QUALITY_DASHBOARD_CONVERSATION_ID = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.incompatibleTab.dataQualityDashboardConversationId', - { - defaultMessage: 'Data Quality dashboard', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.test.ts deleted file mode 100644 index c89cf1d5158ec..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.test.ts +++ /dev/null @@ -1,255 +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 numeral from '@elastic/numeral'; -import { EcsVersion } from '@elastic/ecs'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { EMPTY_STAT } from '../../../helpers'; - -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { mockPartitionedFieldMetadataWithSameFamily } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; -import { PartitionedFieldMetadata } from '../../../types'; -import { - ALL_TAB_ID, - CUSTOM_TAB_ID, - ECS_COMPLIANT_TAB_ID, - INCOMPATIBLE_TAB_ID, - SAME_FAMILY_TAB_ID, -} from '../../index_properties/helpers'; -import { - CUSTOM_FIELDS, - ECS_COMPLIANT_FIELDS, - INCOMPATIBLE_FIELDS, - UNKNOWN, -} from '../../index_properties/translations'; -import { SAME_FAMILY } from '../../stat_label/translations'; -import { - CategoryId, - getFillColor, - getMarkdownComments, - getNodeLabel, - getSummaryData, - getTabId, -} from './helpers'; -import { EcsFlatTyped } from '../../../constants'; - -describe('helpers', () => { - describe('getSummaryData', () => { - test('it returns the expected `SummaryData`', () => { - expect(getSummaryData(mockPartitionedFieldMetadataWithSameFamily)).toEqual([ - { categoryId: 'incompatible', mappings: 3 }, - { categoryId: 'custom', mappings: 4 }, - { categoryId: 'ecs-compliant', mappings: 2 }, - { categoryId: 'same-family', mappings: 1 }, - ]); - }); - }); - - describe('getFillColor', () => { - const invalid: CategoryId = 'invalid-category-id' as CategoryId; - - const categories: Array<{ - categoryId: CategoryId; - expectedColor: string; - }> = [ - { - categoryId: 'incompatible', - expectedColor: euiThemeVars.euiColorDanger, - }, - { - categoryId: 'custom', - expectedColor: euiThemeVars.euiColorLightShade, - }, - { - categoryId: 'ecs-compliant', - expectedColor: euiThemeVars.euiColorSuccess, - }, - { - categoryId: 'same-family', - expectedColor: euiThemeVars.euiColorLightShade, - }, - { - categoryId: invalid, - expectedColor: euiThemeVars.euiColorGhost, - }, - ]; - - categories.forEach(({ categoryId, expectedColor }) => { - test(`it returns the expected color for category '${categoryId}'`, () => { - expect(getFillColor(categoryId)).toEqual(expectedColor); - }); - }); - }); - - describe('getNodeLabel', () => { - const invalid: CategoryId = 'invalid-category-id' as CategoryId; - - const categories: Array<{ - categoryId: CategoryId; - expectedLabel: string; - }> = [ - { - categoryId: 'incompatible', - expectedLabel: INCOMPATIBLE_FIELDS, - }, - { - categoryId: 'custom', - expectedLabel: CUSTOM_FIELDS, - }, - { - categoryId: 'ecs-compliant', - expectedLabel: ECS_COMPLIANT_FIELDS, - }, - { - categoryId: 'same-family', - expectedLabel: SAME_FAMILY, - }, - { - categoryId: invalid, - expectedLabel: UNKNOWN, - }, - ]; - - categories.forEach(({ categoryId, expectedLabel }) => { - test(`it returns the expected label for category '${categoryId}'`, () => { - expect(getNodeLabel(categoryId)).toEqual(expectedLabel); - }); - }); - }); - - describe('getTabId', () => { - const groupByFields: Array<{ - groupByField: string; - expectedTabId: string; - }> = [ - { - groupByField: 'incompatible', - expectedTabId: INCOMPATIBLE_TAB_ID, - }, - { - groupByField: 'custom', - expectedTabId: CUSTOM_TAB_ID, - }, - { - groupByField: 'ecs-compliant', - expectedTabId: ECS_COMPLIANT_TAB_ID, - }, - { - groupByField: 'same-family', - expectedTabId: SAME_FAMILY_TAB_ID, - }, - { - groupByField: 'some-other-group', - expectedTabId: ALL_TAB_ID, - }, - ]; - - groupByFields.forEach(({ groupByField, expectedTabId }) => { - test(`it returns the expected tab ID for groupByField '${groupByField}'`, () => { - expect(getTabId(groupByField)).toEqual(expectedTabId); - }); - }); - }); - - describe('getMarkdownComments', () => { - const defaultBytesFormat = '0,0.[0]b'; - const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - - const defaultNumberFormat = '0,0.[000]'; - const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - const isILMAvailable = true; - - test('it returns the expected comment when the index has incompatible fields ', () => { - expect( - getMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'auditbeat-*', - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, - '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', - ]); - }); - - test('it returns an empty array when the index does NOT have incompatible fields ', () => { - const noIncompatible: PartitionedFieldMetadata = { - ...mockPartitionedFieldMetadata, - incompatible: [], // <-- no incompatible fields - }; - - expect( - getMarkdownComments({ - docsCount: 4, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-index-1', - isILMAvailable, - partitionedFieldMetadata: noIncompatible, - pattern: 'auditbeat-*', - patternDocsCount: 57410, - sizeInBytes: 28413, - }) - ).toEqual([]); - }); - - test('it returns a missing timestamp comment for an empty index', () => { - const emptyIndex: PartitionedFieldMetadata = { - all: [], - ecsCompliant: [], - custom: [], - incompatible: [ - { - ...EcsFlatTyped['@timestamp'], - hasEcsMetadata: true, - indexFieldName: '@timestamp', - indexFieldType: '-', - indexInvalidValues: [], - isEcsCompliant: false, - isInSameFamily: false, - }, - ], - sameFamily: [], - }; - - expect( - getMarkdownComments({ - docsCount: 0, - formatBytes, - formatNumber, - ilmPhase: 'unmanaged', - indexName: 'auditbeat-custom-empty-index-1', - isILMAvailable, - partitionedFieldMetadata: emptyIndex, - pattern: 'auditbeat-*', - patternDocsCount: 57410, - sizeInBytes: 247, - }) - ).toEqual([ - '### auditbeat-custom-empty-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-empty-index-1 | 0 (0.0%) | 1 | `unmanaged` | 247B |\n\n', - '### **Incompatible fields** `1` **Same family** `0` **Custom fields** `0` **ECS compliant fields** `0` **All fields** `0`\n', - `#### 1 incompatible field\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, - '\n#### Incompatible field mappings - auditbeat-custom-empty-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| @timestamp | `date` | `-` |\n\n\n', - '#### Missing an @timestamp (date) field mapping for this index\n\nConsider adding an @timestamp (date) field mapping to this index, as required by the Elastic Common Schema (ECS), because:\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n', - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.ts deleted file mode 100644 index 001fcbdcda779..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/helpers.ts +++ /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 { euiThemeVars } from '@kbn/ui-theme'; - -import { getMissingTimestampComment, showMissingTimestampCallout } from '../helpers'; -import { - ALL_TAB_ID, - ECS_COMPLIANT_TAB_ID, - CUSTOM_TAB_ID, - INCOMPATIBLE_TAB_ID, - SAME_FAMILY_TAB_ID, -} from '../../index_properties/helpers'; -import { - getAllIncompatibleMarkdownComments, - showInvalidCallout, -} from '../incompatible_tab/helpers'; -import * as i18n from '../../index_properties/translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; - -export type CategoryId = 'incompatible' | 'custom' | 'ecs-compliant' | 'same-family'; - -interface SummaryData { - categoryId: CategoryId; - mappings: number; -} - -export const getSummaryData = ( - partitionedFieldMetadata: PartitionedFieldMetadata -): SummaryData[] => [ - { categoryId: 'incompatible', mappings: partitionedFieldMetadata.incompatible.length }, - { categoryId: 'custom', mappings: partitionedFieldMetadata.custom.length }, - { categoryId: 'ecs-compliant', mappings: partitionedFieldMetadata.ecsCompliant.length }, - { categoryId: 'same-family', mappings: partitionedFieldMetadata.sameFamily.length }, -]; - -export const getFillColor = (categoryId: CategoryId | string): string => { - switch (categoryId) { - case 'incompatible': - return euiThemeVars.euiColorDanger; - case 'same-family': - return euiThemeVars.euiColorLightShade; - case 'custom': - return euiThemeVars.euiColorLightShade; - case 'ecs-compliant': - return euiThemeVars.euiColorSuccess; - default: - return euiThemeVars.euiColorGhost; - } -}; - -export const getNodeLabel = (categoryId: CategoryId): string => { - switch (categoryId) { - case 'incompatible': - return i18n.INCOMPATIBLE_FIELDS; - case 'same-family': - return i18n.SAME_FAMILY; - case 'custom': - return i18n.CUSTOM_FIELDS; - case 'ecs-compliant': - return i18n.ECS_COMPLIANT_FIELDS; - default: - return i18n.UNKNOWN; - } -}; - -export const getTabId = (groupByField: string): string => { - switch (groupByField) { - case 'incompatible': - return INCOMPATIBLE_TAB_ID; - case 'same-family': - return SAME_FAMILY_TAB_ID; - case 'custom': - return CUSTOM_TAB_ID; - case 'ecs-compliant': - return ECS_COMPLIANT_TAB_ID; - default: - return ALL_TAB_ID; - } -}; - -const isString = (x: string | null): x is string => typeof x === 'string'; - -export const getMarkdownComments = ({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, -}: { - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - ilmPhase: IlmPhase | undefined; - indexName: string; - isILMAvailable: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata; - pattern: string; - patternDocsCount: number; - sizeInBytes: number | undefined; -}): string[] => { - const invalidMarkdownComments = showInvalidCallout(partitionedFieldMetadata.incompatible) - ? getAllIncompatibleMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }) - : []; - - const showMissingTimestampComment = showMissingTimestampCallout( - partitionedFieldMetadata.ecsCompliant - ) - ? getMissingTimestampComment() - : null; - - return [...invalidMarkdownComments, showMissingTimestampComment].filter(isString); -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/index.tsx deleted file mode 100644 index eed0c5a69d3b3..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/summary_tab/index.tsx +++ /dev/null @@ -1,106 +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 { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import { CalloutSummary } from './callout_summary'; -import { EcsSummaryDonutChart } from '../../../ecs_summary_donut_chart'; -import { ALL_TAB_ID } from '../../index_properties/helpers'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; - -interface Props { - addSuccessToast: (toast: { title: string }) => void; - addToNewCaseDisabled: boolean; - docsCount: number; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - ilmPhase: IlmPhase | undefined; - indexName: string; - isAssistantEnabled: boolean; - onAddToNewCase: (markdownComments: string[]) => void; - partitionedFieldMetadata: PartitionedFieldMetadata; - pattern: string; - patternDocsCount: number; - setSelectedTabId: (tabId: string) => void; - sizeInBytes: number | undefined; - theme?: PartialTheme; - baseTheme: Theme; -} - -const SummaryTabComponent: React.FC = ({ - addSuccessToast, - addToNewCaseDisabled, - formatBytes, - formatNumber, - docsCount, - getGroupByFieldsOnClick, - ilmPhase, - indexName, - isAssistantEnabled, - onAddToNewCase, - partitionedFieldMetadata, - pattern, - patternDocsCount, - setSelectedTabId, - sizeInBytes, - theme, - baseTheme, -}) => ( - <> - - - - -); - -SummaryTabComponent.displayName = 'SummaryTabComponent'; - -export const SummaryTab = React.memo(SummaryTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/chart_legend_item.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/chart_legend_item.tsx deleted file mode 100644 index f561ef2cb51d7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/chart_legend_item.tsx +++ /dev/null @@ -1,65 +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 { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiText, EuiToolTip } from '@elastic/eui'; -import React from 'react'; - -import { ChartLegendLink } from '../../data_quality_panel/tabs/styles'; -import { FixedWidthLegendText } from '../../styles'; - -const DEFAULT_DATA_TEST_SUBJ = 'chartLegendItem'; - -interface Props { - color: string | null; - count: number | string; - dataTestSubj?: string; - onClick: (() => void) | undefined; - text: string; - textWidth?: number; -} - -const ChartLegendItemComponent: React.FC = ({ - color, - count, - dataTestSubj = DEFAULT_DATA_TEST_SUBJ, - onClick, - text, - textWidth, -}) => ( - - - - - {color != null ? ( - - - {text} - - - ) : ( - - {text} - - )} - - - - - {count} - - - -); - -ChartLegendItemComponent.displayName = 'ChartLegendItemComponent'; - -export const ChartLegendItem = React.memo(ChartLegendItemComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/index.tsx deleted file mode 100644 index 78f22eccfd3d2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/chart_legend/index.tsx +++ /dev/null @@ -1,95 +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 } from 'react'; - -import { ChartLegendItem } from './chart_legend_item'; -import { getEcsCompliantColor } from '../../data_quality_panel/tabs/helpers'; -import { - ECS_COMPLIANT_TAB_ID, - CUSTOM_TAB_ID, - INCOMPATIBLE_TAB_ID, - SAME_FAMILY_TAB_ID, -} from '../../data_quality_panel/index_properties/helpers'; -import { getCustomColor } from '../../data_quality_panel/tabs/custom_tab/helpers'; -import { - getIncompatibleColor, - getSameFamilyColor, -} from '../../data_quality_panel/tabs/incompatible_tab/helpers'; -import type { PartitionedFieldMetadata } from '../../types'; -import * as i18n from '../../data_quality_panel/index_properties/translations'; -import { LegendContainer } from '../../data_quality_panel/tabs/styles'; - -const LEGEND_WIDTH = 200; // px - -interface Props { - partitionedFieldMetadata: PartitionedFieldMetadata; - setSelectedTabId: (tabId: string) => void; -} - -const ChartLegendComponent: React.FC = ({ partitionedFieldMetadata, setSelectedTabId }) => { - const showIncompatibleTab = useCallback( - () => setSelectedTabId(INCOMPATIBLE_TAB_ID), - [setSelectedTabId] - ); - - const showSameFamilyTab = useCallback( - () => setSelectedTabId(SAME_FAMILY_TAB_ID), - [setSelectedTabId] - ); - - const showCustomTab = useCallback(() => setSelectedTabId(CUSTOM_TAB_ID), [setSelectedTabId]); - - const showEcsCompliantTab = useCallback( - () => setSelectedTabId(ECS_COMPLIANT_TAB_ID), - [setSelectedTabId] - ); - - return ( - - {partitionedFieldMetadata.incompatible.length > 0 && ( - - )} - - {partitionedFieldMetadata.sameFamily.length > 0 && ( - - )} - - {partitionedFieldMetadata.custom.length > 0 && ( - - )} - - {partitionedFieldMetadata.ecsCompliant.length > 0 && ( - - )} - - ); -}; - -ChartLegendComponent.displayName = 'ChartLegendComponent'; - -export const ChartLegend = React.memo(ChartLegendComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.test.ts deleted file mode 100644 index 1ab8c650940d4..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.test.ts +++ /dev/null @@ -1,30 +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 { allMetadataIsEmpty } from './helpers'; -import { mockPartitionedFieldMetadata } from '../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { PartitionedFieldMetadata } from '../types'; - -describe('helpers', () => { - describe('allMetadataIsEmpty', () => { - test('it returns false when `all` is NOT is empty', () => { - expect(allMetadataIsEmpty(mockPartitionedFieldMetadata)).toBe(false); - }); - - test('it returns true when `all` is is empty', () => { - const allIsEmpty: PartitionedFieldMetadata = { - all: [], // <-- empty - custom: [], - ecsCompliant: [], - incompatible: [], - sameFamily: [], - }; - - expect(allMetadataIsEmpty(allIsEmpty)).toBe(true); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.ts deleted file mode 100644 index 3765bbe68ed16..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/helpers.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { PartitionedFieldMetadata } from '../types'; - -export const allMetadataIsEmpty = (partitionedFieldMetadata: PartitionedFieldMetadata): boolean => - partitionedFieldMetadata.all.length === 0; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/index.tsx deleted file mode 100644 index bb5d274d0f825..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/index.tsx +++ /dev/null @@ -1,203 +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 type { - Datum, - ElementClickListener, - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, - PartitionLayer, -} from '@elastic/charts'; -import { Chart, Partition, PartitionLayout, Settings } from '@elastic/charts'; -import { - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; -import styled from 'styled-components'; - -import { i18n } from '@kbn/i18n'; -import { ChartLegend } from './chart_legend'; -import { - getFillColor, - getNodeLabel, - getSummaryData, - getTabId, -} from '../data_quality_panel/tabs/summary_tab/helpers'; -import { allMetadataIsEmpty } from './helpers'; -import * as translations from './translations'; -import type { PartitionedFieldMetadata } from '../types'; - -export const DEFAULT_HEIGHT = 180; // px - -const DonutTextWrapper = styled(EuiFlexGroup)` - max-width: 77px; - position: absolute; - top: 40%; - width: 100%; - z-index: 1; -`; - -const CenteredFlexItem = styled(EuiFlexItem)` - align-items: center; - position: relative; -`; - -const donutTheme: PartialTheme = { - chartMargins: { top: 0, bottom: 0, left: 0, right: 0 }, - partition: { - idealFontSizeJump: 1.1, - outerSizeRatio: 1, - emptySizeRatio: 0.8, - circlePadding: 4, - }, -}; - -interface Props { - defaultTabId: string; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - height?: number; - partitionedFieldMetadata: PartitionedFieldMetadata; - setSelectedTabId: (tabId: string) => void; - theme?: PartialTheme; - baseTheme: Theme; -} - -const EcsSummaryDonutChartComponent: React.FC = ({ - defaultTabId, - getGroupByFieldsOnClick, - height = DEFAULT_HEIGHT, - partitionedFieldMetadata, - setSelectedTabId, - theme = {}, - baseTheme, -}) => { - const summaryData = useMemo( - () => getSummaryData(partitionedFieldMetadata), - [partitionedFieldMetadata] - ); - const valueAccessor = useCallback((d: Datum) => d.mappings as number, []); - const valueFormatter = useCallback((d: number) => `${d}`, []); - const layers = useMemo( - (): PartitionLayer[] => [ - { - groupByRollup: (d: Datum) => d.categoryId, - nodeLabel: (d: Datum) => getNodeLabel(d), - shape: { - fillColor: getFillColor, - }, - }, - ], - [] - ); - const showDefaultTab = useCallback( - () => setSelectedTabId(defaultTabId), - [defaultTabId, setSelectedTabId] - ); - const onElementClick: ElementClickListener = useCallback( - (event) => { - const { groupByField0 } = getGroupByFieldsOnClick(event); - - setSelectedTabId(getTabId(groupByField0)); - }, - [getGroupByFieldsOnClick, setSelectedTabId] - ); - - if (allMetadataIsEmpty(partitionedFieldMetadata)) { - return null; - } - - return ( - <> - -

{translations.CHART_TITLE}

-
- - - - - - - - - {partitionedFieldMetadata.all.length} - - {translations.FIELDS} - - - - - - - - - - - - - - - - - ); -}; - -EcsSummaryDonutChartComponent.displayName = 'EcsSummaryDonutChartComponent'; - -export const EcsSummaryDonutChart = React.memo(EcsSummaryDonutChartComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/translations.ts deleted file mode 100644 index 4df2f41cfdbd3..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ecs_summary_donut_chart/translations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const CHART_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ecsSummaryDonutChart.chartTitle', - { - defaultMessage: 'Field mappings', - } -); - -export const FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ecsSummaryDonutChart.fieldsLabel', - { - defaultMessage: 'Fields', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.test.ts deleted file mode 100644 index bfe3ffc0c5e55..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.test.ts +++ /dev/null @@ -1,1586 +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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { omit } from 'lodash/fp'; - -import { - FieldType, - getDocsCount, - getErrorSummary, - getErrorSummaries, - getErrorSummariesForRollup, - getEnrichedFieldMetadata, - getFieldTypes, - getPatternIlmPhaseDescription, - getIlmPhaseDescription, - getIncompatibleStatColor, - getIndexNames, - getIsInSameFamily, - getMissingTimestampFieldMetadata, - getPartitionedFieldMetadata, - getPartitionedFieldMetadataStats, - getSameFamilyStatColor, - getSizeInBytes, - getTotalDocsCount, - getTotalPatternIncompatible, - getTotalPatternIndicesChecked, - getTotalPatternSameFamily, - getTotalSizeInBytes, - isMappingCompatible, - postStorageResult, - getStorageResults, - StorageResult, - formatStorageResult, -} from './helpers'; -import { - hostNameWithTextMapping, - hostNameKeyword, - someField, - someFieldKeyword, - sourceIpWithTextMapping, - sourceIpKeyword, - sourcePort, - timestamp, - eventCategoryWithUnallowedValues, -} from './mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockIlmExplain } from './mock/ilm_explain/mock_ilm_explain'; -import { mockMappingsProperties } from './mock/mappings_properties/mock_mappings_properties'; -import { alertIndexNoResults } from './mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { - packetbeatNoResults, - packetbeatWithSomeErrors, -} from './mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { - auditbeatNoResults, - auditbeatWithAllResults, -} from './mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from './mock/stats/mock_stats'; -import { mockStatsAuditbeatIndex } from './mock/stats/mock_stats_packetbeat_index'; -import { mockStatsPacketbeatIndex } from './mock/stats/mock_stats_auditbeat_index'; -import { - COLD_DESCRIPTION, - FROZEN_DESCRIPTION, - HOT_DESCRIPTION, - UNMANAGED_DESCRIPTION, - WARM_DESCRIPTION, -} from './translations'; -import { - DataQualityCheckResult, - EnrichedFieldMetadata, - PartitionedFieldMetadata, - PatternRollup, - UnallowedValueCount, -} from './types'; -import { httpServiceMock } from '@kbn/core-http-browser-mocks'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { EcsFlatTyped } from './constants'; -import { mockPartitionedFieldMetadataWithSameFamily } from './mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; - -describe('helpers', () => { - describe('getTotalPatternSameFamily', () => { - const baseResult: DataQualityCheckResult = { - docsCount: 4, - error: null, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - markdownComments: [ - '### auditbeat-custom-index-1\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase |\n|--------|-------|------|---------------------|-----------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` |\n\n', - '### **Incompatible fields** `3` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - "#### 3 incompatible fields, 0 fields with mappings in the same family\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.1.\n\nIncompatible fields with mappings in the same family have exactly the same search behavior but may have different space usage or performance characteristics.\n\nWhen an incompatible field is not in the same family:\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n", - '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2),\n`theory` (1) |\n\n', - ], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }; - - it('returns undefined when results is undefined', () => { - expect(getTotalPatternSameFamily(undefined)).toBeUndefined(); - }); - - it('returns 0 when results is an empty object', () => { - expect(getTotalPatternSameFamily({})).toBe(0); - }); - - it('should sum sameFamily values and return the total', () => { - const results: Record = { - a: { - ...baseResult, - indexName: 'a', - markdownComments: [], - pattern: 'pattern', - sameFamily: 2, - }, - b: { - ...baseResult, - indexName: 'b', - markdownComments: [], - pattern: 'pattern', - sameFamily: 3, - }, - c: { ...baseResult, indexName: 'c', markdownComments: [], pattern: 'pattern' }, - }; - - expect(getTotalPatternSameFamily(results)).toBe(5); - }); - - it('handles a mix of defined and undefined sameFamily values', () => { - const results: Record = { - a: { - ...baseResult, - indexName: 'a', - markdownComments: [], - pattern: 'pattern', - sameFamily: 1, - }, - b: { - ...baseResult, - indexName: 'b', - markdownComments: [], - pattern: 'pattern', - sameFamily: undefined, - }, - c: { - ...baseResult, - indexName: 'c', - markdownComments: [], - pattern: 'pattern', - sameFamily: 2, - }, - }; - - expect(getTotalPatternSameFamily(results)).toBe(3); - }); - }); - - describe('getSameFamilyStatColor', () => { - it('returns the expected color when sameFamily is greater than zero', () => { - const result = getSameFamilyStatColor(1); - - expect(result).toEqual(euiThemeVars.euiColorLightShade); - }); - - it('returns undefined when sameFamily is 0', () => { - const result = getSameFamilyStatColor(0); - - expect(result).toBeUndefined(); - }); - - it('returns undefined when sameFamily is negative', () => { - const result = getSameFamilyStatColor(-1); - - expect(result).toBeUndefined(); - }); - - it('returns undefined when sameFamily is undefined', () => { - const result = getSameFamilyStatColor(undefined); - - expect(result).toBeUndefined(); - }); - }); - - describe('getIndexNames', () => { - const isILMAvailable = true; - const ilmPhases = ['hot', 'warm', 'unmanaged']; - - test('returns the expected index names when they have an ILM phase included in the ilmPhases list', () => { - expect( - getIndexNames({ - ilmExplain: mockIlmExplain, // <-- the mock indexes have 'hot' ILM phases - ilmPhases, - isILMAvailable, - stats: mockStats, - }) - ).toEqual([ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - 'auditbeat-custom-index-1', - ]); - }); - - test('returns the expected filtered index names when they do NOT have an ILM phase included in the ilmPhases list', () => { - expect( - getIndexNames({ - ilmExplain: mockIlmExplain, // <-- the mock indexes have 'hot' and 'unmanaged' ILM phases... - ilmPhases: ['warm', 'unmanaged'], // <-- ...but we don't ask for 'hot' - isILMAvailable, - stats: mockStats, - }) - ).toEqual(['auditbeat-custom-index-1']); // <-- the 'unmanaged' index - }); - - test('returns the expected index names when the `ilmExplain` is missing a record for an index', () => { - // the following `ilmExplain` is missing a record for one of the two packetbeat indexes: - const ilmExplainWithMissingIndex: Record = omit( - '.ds-packetbeat-8.6.1-2023.02.04-000001', - mockIlmExplain - ); - - expect( - getIndexNames({ - ilmExplain: ilmExplainWithMissingIndex, // <-- the mock indexes have 'hot' ILM phases... - ilmPhases: ['hot', 'warm', 'unmanaged'], - isILMAvailable, - stats: mockStats, - }) - ).toEqual(['.ds-packetbeat-8.5.3-2023.02.04-000001', 'auditbeat-custom-index-1']); // <-- only includes two of the three indices, because the other one is missing an ILM explain record - }); - - test('returns empty index names when `ilmPhases` is empty', () => { - expect( - getIndexNames({ - ilmExplain: mockIlmExplain, - ilmPhases: [], - isILMAvailable, - stats: mockStats, - }) - ).toEqual([]); - }); - - test('returns empty index names when they have an ILM phase that matches', () => { - expect( - getIndexNames({ - ilmExplain: null, - ilmPhases, - isILMAvailable, - stats: mockStats, - }) - ).toEqual([]); - }); - - test('returns empty index names when just `stats` is null', () => { - expect( - getIndexNames({ - ilmExplain: mockIlmExplain, - ilmPhases, - isILMAvailable, - stats: null, - }) - ).toEqual([]); - }); - - test('returns empty index names when both `ilmExplain` and `stats` are null', () => { - expect( - getIndexNames({ - ilmExplain: null, - ilmPhases, - isILMAvailable, - stats: null, - }) - ).toEqual([]); - }); - }); - - describe('getFieldTypes', () => { - const expected = [ - { - field: '@timestamp', - type: 'date', - }, - { - field: 'event.category', - type: 'keyword', - }, - { - field: 'host.name', - type: 'text', - }, - { - field: 'host.name.keyword', - type: 'keyword', - }, - { - field: 'some.field', - type: 'text', - }, - { - field: 'some.field.keyword', - type: 'keyword', - }, - { - field: 'source.ip', - type: 'text', - }, - { - field: 'source.ip.keyword', - type: 'keyword', - }, - { - field: 'source.port', - type: 'long', - }, - ]; - - test('it flattens the field names and types in the mapping properties', () => { - expect(getFieldTypes(mockMappingsProperties)).toEqual(expected); - }); - - test('it throws a type error when mappingsProperties is not flatten-able', () => { - // @ts-expect-error - const invalidType: Record = []; // <-- this is an array, NOT a valid Record - - expect(() => getFieldTypes(invalidType)).toThrowError('Root value is not flatten-able'); - }); - }); - - describe('getIsInSameFamily', () => { - test('it returns false when ecsExpectedType is undefined', () => { - expect(getIsInSameFamily({ ecsExpectedType: undefined, type: 'keyword' })).toBe(false); - }); - - const expectedFamilyMembers: { - [key: string]: string[]; - } = { - constant_keyword: ['keyword', 'wildcard'], // `keyword` and `wildcard` in the same family as `constant_keyword` - keyword: ['constant_keyword', 'wildcard'], - match_only_text: ['text'], - text: ['match_only_text'], - wildcard: ['keyword', 'constant_keyword'], - }; - - const ecsExpectedTypes = Object.keys(expectedFamilyMembers); - - ecsExpectedTypes.forEach((ecsExpectedType) => { - const otherMembersOfSameFamily = expectedFamilyMembers[ecsExpectedType]; - - otherMembersOfSameFamily.forEach((type) => - test(`it returns true for ecsExpectedType '${ecsExpectedType}' when given '${type}', a type in the same family`, () => { - expect(getIsInSameFamily({ ecsExpectedType, type })).toBe(true); - }) - ); - - test(`it returns false for ecsExpectedType '${ecsExpectedType}' when given 'date', a type NOT in the same family`, () => { - expect(getIsInSameFamily({ ecsExpectedType, type: 'date' })).toBe(false); - }); - }); - }); - - describe('isMappingCompatible', () => { - test('it returns true for an exact match', () => { - expect(isMappingCompatible({ ecsExpectedType: 'keyword', type: 'keyword' })).toBe(true); - }); - - test("it returns false when both types don't exactly match", () => { - expect(isMappingCompatible({ ecsExpectedType: 'wildcard', type: 'keyword' })).toBe(false); - }); - }); - - describe('getEnrichedFieldMetadata', () => { - /** - * The ECS schema - * https://raw.githubusercontent.com/elastic/ecs/main/generated/ecs/ecs_flat.yml - * defines a handful of fields that have `allowed_values`. For these - * fields, the documents in an index should only have specific values. - * - * This instance of the type `Record` - * represents an index that doesn't have any unallowed values, for the - * specified keys in the map, i.e. `event.category`, `event.kind`, etc. - * - * This will be used to test the happy path. Variants of this - * value will be used to test unhappy paths. - */ - const noUnallowedValues: Record = { - 'event.category': [], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }; - - /** - * Represents an index that has unallowed values, for the - * `event.category` field. The other fields in the collection, - * i.e. `event.kind`, don't have any unallowed values. - * - * This instance will be used to test paths where a field is - * NOT ECS complaint, because the index has unallowed values. - */ - const unallowedValues: Record = { - 'event.category': [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }; - - /** - * This instance of a `FieldType` has the correct mapping for the - * `event.category` field. - * - * This instance will be used to test paths where the index has - * a valid mapping for the `event.category` field. - */ - const fieldMetadataCorrectMappingType: FieldType = { - field: 'event.category', - type: 'keyword', // <-- this index has the correct mapping type - }; - - /** - * This `EnrichedFieldMetadata` for the `event.category` field, - * represents a happy path result, where the index being checked: - * - * 1) The `type` of the field in the index, `keyword`, matches the expected - * `type` of the `event.category` field, as defined by the `EcsMetadata` - * 2) The index doesn't have any unallowed values for the `event.category` field - * - * Since this is a happy path result, it has the following values: - * `indexInvalidValues` is an empty array, because the index does not contain any invalid values - * `isEcsCompliant` is true, because the index has the expected mapping type, and no unallowed values - */ - const happyPathResultSample: EnrichedFieldMetadata = { - dashed_name: 'event-category', - description: - 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', - example: 'authentication', - flat_name: 'event.category', - ignore_above: 1024, - level: 'core', - name: 'category', - normalize: ['array'], - short: 'Event category. The second categorization field in the hierarchy.', - type: 'keyword', - indexFieldName: 'event.category', - indexFieldType: 'keyword', // a valid mapping, because the `type` property from the `ecsMetadata` is also `keyword` - indexInvalidValues: [], // empty array, because the index does not contain any invalid values - hasEcsMetadata: true, - isEcsCompliant: true, // because the index has the expected mapping type, and no unallowed values - isInSameFamily: false, - }; - - /** - * Creates expected result matcher based on the happy path result sample. Please, add similar `expect` based assertions to it if anything breaks - * with an ECS upgrade, instead of hardcoding the values. - */ - const expectedResult = (extraFields: Record = {}) => - expect.objectContaining({ - ...happyPathResultSample, - ...extraFields, - allowed_values: expect.arrayContaining([ - expect.objectContaining({ - description: expect.any(String), - name: expect.any(String), - expected_event_types: expect.any(Array), - }), - ]), - }); - - test('it returns the happy path result when the index has no mapping conflicts, and no unallowed values', () => { - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index - unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index - }) - ).toEqual(expectedResult()); - }); - - test('it returns the happy path result when the index has no mapping conflicts, and the unallowedValues map does not contain an entry for the field', () => { - // create an `unallowedValues` that doesn't have an entry for `event.category`: - const noEntryForEventCategory: Record = omit( - 'event.category', - unallowedValues - ); - - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index - unallowedValues: noEntryForEventCategory, // a lookup in this map for the `event.category` field will return undefined - }) - ).toEqual(expectedResult()); - }); - - test('it returns a result with the expected `indexInvalidValues` and `isEcsCompliant` when the index has no mapping conflict, but it has unallowed values', () => { - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index - unallowedValues, // this index has unallowed values for the event.category field - }) - ).toEqual( - expectedResult({ - indexInvalidValues: [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ], - isEcsCompliant: false, // because there are unallowed values - }) - ); - }); - - test('it returns a result with the expected `isEcsCompliant` and `isInSameFamily` when the index type does not match ECS, but NO unallowed values', () => { - const indexFieldType = 'text'; - - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: { - field: 'event.category', // `event.category` is a `keyword`, per the ECS spec - type: indexFieldType, // this index has a mapping of `text` instead - }, - unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index - }) - ).toEqual( - expectedResult({ - indexFieldType, - isEcsCompliant: false, // `keyword` !== `text` - isInSameFamily: false, // `keyword` and `text` are not in the same family - }) - ); - }); - - test('it returns a result with the expected `isEcsCompliant` and `isInSameFamily` when the mapping is is in the same family', () => { - const indexFieldType = 'wildcard'; - - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: { - field: 'event.category', // `event.category` is a `keyword` per the ECS spec - type: indexFieldType, // this index has a mapping of `wildcard` instead - }, - unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index - }) - ).toEqual( - expectedResult({ - indexFieldType, - isEcsCompliant: false, // `wildcard` !== `keyword` - isInSameFamily: true, // `wildcard` and `keyword` are in the same family - }) - ); - }); - - test('it returns a result with the expected `indexInvalidValues`,`isEcsCompliant`, and `isInSameFamily` when the index has BOTH mapping conflicts, and unallowed values', () => { - const indexFieldType = 'text'; - - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: { - field: 'event.category', // `event.category` is a `keyword` per the ECS spec - type: indexFieldType, // this index has a mapping of `text` instead - }, - unallowedValues, // this index also has unallowed values for the event.category field - }) - ).toEqual( - expectedResult({ - indexFieldType, - indexInvalidValues: [ - { - count: 2, - fieldName: 'an_invalid_category', - }, - { - count: 1, - fieldName: 'theory', - }, - ], - isEcsCompliant: false, // because there are BOTH mapping conflicts and unallowed values - isInSameFamily: false, // `text` and `keyword` are not in the same family - }) - ); - }); - - test('it returns the expected result for a custom field, i.e. a field that does NOT have an entry in `ecsMetadata`', () => { - const field = 'a_custom_field'; // not defined by ECS - const indexFieldType = 'keyword'; - - expect( - getEnrichedFieldMetadata({ - ecsMetadata: EcsFlatTyped, - fieldMetadata: { - field, - type: indexFieldType, // no mapping conflict, because ECS doesn't define this field - }, - unallowedValues: noUnallowedValues, // no unallowed values for `a_custom_field` in this index - }) - ).toEqual({ - indexFieldName: field, - indexFieldType, - indexInvalidValues: [], - hasEcsMetadata: false, - isEcsCompliant: false, - isInSameFamily: false, // custom fields are never in the same family - }); - }); - }); - - describe('getMissingTimestampFieldMetadata', () => { - test('it returns the expected `EnrichedFieldMetadata`', () => { - expect(getMissingTimestampFieldMetadata()).toEqual({ - ...EcsFlatTyped['@timestamp'], - hasEcsMetadata: true, - indexFieldName: '@timestamp', - indexFieldType: '-', // the index did NOT define a mapping for @timestamp - indexInvalidValues: [], - isEcsCompliant: false, // an index must define the @timestamp mapping - isInSameFamily: false, // `date` is not a member of any families - }); - }); - }); - - describe('getPartitionedFieldMetadata', () => { - test('it places all the `EnrichedFieldMetadata` in the expected categories', () => { - const enrichedFieldMetadata: EnrichedFieldMetadata[] = [ - timestamp, - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - hostNameKeyword, - someField, - someFieldKeyword, - sourceIpWithTextMapping, - sourceIpKeyword, - sourcePort, - ]; - const expected: PartitionedFieldMetadata = { - all: [ - timestamp, - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - hostNameKeyword, - someField, - someFieldKeyword, - sourceIpWithTextMapping, - sourceIpKeyword, - sourcePort, - ], - ecsCompliant: [timestamp, sourcePort], - custom: [hostNameKeyword, someField, someFieldKeyword, sourceIpKeyword], - incompatible: [ - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - sourceIpWithTextMapping, - ], - sameFamily: [], - }; - - expect(getPartitionedFieldMetadata(enrichedFieldMetadata)).toEqual(expected); - }); - }); - - describe('getPartitionedFieldMetadataStats', () => { - test('it returns the expected stats', () => { - const partitionedFieldMetadata: PartitionedFieldMetadata = { - all: [ - timestamp, - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - hostNameKeyword, - someField, - someFieldKeyword, - sourceIpWithTextMapping, - sourceIpKeyword, - sourcePort, - ], - ecsCompliant: [timestamp, sourcePort], - custom: [hostNameKeyword, someField, someFieldKeyword, sourceIpKeyword], - incompatible: [ - eventCategoryWithUnallowedValues, - hostNameWithTextMapping, - sourceIpWithTextMapping, - ], - sameFamily: [], - }; - - expect(getPartitionedFieldMetadataStats(partitionedFieldMetadata)).toEqual({ - all: 9, - custom: 4, - ecsCompliant: 2, - incompatible: 3, - sameFamily: 0, - }); - }); - }); - - describe('getDocsCount', () => { - test('it returns the expected docs count when `stats` contains the `indexName`', () => { - const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; - const expectedCount = mockStatsPacketbeatIndex[indexName].num_docs; - - expect( - getDocsCount({ - indexName, - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(expectedCount); - }); - - test('it returns zero when `stats` does NOT contain the `indexName`', () => { - const indexName = 'not-gonna-find-it'; - - expect( - getDocsCount({ - indexName, - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(0); - }); - - test('it returns zero when `stats` is null', () => { - const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; - - expect( - getDocsCount({ - indexName, - stats: null, - }) - ).toEqual(0); - }); - - test('it returns the expected total for a green index, where `primaries.docs.count` and `total.docs.count` have different values', () => { - const indexName = 'auditbeat-custom-index-1'; - - expect( - getDocsCount({ - indexName, - stats: mockStatsAuditbeatIndex, - }) - ).toEqual(mockStatsAuditbeatIndex[indexName].num_docs); - }); - }); - - describe('getSizeInBytes', () => { - test('it returns the expected size when `stats` contains the `indexName`', () => { - const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; - const expectedCount = mockStatsPacketbeatIndex[indexName].size_in_bytes; - - expect( - getSizeInBytes({ - indexName, - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(expectedCount); - }); - - test('it returns undefined when `stats` does NOT contain the `indexName`', () => { - const indexName = 'not-gonna-find-it'; - - expect( - getSizeInBytes({ - indexName, - stats: mockStatsPacketbeatIndex, - }) - ).toBeUndefined(); - }); - - test('it returns undefined when `stats` is null', () => { - const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; - - expect( - getSizeInBytes({ - indexName, - stats: null, - }) - ).toBeUndefined(); - }); - - test('it returns the expected size for a green index, where `primaries.store.size_in_bytes` and `total.store.size_in_bytes` have different values', () => { - const indexName = 'auditbeat-custom-index-1'; - - expect( - getSizeInBytes({ - indexName, - stats: mockStatsAuditbeatIndex, - }) - ).toEqual(mockStatsAuditbeatIndex[indexName].size_in_bytes); - }); - }); - - describe('getTotalDocsCount', () => { - test('it returns the expected total given a subset of index names in the stats', () => { - const indexName = '.ds-packetbeat-8.5.3-2023.02.04-000001'; - const expectedCount = mockStatsPacketbeatIndex[indexName].num_docs; - - expect( - getTotalDocsCount({ - indexNames: [indexName], - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(expectedCount); - }); - - test('it returns the expected total given all index names in the stats', () => { - const allIndexNamesInStats = [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - ]; - - expect( - getTotalDocsCount({ - indexNames: allIndexNamesInStats, - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(3258632); - }); - - test('it returns zero given an empty collection of index names', () => { - expect( - getTotalDocsCount({ - indexNames: [], // <-- empty - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(0); - }); - - test('it returns the expected total for a green index', () => { - const indexName = 'auditbeat-custom-index-1'; - const expectedCount = mockStatsAuditbeatIndex[indexName].num_docs; - - expect( - getTotalDocsCount({ - indexNames: [indexName], - stats: mockStatsAuditbeatIndex, - }) - ).toEqual(expectedCount); - }); - }); - - describe('getTotalSizeInBytes', () => { - test('it returns the expected total given a subset of index names in the stats', () => { - const indexName = '.ds-packetbeat-8.5.3-2023.02.04-000001'; - const expectedCount = mockStatsPacketbeatIndex[indexName].size_in_bytes; - - expect( - getTotalSizeInBytes({ - indexNames: [indexName], - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(expectedCount); - }); - - test('it returns the expected total given all index names in the stats', () => { - const allIndexNamesInStats = [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - ]; - - expect( - getTotalSizeInBytes({ - indexNames: allIndexNamesInStats, - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(1464758182); - }); - - test('it returns undefined given an empty collection of index names', () => { - expect( - getTotalSizeInBytes({ - indexNames: [], // <-- empty - stats: mockStatsPacketbeatIndex, - }) - ).toBeUndefined(); - }); - - test('it returns undefined if sizeInByte in not an integer', () => { - const indexName = 'auditbeat-custom-index-1'; - - expect( - getTotalSizeInBytes({ - indexNames: [indexName], - stats: { [indexName]: { ...mockStatsAuditbeatIndex[indexName], size_in_bytes: null } }, - }) - ).toBeUndefined(); - }); - - test('it returns the expected total for an index', () => { - const indexName = 'auditbeat-custom-index-1'; - const expectedCount = mockStatsAuditbeatIndex[indexName].size_in_bytes; - - expect( - getTotalSizeInBytes({ - indexNames: [indexName], - stats: mockStatsAuditbeatIndex, - }) - ).toEqual(expectedCount); - }); - - test('it returns the expected total for indices', () => { - const expectedCount = Object.values(mockStatsPacketbeatIndex).reduce( - (acc, { size_in_bytes: sizeInBytes }) => { - return acc + (sizeInBytes ?? 0); - }, - 0 - ); - - expect( - getTotalSizeInBytes({ - indexNames: [ - '.ds-packetbeat-8.6.1-2023.02.04-000001', - '.ds-packetbeat-8.5.3-2023.02.04-000001', - ], - stats: mockStatsPacketbeatIndex, - }) - ).toEqual(expectedCount); - }); - }); - - describe('getIlmPhaseDescription', () => { - const phases: Array<{ - phase: string; - expected: string; - }> = [ - { - phase: 'hot', - expected: HOT_DESCRIPTION, - }, - { - phase: 'warm', - expected: WARM_DESCRIPTION, - }, - { - phase: 'cold', - expected: COLD_DESCRIPTION, - }, - { - phase: 'frozen', - expected: FROZEN_DESCRIPTION, - }, - { - phase: 'unmanaged', - expected: UNMANAGED_DESCRIPTION, - }, - { - phase: 'something-else', - expected: ' ', - }, - ]; - - phases.forEach(({ phase, expected }) => { - test(`it returns ${expected} when phase is ${phase}`, () => { - expect(getIlmPhaseDescription(phase)).toBe(expected); - }); - }); - }); - - describe('getPatternIlmPhaseDescription', () => { - const phases: Array<{ - expected: string; - indices: number; - pattern: string; - phase: string; - }> = [ - { - expected: - '1 index matching the .alerts-security.alerts-default pattern is hot. Hot indices are actively being updated and queried.', - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'hot', - }, - { - expected: - '2 indices matching the .alerts-security.alerts-default pattern are hot. Hot indices are actively being updated and queried.', - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'hot', - }, - { - expected: - '1 index matching the .alerts-security.alerts-default pattern is warm. Warm indices are no longer being updated but are still being queried.', - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'warm', - }, - { - expected: - '2 indices matching the .alerts-security.alerts-default pattern are warm. Warm indices are no longer being updated but are still being queried.', - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'warm', - }, - { - expected: - '1 index matching the .alerts-security.alerts-default pattern is cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'cold', - }, - { - expected: - '2 indices matching the .alerts-security.alerts-default pattern are cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'cold', - }, - { - expected: - "1 index matching the .alerts-security.alerts-default pattern is frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.", - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'frozen', - }, - { - expected: - "2 indices matching the .alerts-security.alerts-default pattern are frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.", - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'frozen', - }, - { - expected: - '1 index matching the .alerts-security.alerts-default pattern is unmanaged by Index Lifecycle Management (ILM)', - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'unmanaged', - }, - { - expected: - '2 indices matching the .alerts-security.alerts-default pattern are unmanaged by Index Lifecycle Management (ILM)', - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'unmanaged', - }, - { - expected: '', - indices: 1, - pattern: '.alerts-security.alerts-default', - phase: 'some-other-phase', - }, - { - expected: '', - indices: 2, - pattern: '.alerts-security.alerts-default', - phase: 'some-other-phase', - }, - ]; - - phases.forEach(({ expected, indices, pattern, phase }) => { - test(`it returns the expected description when indices is ${indices}, pattern is ${pattern}, and phase is ${phase}`, () => { - expect(getPatternIlmPhaseDescription({ indices, pattern, phase })).toBe(expected); - }); - }); - }); - - describe('getTotalPatternIncompatible', () => { - test('it returns zero when multiple indices in the results results have a count of zero', () => { - const results: Record = { - '.ds-packetbeat-8.5.3-2023.02.04-000001': { - docsCount: 1630289, - error: null, - ilmPhase: 'hot', - incompatible: 0, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - docsCount: 1628343, - error: null, - ilmPhase: 'hot', - incompatible: 0, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - }; - - expect(getTotalPatternIncompatible(results)).toEqual(0); - }); - - test("it returns the expected total when some indices have incompatible fields, but others don't", () => { - const results: Record = { - '.ds-auditbeat-8.6.1-2023.02.07-000001': { - docsCount: 18086, - error: null, - ilmPhase: 'hot', - incompatible: 0, - indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - 'auditbeat-custom-index-1': { - docsCount: 4, - error: null, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - 'auditbeat-custom-empty-index-1': { - docsCount: 0, - error: null, - ilmPhase: 'unmanaged', - incompatible: 1, - indexName: 'auditbeat-custom-empty-index-1', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - }; - - expect(getTotalPatternIncompatible(results)).toEqual(4); - }); - - test('it returns the expected total when some indices have undefined incompatible counts', () => { - const results: Record = { - '.ds-auditbeat-8.6.1-2023.02.07-000001': { - docsCount: 18086, - error: null, - ilmPhase: 'hot', - incompatible: undefined, // <-- this index has an undefined `incompatible` - indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - 'auditbeat-custom-index-1': { - docsCount: 4, - error: null, - ilmPhase: 'unmanaged', - incompatible: 3, - indexName: 'auditbeat-custom-index-1', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - 'auditbeat-custom-empty-index-1': { - docsCount: 0, - error: null, - ilmPhase: 'unmanaged', - incompatible: 1, - indexName: 'auditbeat-custom-empty-index-1', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'auditbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }, - }; - - expect(getTotalPatternIncompatible(results)).toEqual(4); - }); - - test('it returns zero when `results` is empty', () => { - expect(getTotalPatternIncompatible({})).toEqual(0); - }); - - test('it returns undefined when `results` is undefined', () => { - expect(getTotalPatternIncompatible(undefined)).toBeUndefined(); - }); - }); - - describe('getTotalPatternIndicesChecked', () => { - test('it returns zero when `patternRollup` is undefined', () => { - expect(getTotalPatternIndicesChecked(undefined)).toEqual(0); - }); - - test('it returns zero when `patternRollup` does NOT have any results', () => { - expect(getTotalPatternIndicesChecked(auditbeatNoResults)).toEqual(0); - }); - - test('it returns the expected total when all indices in `patternRollup` have results', () => { - expect(getTotalPatternIndicesChecked(auditbeatWithAllResults)).toEqual(3); - }); - - test('it returns the expected total when some indices in `patternRollup` have errors', () => { - expect(getTotalPatternIndicesChecked(packetbeatWithSomeErrors)).toEqual(1); - }); - }); - - describe('getIncompatibleStatColor', () => { - test('it returns the expected color when incompatible is greater than zero', () => { - const incompatible = 123; - - expect(getIncompatibleStatColor(incompatible)).toBe('#bd271e'); - }); - - test('it returns undefined when incompatible is zero', () => { - const incompatible = 0; - - expect(getIncompatibleStatColor(incompatible)).toBeUndefined(); - }); - - test('it returns undefined when incompatible is undefined', () => { - const incompatible = undefined; - - expect(getIncompatibleStatColor(incompatible)).toBeUndefined(); - }); - }); - - describe('getErrorSummary', () => { - test('it returns the expected error summary', () => { - const resultWithError: DataQualityCheckResult = { - docsCount: 1630289, - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: Date.now(), - }; - - expect(getErrorSummary(resultWithError)).toEqual({ - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }); - }); - }); - - describe('getErrorSummariesForRollup', () => { - test('it returns the expected array of `ErrorSummary` when the `PatternRollup` contains errors', () => { - expect(getErrorSummariesForRollup(packetbeatWithSomeErrors)).toEqual([ - { - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - ]); - }); - - test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` contains all results, with NO errors', () => { - expect(getErrorSummariesForRollup(auditbeatWithAllResults)).toEqual([]); - }); - - test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` has NO results', () => { - expect(getErrorSummariesForRollup(auditbeatNoResults)).toEqual([]); - }); - - test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` is undefined', () => { - expect(getErrorSummariesForRollup(undefined)).toEqual([]); - }); - - test('it returns BOTH the expected (root) pattern-level error, and an index-level error when `PatternRollup` has both', () => { - const withPatternLevelError: PatternRollup = { - ...packetbeatWithSomeErrors, - error: 'This is a pattern-level error', - }; - - expect(getErrorSummariesForRollup(withPatternLevelError)).toEqual([ - { - error: 'This is a pattern-level error', - indexName: null, - pattern: 'packetbeat-*', - }, - { - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - ]); - }); - - test('it returns the expected (root) pattern-level error when there are no index-level results', () => { - const withPatternLevelError: PatternRollup = { - ...auditbeatNoResults, - error: 'This is a pattern-level error', - }; - - expect(getErrorSummariesForRollup(withPatternLevelError)).toEqual([ - { - error: 'This is a pattern-level error', - indexName: null, - pattern: 'auditbeat-*', - }, - ]); - }); - }); - - describe('getErrorSummaries', () => { - test('it returns an empty array when patternRollups is empty', () => { - expect(getErrorSummaries({})).toEqual([]); - }); - - test('it returns an empty array when none of the patternRollups have errors', () => { - expect( - getErrorSummaries({ - '.alerts-security.alerts-default': alertIndexNoResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, - }) - ).toEqual([]); - }); - - test('it returns the expected array of `ErrorSummary` when some of the `PatternRollup` contain errors', () => { - expect( - getErrorSummaries({ - '.alerts-security.alerts-default': alertIndexNoResults, - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatWithSomeErrors, // <-- has errors - }) - ).toEqual([ - { - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - ]); - }); - - test('it returns the expected array of `ErrorSummary` when there are both pattern-level and index-level errors', () => { - const withPatternLevelError: PatternRollup = { - ...auditbeatNoResults, - error: 'This is a pattern-level error', - }; - - expect( - getErrorSummaries({ - '.alerts-security.alerts-default': alertIndexNoResults, - 'auditbeat-*': withPatternLevelError, // <-- has pattern-level errors - 'packetbeat-*': packetbeatWithSomeErrors, // <-- has index-level errors - }) - ).toEqual([ - { - error: 'This is a pattern-level error', - indexName: null, - pattern: 'auditbeat-*', - }, - { - error: - 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', - indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', - pattern: 'packetbeat-*', - }, - ]); - }); - - test('it returns the expected array of `ErrorSummary` when there are just pattern-level errors', () => { - const withPatternLevelError: PatternRollup = { - ...auditbeatNoResults, - error: 'This is a pattern-level error', - }; - - expect( - getErrorSummaries({ - '.alerts-security.alerts-default': alertIndexNoResults, - 'auditbeat-*': withPatternLevelError, // <-- has pattern-level errors - 'packetbeat-*': packetbeatNoResults, - }) - ).toEqual([ - { - error: 'This is a pattern-level error', - indexName: null, - pattern: 'auditbeat-*', - }, - ]); - }); - }); - - describe('formatStorageResult', () => { - it('should correctly format the input data into a StorageResult object', () => { - const inputData: Parameters[number] = { - result: { - indexName: 'testIndex', - pattern: 'testPattern', - checkedAt: 1627545600000, - docsCount: 100, - incompatible: 3, - sameFamily: 1, - ilmPhase: 'hot', - markdownComments: ['test comments'], - error: null, - }, - report: { - batchId: 'testBatch', - isCheckAll: true, - sameFamilyFields: ['agent.type'], - unallowedMappingFields: ['event.category', 'host.name', 'source.ip'], - unallowedValueFields: ['event.category'], - sizeInBytes: 5000, - ecsVersion: '1.0.0', - indexName: 'testIndex', - indexId: 'testIndexId', - }, - partitionedFieldMetadata: mockPartitionedFieldMetadataWithSameFamily, - }; - - const expectedResult: StorageResult = { - batchId: 'testBatch', - indexName: 'testIndex', - indexPattern: 'testPattern', - isCheckAll: true, - checkedAt: 1627545600000, - docsCount: 100, - totalFieldCount: 10, - ecsFieldCount: 2, - customFieldCount: 4, - incompatibleFieldCount: 3, - incompatibleFieldMappingItems: [ - { - fieldName: 'event.category', - expectedValue: 'keyword', - actualValue: 'constant_keyword', - description: - 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', - }, - { - fieldName: 'host.name', - expectedValue: 'keyword', - actualValue: 'text', - description: - 'Name of the host.\nIt can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.', - }, - { - fieldName: 'source.ip', - expectedValue: 'ip', - actualValue: 'text', - description: 'IP address of the source (IPv4 or IPv6).', - }, - ], - incompatibleFieldValueItems: [ - { - fieldName: 'event.category', - expectedValues: [ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ], - actualValues: [{ name: 'an_invalid_category', count: 2 }], - description: - 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', - }, - ], - sameFamilyFieldCount: 1, - sameFamilyFields: ['agent.type'], - sameFamilyFieldItems: [ - { - fieldName: 'agent.type', - expectedValue: 'keyword', - actualValue: 'constant_keyword', - description: - 'Type of the agent.\nThe agent type always stays the same and should be given by the agent used. In case of Filebeat the agent would always be Filebeat also if two Filebeat instances are run on the same machine.', - }, - ], - unallowedMappingFields: ['event.category', 'host.name', 'source.ip'], - unallowedValueFields: ['event.category'], - sizeInBytes: 5000, - ilmPhase: 'hot', - markdownComments: ['test comments'], - ecsVersion: '1.0.0', - indexId: 'testIndexId', - error: null, - }; - - expect(formatStorageResult(inputData)).toEqual(expectedResult); - }); - }); - - describe('postStorageResult', () => { - const { fetch } = httpServiceMock.createStartContract(); - const { toasts } = notificationServiceMock.createStartContract(); - beforeEach(() => { - fetch.mockClear(); - }); - - test('it posts the result', async () => { - const storageResult = { indexName: 'test' } as unknown as StorageResult; - await postStorageResult({ - storageResult, - httpFetch: fetch, - abortController: new AbortController(), - toasts, - }); - - expect(fetch).toHaveBeenCalledWith( - '/internal/ecs_data_quality_dashboard/results', - expect.objectContaining({ - method: 'POST', - body: JSON.stringify(storageResult), - }) - ); - }); - - test('it throws error', async () => { - const storageResult = { indexName: 'test' } as unknown as StorageResult; - fetch.mockRejectedValueOnce('test-error'); - await postStorageResult({ - httpFetch: fetch, - storageResult, - abortController: new AbortController(), - toasts, - }); - expect(toasts.addError).toHaveBeenCalledWith('test-error', { title: expect.any(String) }); - }); - }); - - describe('getStorageResults', () => { - const { fetch } = httpServiceMock.createStartContract(); - const { toasts } = notificationServiceMock.createStartContract(); - beforeEach(() => { - fetch.mockClear(); - }); - - test('it gets the results', async () => { - await getStorageResults({ - httpFetch: fetch, - abortController: new AbortController(), - pattern: 'auditbeat-*', - toasts, - }); - - expect(fetch).toHaveBeenCalledWith( - '/internal/ecs_data_quality_dashboard/results_latest/auditbeat-*', - expect.objectContaining({ - method: 'GET', - }) - ); - }); - - it('should catch error', async () => { - fetch.mockRejectedValueOnce('test-error'); - - const results = await getStorageResults({ - httpFetch: fetch, - abortController: new AbortController(), - pattern: 'auditbeat-*', - toasts, - }); - - expect(toasts.addError).toHaveBeenCalledWith('test-error', { title: expect.any(String) }); - expect(results).toEqual([]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts deleted file mode 100644 index 0980ac3763347..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts +++ /dev/null @@ -1,620 +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 type { HttpHandler } from '@kbn/core-http-browser'; -import type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; -import { has, sortBy } from 'lodash/fp'; -import { IToasts } from '@kbn/core-notifications-browser'; -import { getIlmPhase } from './data_quality_panel/pattern/helpers'; -import { getFillColor } from './data_quality_panel/tabs/summary_tab/helpers'; - -import * as i18n from './translations'; - -import type { - DataQualityCheckResult, - DataQualityIndexCheckedParams, - EcsBasedFieldMetadata, - EnrichedFieldMetadata, - ErrorSummary, - IlmPhase, - IncompatibleFieldMappingItem, - IncompatibleFieldValueItem, - MeteringStatsIndex, - PartitionedFieldMetadata, - PartitionedFieldMetadataStats, - PatternRollup, - SameFamilyFieldItem, - UnallowedValueCount, -} from './types'; -import { EcsFlatTyped } from './constants'; - -const EMPTY_INDEX_NAMES: string[] = []; -export const INTERNAL_API_VERSION = '1'; - -export const getIndexNames = ({ - ilmExplain, - ilmPhases, - isILMAvailable, - stats, -}: { - ilmExplain: Record | null; - ilmPhases: string[]; - isILMAvailable: boolean; - stats: Record | null; -}): string[] => { - if (((isILMAvailable && ilmExplain != null) || !isILMAvailable) && stats != null) { - const allIndexNames = Object.keys(stats); - const filteredByIlmPhase = isILMAvailable - ? allIndexNames.filter((indexName) => - ilmPhases.includes(getIlmPhase(ilmExplain?.[indexName], isILMAvailable) ?? '') - ) - : allIndexNames; - - return filteredByIlmPhase; - } else { - return EMPTY_INDEX_NAMES; - } -}; - -export interface FieldType { - field: string; - type: string; -} - -function shouldReadKeys(value: unknown): value is Record { - return typeof value === 'object' && value !== null && !Array.isArray(value); -} - -const getNextPathWithoutProperties = ({ - key, - pathWithoutProperties, - value, -}: { - key: string; - pathWithoutProperties: string; - value: unknown; -}): string => { - if (!pathWithoutProperties) { - return key; - } - - if (shouldReadKeys(value) && (key === 'properties' || key === 'fields')) { - return `${pathWithoutProperties}`; - } else { - return `${pathWithoutProperties}.${key}`; - } -}; - -export function getFieldTypes(mappingsProperties: Record): FieldType[] { - if (!shouldReadKeys(mappingsProperties)) { - throw new TypeError(`Root value is not flatten-able, received ${mappingsProperties}`); - } - - const result: FieldType[] = []; - (function flatten(prefix, object, pathWithoutProperties) { - for (const [key, value] of Object.entries(object)) { - const path = prefix ? `${prefix}.${key}` : key; - - const nextPathWithoutProperties = getNextPathWithoutProperties({ - key, - pathWithoutProperties, - value, - }); - - if (shouldReadKeys(value)) { - flatten(path, value, nextPathWithoutProperties); - } else { - if (nextPathWithoutProperties.endsWith('.type')) { - const pathWithoutType = nextPathWithoutProperties.slice( - 0, - nextPathWithoutProperties.lastIndexOf('.type') - ); - - result.push({ - field: pathWithoutType, - type: `${value}`, - }); - } - } - } - })('', mappingsProperties, ''); - - return result; -} - -/** - * Per https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#_core_datatypes - * - * ``` - * Field types are grouped by _family_. Types in the same family have exactly - * the same search behavior but may have different space usage or - * performance characteristics. - * - * Currently, there are two type families, `keyword` and `text`. Other type - * families have only a single field type. For example, the `boolean` type - * family consists of one field type: `boolean`. - * ``` - */ -export const fieldTypeFamilies: Record> = { - keyword: new Set(['keyword', 'constant_keyword', 'wildcard']), - text: new Set(['text', 'match_only_text']), -}; - -export const getIsInSameFamily = ({ - ecsExpectedType, - type, -}: { - ecsExpectedType: string | undefined; - type: string; -}): boolean => { - if (ecsExpectedType != null) { - const allFamilies = Object.values(fieldTypeFamilies); - - return allFamilies.reduce( - (acc, family) => (acc !== true ? family.has(ecsExpectedType) && family.has(type) : acc), - false - ); - } else { - return false; - } -}; - -export const isMappingCompatible = ({ - ecsExpectedType, - type, -}: { - ecsExpectedType: string | undefined; - type: string; -}): boolean => type === ecsExpectedType; - -export const getEnrichedFieldMetadata = ({ - ecsMetadata, - fieldMetadata, - unallowedValues, -}: { - ecsMetadata: EcsFlatTyped; - fieldMetadata: FieldType; - unallowedValues: Record; -}): EnrichedFieldMetadata => { - const { field, type } = fieldMetadata; - const indexInvalidValues = unallowedValues[field] ?? []; - - if (has(fieldMetadata.field, ecsMetadata)) { - const ecsExpectedType = ecsMetadata[field].type; - const isEcsCompliant = - isMappingCompatible({ ecsExpectedType, type }) && indexInvalidValues.length === 0; - - const isInSameFamily = - !isMappingCompatible({ ecsExpectedType, type }) && - indexInvalidValues.length === 0 && - getIsInSameFamily({ ecsExpectedType, type }); - - return { - ...ecsMetadata[field], - indexFieldName: field, - indexFieldType: type, - indexInvalidValues, - hasEcsMetadata: true, - isEcsCompliant, - isInSameFamily, - }; - } else { - return { - indexFieldName: field, - indexFieldType: type, - indexInvalidValues: [], - hasEcsMetadata: false, - isEcsCompliant: false, - isInSameFamily: false, // custom fields are never in the same family - }; - } -}; - -export const getMissingTimestampFieldMetadata = (): EcsBasedFieldMetadata => ({ - ...EcsFlatTyped['@timestamp'], - hasEcsMetadata: true, - indexFieldName: '@timestamp', - indexFieldType: '-', - indexInvalidValues: [], - isEcsCompliant: false, - isInSameFamily: false, // `date` is not a member of any families -}); - -export const getPartitionedFieldMetadata = ( - enrichedFieldMetadata: EnrichedFieldMetadata[] -): PartitionedFieldMetadata => - enrichedFieldMetadata.reduce( - (acc, x) => ({ - all: [...acc.all, x], - ecsCompliant: x.isEcsCompliant ? [...acc.ecsCompliant, x] : acc.ecsCompliant, - custom: !x.hasEcsMetadata ? [...acc.custom, x] : acc.custom, - incompatible: - x.hasEcsMetadata && !x.isEcsCompliant && !x.isInSameFamily - ? [...acc.incompatible, x] - : acc.incompatible, - sameFamily: x.isInSameFamily ? [...acc.sameFamily, x] : acc.sameFamily, - }), - { - all: [], - ecsCompliant: [], - custom: [], - incompatible: [], - sameFamily: [], - } - ); - -export const getPartitionedFieldMetadataStats = ( - partitionedFieldMetadata: PartitionedFieldMetadata -): PartitionedFieldMetadataStats => { - const { all, ecsCompliant, custom, incompatible, sameFamily } = partitionedFieldMetadata; - - return { - all: all.length, - ecsCompliant: ecsCompliant.length, - custom: custom.length, - incompatible: incompatible.length, - sameFamily: sameFamily.length, - }; -}; - -export const getDocsCount = ({ - indexName, - stats, -}: { - indexName: string; - stats: Record | null; -}): number => (stats && stats[indexName]?.num_docs) ?? 0; - -export const getIndexId = ({ - indexName, - stats, -}: { - indexName: string; - stats: Record | null; -}): string | null | undefined => stats && stats[indexName]?.uuid; - -export const getSizeInBytes = ({ - indexName, - stats, -}: { - indexName: string; - stats: Record | null; -}): number | undefined => (stats && stats[indexName]?.size_in_bytes) ?? undefined; - -export const getTotalDocsCount = ({ - indexNames, - stats, -}: { - indexNames: string[]; - stats: Record | null; -}): number => - indexNames.reduce( - (acc: number, indexName: string) => acc + getDocsCount({ stats, indexName }), - 0 - ); - -export const getTotalSizeInBytes = ({ - indexNames, - stats, -}: { - indexNames: string[]; - stats: Record | null; -}): number | undefined => { - let sum; - for (let i = 0; i < indexNames.length; i++) { - const currentSizeInBytes = getSizeInBytes({ stats, indexName: indexNames[i] }); - if (currentSizeInBytes != null) { - if (sum == null) { - sum = 0; - } - sum += currentSizeInBytes; - } else { - return undefined; - } - } - return sum; -}; - -export const EMPTY_STAT = '--'; - -/** - * Returns an i18n description of an an ILM phase - */ -export const getIlmPhaseDescription = (phase: string): string => { - switch (phase) { - case 'hot': - return i18n.HOT_DESCRIPTION; - case 'warm': - return i18n.WARM_DESCRIPTION; - case 'cold': - return i18n.COLD_DESCRIPTION; - case 'frozen': - return i18n.FROZEN_DESCRIPTION; - case 'unmanaged': - return i18n.UNMANAGED_DESCRIPTION; - default: - return ' '; - } -}; - -export const getPatternIlmPhaseDescription = ({ - indices, - pattern, - phase, -}: { - indices: number; - pattern: string; - phase: string; -}): string => { - switch (phase) { - case 'hot': - return i18n.HOT_PATTERN_TOOLTIP({ indices, pattern }); - case 'warm': - return i18n.WARM_PATTERN_TOOLTIP({ indices, pattern }); - case 'cold': - return i18n.COLD_PATTERN_TOOLTIP({ indices, pattern }); - case 'frozen': - return i18n.FROZEN_PATTERN_TOOLTIP({ indices, pattern }); - case 'unmanaged': - return i18n.UNMANAGED_PATTERN_TOOLTIP({ indices, pattern }); - default: - return ''; - } -}; - -export const getTotalPatternIncompatible = ( - results: Record | undefined -): number | undefined => { - if (results == null) { - return undefined; - } - - const allResults = Object.values(results); - - return allResults.reduce((acc, { incompatible }) => acc + (incompatible ?? 0), 0); -}; - -export const getTotalPatternIndicesChecked = (patternRollup: PatternRollup | undefined): number => { - if (patternRollup != null && patternRollup.results != null) { - const allResults = Object.values(patternRollup.results); - const nonErrorResults = allResults.filter(({ error }) => error == null); - - return nonErrorResults.length; - } else { - return 0; - } -}; - -export const getTotalPatternSameFamily = ( - results: Record | undefined -): number | undefined => { - if (results == null) { - return undefined; - } - - const allResults = Object.values(results); - - return allResults.reduce((acc, { sameFamily }) => acc + (sameFamily ?? 0), 0); -}; - -export const getIncompatibleStatColor = (incompatible: number | undefined): string | undefined => - incompatible != null && incompatible > 0 ? getFillColor('incompatible') : undefined; - -export const getSameFamilyStatColor = (sameFamily: number | undefined): string | undefined => - sameFamily != null && sameFamily > 0 ? getFillColor('same-family') : undefined; - -export const getErrorSummary = ({ - error, - indexName, - pattern, -}: DataQualityCheckResult): ErrorSummary => ({ - error: String(error), - indexName, - pattern, -}); - -export const getErrorSummariesForRollup = ( - patternRollup: PatternRollup | undefined -): ErrorSummary[] => { - const maybePatternErrorSummary: ErrorSummary[] = - patternRollup != null && patternRollup.error != null - ? [{ pattern: patternRollup.pattern, indexName: null, error: patternRollup.error }] - : []; - - if (patternRollup != null && patternRollup.results != null) { - const unsortedResults: DataQualityCheckResult[] = Object.values(patternRollup.results); - const sortedResults = sortBy('indexName', unsortedResults); - - return sortedResults.reduce( - (acc, result) => [...acc, ...(result.error != null ? [getErrorSummary(result)] : [])], - maybePatternErrorSummary - ); - } else { - return maybePatternErrorSummary; - } -}; - -export const getErrorSummaries = ( - patternRollups: Record -): ErrorSummary[] => { - const allPatterns: string[] = Object.keys(patternRollups); - - // sort the patterns A-Z: - const sortedPatterns = [...allPatterns].sort((a, b) => { - return a.localeCompare(b); - }); - - return sortedPatterns.reduce( - (acc, pattern) => [...acc, ...getErrorSummariesForRollup(patternRollups[pattern])], - [] - ); -}; - -export const POST_INDEX_RESULTS = '/internal/ecs_data_quality_dashboard/results'; -export const GET_INDEX_RESULTS_LATEST = - '/internal/ecs_data_quality_dashboard/results_latest/{pattern}'; - -export interface StorageResult { - batchId: string; - indexName: string; - indexPattern: string; - isCheckAll: boolean; - checkedAt: number; - docsCount: number; - totalFieldCount: number; - ecsFieldCount: number; - customFieldCount: number; - incompatibleFieldCount: number; - incompatibleFieldMappingItems: IncompatibleFieldMappingItem[]; - incompatibleFieldValueItems: IncompatibleFieldValueItem[]; - sameFamilyFieldCount: number; - sameFamilyFields: string[]; - sameFamilyFieldItems: SameFamilyFieldItem[]; - unallowedMappingFields: string[]; - unallowedValueFields: string[]; - sizeInBytes: number; - ilmPhase?: IlmPhase; - markdownComments: string[]; - ecsVersion: string; - indexId: string; - error: string | null; -} - -export const formatStorageResult = ({ - result, - report, - partitionedFieldMetadata, -}: { - result: DataQualityCheckResult; - report: DataQualityIndexCheckedParams; - partitionedFieldMetadata: PartitionedFieldMetadata; -}): StorageResult => { - const incompatibleFieldMappingItems: IncompatibleFieldMappingItem[] = []; - const incompatibleFieldValueItems: IncompatibleFieldValueItem[] = []; - const sameFamilyFieldItems: SameFamilyFieldItem[] = []; - - partitionedFieldMetadata.incompatible.forEach((field) => { - if (field.type !== field.indexFieldType) { - incompatibleFieldMappingItems.push({ - fieldName: field.indexFieldName, - expectedValue: field.type, - actualValue: field.indexFieldType, - description: field.description, - }); - } - - if (field.indexInvalidValues.length > 0) { - incompatibleFieldValueItems.push({ - fieldName: field.indexFieldName, - expectedValues: field.allowed_values?.map((x) => x.name) ?? [], - actualValues: field.indexInvalidValues.map((v) => ({ name: v.fieldName, count: v.count })), - description: field.description, - }); - } - }); - - partitionedFieldMetadata.sameFamily.forEach((field) => { - sameFamilyFieldItems.push({ - fieldName: field.indexFieldName, - expectedValue: field.type, - actualValue: field.indexFieldType, - description: field.description, - }); - }); - - return { - batchId: report.batchId, - indexName: result.indexName, - indexPattern: result.pattern, - isCheckAll: report.isCheckAll, - checkedAt: result.checkedAt ?? Date.now(), - docsCount: result.docsCount ?? 0, - totalFieldCount: partitionedFieldMetadata.all.length, - ecsFieldCount: partitionedFieldMetadata.ecsCompliant.length, - customFieldCount: partitionedFieldMetadata.custom.length, - incompatibleFieldCount: partitionedFieldMetadata.incompatible.length, - incompatibleFieldMappingItems, - incompatibleFieldValueItems, - sameFamilyFieldCount: partitionedFieldMetadata.sameFamily.length, - sameFamilyFields: report.sameFamilyFields ?? [], - sameFamilyFieldItems, - unallowedMappingFields: report.unallowedMappingFields ?? [], - unallowedValueFields: report.unallowedValueFields ?? [], - sizeInBytes: report.sizeInBytes ?? 0, - ilmPhase: result.ilmPhase, - markdownComments: result.markdownComments, - ecsVersion: report.ecsVersion, - indexId: report.indexId ?? '', - error: result.error, - }; -}; - -export const formatResultFromStorage = ({ - storageResult, - pattern, -}: { - storageResult: StorageResult; - pattern: string; -}): DataQualityCheckResult => ({ - docsCount: storageResult.docsCount, - error: storageResult.error, - ilmPhase: storageResult.ilmPhase, - incompatible: storageResult.incompatibleFieldCount, - indexName: storageResult.indexName, - markdownComments: storageResult.markdownComments, - sameFamily: storageResult.sameFamilyFieldCount, - checkedAt: storageResult.checkedAt, - pattern, -}); - -export async function postStorageResult({ - storageResult, - httpFetch, - toasts, - abortController = new AbortController(), -}: { - storageResult: StorageResult; - httpFetch: HttpHandler; - toasts: IToasts; - abortController?: AbortController; -}): Promise { - try { - await httpFetch(POST_INDEX_RESULTS, { - method: 'POST', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - body: JSON.stringify(storageResult), - }); - } catch (err) { - toasts.addError(err, { title: i18n.POST_RESULT_ERROR_TITLE }); - } -} - -export async function getStorageResults({ - pattern, - httpFetch, - toasts, - abortController, -}: { - pattern: string; - httpFetch: HttpHandler; - toasts: IToasts; - abortController: AbortController; -}): Promise { - try { - const route = GET_INDEX_RESULTS_LATEST.replace('{pattern}', pattern); - const results = await httpFetch(route, { - method: 'GET', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - }); - return results; - } catch (err) { - toasts.addError(err, { title: i18n.GET_RESULTS_ERROR_TITLE }); - return []; - } -} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx deleted file mode 100644 index 417f1419a7ca5..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx +++ /dev/null @@ -1,28 +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 { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from '../mock/test_providers/test_providers'; -import { IlmPhasesEmptyPrompt } from '.'; - -describe('IlmPhasesEmptyPrompt', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it renders the expected content', () => { - expect(screen.getByTestId('ilmPhasesEmptyPrompt')).toHaveTextContent( - "ILM phases that can be checked for data qualityhot: The index is actively being updated and queriedwarm: The index is no longer being updated but is still being queriedunmanaged: The index isn't managed by Index Lifecycle Management (ILM)ILM phases that cannot be checkedThe following ILM phases cannot be checked for data quality because they are slower to accesscold: The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.frozen: The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow." - ); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx deleted file mode 100644 index 1720da6df8be0..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx +++ /dev/null @@ -1,92 +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 { EuiEmptyPrompt, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - -import { - COLD_DESCRIPTION, - FROZEN_DESCRIPTION, - HOT_DESCRIPTION, - UNMANAGED_DESCRIPTION, - WARM_DESCRIPTION, -} from '../translations'; -import * as i18n from './translations'; - -const Ul = styled.ul` - text-align: left; -`; - -const Li = styled.ul` - margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; - text-align: left; -`; - -const IlmPhasesEmptyPromptComponent: React.FC = () => { - const title = useMemo(() =>

{i18n.TITLE}

, []); - const body = useMemo(() =>

{i18n.BODY}

, []); - const footer = useMemo( - () => ( -
- -

{i18n.ILM_PHASES_THAT_CAN_BE_CHECKED}

-
- - - -
    -
  • - {i18n.HOT} - {': '} - {HOT_DESCRIPTION} -
  • -
  • - {i18n.WARM} - {': '} - {WARM_DESCRIPTION} -
  • -
  • - {i18n.UNMANAGED} - {': '} - {UNMANAGED_DESCRIPTION} -
  • -
- - - - -

{i18n.ILM_PHASES_THAT_CANNOT_BE_CHECKED}

-
- - - {i18n.THE_FOLLOWING_ILM_PHASES} - - - - -
    -
  • - {i18n.COLD} - {': '} - {COLD_DESCRIPTION} -
  • -
  • - {i18n.FROZEN} - {': '} - {FROZEN_DESCRIPTION} -
  • -
-
- ), - [] - ); - - return ; -}; - -export const IlmPhasesEmptyPrompt = React.memo(IlmPhasesEmptyPromptComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/translations.ts deleted file mode 100644 index 08a39d5b64d22..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/translations.ts +++ /dev/null @@ -1,80 +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 BODY = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptBody', - { - defaultMessage: - 'Indices with these Index Lifecycle Management (ILM) phases will be checked for data quality', - } -); - -export const COLD = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptColdLabel', - { - defaultMessage: 'cold', - } -); - -export const FROZEN = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptFrozenLabel', - { - defaultMessage: 'frozen', - } -); - -export const HOT = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptHotLabel', - { - defaultMessage: 'hot', - } -); - -export const ILM_PHASES_THAT_CAN_BE_CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptIlmPhasesThatCanBeCheckedSubtitle', - { - defaultMessage: 'ILM phases that can be checked for data quality', - } -); - -export const ILM_PHASES_THAT_CANNOT_BE_CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptIlmPhasesThatCannotBeCheckedSubtitle', - { - defaultMessage: 'ILM phases that cannot be checked', - } -); - -export const THE_FOLLOWING_ILM_PHASES = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptITheFollowingIlmPhasesLabel', - { - defaultMessage: - 'The following ILM phases cannot be checked for data quality because they are slower to access', - } -); - -export const UNMANAGED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptUnmanagedLabel', - { - defaultMessage: 'unmanaged', - } -); - -export const WARM = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptWarmLabel', - { - defaultMessage: 'warm', - } -); - -export const TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptTitle', - { - defaultMessage: 'Select one or more ILM phases', - } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx deleted file mode 100644 index 720f2fc61da6c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx +++ /dev/null @@ -1,84 +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 { DARK_THEME } from '@elastic/charts'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestProviders } from './mock/test_providers/test_providers'; -import { DataQualityPanel } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; - -const { toasts } = notificationServiceMock.createSetupContract(); - -describe('DataQualityPanel', () => { - describe('when ILM phases are provided', () => { - const ilmPhases: string[] = ['hot', 'warm', 'unmanaged']; - - beforeEach(() => { - render( - - - - ); - }); - - test('it does NOT render the ILM phases empty prompt', () => { - expect(screen.queryByTestId('ilmPhasesEmptyPrompt')).not.toBeInTheDocument(); - }); - - test('it renders the body', () => { - expect(screen.getByTestId('body')).toBeInTheDocument(); - }); - }); - - describe('when ILM phases are NOT provided', () => { - test('it renders the ILM phases empty prompt', () => { - const ilmPhases: string[] = []; - - render( - - - - ); - - expect(screen.getByTestId('ilmPhasesEmptyPrompt')).toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx deleted file mode 100644 index 6db2d8991db82..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx +++ /dev/null @@ -1,145 +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 type { HttpHandler } from '@kbn/core-http-browser'; -import numeral from '@elastic/numeral'; -import type { - FlameElementEvent, - HeatmapElementEvent, - MetricElementEvent, - PartialTheme, - PartitionElementEvent, - Theme, - WordCloudElementEvent, - XYChartElementEvent, -} from '@elastic/charts'; -import React, { useCallback, useMemo } from 'react'; - -import type { IToasts } from '@kbn/core-notifications-browser'; -import { Body } from './data_quality_panel/body'; -import { DataQualityProvider } from './data_quality_panel/data_quality_context'; -import { EMPTY_STAT } from './helpers'; -import { ReportDataQualityCheckAllCompleted, ReportDataQualityIndexChecked } from './types'; - -interface Props { - toasts: IToasts; - baseTheme: Theme; - canUserCreateAndReadCases: () => boolean; - defaultNumberFormat: string; - defaultBytesFormat: string; - endDate?: string | null; - getGroupByFieldsOnClick: ( - elements: Array< - | FlameElementEvent - | HeatmapElementEvent - | MetricElementEvent - | PartitionElementEvent - | WordCloudElementEvent - | XYChartElementEvent - > - ) => { - groupByField0: string; - groupByField1: string; - }; - httpFetch: HttpHandler; - ilmPhases: string[]; - isAssistantEnabled: boolean; - isILMAvailable: boolean; - lastChecked: string; - openCreateCaseFlyout: ({ - comments, - headerContent, - }: { - comments: string[]; - headerContent?: React.ReactNode; - }) => void; - patterns: string[]; - reportDataQualityIndexChecked?: ReportDataQualityIndexChecked; - reportDataQualityCheckAllCompleted?: ReportDataQualityCheckAllCompleted; - setLastChecked: (lastChecked: string) => void; - startDate?: string | null; - theme?: PartialTheme; -} - -/** Renders the `Data Quality` dashboard content */ -const DataQualityPanelComponent: React.FC = ({ - toasts, - baseTheme, - canUserCreateAndReadCases, - defaultBytesFormat, - defaultNumberFormat, - endDate, - getGroupByFieldsOnClick, - httpFetch, - ilmPhases, - isAssistantEnabled, - isILMAvailable, - lastChecked, - openCreateCaseFlyout, - patterns, - reportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted, - setLastChecked, - startDate, - theme, -}) => { - const formatBytes = useCallback( - (value: number | undefined): string => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT, - [defaultBytesFormat] - ); - - const formatNumber = useCallback( - (value: number | undefined): string => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT, - [defaultNumberFormat] - ); - - const telemetryEvents = useMemo( - () => ({ reportDataQualityCheckAllCompleted, reportDataQualityIndexChecked }), - [reportDataQualityCheckAllCompleted, reportDataQualityIndexChecked] - ); - - const addSuccessToast = useCallback( - (toast: { title: string }) => { - toasts.addSuccess(toast); - }, - [toasts] - ); - - return ( - - - - ); -}; - -DataQualityPanelComponent.displayName = 'DataQualityPanelComponent'; - -/** Renders the `Data Quality` dashboard content */ -export const DataQualityPanel = React.memo(DataQualityPanelComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx deleted file mode 100644 index b4579dd4bd50c..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx +++ /dev/null @@ -1,95 +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 { actionTypeRegistryMock } from '@kbn/triggers-actions-ui-plugin/public/application/action_type_registry.mock'; -import { httpServiceMock } from '@kbn/core-http-browser-mocks'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { AssistantAvailability, AssistantProvider } from '@kbn/elastic-assistant'; -import { I18nProvider } from '@kbn/i18n-react'; -import { euiDarkVars } from '@kbn/ui-theme'; -import React from 'react'; -import { ThemeProvider } from 'styled-components'; - -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { DataQualityProvider } from '../../data_quality_panel/data_quality_context'; - -interface Props { - children: React.ReactNode; - isILMAvailable?: boolean; -} - -window.scrollTo = jest.fn(); - -/** A utility for wrapping children in the providers required to run tests */ -export const TestProvidersComponent: React.FC = ({ children, isILMAvailable = true }) => { - const http = httpServiceMock.createSetupContract({ basePath: '/test' }); - const { toasts } = notificationServiceMock.createSetupContract(); - const actionTypeRegistry = actionTypeRegistryMock.create(); - const mockGetComments = jest.fn(() => []); - const mockHttp = httpServiceMock.createStartContract({ basePath: '/test' }); - const mockNavigateToApp = jest.fn(); - const mockTelemetryEvents = { - reportDataQualityIndexChecked: jest.fn(), - reportDataQualityCheckAllCompleted: jest.fn(), - }; - const mockAssistantAvailability: AssistantAvailability = { - hasAssistantPrivilege: false, - hasConnectorsAllPrivilege: true, - hasConnectorsReadPrivilege: true, - hasUpdateAIAssistantAnonymization: true, - isAssistantEnabled: true, - }; - const queryClient = new QueryClient({ - defaultOptions: { - queries: { - retry: false, - }, - }, - logger: { - log: jest.fn(), - warn: jest.fn(), - error: () => {}, - }, - }); - - return ( - - ({ eui: euiDarkVars, darkMode: true })}> - - - - {children} - - - - - - ); -}; - -TestProvidersComponent.displayName = 'TestProvidersComponent'; - -export const TestProviders = React.memo(TestProvidersComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/styles.tsx deleted file mode 100644 index 6fbf130d01b8f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/styles.tsx +++ /dev/null @@ -1,30 +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 { EuiCode, EuiText } from '@elastic/eui'; -import { euiThemeVars } from '@kbn/ui-theme'; - -import styled from 'styled-components'; - -export const CodeDanger = styled(EuiCode)` - color: ${euiThemeVars.euiColorDanger}; -`; - -export const CodeSuccess = styled(EuiCode)` - color: ${euiThemeVars.euiColorSuccess}; -`; - -export const CodeWarning = styled(EuiCode)` - color: ${euiThemeVars.euiColorWarning}; -`; - -export const FixedWidthLegendText = styled(EuiText)<{ - $width: number | undefined; -}>` - text-align: left; - ${({ $width }) => ($width != null ? `width: ${$width}px;` : '')} -`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts deleted file mode 100644 index b72a9fee96c57..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts +++ /dev/null @@ -1,304 +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 ADD_TO_NEW_CASE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.addToNewCaseButton', - { - defaultMessage: 'Add to new case', - } -); - -export const CANCEL = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.cancelButton', - { - defaultMessage: 'Cancel', - } -); - -export const CHECK_ALL = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.checkAllButton', - { - defaultMessage: 'Check all', - } -); - -export const CHECKING = (index: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.checkingLabel', { - values: { index }, - defaultMessage: 'Checking {index}', - }); - -export const COLD_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.coldDescription', - { - defaultMessage: - 'The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', - } -); - -export const COLD_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.coldPatternTooltip', { - values: { indices, pattern }, - defaultMessage: - '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', - }); - -export const COPIED_RESULTS_TOAST_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.toasts.copiedResultsToastTitle', - { - defaultMessage: 'Copied results to the clipboard', - } -); - -export const COPY_TO_CLIPBOARD = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.copyToClipboardButton', - { - defaultMessage: 'Copy to clipboard', - } -); - -export const DATA_QUALITY_PROMPT_CONTEXT_PILL = (indexName: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.dataQualityPromptContextPill', { - values: { indexName }, - defaultMessage: 'Data Quality ({indexName})', - }); - -export const DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.dataQualityPromptContextPillTooltip', - { - defaultMessage: 'Add this Data Quality report as context', - } -); - -/** The subtitle displayed on the Data Quality dashboard */ -export const DATA_QUALITY_SUBTITLE: string = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.securitySolutionPackages.ecsDataQualityDashboardSubtitle', - { - defaultMessage: 'Check index mappings and values for compatibility with the', - } -); - -export const DATA_QUALITY_SUGGESTED_USER_PROMPT = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.dataQualitySuggestedUserPrompt', - { - defaultMessage: - 'Explain the results above, and describe some options to fix incompatibilities.', - } -); - -export const DATA_QUALITY_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.securitySolutionPackages.ecsDataQualityDashboardTitle', - { - defaultMessage: 'Data quality', - } -); - -export const DEFAULT_PANEL_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.defaultPanelTitle', - { - defaultMessage: 'Check index mappings', - } -); - -export const ECS_VERSION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ecsVersionStat', - { - defaultMessage: 'ECS version', - } -); - -export const ERROR_LOADING_ILM_EXPLAIN = (details: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingIlmExplainLabel', { - values: { details }, - defaultMessage: 'Error loading ILM Explain: {details}', - }); - -export const ERROR_LOADING_MAPPINGS = ({ - details, - patternOrIndexName, -}: { - details: string; - patternOrIndexName: string; -}) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingMappingsLabel', { - values: { details, patternOrIndexName }, - defaultMessage: 'Error loading mappings for {patternOrIndexName}: {details}', - }); - -export const ERROR_LOADING_STATS = (details: string) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingStatsLabel', { - values: { details }, - defaultMessage: 'Error loading stats: {details}', - }); - -export const ERROR_LOADING_UNALLOWED_VALUES = ({ - details, - indexName, -}: { - details: string; - indexName: string; -}) => - i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.errorLoadingUnallowedValuesLabel', - { - values: { details, indexName }, - defaultMessage: 'Error loading unallowed values for index {indexName}: {details}', - } - ); - -export const FIELDS = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.fieldsLabel', - { - defaultMessage: 'Fields', - } -); - -export const FROZEN_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.frozenDescription', - { - defaultMessage: `The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.`, - } -); - -export const FROZEN_PATTERN_TOOLTIP = ({ - indices, - pattern, -}: { - indices: number; - pattern: string; -}) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.frozenPatternTooltip', { - values: { indices, pattern }, - defaultMessage: `{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.`, - }); - -export const HOT_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.hotDescription', - { - defaultMessage: 'The index is actively being updated and queried', - } -); - -export const HOT_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.hotPatternTooltip', { - values: { indices, pattern }, - defaultMessage: - '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} hot. Hot indices are actively being updated and queried.', - }); - -/** The tooltip for the `ILM phase` combo box on the Data Quality Dashboard */ -export const INDEX_LIFECYCLE_MANAGEMENT_PHASES: string = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexLifecycleManagementPhasesTooltip', - { - defaultMessage: - 'Indices with these Index Lifecycle Management (ILM) phases will be checked for data quality', - } -); - -export const INDEX_NAME = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexNameLabel', - { - defaultMessage: 'Index name', - } -); - -/** The label displayed for the `ILM phase` combo box on the Data Quality dashboard */ -export const ILM_PHASE: string = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseLabel', - { - defaultMessage: 'ILM phase', - } -); - -export const LAST_CHECKED = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.lastCheckedLabel', - { - defaultMessage: 'Last checked', - } -); - -export const LOADING_ECS_METADATA = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingEcsMetadataPrompt', - { - defaultMessage: 'Loading ECS metadata', - } -); - -export const SELECT_AN_INDEX = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.selectAnIndexPrompt', - { - defaultMessage: 'Select an index to compare it against ECS version', - } -); - -/** The placeholder for the `ILM phase` combo box on the Data Quality Dashboard */ -export const SELECT_ONE_OR_MORE_ILM_PHASES: string = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.selectOneOrMorPhasesPlaceholder', - { - defaultMessage: 'Select one or more ILM phases', - } -); - -export const INDEX_SIZE_TOOLTIP = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.indexSizeTooltip', - { - defaultMessage: 'The size of the primary index (does not include replicas)', - } -); - -export const TIMESTAMP_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.timestampDescriptionLabel', - { - defaultMessage: - 'Date/time when the event originated. This is the date/time extracted from the event, typically representing when the event was generated by the source. If the event source has no original timestamp, this value is typically populated by the first time the event was received by the pipeline. Required field for all events.', - } -); - -export const UNMANAGED_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.unmanagedDescription', - { - defaultMessage: `The index isn't managed by Index Lifecycle Management (ILM)`, - } -); - -export const UNMANAGED_PATTERN_TOOLTIP = ({ - indices, - pattern, -}: { - indices: number; - pattern: string; -}) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.unmanagedPatternTooltip', { - values: { indices, pattern }, - defaultMessage: `{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} unmanaged by Index Lifecycle Management (ILM)`, - }); - -export const WARM_DESCRIPTION = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.warmDescription', - { - defaultMessage: 'The index is no longer being updated but is still being queried', - } -); - -export const WARM_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => - i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.warmPatternTooltip', { - values: { indices, pattern }, - defaultMessage: - '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} warm. Warm indices are no longer being updated but are still being queried.', - }); - -export const POST_RESULT_ERROR_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.postResultErrorTitle', - { defaultMessage: 'Error writing saved data quality check results' } -); - -export const GET_RESULTS_ERROR_TITLE = i18n.translate( - 'securitySolutionPackages.ecsDataQualityDashboard.getResultErrorTitle', - { defaultMessage: 'Error reading saved data quality check results' } -); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/types.ts deleted file mode 100644 index ed20efc3fd959..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/types.ts +++ /dev/null @@ -1,286 +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 type { - IlmExplainLifecycleLifecycleExplain, - IndicesGetMappingIndexMappingRecord, -} from '@elastic/elasticsearch/lib/api/types'; -import type { Direction } from '@elastic/eui'; - -export interface Mappings { - pattern: string; - indexes: Record; -} - -export interface EcsFieldMetadata { - dashed_name: string; - description: string; - flat_name: string; - level: string; - name: string; - normalize: string[]; - short: string; - type: string; - - allowed_values?: AllowedValue[]; - beta?: string; - doc_values?: boolean; - example?: string | number | boolean; - expected_values?: string[]; - format?: string; - ignore_above?: number; - index?: boolean; - input_format?: string; - multi_fields?: MultiField[]; - object_type?: string; - original_fieldset?: string; - output_format?: string; - output_precision?: number; - pattern?: string; - required?: boolean; - scaling_factor?: number; -} - -export interface AllowedValue { - description: string; - name: string; - expected_event_types?: string[]; - beta?: string; -} - -export interface MultiField { - flat_name: string; - name: string; - type: string; -} - -export interface CustomFieldMetadata { - hasEcsMetadata: false; - indexFieldName: string; - indexFieldType: string; - indexInvalidValues: []; - isEcsCompliant: false; - isInSameFamily: false; -} -export interface EcsBasedFieldMetadata extends EcsFieldMetadata { - hasEcsMetadata: true; - indexFieldName: string; - indexFieldType: string; - indexInvalidValues: UnallowedValueCount[]; - isEcsCompliant: boolean; - isInSameFamily: boolean; -} - -export type EnrichedFieldMetadata = EcsBasedFieldMetadata | CustomFieldMetadata; - -export interface PartitionedFieldMetadata { - all: EnrichedFieldMetadata[]; - custom: CustomFieldMetadata[]; - ecsCompliant: EcsBasedFieldMetadata[]; - incompatible: EcsBasedFieldMetadata[]; - sameFamily: EcsBasedFieldMetadata[]; -} - -export interface PartitionedFieldMetadataStats { - all: number; - custom: number; - ecsCompliant: number; - incompatible: number; - sameFamily: number; -} - -export interface UnallowedValueRequestItem { - allowedValues: string[]; - indexFieldName: string; - indexName: string; -} - -export interface Bucket { - key: string; - doc_count: number; -} - -export interface UnallowedValueCount { - fieldName: string; - count: number; -} - -export interface UnallowedValueSearchResult { - aggregations?: { - [x: string]: { - buckets?: Bucket[]; - }; - }; -} - -export type IlmPhase = 'hot' | 'warm' | 'cold' | 'frozen' | 'unmanaged'; - -export interface IncompatibleFieldMappingItem { - fieldName: string; - expectedValue: string; - actualValue: string; - description: string; -} - -export interface ActualIncompatibleValue { - name: string; - count: number; -} - -export interface IncompatibleFieldValueItem { - fieldName: string; - expectedValues: string[]; - actualValues: ActualIncompatibleValue[]; - description: string; -} - -export interface SameFamilyFieldItem { - fieldName: string; - expectedValue: string; - actualValue: string; - description: string; -} - -export interface IlmExplainPhaseCounts { - hot: number; - warm: number; - cold: number; - frozen: number; - unmanaged: number; -} - -export interface DataQualityCheckResult { - docsCount: number | undefined; - error: string | null; - ilmPhase: IlmPhase | undefined; - incompatible: number | undefined; - indexName: string; - markdownComments: string[]; - sameFamily: number | undefined; - pattern: string; - checkedAt: number | undefined; -} - -export interface PatternRollup { - docsCount: number | undefined; - error: string | null; - ilmExplain: Record | null; - ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; - indices: number | undefined; - pattern: string; - results: Record | undefined; - sizeInBytes: number | undefined; - stats: Record | null; -} - -export interface CheckIndexRequest { - pattern: string; - indexName: string; -} - -export interface RequestQueueRequest { - topicId: string; - request: T; -} - -export interface RequestQueueResponse { - topicId: string; - request: T; - response: U; -} - -export interface IndexToCheck { - pattern: string; - indexName: string; -} - -export type OnCheckCompleted = (param: { - batchId: string; - checkAllStartTime: number; - error: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - indexName: string; - isLastCheck: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata | null; - pattern: string; - version: string; - requestTime?: number; -}) => void; - -export interface ErrorSummary { - error: string; - indexName: string | null; - pattern: string; -} - -export interface SortConfig { - sort: { - direction: Direction; - field: string; - }; -} - -export interface SelectedIndex { - indexName: string; - pattern: string; -} - -export interface MeteringStatsIndex { - uuid?: string; - name: string; - num_docs: number | null; - size_in_bytes: number | null; - data_stream?: string; -} - -export interface MeteringIndicesStatsResponse { - _shards: { - total: number; - successful: number; - failed: number; - }; - indices: MeteringStatsIndex[]; - datastreams: Array<{ name: string; num_docs: number; size_in_bytes: number }>; - total: { - num_docs: number; - size_in_bytes: number; - }; -} - -export type DataQualityIndexCheckedParams = DataQualityCheckAllCompletedParams & { - errorCount?: number; - ilmPhase?: string; - indexId?: string | null; - indexName: string; - sameFamilyFields?: string[]; - unallowedMappingFields?: string[]; - unallowedValueFields?: string[]; -}; - -export interface DataQualityCheckAllCompletedParams { - batchId: string; - ecsVersion: string; - isCheckAll: boolean; - numberOfDocuments?: number; - numberOfIncompatibleFields?: number; - numberOfIndices?: number; - numberOfIndicesChecked?: number; - numberOfSameFamily?: number; - sizeInBytes?: number; - timeConsumedMs?: number; -} - -export type ReportDataQualityIndexChecked = (params: DataQualityIndexCheckedParams) => void; -export type ReportDataQualityCheckAllCompleted = ( - params: DataQualityCheckAllCompletedParams -) => void; - -export interface TelemetryEvents { - reportDataQualityIndexChecked?: ReportDataQualityIndexChecked; - reportDataQualityCheckAllCompleted?: ReportDataQualityCheckAllCompleted; -} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx deleted file mode 100644 index f715936501736..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx +++ /dev/null @@ -1,127 +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 { renderHook } from '@testing-library/react-hooks'; -import React from 'react'; - -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockIlmExplain } from '../mock/ilm_explain/mock_ilm_explain'; -import { ERROR_LOADING_ILM_EXPLAIN } from '../translations'; -import { useIlmExplain, UseIlmExplain } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); -const ContextWrapper: React.FC<{ children: React.ReactNode; isILMAvailable: boolean }> = ({ - children, - isILMAvailable = true, -}) => ( - - {children} - -); - -const pattern = 'packetbeat-*'; - -describe('useIlmExplain', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('successful response from the ilm api', () => { - let ilmExplainResult: UseIlmExplain | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockIlmExplain); - - const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - ilmExplainResult = await result.current; - }); - - test('it returns the expected ilmExplain map', async () => { - expect(ilmExplainResult?.ilmExplain).toEqual(mockIlmExplain); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(ilmExplainResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(ilmExplainResult?.error).toBeNull(); - }); - }); - - describe('skip ilm api when isILMAvailable is false', () => { - let ilmExplainResult: UseIlmExplain | undefined; - - beforeEach(async () => { - const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { - wrapper: ({ children }) => ( - - {children} - - ), - }); - await waitForNextUpdate(); - ilmExplainResult = await result.current; - }); - - test('it returns the expected ilmExplain map', async () => { - expect(ilmExplainResult?.ilmExplain).toEqual(null); - }); - - test('it returns loading: false, because the request is aborted', async () => { - expect(ilmExplainResult?.loading).toBe(false); - }); - }); - - describe('fetch rejects with an error', () => { - let ilmExplainResult: UseIlmExplain | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - ilmExplainResult = await result.current; - }); - - test('it returns a null ilmExplain, because an error occurred', async () => { - expect(ilmExplainResult?.ilmExplain).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(ilmExplainResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(ilmExplainResult?.error).toEqual(ERROR_LOADING_ILM_EXPLAIN(errorMessage)); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx deleted file mode 100644 index 4e95549338874..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx +++ /dev/null @@ -1,71 +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 type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; -import { useEffect, useState } from 'react'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { INTERNAL_API_VERSION } from '../helpers'; -import * as i18n from '../translations'; - -const ILM_EXPLAIN_ENDPOINT = '/internal/ecs_data_quality_dashboard/ilm_explain'; - -export interface UseIlmExplain { - ilmExplain: Record | null; - error: string | null; - loading: boolean; -} - -export const useIlmExplain = (pattern: string): UseIlmExplain => { - const { httpFetch, isILMAvailable } = useDataQualityContext(); - const [ilmExplain, setIlmExplain] = useState | null>(null); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - const abortController = new AbortController(); - - async function fetchData() { - try { - const encodedIndexName = encodeURIComponent(`${pattern}`); - if (!isILMAvailable) { - abortController.abort(); - } - - const response = await httpFetch>( - `${ILM_EXPLAIN_ENDPOINT}/${encodedIndexName}`, - { - method: 'GET', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - } - ); - - if (!abortController.signal.aborted) { - setIlmExplain(response); - } - } catch (e) { - if (!abortController.signal.aborted) { - setError(i18n.ERROR_LOADING_ILM_EXPLAIN(e.message)); - } - } finally { - setLoading(false); - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [httpFetch, isILMAvailable, pattern, setError]); - - return { ilmExplain, error, loading }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts deleted file mode 100644 index b3a31228bb059..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts +++ /dev/null @@ -1,73 +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 { fetchMappings } from './helpers'; -import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; - -describe('helpers', () => { - describe('fetchMappings', () => { - test('it returns the expected mappings', async () => { - const mockFetch = jest.fn().mockResolvedValue(mockMappingsResponse); - - const result = await fetchMappings({ - abortController: new AbortController(), - httpFetch: mockFetch, - patternOrIndexName: 'auditbeat-custom-index-1', - }); - - expect(result).toEqual({ - 'auditbeat-custom-index-1': { - mappings: { - properties: { - '@timestamp': { type: 'date' }, - event: { properties: { category: { ignore_above: 1024, type: 'keyword' } } }, - host: { - properties: { - name: { - fields: { keyword: { ignore_above: 256, type: 'keyword' } }, - type: 'text', - }, - }, - }, - some: { - properties: { - field: { - fields: { keyword: { ignore_above: 256, type: 'keyword' } }, - type: 'text', - }, - }, - }, - source: { - properties: { - ip: { fields: { keyword: { ignore_above: 256, type: 'keyword' } }, type: 'text' }, - port: { type: 'long' }, - }, - }, - }, - }, - }, - }); - }); - - test('it throws the expected error when fetch fails', async () => { - const error = 'simulated error'; - const mockFetch = jest.fn().mockImplementation(() => { - throw new Error(error); - }); - - await expect( - fetchMappings({ - abortController: new AbortController(), - httpFetch: mockFetch, - patternOrIndexName: 'auditbeat-custom-index-1', - }) - ).rejects.toThrowError( - 'Error loading mappings for auditbeat-custom-index-1: simulated error' - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.ts deleted file mode 100644 index 809f543c0c0ae..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.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. - */ - -import type { HttpHandler } from '@kbn/core-http-browser'; -import type { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; - -import * as i18n from '../translations'; -import { INTERNAL_API_VERSION } from '../helpers'; - -export const MAPPINGS_API_ROUTE = '/internal/ecs_data_quality_dashboard/mappings'; - -export async function fetchMappings({ - abortController, - httpFetch, - patternOrIndexName, -}: { - abortController: AbortController; - httpFetch: HttpHandler; - patternOrIndexName: string; -}): Promise> { - const encodedIndexName = encodeURIComponent(`${patternOrIndexName}`); - - try { - return await httpFetch>( - `${MAPPINGS_API_ROUTE}/${encodedIndexName}`, - { - method: 'GET', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - } - ); - } catch (e) { - throw new Error(i18n.ERROR_LOADING_MAPPINGS({ details: e.message, patternOrIndexName })); - } -} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx deleted file mode 100644 index 8ccac0df997e7..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx +++ /dev/null @@ -1,98 +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 { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; -import { ERROR_LOADING_MAPPINGS } from '../translations'; -import { useMappings, UseMappings } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); - -const ContextWrapper: FC> = ({ children }) => ( - - {children} - -); - -const pattern = 'auditbeat-*'; - -describe('useMappings', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('successful response from the mappings api', () => { - let mappingsResult: UseMappings | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockMappingsResponse); - - const { result, waitForNextUpdate } = renderHook(() => useMappings(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - mappingsResult = await result.current; - }); - - test('it returns the expected mappings', async () => { - expect(mappingsResult?.indexes).toEqual(mockMappingsResponse); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(mappingsResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(mappingsResult?.error).toBeNull(); - }); - }); - - describe('fetch rejects with an error', () => { - let mappingsResult: UseMappings | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook(() => useMappings(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - mappingsResult = await result.current; - }); - - test('it returns null mappings, because an error occurred', async () => { - expect(mappingsResult?.indexes).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(mappingsResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(mappingsResult?.error).toEqual( - ERROR_LOADING_MAPPINGS({ details: errorMessage, patternOrIndexName: pattern }) - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx deleted file mode 100644 index f0f676ff24cac..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; -import { useEffect, useState } from 'react'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { fetchMappings } from './helpers'; - -export interface UseMappings { - indexes: Record | null; - error: string | null; - loading: boolean; -} - -export const useMappings = (patternOrIndexName: string): UseMappings => { - const [indexes, setIndexes] = useState | null>(null); - const { httpFetch } = useDataQualityContext(); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - const abortController = new AbortController(); - - async function fetchData() { - try { - const response = await fetchMappings({ abortController, httpFetch, patternOrIndexName }); - - if (!abortController.signal.aborted) { - setIndexes(response); - } - } catch (e) { - if (!abortController.signal.aborted) { - setError(e.message); - } - } finally { - if (!abortController.signal.aborted) { - setLoading(false); - } - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [httpFetch, patternOrIndexName, setError]); - - return { indexes, error, loading }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts deleted file mode 100644 index c724ee1ae38de..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts +++ /dev/null @@ -1,548 +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 numeral from '@elastic/numeral'; - -import { - getTotalDocsCount, - getTotalIncompatible, - getTotalIndices, - getTotalIndicesChecked, - getTotalSameFamily, - updateResultOnCheckCompleted, -} from './helpers'; -import { auditbeatWithAllResults } from '../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { - mockPacketbeatPatternRollup, - packetbeatNoResults, - packetbeatWithSomeErrors, -} from '../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { DataQualityCheckResult, MeteringStatsIndex, PatternRollup } from '../types'; -import { EMPTY_STAT } from '../helpers'; -import { mockPartitionedFieldMetadata } from '../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { alertIndexWithAllResults } from '../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { EcsVersion } from '@elastic/ecs'; - -const defaultBytesFormat = '0,0.[0]b'; -const formatBytes = (value: number | undefined) => - value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; - -const defaultNumberFormat = '0,0.[000]'; -const formatNumber = (value: number | undefined) => - value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; - -const patternRollups: Record = { - 'auditbeat-*': auditbeatWithAllResults, // indices: 3 - 'packetbeat-*': mockPacketbeatPatternRollup, // indices: 2 -}; - -describe('helpers', () => { - let originalFetch: (typeof global)['fetch']; - - beforeAll(() => { - originalFetch = global.fetch; - }); - - afterAll(() => { - global.fetch = originalFetch; - }); - - describe('getTotalSameFamily', () => { - const defaultDataQualityCheckResult: DataQualityCheckResult = { - docsCount: 26093, - error: null, - ilmPhase: 'hot', - incompatible: 0, - indexName: '.internal.alerts-security.alerts-default-000001', - markdownComments: ['foo', 'bar', 'baz'], - pattern: '.alerts-security.alerts-default', - sameFamily: 7, - checkedAt: 1706526408000, - }; - - const alertIndexWithSameFamily: PatternRollup = { - ...alertIndexWithAllResults, - results: { - '.internal.alerts-security.alerts-default-000001': { - ...defaultDataQualityCheckResult, - }, - }, - }; - - const withSameFamily: Record = { - '.internal.alerts-security.alerts-default-000001': alertIndexWithSameFamily, - }; - - test('it returns the expected count when patternRollups has sameFamily', () => { - expect(getTotalSameFamily(withSameFamily)).toEqual(7); - }); - - test('it returns undefined when patternRollups is empty', () => { - expect(getTotalSameFamily({})).toBeUndefined(); - }); - - test('it returns zero when none of the rollups have same family', () => { - expect(getTotalSameFamily(patternRollups)).toEqual(0); - }); - }); - - describe('getTotalIndices', () => { - test('it returns the expected total when ALL `PatternRollup`s have an `indices`', () => { - expect(getTotalIndices(patternRollups)).toEqual(5); - }); - - test('it returns undefined when only SOME of the `PatternRollup`s have an `indices`', () => { - const someIndicesAreUndefined: Record = { - 'auditbeat-*': { - ...auditbeatWithAllResults, - indices: undefined, // <-- - }, - 'packetbeat-*': mockPacketbeatPatternRollup, // indices: 2 - }; - - expect(getTotalIndices(someIndicesAreUndefined)).toBeUndefined(); - }); - }); - - describe('getTotalDocsCount', () => { - test('it returns the expected total when ALL `PatternRollup`s have a `docsCount`', () => { - expect(getTotalDocsCount(patternRollups)).toEqual( - Number(auditbeatWithAllResults.docsCount) + Number(mockPacketbeatPatternRollup.docsCount) - ); - }); - - test('it returns undefined when only SOME of the `PatternRollup`s have a `docsCount`', () => { - const someIndicesAreUndefined: Record = { - 'auditbeat-*': { - ...auditbeatWithAllResults, - docsCount: undefined, // <-- - }, - 'packetbeat-*': mockPacketbeatPatternRollup, - }; - - expect(getTotalDocsCount(someIndicesAreUndefined)).toBeUndefined(); - }); - }); - - describe('getTotalIncompatible', () => { - test('it returns the expected total when ALL `PatternRollup`s have `results`', () => { - expect(getTotalIncompatible(patternRollups)).toEqual(4); - }); - - test('it returns the expected total when only SOME of the `PatternRollup`s have `results`', () => { - const someResultsAreUndefined: Record = { - 'auditbeat-*': auditbeatWithAllResults, - 'packetbeat-*': packetbeatNoResults, // <-- results is undefined - }; - - expect(getTotalIncompatible(someResultsAreUndefined)).toEqual(4); - }); - - test('it returns undefined when NONE of the `PatternRollup`s have `results`', () => { - const someResultsAreUndefined: Record = { - 'packetbeat-*': packetbeatNoResults, // <-- results is undefined - }; - - expect(getTotalIncompatible(someResultsAreUndefined)).toBeUndefined(); - }); - }); - - describe('getTotalIndicesChecked', () => { - test('it returns the expected total', () => { - expect(getTotalIndicesChecked(patternRollups)).toEqual(3); - }); - - test('it returns the expected total when errors have occurred', () => { - const someErrors: Record = { - 'auditbeat-*': auditbeatWithAllResults, // indices: 3 - 'packetbeat-*': packetbeatWithSomeErrors, // <-- indices: 2, but one has errors - }; - - expect(getTotalIndicesChecked(someErrors)).toEqual(4); - }); - }); - - describe('updateResultOnCheckCompleted', () => { - const packetbeatStats861: MeteringStatsIndex = - mockPacketbeatPatternRollup.stats != null - ? mockPacketbeatPatternRollup.stats['.ds-packetbeat-8.6.1-2023.02.04-000001'] - : ({} as MeteringStatsIndex); - const packetbeatStats853: MeteringStatsIndex = - mockPacketbeatPatternRollup.stats != null - ? mockPacketbeatPatternRollup.stats['.ds-packetbeat-8.5.3-2023.02.04-000001'] - : ({} as MeteringStatsIndex); - - test('it returns the updated rollups', () => { - expect( - updateResultOnCheckCompleted({ - error: null, - formatBytes, - formatNumber, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'packetbeat-*', - patternRollups: { - 'packetbeat-*': mockPacketbeatPatternRollup, - }, - }) - ).toEqual({ - 'packetbeat-*': { - docsCount: 3258632, - error: null, - ilmExplain: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536751379, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536751379, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536751809, - action: 'rollover', - action_time_millis: 1675536751809, - step: 'check-rollover-ready', - step_time_millis: 1675536751809, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - '.ds-packetbeat-8.5.3-2023.02.04-000001': { - index: '.ds-packetbeat-8.5.3-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536774084, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536774084, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536774416, - action: 'rollover', - action_time_millis: 1675536774416, - step: 'check-rollover-ready', - step_time_millis: 1675536774416, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - }, - ilmExplainPhaseCounts: { - hot: 2, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 0, - }, - indices: 2, - pattern: 'packetbeat-*', - results: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - docsCount: 1628343, - error: null, - ilmPhase: 'hot', - incompatible: 3, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - markdownComments: [ - '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 (50.0%) | 3 | `hot` | 697.7MB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, - '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', - ], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: expect.any(Number), - }, - }, - sizeInBytes: 1464758182, - stats: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, - '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, - }, - }, - }); - }); - - test('it returns the expected results when `patternRollup` does NOT have a `docsCount`', () => { - const noDocsCount = { - ...mockPacketbeatPatternRollup, - docsCount: undefined, // <-- - }; - - expect( - updateResultOnCheckCompleted({ - error: null, - formatBytes, - formatNumber, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'packetbeat-*', - patternRollups: { - 'packetbeat-*': noDocsCount, - }, - }) - ).toEqual({ - 'packetbeat-*': { - docsCount: undefined, // <-- - error: null, - ilmExplain: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536751379, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536751379, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536751809, - action: 'rollover', - action_time_millis: 1675536751809, - step: 'check-rollover-ready', - step_time_millis: 1675536751809, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - '.ds-packetbeat-8.5.3-2023.02.04-000001': { - index: '.ds-packetbeat-8.5.3-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536774084, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536774084, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536774416, - action: 'rollover', - action_time_millis: 1675536774416, - step: 'check-rollover-ready', - step_time_millis: 1675536774416, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - }, - ilmExplainPhaseCounts: { - hot: 2, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 0, - }, - indices: 2, - pattern: 'packetbeat-*', - results: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - docsCount: 1628343, - error: null, - ilmPhase: 'hot', - incompatible: 3, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - markdownComments: [ - '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 () | 3 | `hot` | 697.7MB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, - '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', - ], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: expect.any(Number), - }, - }, - sizeInBytes: 1464758182, - stats: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, - '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, - }, - }, - }); - }); - - test('it returns the expected results when `partitionedFieldMetadata` is null', () => { - expect( - updateResultOnCheckCompleted({ - error: null, - formatBytes, - formatNumber, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - isILMAvailable: true, - partitionedFieldMetadata: null, // <-- - pattern: 'packetbeat-*', - patternRollups: { - 'packetbeat-*': mockPacketbeatPatternRollup, - }, - }) - ).toEqual({ - 'packetbeat-*': { - docsCount: 3258632, - error: null, - ilmExplain: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - index: '.ds-packetbeat-8.6.1-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536751379, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536751379, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536751809, - action: 'rollover', - action_time_millis: 1675536751809, - step: 'check-rollover-ready', - step_time_millis: 1675536751809, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - '.ds-packetbeat-8.5.3-2023.02.04-000001': { - index: '.ds-packetbeat-8.5.3-2023.02.04-000001', - managed: true, - policy: 'packetbeat', - index_creation_date_millis: 1675536774084, - time_since_index_creation: '25.26d', - lifecycle_date_millis: 1675536774084, - age: '25.26d', - phase: 'hot', - phase_time_millis: 1675536774416, - action: 'rollover', - action_time_millis: 1675536774416, - step: 'check-rollover-ready', - step_time_millis: 1675536774416, - phase_execution: { - policy: 'packetbeat', - version: 1, - modified_date_in_millis: 1675536751205, - }, - }, - }, - ilmExplainPhaseCounts: { - hot: 2, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 0, - }, - indices: 2, - pattern: 'packetbeat-*', - results: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - docsCount: 1628343, - error: null, - ilmPhase: 'hot', - incompatible: undefined, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - markdownComments: [], - pattern: 'packetbeat-*', - checkedAt: undefined, - }, - }, - sizeInBytes: 1464758182, - stats: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, - '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, - }, - }, - }); - }); - - test('it returns the updated rollups when there is no `partitionedFieldMetadata`', () => { - const noIlmExplain = { - ...mockPacketbeatPatternRollup, - ilmExplain: null, - }; - - expect( - updateResultOnCheckCompleted({ - error: null, - formatBytes, - formatNumber, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'packetbeat-*', - patternRollups: { - 'packetbeat-*': noIlmExplain, - }, - }) - ).toEqual({ - 'packetbeat-*': { - docsCount: 3258632, - error: null, - ilmExplain: null, - ilmExplainPhaseCounts: { - hot: 2, - warm: 0, - cold: 0, - frozen: 0, - unmanaged: 0, - }, - indices: 2, - pattern: 'packetbeat-*', - results: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': { - docsCount: 1628343, - error: null, - ilmPhase: undefined, - incompatible: 3, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - markdownComments: [ - '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', - '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 (50.0%) | 3 | -- | 697.7MB |\n\n', - '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', - `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, - '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', - ], - pattern: 'packetbeat-*', - sameFamily: 0, - checkedAt: expect.any(Number), - }, - }, - sizeInBytes: 1464758182, - stats: { - '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, - '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, - }, - }, - }); - }); - - test('it returns the unmodified rollups when `pattern` is not a member of `patternRollups`', () => { - const shouldNotBeModified: Record = { - 'packetbeat-*': mockPacketbeatPatternRollup, - }; - - expect( - updateResultOnCheckCompleted({ - error: null, - formatBytes, - formatNumber, - indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', - isILMAvailable: true, - partitionedFieldMetadata: mockPartitionedFieldMetadata, - pattern: 'this-pattern-is-not-in-pattern-rollups', // <-- - patternRollups: shouldNotBeModified, - }) - ).toEqual(shouldNotBeModified); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts deleted file mode 100644 index 07f51572b6ba2..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts +++ /dev/null @@ -1,168 +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 { getIndexDocsCountFromRollup } from '../data_quality_panel/data_quality_summary/summary_actions/check_all/helpers'; -import { getIlmPhase } from '../data_quality_panel/pattern/helpers'; -import { getAllIncompatibleMarkdownComments } from '../data_quality_panel/tabs/incompatible_tab/helpers'; -import { - getSizeInBytes, - getTotalPatternIncompatible, - getTotalPatternIndicesChecked, - getTotalPatternSameFamily, -} from '../helpers'; -import type { IlmPhase, PartitionedFieldMetadata, PatternRollup } from '../types'; - -export const getTotalIndices = ( - patternRollups: Record -): number | undefined => { - const allRollups = Object.values(patternRollups); - const allRollupsHaveIndices = allRollups.every(({ indices }) => Number.isInteger(indices)); - - // only return the total when all `PatternRollup`s have a `indices`: - return allRollupsHaveIndices - ? allRollups.reduce((acc, { indices }) => acc + Number(indices), 0) - : undefined; -}; - -export const getTotalDocsCount = ( - patternRollups: Record -): number | undefined => { - const allRollups = Object.values(patternRollups); - const allRollupsHaveDocsCount = allRollups.every(({ docsCount }) => Number.isInteger(docsCount)); - - // only return the total when all `PatternRollup`s have a `docsCount`: - return allRollupsHaveDocsCount - ? allRollups.reduce((acc, { docsCount }) => acc + Number(docsCount), 0) - : undefined; -}; - -export const getTotalSizeInBytes = ( - patternRollups: Record -): number | undefined => { - const allRollups = Object.values(patternRollups); - const allRollupsHaveSizeInBytes = allRollups.every(({ sizeInBytes }) => - Number.isInteger(sizeInBytes) - ); - - // only return the total when all `PatternRollup`s have a `sizeInBytes`: - return allRollupsHaveSizeInBytes - ? allRollups.reduce((acc, { sizeInBytes }) => acc + Number(sizeInBytes), 0) - : undefined; -}; - -export const getTotalIncompatible = ( - patternRollups: Record -): number | undefined => { - const allRollups = Object.values(patternRollups); - const anyRollupsHaveResults = allRollups.some(({ results }) => results != null); - - // only return the total when at least one `PatternRollup` has results: - return anyRollupsHaveResults - ? allRollups.reduce((acc, { results }) => acc + (getTotalPatternIncompatible(results) ?? 0), 0) - : undefined; -}; - -export const getTotalSameFamily = ( - patternRollups: Record -): number | undefined => { - const allRollups = Object.values(patternRollups); - const anyRollupsHaveResults = allRollups.some(({ results }) => results != null); - - // only return the total when at least one `PatternRollup` has results: - return anyRollupsHaveResults - ? allRollups.reduce((acc, { results }) => acc + (getTotalPatternSameFamily(results) ?? 0), 0) - : undefined; -}; - -export const getTotalIndicesChecked = (patternRollups: Record): number => { - const allRollups = Object.values(patternRollups); - - return allRollups.reduce( - (acc, patternRollup) => acc + getTotalPatternIndicesChecked(patternRollup), - 0 - ); -}; - -export const updateResultOnCheckCompleted = ({ - error, - formatBytes, - formatNumber, - indexName, - isILMAvailable, - partitionedFieldMetadata, - pattern, - patternRollups, -}: { - error: string | null; - formatBytes: (value: number | undefined) => string; - formatNumber: (value: number | undefined) => string; - indexName: string; - isILMAvailable: boolean; - partitionedFieldMetadata: PartitionedFieldMetadata | null; - pattern: string; - patternRollups: Record; -}): Record => { - const patternRollup: PatternRollup | undefined = patternRollups[pattern]; - - if (patternRollup != null) { - const ilmExplain = patternRollup.ilmExplain; - - const ilmPhase: IlmPhase | undefined = - ilmExplain != null ? getIlmPhase(ilmExplain[indexName], isILMAvailable) : undefined; - - const docsCount = getIndexDocsCountFromRollup({ - indexName, - patternRollup, - }); - - const patternDocsCount = patternRollup.docsCount ?? 0; - - const sizeInBytes = getSizeInBytes({ indexName, stats: patternRollup.stats }); - - const markdownComments = - partitionedFieldMetadata != null - ? getAllIncompatibleMarkdownComments({ - docsCount, - formatBytes, - formatNumber, - ilmPhase, - indexName, - isILMAvailable, - partitionedFieldMetadata, - patternDocsCount, - sizeInBytes, - }) - : []; - - const incompatible = partitionedFieldMetadata?.incompatible.length; - const sameFamily = partitionedFieldMetadata?.sameFamily.length; - const checkedAt = partitionedFieldMetadata ? Date.now() : undefined; - - return { - ...patternRollups, - [pattern]: { - ...patternRollup, - results: { - ...(patternRollup.results ?? {}), - [indexName]: { - docsCount, - error, - ilmPhase, - incompatible, - indexName, - markdownComments, - pattern, - sameFamily, - checkedAt, - }, - }, - }, - }; - } else { - return patternRollups; - } -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx deleted file mode 100644 index 7a53eedc3c562..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx +++ /dev/null @@ -1,271 +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 { useCallback, useEffect, useMemo, useState } from 'react'; -import { EcsVersion } from '@elastic/ecs'; - -import { isEmpty } from 'lodash/fp'; -import { - getTotalDocsCount, - getTotalIncompatible, - getTotalIndices, - getTotalIndicesChecked, - getTotalSameFamily, - getTotalSizeInBytes, - updateResultOnCheckCompleted, -} from './helpers'; - -import type { DataQualityCheckResult, OnCheckCompleted, PatternRollup } from '../types'; -import { - getDocsCount, - getIndexId, - getStorageResults, - getSizeInBytes, - getTotalPatternSameFamily, - postStorageResult, - formatStorageResult, - formatResultFromStorage, -} from '../helpers'; -import { getIlmPhase, getIndexIncompatible } from '../data_quality_panel/pattern/helpers'; -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { - getIncompatibleMappingsFields, - getIncompatibleValuesFields, - getSameFamilyFields, -} from '../data_quality_panel/tabs/incompatible_tab/helpers'; - -interface Props { - ilmPhases: string[]; - patterns: string[]; -} -interface UseResultsRollup { - onCheckCompleted: OnCheckCompleted; - patternIndexNames: Record; - patternRollups: Record; - totalDocsCount: number | undefined; - totalIncompatible: number | undefined; - totalIndices: number | undefined; - totalIndicesChecked: number | undefined; - totalSameFamily: number | undefined; - totalSizeInBytes: number | undefined; - updatePatternIndexNames: ({ - indexNames, - pattern, - }: { - indexNames: string[]; - pattern: string; - }) => void; - updatePatternRollup: (patternRollup: PatternRollup) => void; -} - -const useStoredPatternResults = (patterns: string[]) => { - const { httpFetch, toasts } = useDataQualityContext(); - const [storedPatternResults, setStoredPatternResults] = useState< - Array<{ pattern: string; results: Record }> - >([]); - - useEffect(() => { - if (isEmpty(patterns)) { - return; - } - - let ignore = false; - const abortController = new AbortController(); - const fetchStoredPatternResults = async () => { - const requests = patterns.map((pattern) => - getStorageResults({ pattern, httpFetch, abortController, toasts }).then((results = []) => ({ - pattern, - results: Object.fromEntries( - results.map((storageResult) => [ - storageResult.indexName, - formatResultFromStorage({ storageResult, pattern }), - ]) - ), - })) - ); - const patternResults = await Promise.all(requests); - if (patternResults?.length && !ignore) { - setStoredPatternResults(patternResults); - } - }; - - fetchStoredPatternResults(); - return () => { - ignore = true; - }; - }, [httpFetch, patterns, toasts]); - - return storedPatternResults; -}; - -export const useResultsRollup = ({ ilmPhases, patterns }: Props): UseResultsRollup => { - const { httpFetch, toasts } = useDataQualityContext(); - const [patternIndexNames, setPatternIndexNames] = useState>({}); - const [patternRollups, setPatternRollups] = useState>({}); - - const storedPatternsResults = useStoredPatternResults(patterns); - - useEffect(() => { - if (!isEmpty(storedPatternsResults)) { - setPatternRollups((current) => - storedPatternsResults.reduce( - (acc, { pattern, results }) => ({ - ...acc, - [pattern]: { - ...current[pattern], - pattern, - results, - }, - }), - current - ) - ); - } - }, [storedPatternsResults]); - - const { telemetryEvents, isILMAvailable } = useDataQualityContext(); - const updatePatternRollup = useCallback((patternRollup: PatternRollup) => { - setPatternRollups((current) => ({ - ...current, - [patternRollup.pattern]: { - ...patternRollup, - results: patternRollup.results ?? current[patternRollup.pattern]?.results, // prevent undefined results override existing - }, - })); - }, []); - - const totalDocsCount = useMemo(() => getTotalDocsCount(patternRollups), [patternRollups]); - const totalIncompatible = useMemo(() => getTotalIncompatible(patternRollups), [patternRollups]); - const totalIndices = useMemo(() => getTotalIndices(patternRollups), [patternRollups]); - const totalIndicesChecked = useMemo( - () => getTotalIndicesChecked(patternRollups), - [patternRollups] - ); - const totalSameFamily = useMemo(() => getTotalSameFamily(patternRollups), [patternRollups]); - const totalSizeInBytes = useMemo(() => getTotalSizeInBytes(patternRollups), [patternRollups]); - - const updatePatternIndexNames = useCallback( - ({ indexNames, pattern }: { indexNames: string[]; pattern: string }) => { - setPatternIndexNames((current) => ({ ...current, [pattern]: indexNames })); - }, - [] - ); - - const onCheckCompleted: OnCheckCompleted = useCallback( - ({ - batchId, - checkAllStartTime, - error, - formatBytes, - formatNumber, - indexName, - partitionedFieldMetadata, - pattern, - requestTime, - isLastCheck, - }) => { - setPatternRollups((currentPatternRollups) => { - const updatedRollups = updateResultOnCheckCompleted({ - error, - formatBytes, - formatNumber, - indexName, - isILMAvailable, - partitionedFieldMetadata, - pattern, - patternRollups: currentPatternRollups, - }); - - const updatedRollup = updatedRollups[pattern]; - const { stats, results, ilmExplain } = updatedRollup; - const indexId = getIndexId({ indexName, stats }); - - if ( - stats && - results && - requestTime != null && - requestTime > 0 && - partitionedFieldMetadata - ) { - const report = { - batchId, - ecsVersion: EcsVersion, - errorCount: error ? 1 : 0, - ilmPhase: getIlmPhase(ilmExplain?.[indexName], isILMAvailable), - indexId, - indexName, - isCheckAll: true, - numberOfDocuments: getDocsCount({ indexName, stats }), - numberOfFields: partitionedFieldMetadata.all.length, - numberOfIncompatibleFields: getIndexIncompatible({ - indexName, - results, - }), - numberOfEcsFields: partitionedFieldMetadata.ecsCompliant.length, - numberOfCustomFields: partitionedFieldMetadata.custom.length, - numberOfIndices: 1, - numberOfIndicesChecked: 1, - numberOfSameFamily: getTotalPatternSameFamily(results), - sameFamilyFields: getSameFamilyFields(partitionedFieldMetadata.sameFamily), - sizeInBytes: getSizeInBytes({ stats, indexName }), - timeConsumedMs: requestTime, - unallowedMappingFields: getIncompatibleMappingsFields( - partitionedFieldMetadata.incompatible - ), - unallowedValueFields: getIncompatibleValuesFields( - partitionedFieldMetadata.incompatible - ), - }; - telemetryEvents.reportDataQualityIndexChecked?.(report); - - const result = results[indexName]; - if (result) { - const storageResult = formatStorageResult({ result, report, partitionedFieldMetadata }); - postStorageResult({ storageResult, httpFetch, toasts }); - } - } - - if (isLastCheck) { - telemetryEvents.reportDataQualityCheckAllCompleted?.({ - batchId, - ecsVersion: EcsVersion, - isCheckAll: true, - numberOfDocuments: getTotalDocsCount(updatedRollups), - numberOfIncompatibleFields: getTotalIncompatible(updatedRollups), - numberOfIndices: getTotalIndices(updatedRollups), - numberOfIndicesChecked: getTotalIndicesChecked(updatedRollups), - numberOfSameFamily: getTotalSameFamily(updatedRollups), - sizeInBytes: getTotalSizeInBytes(updatedRollups), - timeConsumedMs: Date.now() - checkAllStartTime, - }); - } - return updatedRollups; - }); - }, - [httpFetch, isILMAvailable, telemetryEvents, toasts] - ); - - useEffect(() => { - // reset all state - setPatternRollups({}); - setPatternIndexNames({}); - }, [ilmPhases, patterns]); - - return { - onCheckCompleted, - patternIndexNames, - patternRollups, - totalDocsCount, - totalIncompatible, - totalIndices, - totalIndicesChecked, - totalSameFamily, - totalSizeInBytes, - updatePatternIndexNames, - updatePatternRollup, - }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx deleted file mode 100644 index d084f168ac450..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx +++ /dev/null @@ -1,136 +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 { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockStatsAuditbeatIndex } from '../mock/stats/mock_stats_packetbeat_index'; -import { ERROR_LOADING_STATS } from '../translations'; -import { useStats, UseStats } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); - -const ContextWrapper: FC> = ({ children }) => ( - - {children} - -); - -const ContextWrapperILMNotAvailable: FC> = ({ children }) => ( - - {children} - -); - -const pattern = 'auditbeat-*'; -const startDate = `now-7d`; -const endDate = `now`; -const params = { - pattern, -}; - -describe('useStats', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('query with date range when ILM is not available', () => { - const queryParams = { - isILMAvailable: false, - startDate, - endDate, - }; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockStatsAuditbeatIndex); - - const { waitForNextUpdate } = renderHook(() => useStats({ pattern, startDate, endDate }), { - wrapper: ContextWrapperILMNotAvailable, - }); - await waitForNextUpdate(); - }); - test(`it calls the stats api with the expected params`, async () => { - expect(mockHttpFetch.mock.calls[0][1].query).toEqual(queryParams); - }); - }); - - describe('successful response from the stats api', () => { - let statsResult: UseStats | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockStatsAuditbeatIndex); - - const { result, waitForNextUpdate } = renderHook(() => useStats(params), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - statsResult = await result.current; - }); - - test('it returns the expected stats', async () => { - expect(statsResult?.stats).toEqual(mockStatsAuditbeatIndex); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(statsResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(statsResult?.error).toBeNull(); - }); - - test(`it calls the stats api with the expected params`, async () => { - expect(mockHttpFetch.mock.calls[0][1].query).toEqual({ isILMAvailable: true }); - }); - }); - - describe('fetch rejects with an error', () => { - let statsResult: UseStats | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook(() => useStats(params), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - statsResult = await result.current; - }); - - test('it returns null stats, because an error occurred', async () => { - expect(statsResult?.stats).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(statsResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(statsResult?.error).toEqual(ERROR_LOADING_STATS(errorMessage)); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx deleted file mode 100644 index 90af7ded0ba00..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx +++ /dev/null @@ -1,86 +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 { useEffect, useState } from 'react'; -import { HttpFetchQuery } from '@kbn/core/public'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import * as i18n from '../translations'; -import { INTERNAL_API_VERSION } from '../helpers'; -import { MeteringStatsIndex } from '../types'; - -const STATS_ENDPOINT = '/internal/ecs_data_quality_dashboard/stats'; - -export interface UseStats { - stats: Record | null; - error: string | null; - loading: boolean; -} - -export const useStats = ({ - endDate, - pattern, - startDate, -}: { - endDate?: string | null; - pattern: string; - startDate?: string | null; -}): UseStats => { - const { httpFetch, isILMAvailable } = useDataQualityContext(); - const [stats, setStats] = useState | null>(null); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - const abortController = new AbortController(); - - async function fetchData() { - try { - const encodedIndexName = encodeURIComponent(`${pattern}`); - const query: HttpFetchQuery = { isILMAvailable }; - if (!isILMAvailable) { - if (startDate) { - query.startDate = startDate; - } - if (endDate) { - query.endDate = endDate; - } - } - - const response = await httpFetch>( - `${STATS_ENDPOINT}/${encodedIndexName}`, - { - version: INTERNAL_API_VERSION, - method: 'GET', - signal: abortController.signal, - query, - } - ); - - if (!abortController.signal.aborted) { - setStats(response); - } - } catch (e) { - if (!abortController.signal.aborted) { - setError(i18n.ERROR_LOADING_STATS(e.message)); - } - } finally { - if (!abortController.signal.aborted) { - setLoading(false); - } - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [endDate, httpFetch, isILMAvailable, pattern, setError, startDate]); - - return { stats, error, loading }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts deleted file mode 100644 index ade9970277c50..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts +++ /dev/null @@ -1,498 +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 { omit } from 'lodash/fp'; - -import { - fetchUnallowedValues, - getUnallowedValueCount, - getUnallowedValues, - isBucket, -} from './helpers'; -import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; -import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types'; -import { INTERNAL_API_VERSION } from '../helpers'; - -describe('helpers', () => { - let originalFetch: (typeof global)['fetch']; - - beforeAll(() => { - originalFetch = global.fetch; - }); - - afterAll(() => { - global.fetch = originalFetch; - }); - - describe('isBucket', () => { - test('it returns true when the bucket is valid', () => { - expect( - isBucket({ - key: 'stop', - doc_count: 2, - }) - ).toBe(true); - }); - - test('it returns false when just `key` is missing', () => { - expect( - isBucket({ - doc_count: 2, - }) - ).toBe(false); - }); - - test('it returns false when just `key` has an incorrect type', () => { - expect( - isBucket({ - key: 1234, // <-- should be a string - doc_count: 2, - }) - ).toBe(false); - }); - - test('it returns false when just `doc_count` is missing', () => { - expect( - isBucket({ - key: 'stop', - }) - ).toBe(false); - }); - - test('it returns false when just `doc_count` has an incorrect type', () => { - expect( - isBucket({ - key: 'stop', - doc_count: 'foo', // <-- should be a number - }) - ).toBe(false); - }); - - test('it returns false when both `key` and `doc_count` are missing', () => { - expect(isBucket({})).toBe(false); - }); - - test('it returns false when both `key` and `doc_count` have incorrect types', () => { - expect( - isBucket({ - key: 1234, // <-- should be a string - doc_count: 'foo', // <-- should be a number - }) - ).toBe(false); - }); - - test('it returns false when `maybeBucket` is undefined', () => { - expect(isBucket(undefined)).toBe(false); - }); - }); - - describe('getUnallowedValueCount', () => { - test('it returns the expected count', () => { - expect( - getUnallowedValueCount({ - key: 'stop', - doc_count: 2, - }) - ).toEqual({ count: 2, fieldName: 'stop' }); - }); - }); - - describe('getUnallowedValues', () => { - const requestItems: UnallowedValueRequestItem[] = [ - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.category', - allowedValues: [ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.kind', - allowedValues: [ - 'alert', - 'enrichment', - 'event', - 'metric', - 'state', - 'pipeline_error', - 'signal', - ], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.outcome', - allowedValues: ['failure', 'success', 'unknown'], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.type', - allowedValues: [ - 'access', - 'admin', - 'allowed', - 'change', - 'connection', - 'creation', - 'deletion', - 'denied', - 'end', - 'error', - 'group', - 'indicator', - 'info', - 'installation', - 'protocol', - 'start', - 'user', - ], - }, - ]; - - const searchResults: UnallowedValueSearchResult[] = [ - { - aggregations: { - 'event.category': { - buckets: [ - { - key: 'an_invalid_category', - doc_count: 2, - }, - { - key: 'theory', - doc_count: 1, - }, - ], - }, - }, - }, - { - aggregations: { - 'event.kind': { - buckets: [], - }, - }, - }, - { - aggregations: { - 'event.outcome': { - buckets: [], - }, - }, - }, - { - aggregations: { - 'event.type': { - buckets: [], - }, - }, - }, - ]; - - test('it returns the expected unallowed values', () => { - expect( - getUnallowedValues({ - requestItems, - searchResults, - }) - ).toEqual({ - 'event.category': [ - { count: 2, fieldName: 'an_invalid_category' }, - { count: 1, fieldName: 'theory' }, - ], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }); - }); - - test('it returns an empty index when `searchResults` is null', () => { - expect( - getUnallowedValues({ - requestItems, - searchResults: null, - }) - ).toEqual({}); - }); - - test('it returns an empty index when `searchResults` is not an array', () => { - expect( - getUnallowedValues({ - requestItems, - // @ts-expect-error - searchResults: 1234, - }) - ).toEqual({}); - }); - - test('it returns the expected results when `searchResults` does NOT have `aggregations`', () => { - const noAggregations: UnallowedValueSearchResult[] = searchResults.map((x) => - omit('aggregations', x) - ); - - expect( - getUnallowedValues({ - requestItems, - searchResults: noAggregations, - }) - ).toEqual({ - 'event.category': [], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }); - }); - - test('it returns the expected unallowed values when SOME buckets are invalid', () => { - const someInvalid: UnallowedValueSearchResult[] = [ - { - aggregations: { - 'event.category': { - buckets: [ - { - key: 'foo', - // @ts-expect-error - doc_count: 'this-is-an-invalid-bucket', // <-- invalid type, should be number - }, - { - key: 'bar', - doc_count: 1, - }, - ], - }, - }, - }, - { - aggregations: { - 'event.kind': { - buckets: [], - }, - }, - }, - { - aggregations: { - 'event.outcome': { - buckets: [], - }, - }, - }, - { - aggregations: { - 'event.type': { - buckets: [], - }, - }, - }, - ]; - - expect( - getUnallowedValues({ - requestItems, - searchResults: someInvalid, - }) - ).toEqual({ - 'event.category': [{ count: 1, fieldName: 'bar' }], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }); - }); - }); - - describe('fetchUnallowedValues', () => { - const requestItems: UnallowedValueRequestItem[] = [ - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.category', - allowedValues: [ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.kind', - allowedValues: [ - 'alert', - 'enrichment', - 'event', - 'metric', - 'state', - 'pipeline_error', - 'signal', - ], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.outcome', - allowedValues: ['failure', 'success', 'unknown'], - }, - { - indexName: 'auditbeat-custom-index-1', - indexFieldName: 'event.type', - allowedValues: [ - 'access', - 'admin', - 'allowed', - 'change', - 'connection', - 'creation', - 'deletion', - 'denied', - 'end', - 'error', - 'group', - 'indicator', - 'info', - 'installation', - 'protocol', - 'start', - 'user', - ], - }, - ]; - - test('it includes the expected content in the `fetch` request', async () => { - const mockFetch = jest.fn().mockResolvedValue(mockUnallowedValuesResponse); - const abortController = new AbortController(); - - await fetchUnallowedValues({ - abortController, - httpFetch: mockFetch, - indexName: 'auditbeat-custom-index-1', - requestItems, - }); - - expect(mockFetch).toBeCalledWith( - '/internal/ecs_data_quality_dashboard/unallowed_field_values', - { - body: JSON.stringify(requestItems), - headers: { 'Content-Type': 'application/json' }, - method: 'POST', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - } - ); - }); - - test('it returns the expected unallowed values', async () => { - const mockFetch = jest.fn().mockResolvedValue(mockUnallowedValuesResponse); - - const result = await fetchUnallowedValues({ - abortController: new AbortController(), - httpFetch: mockFetch, - indexName: 'auditbeat-custom-index-1', - requestItems, - }); - - expect(result).toEqual([ - { - _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, - aggregations: { - 'event.category': { - buckets: [ - { doc_count: 2, key: 'an_invalid_category' }, - { doc_count: 1, key: 'theory' }, - ], - doc_count_error_upper_bound: 0, - sum_other_doc_count: 0, - }, - }, - hits: { hits: [], max_score: null, total: { relation: 'eq', value: 3 } }, - status: 200, - timed_out: false, - took: 1, - }, - { - _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, - aggregations: { - 'event.kind': { buckets: [], doc_count_error_upper_bound: 0, sum_other_doc_count: 0 }, - }, - hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, - status: 200, - timed_out: false, - took: 0, - }, - { - _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, - aggregations: { - 'event.outcome': { - buckets: [], - doc_count_error_upper_bound: 0, - sum_other_doc_count: 0, - }, - }, - hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, - status: 200, - timed_out: false, - took: 0, - }, - { - _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, - aggregations: { - 'event.type': { buckets: [], doc_count_error_upper_bound: 0, sum_other_doc_count: 0 }, - }, - hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, - status: 200, - timed_out: false, - took: 0, - }, - ]); - }); - - test('it throws the expected error when fetch fails', async () => { - const error = 'simulated error'; - const mockFetch = jest.fn().mockImplementation(() => { - throw new Error(error); - }); - - await expect( - fetchUnallowedValues({ - abortController: new AbortController(), - httpFetch: mockFetch, - indexName: 'auditbeat-custom-index-1', - requestItems, - }) - ).rejects.toThrowError( - 'Error loading unallowed values for index auditbeat-custom-index-1: simulated error' - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.ts deleted file mode 100644 index a193456d4afa9..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.ts +++ /dev/null @@ -1,95 +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 type { HttpHandler } from '@kbn/core-http-browser'; -import { INTERNAL_API_VERSION } from '../helpers'; -import * as i18n from '../translations'; -import type { - Bucket, - UnallowedValueCount, - UnallowedValueRequestItem, - UnallowedValueSearchResult, -} from '../types'; - -const UNALLOWED_VALUES_API_ROUTE = '/internal/ecs_data_quality_dashboard/unallowed_field_values'; - -export const isBucket = (maybeBucket: unknown): maybeBucket is Bucket => - maybeBucket != null && - typeof (maybeBucket as Bucket).key === 'string' && - typeof (maybeBucket as Bucket).doc_count === 'number'; - -// eslint-disable-next-line @typescript-eslint/naming-convention -export const getUnallowedValueCount = ({ doc_count, key }: Bucket): UnallowedValueCount => ({ - count: doc_count, - fieldName: key, -}); - -export const getUnallowedValues = ({ - requestItems, - searchResults, -}: { - requestItems: UnallowedValueRequestItem[]; - searchResults: UnallowedValueSearchResult[] | null; -}): Record => { - if (searchResults == null || !Array.isArray(searchResults)) { - return {}; - } - - return requestItems.reduce((acc, { indexFieldName }) => { - const searchResult = searchResults.find( - (x) => - typeof x.aggregations === 'object' && Array.isArray(x.aggregations[indexFieldName]?.buckets) - ); - - if ( - searchResult != null && - searchResult.aggregations != null && - searchResult.aggregations[indexFieldName] != null - ) { - const buckets = searchResult.aggregations[indexFieldName]?.buckets; - - return { - ...acc, - [indexFieldName]: buckets?.flatMap((x) => (isBucket(x) ? getUnallowedValueCount(x) : [])), - }; - } else { - return { - ...acc, - [indexFieldName]: [], - }; - } - }, {}); -}; - -export async function fetchUnallowedValues({ - abortController, - httpFetch, - indexName, - requestItems, -}: { - abortController: AbortController; - httpFetch: HttpHandler; - indexName: string; - requestItems: UnallowedValueRequestItem[]; -}): Promise { - try { - return await httpFetch(UNALLOWED_VALUES_API_ROUTE, { - body: JSON.stringify(requestItems), - headers: { 'Content-Type': 'application/json' }, - method: 'POST', - signal: abortController.signal, - version: INTERNAL_API_VERSION, - }); - } catch (e) { - throw new Error( - i18n.ERROR_LOADING_UNALLOWED_VALUES({ - details: e.message, - indexName, - }) - ); - } -} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx deleted file mode 100644 index fcbb8aae9337f..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx +++ /dev/null @@ -1,138 +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 { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { getUnallowedValueRequestItems } from '../data_quality_panel/allowed_values/helpers'; -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; -import { ERROR_LOADING_UNALLOWED_VALUES } from '../translations'; -import { UnallowedValueRequestItem } from '../types'; -import { useUnallowedValues, UseUnallowedValues } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { EcsFlatTyped } from '../constants'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); - -const ContextWrapper: FC> = ({ children }) => ( - - {children} - -); - -const indexName = 'auditbeat-custom-index-1'; -const requestItems = getUnallowedValueRequestItems({ - ecsMetadata: EcsFlatTyped, - indexName, -}); - -describe('useUnallowedValues', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('when requestItems is empty', () => { - const emptyRequestItems: UnallowedValueRequestItem[] = []; - - test('it does NOT make an http request', async () => { - await renderHook( - () => - useUnallowedValues({ - indexName, - requestItems: emptyRequestItems, // <-- empty - }), - { - wrapper: ContextWrapper, - } - ); - - expect(mockHttpFetch).not.toBeCalled(); - }); - }); - - describe('successful response from the unallowed values api', () => { - let unallowedValuesResult: UseUnallowedValues | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockUnallowedValuesResponse); - - const { result, waitForNextUpdate } = renderHook( - () => useUnallowedValues({ indexName, requestItems }), - { - wrapper: ContextWrapper, - } - ); - await waitForNextUpdate(); - unallowedValuesResult = await result.current; - }); - - test('it returns the expected unallowed values', async () => { - expect(unallowedValuesResult?.unallowedValues).toEqual({ - 'event.category': [ - { count: 2, fieldName: 'an_invalid_category' }, - { count: 1, fieldName: 'theory' }, - ], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(unallowedValuesResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(unallowedValuesResult?.error).toBeNull(); - }); - }); - - describe('fetch rejects with an error', () => { - let unallowedValuesResult: UseUnallowedValues | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook( - () => useUnallowedValues({ indexName, requestItems }), - { - wrapper: ContextWrapper, - } - ); - await waitForNextUpdate(); - unallowedValuesResult = await result.current; - }); - - test('it returns null unallowed values, because an error occurred', async () => { - expect(unallowedValuesResult?.unallowedValues).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(unallowedValuesResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(unallowedValuesResult?.error).toEqual( - ERROR_LOADING_UNALLOWED_VALUES({ details: errorMessage, indexName }) - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx deleted file mode 100644 index de0ce82fb8527..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx +++ /dev/null @@ -1,83 +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 { useEffect, useState } from 'react'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { fetchUnallowedValues, getUnallowedValues } from './helpers'; -import type { UnallowedValueCount, UnallowedValueRequestItem } from '../types'; - -export interface UseUnallowedValues { - unallowedValues: Record | null; - error: string | null; - loading: boolean; - requestTime: number | undefined; -} - -export const useUnallowedValues = ({ - indexName, - requestItems, -}: { - indexName: string; - requestItems: UnallowedValueRequestItem[]; -}): UseUnallowedValues => { - const [unallowedValues, setUnallowedValues] = useState | null>(null); - const { httpFetch } = useDataQualityContext(); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - const [requestTime, setRequestTime] = useState(); - useEffect(() => { - if (requestItems.length === 0) { - return; - } - - const abortController = new AbortController(); - - async function fetchData() { - const startTime = Date.now(); - - try { - const searchResults = await fetchUnallowedValues({ - abortController, - httpFetch, - indexName, - requestItems, - }); - - const unallowedValuesMap = getUnallowedValues({ - requestItems, - searchResults, - }); - - if (!abortController.signal.aborted) { - setUnallowedValues(unallowedValuesMap); - } - } catch (e) { - if (!abortController.signal.aborted) { - setError(e.message); - setRequestTime(Date.now() - startTime); - } - } finally { - if (!abortController.signal.aborted) { - setLoading(false); - setRequestTime(Date.now() - startTime); - } - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [httpFetch, indexName, requestItems, setError]); - - return { unallowedValues, error, loading, requestTime }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx new file mode 100644 index 0000000000000..ba4aee43c32c7 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx @@ -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 React from 'react'; +import { screen, render } from '@testing-library/react'; + +import { AddToNewCaseAction } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; +import userEvent from '@testing-library/user-event'; + +describe('AddToNewCaseAction', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render add to new case link', () => { + render( + + + + + + ); + + expect(screen.getByTestId('addToNewCase')).toHaveTextContent('Add to new case'); + }); + + describe('when ilm phases are not provided', () => { + it('should render disabled add to new case link', () => { + render( + + + + + + ); + + expect(screen.getByTestId('addToNewCase')).toBeDisabled(); + }); + }); + + describe('when createAndReadCases() returns false', () => { + it('should render disabled add to new case link', () => { + render( + + false }} + > + + + + ); + + expect(screen.getByTestId('addToNewCase')).toBeDisabled(); + }); + }); + + describe('when clicking on add to new case link', () => { + it('should open create case flyout with header content and provided markdown', () => { + let headerContent: React.ReactNode = null; + const openCreateCaseFlyout = jest.fn(({ headerContent: _headerContent }) => { + headerContent = render(_headerContent).container; + }); + render( + + + + + + ); + + userEvent.click(screen.getByTestId('addToNewCase')); + + expect(openCreateCaseFlyout).toHaveBeenCalledWith({ + comments: ['test markdown'], + headerContent: expect.anything(), + }); + + expect(headerContent).toContainHTML('
Create a data quality case
'); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx new file mode 100644 index 0000000000000..93d5b7ba7e20b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.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, { useCallback } from 'react'; +import { EuiIcon, EuiLink } from '@elastic/eui'; + +import { useDataQualityContext } from '../../data_quality_context'; +import { useAddToNewCase } from './hooks/use_add_to_new_case'; +import { StyledLinkText } from '../styles'; +import { ADD_TO_NEW_CASE } from '../../translations'; + +interface Props { + markdownComment: string; +} + +const AddToNewCaseActionComponent: React.FC = ({ markdownComment }) => { + const { canUserCreateAndReadCases, openCreateCaseFlyout, ilmPhases } = useDataQualityContext(); + const { disabled: addToNewCaseDisabled, onAddToNewCase } = useAddToNewCase({ + canUserCreateAndReadCases, + openCreateCaseFlyout, + }); + + const onClickAddToCase = useCallback( + () => onAddToNewCase([markdownComment]), + [markdownComment, onAddToNewCase] + ); + + const addToNewCaseContextMenuOnClick = useCallback(() => { + onClickAddToCase(); + }, [onClickAddToCase]); + + const disableAll = ilmPhases.length === 0; + + return ( + + + + {ADD_TO_NEW_CASE} + + + ); +}; + +AddToNewCaseActionComponent.displayName = 'AddToNewCaseActionComponent'; + +export const AddToNewCaseAction = React.memo(AddToNewCaseActionComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx new file mode 100644 index 0000000000000..33e52a398e3c9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { screen, render } from '@testing-library/react'; + +import { ChatAction } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; + +describe('ChatAction', () => { + it('should render new chat link', () => { + render( + + + + + + ); + + expect(screen.getByTestId('newChatLink')).toHaveTextContent('Ask Assistant'); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx new file mode 100644 index 0000000000000..fb990fc295bbf --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC, useCallback } from 'react'; +import { AssistantAvatar, NewChat } from '@kbn/elastic-assistant'; +import styled from 'styled-components'; + +import { + DATA_QUALITY_DASHBOARD_CONVERSATION_ID, + DATA_QUALITY_PROMPT_CONTEXT_PILL, + DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP, + DATA_QUALITY_SUGGESTED_USER_PROMPT, +} from '../../translations'; +import { useDataQualityContext } from '../../data_quality_context'; +import { ASK_ASSISTANT } from './translations'; + +const StyledLinkText = styled.span` + display: flex; + gap: ${({ theme }) => theme.eui.euiSizeXS}; +`; + +interface Props { + markdownComment: string; + indexName: string; +} + +const ChatActionComponent: FC = ({ indexName, markdownComment }) => { + const { isAssistantEnabled } = useDataQualityContext(); + const getPromptContext = useCallback(async () => markdownComment, [markdownComment]); + return ( + + + + {ASK_ASSISTANT} + + + ); +}; + +ChatActionComponent.displayName = 'ChatActionComponent'; + +export const ChatAction = React.memo(ChatActionComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts new file mode 100644 index 0000000000000..245521c069bf6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.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 { i18n } from '@kbn/i18n'; + +export const ASK_ASSISTANT = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.actions.askAssistant', + { + defaultMessage: 'Ask Assistant', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx new file mode 100644 index 0000000000000..05a44639b08ec --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.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 from 'react'; +import { screen, render } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { copyToClipboard } from '@elastic/eui'; + +import { CopyToClipboardAction } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; + +jest.mock('@elastic/eui', () => { + const original = jest.requireActual('@elastic/eui'); + + return { + ...original, + copyToClipboard: jest.fn(), + }; +}); + +describe('CopyToClipboardAction', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render a copy to clipboard link', () => { + render( + + + + + + ); + + expect(screen.getByTestId('copyToClipboard')).toHaveTextContent('Copy to clipboard'); + }); + + describe('when ilm phases are not provided', () => { + it('should render disabled copy to clipboard link', () => { + render( + + + + + + ); + + expect(screen.getByTestId('copyToClipboard')).toBeDisabled(); + }); + }); + + describe('when copy to clipboard is clicked', () => { + it('should copy the markdown comment to the clipboard and add success toast', () => { + const addSuccessToast = jest.fn(); + render( + + + + + + ); + + userEvent.click(screen.getByTestId('copyToClipboard')); + + expect(copyToClipboard).toHaveBeenCalledWith('test comment'); + expect(addSuccessToast).toHaveBeenCalledWith({ title: 'Copied results to the clipboard' }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx new file mode 100644 index 0000000000000..23df7dd8ad88e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { EuiIcon, EuiLink, copyToClipboard } from '@elastic/eui'; + +import { useDataQualityContext } from '../../data_quality_context'; +import { COPIED_RESULTS_TOAST_TITLE, COPY_TO_CLIPBOARD } from '../../translations'; +import { StyledLinkText } from '../styles'; + +interface Props { + markdownComment: string; +} + +const CopyToClipboardActionComponent: React.FC = ({ markdownComment }) => { + const { addSuccessToast, ilmPhases } = useDataQualityContext(); + const onCopy = useCallback(() => { + copyToClipboard(markdownComment); + + addSuccessToast({ + title: COPIED_RESULTS_TOAST_TITLE, + }); + }, [addSuccessToast, markdownComment]); + + return ( + + + + {COPY_TO_CLIPBOARD} + + + ); +}; + +CopyToClipboardActionComponent.displayName = 'CopyToClipboardActionComponent'; + +export const CopyToClipboardAction = React.memo(CopyToClipboardActionComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx new file mode 100644 index 0000000000000..8d3d5954c7a9e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.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 { render } from '@testing-library/react'; + +import { Actions } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../mock/test_providers/test_providers'; + +describe('Actions', () => { + it('renders nothing by default', () => { + const { container } = render(); + + expect(container).toBeEmptyDOMElement(); + }); + + describe('given showAddToNewCaseAction is true', () => { + it('renders AddToNewCaseAction', () => { + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('addToNewCase')).toBeInTheDocument(); + }); + }); + + describe('given showCopyToClipboardAction is true', () => { + it('renders CopyToClipboardAction', () => { + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('copyToClipboard')).toBeInTheDocument(); + }); + }); + + describe('given showChatAction is true and indexName is present', () => { + it('renders ChatAction', () => { + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('newChatLink')).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx new file mode 100644 index 0000000000000..b1f4fa5911097 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; + +import { ChatAction } from './chat'; +import { CopyToClipboardAction } from './copy_to_clipboard'; +import { AddToNewCaseAction } from './add_to_new_case'; + +export interface Props { + markdownComment: string; + indexName?: string; + showAddToNewCaseAction?: boolean; + showCopyToClipboardAction?: boolean; + showChatAction?: boolean; +} + +const ActionsComponent: React.FC = ({ + showAddToNewCaseAction, + showCopyToClipboardAction, + showChatAction, + markdownComment, + indexName, +}) => { + if (!showAddToNewCaseAction && !showCopyToClipboardAction && !showChatAction) { + return null; + } + + return ( + + {showAddToNewCaseAction && ( + + + + )} + + {showCopyToClipboardAction && ( + + {' '} + {' '} + + )} + + {showChatAction && indexName && ( + + + + )} + + ); +}; + +ActionsComponent.displayName = 'ActionsComponent'; + +export const Actions = React.memo(ActionsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx new file mode 100644 index 0000000000000..4319efa6b1304 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.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 styled from 'styled-components'; + +export const StyledLinkText = styled.span` + display: flex; + gap: ${({ theme }) => theme.eui.euiSizeS}; +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts new file mode 100644 index 0000000000000..25ea07b9d5f27 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EcsFlat } from '@elastic/ecs'; +import { EuiComboBoxOptionOption } from '@elastic/eui'; + +import { EcsFieldMetadata, PartitionedFieldMetadata, SortConfig } from './types'; +import * as i18n from './translations'; + +export const EcsFlatTyped = EcsFlat as unknown as Record; +export type EcsFlatTyped = typeof EcsFlatTyped; + +export const ilmPhaseOptionsStatic: EuiComboBoxOptionOption[] = [ + { + label: i18n.HOT, + value: 'hot', + }, + { + label: i18n.WARM, + value: 'warm', + }, + { + disabled: true, + label: i18n.COLD, + value: 'cold', + }, + { + disabled: true, + label: i18n.FROZEN, + value: 'frozen', + }, + { + label: i18n.UNMANAGED, + value: 'unmanaged', + }, +]; + +export const EMPTY_STAT = '--'; + +export const INTERNAL_API_VERSION = '1'; + +export const defaultSort: SortConfig = { + sort: { + direction: 'desc', + field: 'docsCount', + }, +}; + +export const EMPTY_METADATA: PartitionedFieldMetadata = { + all: [], + ecsCompliant: [], + custom: [], + incompatible: [], + sameFamily: [], +}; + +export const EMPTY_PLACEHOLDER = '--'; + +export const ECS_FIELD_REFERENCE_URL = + 'https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html'; + +/** The documentation link shown in the `Data Quality` dashboard */ +export const ECS_REFERENCE_URL = 'https://www.elastic.co/guide/en/ecs/current/ecs-reference.html'; +export const MAPPING_URL = + 'https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx new file mode 100644 index 0000000000000..48863a25e2431 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { createContext, useContext } from 'react'; + +import { UseIndicesCheckReturnValue } from '../../hooks/use_indices_check/types'; + +export const IndicesCheckContext = createContext(null); + +export const useIndicesCheckContext = () => { + const context = useContext(IndicesCheckContext); + if (context == null) { + throw new Error('useIndicesCheckContext must be used inside the IndicesCheckContextProvider.'); + } + return context; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx new file mode 100644 index 0000000000000..d60c933768153 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx @@ -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 { createContext, useContext } from 'react'; + +import { UseResultsRollupReturnValue } from '../../hooks/use_results_rollup/types'; + +export const ResultsRollupContext = createContext(null); + +export const useResultsRollupContext = () => { + const context = useContext(ResultsRollupContext); + if (context == null) { + throw new Error( + 'useResultsRollupContext must be used inside the ResultsRollupContextProvider.' + ); + } + return context; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx new file mode 100644 index 0000000000000..fb8eccd4b7f8a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx @@ -0,0 +1,109 @@ +/* + * 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 { Theme } from '@elastic/charts'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import { renderHook } from '@testing-library/react-hooks'; +import React, { FC, PropsWithChildren } from 'react'; + +import { DataQualityProvider, useDataQualityContext } from '.'; + +const mockReportDataQualityIndexChecked = jest.fn(); +const mockReportDataQualityCheckAllClicked = jest.fn(); +const mockHttpFetch = jest.fn(); +const { toasts } = notificationServiceMock.createSetupContract(); +const mockTelemetryEvents = { + reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, + reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, +}; +const ContextWrapper: FC> = ({ children }) => ( + true)} + endDate={null} + formatBytes={jest.fn()} + formatNumber={jest.fn()} + isAssistantEnabled={true} + lastChecked={'2023-03-28T22:27:28.159Z'} + openCreateCaseFlyout={jest.fn()} + patterns={['auditbeat-*']} + setLastChecked={jest.fn()} + startDate={null} + theme={{ + background: { + color: '#000', + }, + }} + baseTheme={ + { + background: { + color: '#000', + }, + } as Theme + } + ilmPhases={['hot', 'warm', 'unmanaged']} + selectedIlmPhaseOptions={[ + { + label: 'Hot', + value: 'hot', + }, + { + label: 'Warm', + value: 'warm', + }, + { + label: 'Unmanaged', + value: 'unmanaged', + }, + ]} + setSelectedIlmPhaseOptions={jest.fn()} + > + {children} + +); + +describe('DataQualityContext', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it throws an error when useDataQualityContext hook is used without a DataQualityContext', () => { + const { result } = renderHook(useDataQualityContext); + + expect(result.error).toEqual( + new Error('useDataQualityContext must be used within a DataQualityProvider') + ); + }); + + test('it should return the httpFetch function', () => { + const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); + const httpFetch = result.current.httpFetch; + + const path = '/path/to/resource'; + httpFetch(path); + + expect(mockHttpFetch).toBeCalledWith(path); + }); + + test('it should return the telemetry events', () => { + const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); + const telemetryEvents = result.current.telemetryEvents; + + expect(telemetryEvents).toEqual(mockTelemetryEvents); + }); + + test('it should return the isILMAvailable param', async () => { + const { result } = renderHook(useDataQualityContext, { wrapper: ContextWrapper }); + const isILMAvailable = result.current.isILMAvailable; + + expect(isILMAvailable).toEqual(true); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx new file mode 100644 index 0000000000000..762efef424a10 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx @@ -0,0 +1,129 @@ +/* + * 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 type { PropsWithChildren } from 'react'; +import type { HttpHandler } from '@kbn/core-http-browser'; +import type { IToasts } from '@kbn/core-notifications-browser'; +import { PartialTheme, Theme } from '@elastic/charts'; + +import { EuiComboBoxOptionOption } from '@elastic/eui'; +import type { TelemetryEvents } from '../types'; + +export interface DataQualityProviderProps { + httpFetch: HttpHandler; + isILMAvailable: boolean; + telemetryEvents: TelemetryEvents; + toasts: IToasts; + addSuccessToast: (toast: { title: string }) => void; + baseTheme: Theme; + canUserCreateAndReadCases: () => boolean; + endDate?: string | null; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + isAssistantEnabled: boolean; + lastChecked: string; + openCreateCaseFlyout: ({ + comments, + headerContent, + }: { + comments: string[]; + headerContent?: React.ReactNode; + }) => void; + patterns: string[]; + setLastChecked: (lastChecked: string) => void; + startDate?: string | null; + theme?: PartialTheme; + ilmPhases: string[]; + selectedIlmPhaseOptions: EuiComboBoxOptionOption[]; + setSelectedIlmPhaseOptions: (options: EuiComboBoxOptionOption[]) => void; +} + +const DataQualityContext = React.createContext(undefined); + +export const DataQualityProvider: React.FC> = ({ + children, + httpFetch, + toasts, + isILMAvailable, + telemetryEvents, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, +}) => { + const value = useMemo( + () => ({ + httpFetch, + toasts, + isILMAvailable, + telemetryEvents, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, + }), + [ + httpFetch, + toasts, + isILMAvailable, + telemetryEvents, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, + ] + ); + + return {children}; +}; + +export const useDataQualityContext = () => { + const context = React.useContext(DataQualityContext); + + if (context == null) { + throw new Error('useDataQualityContext must be used within a DataQualityProvider'); + } + + return context; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx new file mode 100644 index 0000000000000..a20e279e6ac19 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.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. + */ + +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { IlmPhasesEmptyPrompt } from '.'; + +describe('IlmPhasesEmptyPrompt', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it renders the expected content', () => { + expect(screen.getByTestId('ilmPhasesEmptyPrompt')).toHaveTextContent( + "ILM phases that can be checked for data qualityhot: The index is actively being updated and queriedwarm: The index is no longer being updated but is still being queriedunmanaged: The index isn't managed by Index Lifecycle Management (ILM)ILM phases that cannot be checkedThe following ILM phases cannot be checked for data quality because they are slower to accesscold: The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.frozen: The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow." + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx new file mode 100644 index 0000000000000..fe5c4cf59e8a8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiEmptyPrompt, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + +import { + COLD_DESCRIPTION, + FROZEN_DESCRIPTION, + HOT_DESCRIPTION, + UNMANAGED_DESCRIPTION, + WARM_DESCRIPTION, + HOT, + WARM, + FROZEN, + COLD, + UNMANAGED, +} from '../../translations'; +import * as i18n from './translations'; + +const Ul = styled.ul` + text-align: left; +`; + +const Li = styled.ul` + margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; + text-align: left; +`; + +const IlmPhasesEmptyPromptComponent: React.FC = () => { + const title = useMemo(() =>

{i18n.TITLE}

, []); + const body = useMemo(() =>

{i18n.BODY}

, []); + const footer = useMemo( + () => ( +
+ +

{i18n.ILM_PHASES_THAT_CAN_BE_CHECKED}

+
+ + + +
    +
  • + {HOT} + {': '} + {HOT_DESCRIPTION} +
  • +
  • + {WARM} + {': '} + {WARM_DESCRIPTION} +
  • +
  • + {UNMANAGED} + {': '} + {UNMANAGED_DESCRIPTION} +
  • +
+ + + + +

{i18n.ILM_PHASES_THAT_CANNOT_BE_CHECKED}

+
+ + + {i18n.THE_FOLLOWING_ILM_PHASES} + + + + +
    +
  • + {COLD} + {': '} + {COLD_DESCRIPTION} +
  • +
  • + {FROZEN} + {': '} + {FROZEN_DESCRIPTION} +
  • +
+
+ ), + [] + ); + + return ; +}; + +export const IlmPhasesEmptyPrompt = React.memo(IlmPhasesEmptyPromptComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts new file mode 100644 index 0000000000000..1b0e3b1dd10cd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const BODY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptBody', + { + defaultMessage: + 'Indices with these Index Lifecycle Management (ILM) phases will be checked for data quality', + } +); + +export const ILM_PHASES_THAT_CAN_BE_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptIlmPhasesThatCanBeCheckedSubtitle', + { + defaultMessage: 'ILM phases that can be checked for data quality', + } +); + +export const ILM_PHASES_THAT_CANNOT_BE_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptIlmPhasesThatCannotBeCheckedSubtitle', + { + defaultMessage: 'ILM phases that cannot be checked', + } +); + +export const THE_FOLLOWING_ILM_PHASES = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptITheFollowingIlmPhasesLabel', + { + defaultMessage: + 'The following ILM phases cannot be checked for data quality because they are slower to access', + } +); + +export const TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhasesEmptyPromptTitle', + { + defaultMessage: 'Select one or more ILM phases', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx new file mode 100644 index 0000000000000..dfe943215f909 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { render, screen, waitFor } from '@testing-library/react'; +import React from 'react'; + +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../mock/test_providers/test_providers'; +import { DataQualityDetails } from '.'; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; + +describe('DataQualityDetails', () => { + describe('when ILM phases are provided', () => { + beforeEach(async () => { + jest.clearAllMocks(); + + render( + + + + + + ); + + await waitFor(() => {}); // wait for PatternComponent state updates + }); + + test('it renders the storage details', () => { + expect(screen.getByTestId('storageDetails')).toBeInTheDocument(); + }); + + test('it renders the indices details', () => { + expect(screen.getByTestId('indicesDetails')).toBeInTheDocument(); + }); + }); + + describe('when ILM phases are are empty', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders an empty prompt when ilmPhases is empty', () => { + expect(screen.getByTestId('ilmPhasesEmptyPrompt')).toBeInTheDocument(); + }); + + test('it does NOT render the storage details', () => { + expect(screen.queryByTestId('storageDetails')).not.toBeInTheDocument(); + }); + + test('it does NOT render the indices details', () => { + expect(screen.queryByTestId('indicesDetails')).not.toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx new file mode 100644 index 0000000000000..a880d2a7d4f16 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx @@ -0,0 +1,40 @@ +/* + * 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, useState } from 'react'; + +import { IlmPhasesEmptyPrompt } from './ilm_phases_empty_prompt'; +import { IndicesDetails } from './indices_details'; +import { StorageDetails } from './storage_details'; +import { SelectedIndex } from '../types'; +import { useDataQualityContext } from '../data_quality_context'; + +const DataQualityDetailsComponent: React.FC = () => { + const { isILMAvailable, ilmPhases } = useDataQualityContext(); + const [chartSelectedIndex, setChartSelectedIndex] = useState(null); + + const handleChartsIndexSelected = useCallback(async ({ indexName, pattern }: SelectedIndex) => { + setChartSelectedIndex({ indexName, pattern }); + }, []); + + if (isILMAvailable && ilmPhases.length === 0) { + return ; + } + + return ( + <> + + + + ); +}; + +DataQualityDetailsComponent.displayName = 'DataQualityDetailsComponent'; +export const DataQualityDetails = React.memo(DataQualityDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx new file mode 100644 index 0000000000000..d5aaa1eea19ae --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import numeral from '@elastic/numeral'; +import { render, screen, waitFor } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_STAT } from '../../constants'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; +import { Props, IndicesDetails } from '.'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +const patternIndexNames: Record = { + 'auditbeat-*': [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-empty-index-1', + 'auditbeat-custom-index-1', + ], + '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], + 'packetbeat-*': [ + '.ds-packetbeat-8.5.3-2023.02.04-000001', + '.ds-packetbeat-8.6.1-2023.02.04-000001', + ], +}; + +const defaultProps: Props = { + chartSelectedIndex: null, + setChartSelectedIndex: jest.fn(), +}; + +describe('IndicesDetails', () => { + beforeEach(async () => { + jest.clearAllMocks(); + + render( + + + + + + ); + + await waitFor(() => {}); + }); + + describe('rendering patterns', () => { + patterns.forEach((pattern) => { + test(`it renders the ${pattern} pattern`, () => { + expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx new file mode 100644 index 0000000000000..fd565d8fc7637 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { useResultsRollupContext } from '../../contexts/results_rollup_context'; +import { Pattern } from './pattern'; +import { SelectedIndex } from '../../types'; +import { useDataQualityContext } from '../../data_quality_context'; + +const StyledPatternWrapperFlexItem = styled(EuiFlexItem)` + margin-bottom: ${({ theme }) => theme.eui.euiSize}; + + &:last-child { + margin-bottom: 0; + } +`; + +export interface Props { + chartSelectedIndex: SelectedIndex | null; + setChartSelectedIndex: (selectedIndex: SelectedIndex | null) => void; +} + +const IndicesDetailsComponent: React.FC = ({ + chartSelectedIndex, + setChartSelectedIndex, +}) => { + const { patternRollups, patternIndexNames } = useResultsRollupContext(); + const { patterns } = useDataQualityContext(); + + return ( +
+ {patterns.map((pattern) => ( + + + + ))} +
+ ); +}; + +IndicesDetailsComponent.displayName = 'IndicesDetailsComponent'; + +export const IndicesDetails = React.memo(IndicesDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts new file mode 100644 index 0000000000000..634f2cd8f59cc --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.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 const MIN_PAGE_SIZE = 10; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx new file mode 100644 index 0000000000000..aad142baff3a4 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx @@ -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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +import { ErrorEmptyPrompt } from '.'; + +describe('ErrorEmptyPrompt', () => { + test('it renders the expected content', () => { + const title = 'This is the title of this work'; + + render( + + + + ); + + expect(screen.getByTestId('errorEmptyPrompt').textContent?.includes(title)).toBe(true); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx new file mode 100644 index 0000000000000..da2f51dc6485b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx @@ -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 { EuiCallOut, EuiCode } from '@elastic/eui'; +import React from 'react'; + +import * as i18n from '../../../../translations'; + +interface Props { + title: string; +} + +const ErrorEmptyPromptComponent: React.FC = ({ title }) => ( + +

{i18n.ERRORS_MAY_OCCUR}

+ + {i18n.THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} +
    +
  • + {i18n.MONITOR} {i18n.OR} {i18n.MANAGE} +
  • +
  • + {i18n.VIEW_INDEX_METADATA} +
  • +
  • + {i18n.READ} +
  • +
+
+); + +export const ErrorEmptyPrompt = React.memo(ErrorEmptyPromptComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx new file mode 100644 index 0000000000000..768845f023011 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx @@ -0,0 +1,206 @@ +/* + * 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 { renderHook } from '@testing-library/react-hooks'; +import React from 'react'; + +import { DataQualityProvider } from '../../../../../data_quality_context'; +import { mockIlmExplain } from '../../../../../mock/ilm_explain/mock_ilm_explain'; +import { ERROR_LOADING_ILM_EXPLAIN } from '../../../../../translations'; +import { useIlmExplain, UseIlmExplain } from '.'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import { Theme } from '@elastic/charts'; + +const mockHttpFetch = jest.fn(); +const mockReportDataQualityIndexChecked = jest.fn(); +const mockReportDataQualityCheckAllClicked = jest.fn(); +const mockTelemetryEvents = { + reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, + reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, +}; +const { toasts } = notificationServiceMock.createSetupContract(); +const ContextWrapper: React.FC<{ children: React.ReactNode; isILMAvailable: boolean }> = ({ + children, + isILMAvailable = true, +}) => ( + true)} + endDate={null} + formatBytes={jest.fn()} + formatNumber={jest.fn()} + isAssistantEnabled={true} + lastChecked={'2023-03-28T22:27:28.159Z'} + openCreateCaseFlyout={jest.fn()} + patterns={['auditbeat-*']} + setLastChecked={jest.fn()} + startDate={null} + theme={{ + background: { + color: '#000', + }, + }} + baseTheme={ + { + background: { + color: '#000', + }, + } as Theme + } + ilmPhases={['hot', 'warm', 'unmanaged']} + selectedIlmPhaseOptions={[ + { + label: 'Hot', + value: 'hot', + }, + { + label: 'Warm', + value: 'warm', + }, + { + label: 'Unmanaged', + value: 'unmanaged', + }, + ]} + setSelectedIlmPhaseOptions={jest.fn()} + > + {children} + +); + +const pattern = 'packetbeat-*'; + +describe('useIlmExplain', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('successful response from the ilm api', () => { + let ilmExplainResult: UseIlmExplain | undefined; + + beforeEach(async () => { + mockHttpFetch.mockResolvedValue(mockIlmExplain); + + const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { + wrapper: ContextWrapper, + }); + await waitForNextUpdate(); + ilmExplainResult = await result.current; + }); + + test('it returns the expected ilmExplain map', async () => { + expect(ilmExplainResult?.ilmExplain).toEqual(mockIlmExplain); + }); + + test('it returns loading: false, because the data has loaded', async () => { + expect(ilmExplainResult?.loading).toBe(false); + }); + + test('it returns a null error, because no errors occurred', async () => { + expect(ilmExplainResult?.error).toBeNull(); + }); + }); + + describe('skip ilm api when isILMAvailable is false', () => { + let ilmExplainResult: UseIlmExplain | undefined; + + beforeEach(async () => { + const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { + wrapper: ({ children }) => ( + true)} + endDate={null} + formatBytes={jest.fn()} + formatNumber={jest.fn()} + isAssistantEnabled={true} + lastChecked={'2023-03-28T22:27:28.159Z'} + openCreateCaseFlyout={jest.fn()} + patterns={['auditbeat-*']} + setLastChecked={jest.fn()} + startDate={null} + theme={{ + background: { + color: '#000', + }, + }} + baseTheme={ + { + background: { + color: '#000', + }, + } as Theme + } + ilmPhases={['hot', 'warm', 'unmanaged']} + selectedIlmPhaseOptions={[ + { + label: 'Hot', + value: 'hot', + }, + { + label: 'Warm', + value: 'warm', + }, + { + label: 'Unmanaged', + value: 'unmanaged', + }, + ]} + setSelectedIlmPhaseOptions={jest.fn()} + > + {children} + + ), + }); + await waitForNextUpdate(); + ilmExplainResult = await result.current; + }); + + test('it returns the expected ilmExplain map', async () => { + expect(ilmExplainResult?.ilmExplain).toEqual(null); + }); + + test('it returns loading: false, because the request is aborted', async () => { + expect(ilmExplainResult?.loading).toBe(false); + }); + }); + + describe('fetch rejects with an error', () => { + let ilmExplainResult: UseIlmExplain | undefined; + const errorMessage = 'simulated error'; + + beforeEach(async () => { + mockHttpFetch.mockRejectedValue(new Error(errorMessage)); + + const { result, waitForNextUpdate } = renderHook(() => useIlmExplain(pattern), { + wrapper: ContextWrapper, + }); + await waitForNextUpdate(); + ilmExplainResult = await result.current; + }); + + test('it returns a null ilmExplain, because an error occurred', async () => { + expect(ilmExplainResult?.ilmExplain).toBeNull(); + }); + + test('it returns loading: false, because data loading reached a terminal state', async () => { + expect(ilmExplainResult?.loading).toBe(false); + }); + + test('it returns the expected error', async () => { + expect(ilmExplainResult?.error).toEqual(ERROR_LOADING_ILM_EXPLAIN(errorMessage)); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx new file mode 100644 index 0000000000000..17d8b8d46dea7 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; +import { useEffect, useState } from 'react'; + +import { useDataQualityContext } from '../../../../../data_quality_context'; +import { INTERNAL_API_VERSION } from '../../../../../constants'; +import * as i18n from '../../../../../translations'; +import { useIsMounted } from '../../../../../hooks/use_is_mounted'; + +const ILM_EXPLAIN_ENDPOINT = '/internal/ecs_data_quality_dashboard/ilm_explain'; + +export interface UseIlmExplain { + ilmExplain: Record | null; + error: string | null; + loading: boolean; +} + +export const useIlmExplain = (pattern: string): UseIlmExplain => { + const { httpFetch, isILMAvailable } = useDataQualityContext(); + const { isMountedRef } = useIsMounted(); + const [ilmExplain, setIlmExplain] = useState | null>(null); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const abortController = new AbortController(); + + async function fetchData() { + try { + const encodedIndexName = encodeURIComponent(`${pattern}`); + if (!isILMAvailable) { + abortController.abort(); + } + + const response = await httpFetch>( + `${ILM_EXPLAIN_ENDPOINT}/${encodedIndexName}`, + { + method: 'GET', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + } + ); + + if (!abortController.signal.aborted) { + if (isMountedRef.current) { + setIlmExplain(response); + } + } + } catch (e) { + if (!abortController.signal.aborted) { + if (isMountedRef.current) { + setError(i18n.ERROR_LOADING_ILM_EXPLAIN(e.message)); + } + } + } finally { + if (isMountedRef.current) { + setLoading(false); + } + } + } + + fetchData(); + + return () => { + abortController.abort(); + }; + }, [httpFetch, isILMAvailable, isMountedRef, pattern, setError]); + + return { ilmExplain, error, loading }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx new file mode 100644 index 0000000000000..5982fa715adb9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx @@ -0,0 +1,215 @@ +/* + * 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 { renderHook } from '@testing-library/react-hooks'; +import React, { FC, PropsWithChildren } from 'react'; + +import { DataQualityProvider } from '../../../../../data_quality_context'; +import { mockStatsAuditbeatIndex } from '../../../../../mock/stats/mock_stats_packetbeat_index'; +import { ERROR_LOADING_STATS } from '../../../../../translations'; +import { useStats, UseStats } from '.'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import { Theme } from '@elastic/charts'; + +const mockHttpFetch = jest.fn(); +const mockReportDataQualityIndexChecked = jest.fn(); +const mockReportDataQualityCheckAllClicked = jest.fn(); +const mockTelemetryEvents = { + reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, + reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, +}; +const { toasts } = notificationServiceMock.createSetupContract(); + +const ContextWrapper: FC> = ({ children }) => ( + true)} + endDate={null} + formatBytes={jest.fn()} + formatNumber={jest.fn()} + isAssistantEnabled={true} + lastChecked={'2023-03-28T22:27:28.159Z'} + openCreateCaseFlyout={jest.fn()} + patterns={['auditbeat-*']} + setLastChecked={jest.fn()} + startDate={null} + theme={{ + background: { + color: '#000', + }, + }} + baseTheme={ + { + background: { + color: '#000', + }, + } as Theme + } + ilmPhases={['hot', 'warm', 'unmanaged']} + selectedIlmPhaseOptions={[ + { + label: 'Hot', + value: 'hot', + }, + { + label: 'Warm', + value: 'warm', + }, + { + label: 'Unmanaged', + value: 'unmanaged', + }, + ]} + setSelectedIlmPhaseOptions={jest.fn()} + > + {children} + +); + +const ContextWrapperILMNotAvailable: FC> = ({ children }) => ( + true)} + endDate={null} + formatBytes={jest.fn()} + formatNumber={jest.fn()} + isAssistantEnabled={true} + lastChecked={'2023-03-28T22:27:28.159Z'} + openCreateCaseFlyout={jest.fn()} + patterns={['auditbeat-*']} + setLastChecked={jest.fn()} + startDate={null} + theme={{ + background: { + color: '#000', + }, + }} + baseTheme={ + { + background: { + color: '#000', + }, + } as Theme + } + ilmPhases={['hot', 'warm', 'unmanaged']} + selectedIlmPhaseOptions={[ + { + label: 'Hot', + value: 'hot', + }, + { + label: 'Warm', + value: 'warm', + }, + { + label: 'Unmanaged', + value: 'unmanaged', + }, + ]} + setSelectedIlmPhaseOptions={jest.fn()} + > + {children} + +); + +const pattern = 'auditbeat-*'; +const startDate = `now-7d`; +const endDate = `now`; +const params = { + pattern, +}; + +describe('useStats', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('query with date range when ILM is not available', () => { + const queryParams = { + isILMAvailable: false, + startDate, + endDate, + }; + + beforeEach(async () => { + mockHttpFetch.mockResolvedValue(mockStatsAuditbeatIndex); + + const { waitForNextUpdate } = renderHook(() => useStats({ pattern, startDate, endDate }), { + wrapper: ContextWrapperILMNotAvailable, + }); + await waitForNextUpdate(); + }); + test(`it calls the stats api with the expected params`, async () => { + expect(mockHttpFetch.mock.calls[0][1].query).toEqual(queryParams); + }); + }); + + describe('successful response from the stats api', () => { + let statsResult: UseStats | undefined; + + beforeEach(async () => { + mockHttpFetch.mockResolvedValue(mockStatsAuditbeatIndex); + + const { result, waitForNextUpdate } = renderHook(() => useStats(params), { + wrapper: ContextWrapper, + }); + await waitForNextUpdate(); + statsResult = await result.current; + }); + + test('it returns the expected stats', async () => { + expect(statsResult?.stats).toEqual(mockStatsAuditbeatIndex); + }); + + test('it returns loading: false, because the data has loaded', async () => { + expect(statsResult?.loading).toBe(false); + }); + + test('it returns a null error, because no errors occurred', async () => { + expect(statsResult?.error).toBeNull(); + }); + + test(`it calls the stats api with the expected params`, async () => { + expect(mockHttpFetch.mock.calls[0][1].query).toEqual({ isILMAvailable: true }); + }); + }); + + describe('fetch rejects with an error', () => { + let statsResult: UseStats | undefined; + const errorMessage = 'simulated error'; + + beforeEach(async () => { + mockHttpFetch.mockRejectedValue(new Error(errorMessage)); + + const { result, waitForNextUpdate } = renderHook(() => useStats(params), { + wrapper: ContextWrapper, + }); + await waitForNextUpdate(); + statsResult = await result.current; + }); + + test('it returns null stats, because an error occurred', async () => { + expect(statsResult?.stats).toBeNull(); + }); + + test('it returns loading: false, because data loading reached a terminal state', async () => { + expect(statsResult?.loading).toBe(false); + }); + + test('it returns the expected error', async () => { + expect(statsResult?.error).toEqual(ERROR_LOADING_STATS(errorMessage)); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx new file mode 100644 index 0000000000000..2f1507ed47007 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx @@ -0,0 +1,94 @@ +/* + * 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 { useEffect, useState } from 'react'; +import { HttpFetchQuery } from '@kbn/core/public'; + +import { useDataQualityContext } from '../../../../../data_quality_context'; +import * as i18n from '../../../../../translations'; +import { INTERNAL_API_VERSION } from '../../../../../constants'; +import { MeteringStatsIndex } from '../../../../../types'; +import { useIsMounted } from '../../../../../hooks/use_is_mounted'; + +const STATS_ENDPOINT = '/internal/ecs_data_quality_dashboard/stats'; + +export interface UseStats { + stats: Record | null; + error: string | null; + loading: boolean; +} + +export const useStats = ({ + endDate, + pattern, + startDate, +}: { + endDate?: string | null; + pattern: string; + startDate?: string | null; +}): UseStats => { + const { isMountedRef } = useIsMounted(); + const { httpFetch, isILMAvailable } = useDataQualityContext(); + const [stats, setStats] = useState | null>(null); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const abortController = new AbortController(); + + async function fetchData() { + try { + const encodedIndexName = encodeURIComponent(`${pattern}`); + const query: HttpFetchQuery = { isILMAvailable }; + if (!isILMAvailable) { + if (startDate) { + query.startDate = startDate; + } + if (endDate) { + query.endDate = endDate; + } + } + + const response = await httpFetch>( + `${STATS_ENDPOINT}/${encodedIndexName}`, + { + version: INTERNAL_API_VERSION, + method: 'GET', + signal: abortController.signal, + query, + } + ); + + if (!abortController.signal.aborted) { + if (isMountedRef.current) { + setStats(response); + } + } + } catch (e) { + if (!abortController.signal.aborted) { + if (isMountedRef.current) { + setError(i18n.ERROR_LOADING_STATS(e.message)); + } + } + } finally { + if (!abortController.signal.aborted) { + if (isMountedRef.current) { + setLoading(false); + } + } + } + } + + fetchData(); + + return () => { + abortController.abort(); + }; + }, [endDate, httpFetch, isILMAvailable, isMountedRef, pattern, setError, startDate]); + + return { stats, error, loading }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx new file mode 100644 index 0000000000000..cbed456f9cdd5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx @@ -0,0 +1,105 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import React, { ComponentProps } from 'react'; + +import { EMPTY_STAT } from '../../../constants'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../mock/test_providers/test_providers'; +import { Pattern } from '.'; +import { getCheckState } from '../../../stub/get_check_state'; + +const indexName = 'auditbeat-custom-index-1'; +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +jest.mock('./hooks/use_stats', () => ({ + useStats: jest.fn(() => ({ + stats: {}, + error: null, + loading: false, + })), +})); + +jest.mock('./hooks/use_ilm_explain', () => ({ + useIlmExplain: jest.fn(() => ({ + error: null, + ilmExplain: {}, + loading: false, + })), +})); + +const ilmPhases = ['hot', 'warm', 'unmanaged']; + +const defaultProps: ComponentProps = { + pattern: '', + patternRollup: undefined, + chartSelectedIndex: null, + setChartSelectedIndex: jest.fn(), + indexNames: undefined, +}; + +describe('pattern', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it renders the remote clusters callout when the pattern includes a colon', () => { + const pattern = 'remote:*'; // <-- a colon in the pattern indicates the use of cross cluster search + + render( + + + + + + ); + + expect(screen.getByTestId('remoteClustersCallout')).toBeInTheDocument(); + }); + + test('it does NOT render the remote clusters callout when the pattern does NOT include a colon', () => { + const pattern = 'auditbeat-*'; // <-- no colon in the pattern + + render( + + + + + + ); + + expect(screen.queryByTestId('remoteClustersCallout')).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx new file mode 100644 index 0000000000000..fc3c698c7a460 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx @@ -0,0 +1,337 @@ +/* + * 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 { EuiSpacer, useGeneratedHtmlId } from '@elastic/eui'; +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; + +import { ErrorEmptyPrompt } from './error_empty_prompt'; +import { getTotalPatternIncompatible, getTotalPatternIndicesChecked } from '../../../utils/stats'; +import { getIndexNames, getPatternDocsCount, getPatternSizeInBytes } from './utils/stats'; +import { LoadingEmptyPrompt } from './loading_empty_prompt'; +import { PatternSummary } from './pattern_summary'; +import { RemoteClustersCallout } from './remote_clusters_callout'; +import { SummaryTable } from './summary_table'; +import { getSummaryTableColumns } from './summary_table/utils/columns'; +import * as i18n from './translations'; +import type { PatternRollup, SelectedIndex, SortConfig } from '../../../types'; +import { useIlmExplain } from './hooks/use_ilm_explain'; +import { useStats } from './hooks/use_stats'; +import { useDataQualityContext } from '../../../data_quality_context'; +import { PatternAccordion, PatternAccordionChildren } from './styles'; +import { IndexCheckFlyout } from './index_check_flyout'; +import { useResultsRollupContext } from '../../../contexts/results_rollup_context'; +import { useIndicesCheckContext } from '../../../contexts/indices_check_context'; +import { getSummaryTableItems } from '../../../utils/get_summary_table_items'; +import { defaultSort } from '../../../constants'; +import { MIN_PAGE_SIZE } from './constants'; +import { getIlmExplainPhaseCounts } from './utils/ilm_explain'; +import { shouldCreateIndexNames } from './utils/should_create_index_names'; +import { shouldCreatePatternRollup } from './utils/should_create_pattern_rollup'; +import { getPageIndex } from './utils/get_page_index'; + +const EMPTY_INDEX_NAMES: string[] = []; + +interface Props { + indexNames: string[] | undefined; + pattern: string; + patternRollup: PatternRollup | undefined; + chartSelectedIndex: SelectedIndex | null; + setChartSelectedIndex: (selectedIndex: SelectedIndex | null) => void; +} + +const PatternComponent: React.FC = ({ + indexNames, + pattern, + patternRollup, + chartSelectedIndex, + setChartSelectedIndex, +}) => { + const { httpFetch, isILMAvailable, ilmPhases, startDate, endDate, formatBytes, formatNumber } = + useDataQualityContext(); + const { checkIndex, checkState } = useIndicesCheckContext(); + const { updatePatternIndexNames, updatePatternRollup } = useResultsRollupContext(); + const containerRef = useRef(null); + const [sorting, setSorting] = useState(defaultSort); + const [pageIndex, setPageIndex] = useState(0); + const [pageSize, setPageSize] = useState(MIN_PAGE_SIZE); + const patternComponentAccordionId = useGeneratedHtmlId({ prefix: 'patternComponentAccordion' }); + const [expandedIndexName, setExpandedIndexName] = useState(null); + const flyoutIndexExpandActionAbortControllerRef = useRef(new AbortController()); + const tableRowIndexCheckNowActionAbortControllerRef = useRef(new AbortController()); + const flyoutIndexChartSelectedActionAbortControllerRef = useRef(new AbortController()); + + const { + error: statsError, + loading: loadingStats, + stats, + } = useStats({ pattern, startDate, endDate }); + const { error: ilmExplainError, loading: loadingIlmExplain, ilmExplain } = useIlmExplain(pattern); + + const loading = useMemo( + () => loadingStats || loadingIlmExplain, + [loadingIlmExplain, loadingStats] + ); + const error = useMemo(() => statsError ?? ilmExplainError, [ilmExplainError, statsError]); + + const ilmExplainPhaseCounts = useMemo( + () => (isILMAvailable ? getIlmExplainPhaseCounts(ilmExplain) : undefined), + [ilmExplain, isILMAvailable] + ); + + const isFlyoutVisible = expandedIndexName !== null; + + const items = useMemo( + () => + getSummaryTableItems({ + ilmExplain, + indexNames: indexNames ?? EMPTY_INDEX_NAMES, + isILMAvailable, + pattern, + patternDocsCount: patternRollup?.docsCount ?? 0, + results: patternRollup?.results, + sortByColumn: sorting.sort.field, + sortByDirection: sorting.sort.direction, + stats, + }), + [ + ilmExplain, + indexNames, + isILMAvailable, + pattern, + patternRollup?.docsCount, + patternRollup?.results, + sorting.sort.direction, + sorting.sort.field, + stats, + ] + ); + + const handleFlyoutClose = useCallback(() => { + setExpandedIndexName(null); + }, []); + + const handleFlyoutIndexExpandAction = useCallback( + (indexName) => { + checkIndex({ + abortController: flyoutIndexExpandActionAbortControllerRef.current, + indexName, + pattern, + httpFetch, + formatBytes, + formatNumber, + }); + setExpandedIndexName(indexName); + }, + [checkIndex, formatBytes, formatNumber, httpFetch, pattern] + ); + + const handleTableRowIndexCheckNowAction = useCallback( + (indexName) => { + checkIndex({ + abortController: tableRowIndexCheckNowActionAbortControllerRef.current, + indexName, + pattern, + httpFetch, + formatBytes, + formatNumber, + }); + }, + [checkIndex, formatBytes, formatNumber, httpFetch, pattern] + ); + + useEffect(() => { + const newIndexNames = getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }); + const newDocsCount = getPatternDocsCount({ indexNames: newIndexNames, stats }); + + if ( + shouldCreateIndexNames({ + indexNames, + ilmExplain, + isILMAvailable, + newIndexNames, + stats, + }) + ) { + updatePatternIndexNames({ + indexNames: newIndexNames, + pattern, + }); + } + + if ( + shouldCreatePatternRollup({ + error, + ilmExplain, + isILMAvailable, + newDocsCount, + patternRollup, + stats, + }) + ) { + updatePatternRollup({ + docsCount: newDocsCount, + error, + ilmExplain, + ilmExplainPhaseCounts, + indices: getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }).length, + pattern, + results: undefined, + sizeInBytes: isILMAvailable + ? getPatternSizeInBytes({ + indexNames: getIndexNames({ stats, ilmExplain, ilmPhases, isILMAvailable }), + stats, + }) ?? 0 + : undefined, + stats, + }); + } + }, [ + error, + ilmExplain, + ilmExplainPhaseCounts, + ilmPhases, + indexNames, + isILMAvailable, + pattern, + patternRollup, + stats, + updatePatternIndexNames, + updatePatternRollup, + ]); + + useEffect(() => { + if (chartSelectedIndex?.pattern === pattern) { + const selectedPageIndex = getPageIndex({ + indexName: chartSelectedIndex.indexName, + items, + pageSize, + }); + + if (selectedPageIndex != null) { + setPageIndex(selectedPageIndex); + } + + if (chartSelectedIndex.indexName !== expandedIndexName && !isFlyoutVisible) { + checkIndex({ + abortController: flyoutIndexChartSelectedActionAbortControllerRef.current, + indexName: chartSelectedIndex.indexName, + pattern: chartSelectedIndex.pattern, + httpFetch, + formatBytes, + formatNumber, + }); + setExpandedIndexName(chartSelectedIndex.indexName); + } + + containerRef.current?.scrollIntoView(); + setChartSelectedIndex(null); + } + }, [ + items, + pageSize, + pattern, + chartSelectedIndex, + setChartSelectedIndex, + expandedIndexName, + isFlyoutVisible, + checkIndex, + httpFetch, + formatBytes, + formatNumber, + ]); + + useEffect(() => { + const flyoutIndexExpandActionAbortController = + flyoutIndexExpandActionAbortControllerRef.current; + const tableRowIndexCheckNowActionAbortController = + tableRowIndexCheckNowActionAbortControllerRef.current; + const flyoutIndexChartSelectedActionAbortController = + flyoutIndexChartSelectedActionAbortControllerRef.current; + return () => { + flyoutIndexExpandActionAbortController.abort(); + tableRowIndexCheckNowActionAbortController.abort(); + flyoutIndexChartSelectedActionAbortController.abort(); + }; + }, []); + + return ( +
+ + } + > + + {!loading && pattern.includes(':') && ( + <> + + + + )} + + {!loading && error != null && ( + <> + + + + )} + + {loading && ( + <> + + + + )} + + {!loading && error == null && ( +
+ +
+ )} +
+
+ {isFlyoutVisible ? ( + + ) : null} +
+ ); +}; + +PatternComponent.displayName = 'PatternComponent'; + +export const Pattern = React.memo(PatternComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.test.tsx new file mode 100644 index 0000000000000..ffbeb191e5582 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.test.tsx @@ -0,0 +1,64 @@ +/* + * 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 { renderHook, act } from '@testing-library/react-hooks'; + +import { useCurrentWindowWidth } from '.'; +import { fireEvent } from '@testing-library/react'; + +describe('useCurrentWidthWidth', () => { + beforeEach(() => { + Object.defineProperty(window, 'innerWidth', { + writable: true, + configurable: true, + value: 1024, + }); + }); + it('return current window width', () => { + const { result } = renderHook(() => useCurrentWindowWidth()); + expect(result.error).toBeUndefined(); + expect(result.current).toBe(window.innerWidth); + }); + + it('return last-throttled value of window.innerWidth with interval of 250ms', async () => { + jest.useFakeTimers(); + const { result } = renderHook(() => useCurrentWindowWidth()); + + // first resize within throttle interval + fireEvent.resize(window, { target: { innerWidth: 500 } }); + act(() => { + jest.advanceTimersByTime(200); + }); + + expect(result.current).toBe(1024); + + // second resize within throttle interval + fireEvent.resize(window, { target: { innerWidth: 400 } }); + act(() => { + jest.advanceTimersByTime(49); + }); + + expect(result.current).toBe(1024); + + // third and final resize after throttle interval + fireEvent.resize(window, { target: { innerWidth: 600 } }); + act(() => { + jest.advanceTimersByTime(200); + }); + + expect(result.current).toBe(600); + + // release all timers to confirm the final value + act(() => { + jest.runAllTimers(); + }); + + expect(result.current).toBe(600); + + jest.useRealTimers(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx new file mode 100644 index 0000000000000..0ef0febcded4d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import throttle from 'lodash/throttle'; +import { useEffect, useState } from 'react'; + +export const useCurrentWindowWidth = () => { + const [currentWidth, setCurrentWidth] = useState(() => window.innerWidth); + + useEffect(() => { + const handleWindowResize = throttle( + () => { + setCurrentWidth(window.innerWidth); + }, + 250, + { leading: false } + ); + + window.addEventListener('resize', handleWindowResize); + + return () => window.removeEventListener('resize', handleWindowResize); + }, []); + + return currentWidth; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx new file mode 100644 index 0000000000000..0b6b1d62ada01 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx @@ -0,0 +1,130 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import moment from 'moment'; +import userEvent from '@testing-library/user-event'; + +import { IndexCheckFlyout } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../../mock/test_providers/test_providers'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { mockStats } from '../../../../mock/stats/mock_stats'; + +describe('IndexCheckFlyout', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('rendering', () => { + beforeEach(() => { + render( + + + + + + ); + }); + + it('should render without crashing', () => { + expect(screen.getByTestId('indexCheckFlyout')).toBeInTheDocument(); + }); + + it('should render heading section correctly with formatted latest check time', () => { + expect(screen.getByRole('heading', { level: 2 })).toHaveTextContent( + 'auditbeat-custom-index-1' + ); + expect(screen.getByTestId('latestCheckedAt')).toHaveTextContent( + moment(auditbeatWithAllResults.results!['auditbeat-custom-index-1'].checkedAt).format( + 'MMM DD, YYYY @ HH:mm:ss.SSS' + ) + ); + }); + + it('should render the correct index properties panel', () => { + expect(screen.getByTestId('indexStatsPanel')).toBeInTheDocument(); + expect(screen.getByTestId('indexCheckFields')).toBeInTheDocument(); + }); + + it('should render footer with check now button', () => { + expect(screen.getByRole('button', { name: 'Check now' })).toBeInTheDocument(); + }); + }); + + describe('when flyout close is clicked', () => { + it('should call onClose', () => { + const onClose = jest.fn(); + render( + + + + + + ); + + const closeButton = screen.getByRole('button', { name: 'Close this dialog' }); + userEvent.click(closeButton); + + expect(onClose).toHaveBeenCalled(); + }); + }); + + describe('when check now button is clicked', () => { + it('should call checkIndex', () => { + const checkIndex = jest.fn(); + render( + + + + + + ); + + const checkNowButton = screen.getByRole('button', { name: 'Check now' }); + userEvent.click(checkNowButton); + + expect(checkIndex).toHaveBeenCalledWith({ + abortController: expect.any(AbortController), + formatBytes: expect.any(Function), + formatNumber: expect.any(Function), + httpFetch: expect.any(Function), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx new file mode 100644 index 0000000000000..0ae749a216856 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlyoutHeader, + EuiSpacer, + EuiText, + EuiTitle, + useGeneratedHtmlId, +} from '@elastic/eui'; +import React, { useCallback, useEffect } from 'react'; +import moment from 'moment'; + +import { getIlmPhase } from '../../../../utils/get_ilm_phase'; +import { getDocsCount, getSizeInBytes } from '../../../../utils/stats'; +import { useIndicesCheckContext } from '../../../../contexts/indices_check_context'; + +import { EMPTY_STAT } from '../../../../constants'; +import { MeteringStatsIndex, PatternRollup } from '../../../../types'; +import { useDataQualityContext } from '../../../../data_quality_context'; +import { IndexProperties } from './index_properties'; +import { IndexResultBadge } from '../index_result_badge'; +import { useCurrentWindowWidth } from './hooks/use_current_window_width'; +import { CHECK_NOW } from './translations'; + +export interface Props { + ilmExplain: Record | null; + indexName: string; + pattern: string; + patternRollup: PatternRollup | undefined; + stats: Record | null; + onClose: () => void; +} + +export const IndexCheckFlyoutComponent: React.FC = ({ + ilmExplain, + indexName, + pattern, + patternRollup, + stats, + onClose, +}) => { + const currentWindowWidth = useCurrentWindowWidth(); + const isLargeScreen = currentWindowWidth > 1720; + const isMediumScreen = currentWindowWidth > 1200; + const { httpFetch, formatBytes, formatNumber, isILMAvailable } = useDataQualityContext(); + const { checkState, checkIndex } = useIndicesCheckContext(); + const indexCheckState = checkState[indexName]; + const isChecking = indexCheckState?.isChecking ?? false; + const partitionedFieldMetadata = indexCheckState?.partitionedFieldMetadata ?? null; + const indexResult = patternRollup?.results?.[indexName]; + const indexCheckFlyoutTitleId = useGeneratedHtmlId({ + prefix: 'indexCheckFlyoutTitle', + }); + const abortControllerRef = React.useRef(new AbortController()); + + const handleCheckNow = useCallback(() => { + checkIndex({ + abortController: abortControllerRef.current, + indexName, + pattern, + httpFetch, + formatBytes, + formatNumber, + }); + }, [checkIndex, formatBytes, formatNumber, httpFetch, indexName, pattern]); + + useEffect(() => { + const abortController = abortControllerRef.current; + return () => { + abortController.abort(); + }; + }, []); + + return ( +
+ + + + + {partitionedFieldMetadata?.incompatible != null && ( + + )} +

{indexName}

+
+
+ {indexResult != null && indexResult.checkedAt != null && ( + <> + + + {moment(indexResult.checkedAt).isValid() + ? moment(indexResult.checkedAt).format('MMM DD, YYYY @ HH:mm:ss.SSS') + : EMPTY_STAT} + + + )} +
+ + + + + + + + {CHECK_NOW} + + + + +
+
+ ); +}; + +IndexCheckFlyoutComponent.displayName = 'IndexCheckFlyoutComponent'; + +export const IndexCheckFlyout = React.memo(IndexCheckFlyoutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx similarity index 81% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx index 1c37ec799c53c..cd16e9870906a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx @@ -9,16 +9,16 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { EmptyPromptBody } from './empty_prompt_body'; -import { TestProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; describe('EmptyPromptBody', () => { const content = 'foo bar baz @baz'; test('it renders the expected content', () => { render( - + - + ); expect(screen.getByTestId('emptyPromptBody')).toHaveTextContent(content); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx similarity index 81% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx index 6bb3b72ed3ece..0b146f7b7f123 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx @@ -9,16 +9,16 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { EmptyPromptTitle } from './empty_prompt_title'; -import { TestProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; describe('EmptyPromptTitle', () => { const title = 'What is a great title?'; test('it renders the expected content', () => { render( - + - + ); expect(screen.getByTestId('emptyPromptTitle')).toHaveTextContent(title); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx new file mode 100644 index 0000000000000..2d361ec0ed34f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx @@ -0,0 +1,216 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { render, screen, waitFor } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_STAT } from '../../../../../constants'; +import { auditbeatWithAllResults } from '../../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../../../mock/test_providers/test_providers'; +import { LOADING_MAPPINGS, LOADING_UNALLOWED_VALUES } from './translations'; +import { IndexProperties, Props } from '.'; +import { getCheckState } from '../../../../../stub/get_check_state'; + +const indexName = 'auditbeat-custom-index-1'; +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const pattern = 'auditbeat-*'; +const patternRollup = auditbeatWithAllResults; + +const defaultProps: Props = { + docsCount: auditbeatWithAllResults.docsCount ?? 0, + ilmPhase: 'hot', + indexName: 'auditbeat-custom-index-1', + pattern, + patternRollup, +}; + +describe('IndexProperties', () => { + test('it renders the tab content', async () => { + render( + + + + + + ); + + await waitFor(() => { + expect(screen.getByTestId('incompatibleTab')).toBeInTheDocument(); + }); + }); + + describe('when an error occurs loading mappings', () => { + const abortController = new AbortController(); + abortController.abort(); + + const error = 'simulated fetch mappings error'; + + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('it displays the expected empty prompt content', async () => { + render( + + + + + + ); + + await waitFor(() => { + expect( + screen + .getByTestId('errorEmptyPrompt') + .textContent?.includes('Unable to load index mappings') + ).toBe(true); + }); + }); + }); + + describe('when an error occurs loading unallowed values', () => { + const abortController = new AbortController(); + abortController.abort(); + + const error = 'simulated fetch unallowed values error'; + + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('it displays the expected empty prompt content', async () => { + render( + + + + + + ); + + await waitFor(() => { + expect( + screen + .getByTestId('errorEmptyPrompt') + .textContent?.includes('Unable to load unallowed values') + ).toBe(true); + }); + }); + }); + + describe('when mappings are loading', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('it displays the expected loading prompt content', async () => { + render( + + + + + + ); + + await waitFor(() => { + expect( + screen.getByTestId('loadingEmptyPrompt').textContent?.includes(LOADING_MAPPINGS) + ).toBe(true); + }); + }); + }); + + describe('when unallowed values are loading', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('it displays the expected loading prompt content', async () => { + render( + + + + + + ); + + await waitFor(() => { + expect( + screen.getByTestId('loadingEmptyPrompt').textContent?.includes(LOADING_UNALLOWED_VALUES) + ).toBe(true); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx new file mode 100644 index 0000000000000..03d293a02e69a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx @@ -0,0 +1,87 @@ +/* + * 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 { EuiSpacer } from '@elastic/eui'; +import { ErrorEmptyPrompt } from '../../error_empty_prompt'; +import { LoadingEmptyPrompt } from '../../loading_empty_prompt'; +import * as i18n from './translations'; +import type { IlmPhase, PatternRollup } from '../../../../../types'; +import { useIndicesCheckContext } from '../../../../../contexts/indices_check_context'; +import { IndexCheckFields } from './index_check_fields'; +import { IndexStatsPanel } from './index_stats_panel'; +import { useDataQualityContext } from '../../../../../data_quality_context'; +import { getIndexPropertiesContainerId } from './utils/get_index_properties_container_id'; + +export interface Props { + docsCount: number; + ilmPhase: IlmPhase | undefined; + indexName: string; + pattern: string; + patternRollup: PatternRollup | undefined; + sizeInBytes?: number; +} + +const IndexPropertiesComponent: React.FC = ({ + docsCount, + ilmPhase, + indexName, + pattern, + patternRollup, + sizeInBytes, +}) => { + const { checkState } = useIndicesCheckContext(); + const { formatBytes, formatNumber } = useDataQualityContext(); + const indexCheckState = checkState[indexName]; + const isChecking = indexCheckState?.isChecking ?? false; + const isLoadingMappings = indexCheckState?.isLoadingMappings ?? false; + const isLoadingUnallowedValues = indexCheckState?.isLoadingUnallowedValues ?? false; + const genericCheckError = indexCheckState?.genericError ?? null; + const mappingsError = indexCheckState?.mappingsError ?? null; + const unallowedValuesError = indexCheckState?.unallowedValuesError ?? null; + const isCheckComplete = indexCheckState?.isCheckComplete ?? false; + + if (mappingsError != null) { + return ; + } else if (unallowedValuesError != null) { + return ; + } else if (genericCheckError != null) { + return ; + } + + if (isLoadingMappings) { + return ; + } else if (isLoadingUnallowedValues) { + return ; + } else if (isChecking) { + return ; + } + + return isCheckComplete ? ( +
+ {ilmPhase && ( + + )} + + +
+ ) : null; +}; + +IndexPropertiesComponent.displayName = 'IndexPropertiesComponent'; + +export const IndexProperties = React.memo(IndexPropertiesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/constants.ts new file mode 100644 index 0000000000000..889f014a66f1b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/constants.ts @@ -0,0 +1,12 @@ +/* + * 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 ALL_TAB_ID = 'allTab'; +export const ECS_COMPLIANT_TAB_ID = 'ecsCompliantTab'; +export const CUSTOM_TAB_ID = 'customTab'; +export const INCOMPATIBLE_TAB_ID = 'incompatibleTab'; +export const SAME_FAMILY_TAB_ID = 'sameFamilyTab'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.tsx new file mode 100644 index 0000000000000..024a53087efae --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.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 { screen, render } from '@testing-library/react'; + +import { IndexCheckFields } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../../../../mock/test_providers/test_providers'; +import { auditbeatWithAllResults } from '../../../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import userEvent from '@testing-library/user-event'; + +describe('IndexCheckFields', () => { + beforeEach(() => { + render( + + + + + + ); + }); + it('should render the index check fields', () => { + expect(screen.getByTestId('indexCheckFields')).toBeInTheDocument(); + }); + + it('should render incompatible tab content by default', () => { + expect(screen.getByTestId('incompatibleTab')).toBeInTheDocument(); + expect(screen.getByTestId('incompatibleTabContent')).toBeInTheDocument(); + }); + + describe.each([ + ['sameFamilyTab', 'sameFamilyTabContent'], + ['customTab', 'customTabContent'], + ['ecsCompliantTab', 'ecsCompliantTabContent'], + ['allTab', 'allTabContent'], + ])('when clicking on %s tab', (tab, tabContent) => { + it(`should render ${tabContent} content`, () => { + userEvent.click(screen.getByTestId(tab)); + + expect(screen.getByTestId(tabContent)).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx new file mode 100644 index 0000000000000..7e69a906c42ad --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx @@ -0,0 +1,121 @@ +/* + * 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 } from 'react'; +import { EuiButtonGroup, EuiFlexGroup, EuiSpacer } from '@elastic/eui'; +import styled from 'styled-components'; + +import { EMPTY_METADATA } from '../../../../../../constants'; +import { useDataQualityContext } from '../../../../../../data_quality_context'; +import { useIndicesCheckContext } from '../../../../../../contexts/indices_check_context'; +import { INCOMPATIBLE_TAB_ID } from './constants'; +import { IlmPhase, PatternRollup } from '../../../../../../types'; +import { getTabs } from './tabs/helpers'; + +const StyledTabFlexGroup = styled(EuiFlexGroup)` + width: 100%; +`; + +const StyledTabFlexItem = styled.div` + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +`; + +const StyledButtonGroup = styled(EuiButtonGroup)` + button[data-test-subj='incompatibleTab'] { + flex-grow: 1.2; + } + button[data-test-subj='ecsCompliantTab'] { + flex-grow: 1.4; + } +`; + +export interface Props { + docsCount: number; + ilmPhase: IlmPhase | undefined; + indexName: string; + patternRollup: PatternRollup | undefined; +} + +const IndexCheckFieldsComponent: React.FC = ({ + indexName, + ilmPhase, + patternRollup, + docsCount, +}) => { + const { formatBytes, formatNumber } = useDataQualityContext(); + const { checkState } = useIndicesCheckContext(); + const partitionedFieldMetadata = checkState[indexName]?.partitionedFieldMetadata ?? null; + + const [selectedTabId, setSelectedTabId] = useState(INCOMPATIBLE_TAB_ID); + + const tabs = useMemo( + () => + getTabs({ + formatBytes, + formatNumber, + docsCount, + ilmPhase, + indexName, + partitionedFieldMetadata: partitionedFieldMetadata ?? EMPTY_METADATA, + patternDocsCount: patternRollup?.docsCount ?? 0, + stats: patternRollup?.stats ?? null, + }), + [ + formatBytes, + formatNumber, + docsCount, + ilmPhase, + indexName, + partitionedFieldMetadata, + patternRollup?.docsCount, + patternRollup?.stats, + ] + ); + + const tabSelections = tabs.map((tab) => ({ + id: tab.id, + label: ( + + {tab.name} + {tab.append} + + ), + textProps: false as false, + })); + + const handleSelectedTabId = (optionId: string) => { + setSelectedTabId(optionId); + }; + + return ( +
+ + + {tabs.find((tab) => tab.id === selectedTabId)?.content} +
+ ); +}; + +IndexCheckFieldsComponent.displayName = 'IndexFieldsComponent'; + +export const IndexCheckFields = React.memo(IndexCheckFieldsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx new file mode 100644 index 0000000000000..085a865917b42 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx @@ -0,0 +1,57 @@ +/* + * 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 { EcsVersion } from '@elastic/ecs'; +import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; + +import { CompareFieldsTable } from '../compare_fields_table'; +import { getCommonTableColumns } from '../compare_fields_table/get_common_table_columns'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; +import * as i18n from '../../../translations'; +import type { PartitionedFieldMetadata } from '../../../../../../../../types'; + +interface Props { + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; +} + +const AllTabComponent: React.FC = ({ indexName, partitionedFieldMetadata }) => { + const body = useMemo(() => , []); + const title = useMemo(() => , []); + + return ( +
+ {partitionedFieldMetadata.all.length > 0 ? ( + <> + +

{i18n.ALL_CALLOUT(EcsVersion)}

+
+ + + + ) : ( + + )} +
+ ); +}; + +AllTabComponent.displayName = 'AllTabComponent'; + +export const AllTab = React.memo(AllTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.tsx new file mode 100644 index 0000000000000..b83f1fdc7ca60 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.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 { EcsVersion } from '@elastic/ecs'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../../translations'; +import { + hostNameKeyword, + someField, +} from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { CustomCallout } from '.'; + +describe('CustomCallout', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it includes the ECS version in the main content', () => { + expect(screen.getByTestId('fieldsNotDefinedByEcs')).toHaveTextContent( + `These fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.` + ); + }); + + test('it notes ECS is a permissive schema', () => { + expect(screen.getByTestId('ecsIsPermissive')).toHaveTextContent(ECS_IS_A_PERMISSIVE_SCHEMA); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx new file mode 100644 index 0000000000000..1d631fa15a371 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EcsVersion } from '@elastic/ecs'; + +import { EuiCallOut, EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import type { CustomFieldMetadata } from '../../../../../../../../../types'; + +import * as i18n from '../../../../translations'; + +interface Props { + customFieldMetadata: CustomFieldMetadata[]; +} + +const CustomCalloutComponent: React.FC = ({ customFieldMetadata }) => { + return ( + +
+ {i18n.CUSTOM_CALLOUT({ fieldCount: customFieldMetadata.length, version: EcsVersion })} +
+ +
{i18n.ECS_IS_A_PERMISSIVE_SCHEMA}
+
+ ); +}; + +CustomCalloutComponent.displayName = 'CustomCalloutComponent'; + +export const CustomCallout = React.memo(CustomCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx new file mode 100644 index 0000000000000..ffb315c266669 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx @@ -0,0 +1,52 @@ +/* + * 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 { EcsVersion } from '@elastic/ecs'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { + DETECTION_ENGINE_RULES_MAY_NOT_MATCH, + MAPPINGS_THAT_CONFLICT_WITH_ECS, + PAGES_MAY_NOT_DISPLAY_EVENTS, +} from '../../../../translations'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { IncompatibleCallout } from '.'; + +describe('IncompatibleCallout', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it includes the ECS version in the main content', () => { + expect(screen.getByTestId('fieldsAreIncompatible')).toHaveTextContent( + `Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.` + ); + }); + + test('it warns rules may not match', () => { + expect(screen.getByTestId('rulesMayNotMatch')).toHaveTextContent( + DETECTION_ENGINE_RULES_MAY_NOT_MATCH + ); + }); + + test('it warns pages may not display events', () => { + expect(screen.getByTestId('pagesMayNotDisplayEvents')).toHaveTextContent( + PAGES_MAY_NOT_DISPLAY_EVENTS + ); + }); + + test("it warns mappings that don't comply with ECS are unsupported", () => { + expect(screen.getByTestId('mappingsThatDontComply')).toHaveTextContent( + MAPPINGS_THAT_CONFLICT_WITH_ECS + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx new file mode 100644 index 0000000000000..41a69eb69424a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx @@ -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 { EcsVersion } from '@elastic/ecs'; + +import { EuiCallOut, EuiSpacer } from '@elastic/eui'; +import React from 'react'; + +import * as i18n from '../../../../translations'; +import { CalloutItem } from '../../styles'; + +const IncompatibleCalloutComponent: React.FC = () => { + return ( + +
{i18n.INCOMPATIBLE_CALLOUT(EcsVersion)}
+ + + {i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} + + + {i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} + + + {i18n.MAPPINGS_THAT_CONFLICT_WITH_ECS} + +
+ ); +}; + +IncompatibleCalloutComponent.displayName = 'IncompatibleCalloutComponent'; + +export const IncompatibleCallout = React.memo(IncompatibleCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.tsx new file mode 100644 index 0000000000000..3e9b1f705d1eb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.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 { EuiCallOut, EuiSpacer } from '@elastic/eui'; +import React from 'react'; + +import * as i18n from '../../../../translations'; +import { CalloutItem } from '../../styles'; + +interface Props { + children?: React.ReactNode; +} + +const MissingTimestampCalloutComponent: React.FC = ({ children }) => ( + +
{i18n.MISSING_TIMESTAMP_CALLOUT}
+ + {i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} + {i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} + + {children} +
+); + +MissingTimestampCalloutComponent.displayName = 'MissingTimestampCalloutComponent'; + +export const MissingTimestampCallout = React.memo(MissingTimestampCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.tsx new file mode 100644 index 0000000000000..39289f1a9294f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.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 { EcsVersion } from '@elastic/ecs'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { FIELDS_WITH_MAPPINGS_SAME_FAMILY } from '../../../../translations'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { SameFamilyCallout } from '.'; +import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; + +describe('SameFamilyCallout', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it includes the ECS version in the main content', () => { + expect(screen.getByTestId('fieldsDefinedByEcs')).toHaveTextContent( + `This field is defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but its mapping type doesn't exactly match.` + ); + }); + + test('it notes fields with mappings have the same behavior, but may have different space usage or performance characteristics', () => { + expect(screen.getByTestId('fieldsWithMappingsSameFamily')).toHaveTextContent( + FIELDS_WITH_MAPPINGS_SAME_FAMILY + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx new file mode 100644 index 0000000000000..ba7bab71f228d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx @@ -0,0 +1,40 @@ +/* + * 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 { EcsVersion } from '@elastic/ecs'; +import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui'; +import React from 'react'; + +import * as i18n from '../../../../translations'; +import type { EcsBasedFieldMetadata } from '../../../../../../../../../types'; + +interface Props { + ecsBasedFieldMetadata: EcsBasedFieldMetadata[]; +} + +const SameFamilyCalloutComponent: React.FC = ({ ecsBasedFieldMetadata }) => { + return ( + +
+ {i18n.SAME_FAMILY_CALLOUT({ + fieldCount: ecsBasedFieldMetadata.length, + version: EcsVersion, + })} +
+ +
+ + {i18n.FIELDS_WITH_MAPPINGS_SAME_FAMILY} + +
+
+ ); +}; + +SameFamilyCalloutComponent.displayName = 'SameFamilyCalloutComponent'; + +export const SameFamilyCallout = React.memo(SameFamilyCalloutComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.tsx new file mode 100644 index 0000000000000..da16307b9a23b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { mockAllowedValues } from '../../../../../../../../../mock/allowed_values/mock_allowed_values'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { EcsAllowedValues } from '.'; + +describe('EcsAllowedValues', () => { + describe('when `allowedValues` exists', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it renders the allowed values', () => { + expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( + mockAllowedValues.map(({ name }) => `${name}`).join('') + ); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); + }); + }); + + describe('when `allowedValues` is undefined', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it does NOT render the allowed values', () => { + expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); + }); + + test('it renders the placeholder', () => { + expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx new file mode 100644 index 0000000000000..07197641c9788 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; + +import { EMPTY_PLACEHOLDER } from '../helpers'; +import { CodeSuccess } from '../../../../../../../../../styles'; +import type { AllowedValue } from '../../../../../../../../../types'; + +interface Props { + allowedValues: AllowedValue[] | undefined; +} + +const EcsAllowedValuesComponent: React.FC = ({ allowedValues }) => + allowedValues == null ? ( + {EMPTY_PLACEHOLDER} + ) : ( + + {allowedValues.map((x, i) => ( + + {x.name} + + ))} + + ); + +EcsAllowedValuesComponent.displayName = 'EcsAllowedValuesComponent'; + +export const EcsAllowedValues = React.memo(EcsAllowedValuesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx new file mode 100644 index 0000000000000..5bcd6bb90e0b7 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx @@ -0,0 +1,274 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { omit } from 'lodash/fp'; +import React from 'react'; + +import { + eventCategory, + someField, + eventCategoryWithUnallowedValues, +} from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { + DOCUMENT_VALUES_ACTUAL, + ECS_DESCRIPTION, + ECS_MAPPING_TYPE_EXPECTED, + ECS_VALUES_EXPECTED, + FIELD, + INDEX_MAPPING_TYPE_ACTUAL, +} from '../translations'; +import { EnrichedFieldMetadata } from '../../../../../../../../../types'; +import { EMPTY_PLACEHOLDER, getCommonTableColumns } from '.'; +import { SAME_FAMILY_BADGE_LABEL } from '../../../translate'; + +describe('getCommonTableColumns', () => { + test('it returns the expected column configuration', () => { + expect(getCommonTableColumns().map((x) => omit('render', x))).toEqual([ + { field: 'indexFieldName', name: FIELD, sortable: true, truncateText: false, width: '15%' }, + { + field: 'type', + name: ECS_MAPPING_TYPE_EXPECTED, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'indexFieldType', + name: INDEX_MAPPING_TYPE_ACTUAL, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'allowed_values', + name: ECS_VALUES_EXPECTED, + sortable: false, + truncateText: false, + width: '15%', + }, + { + field: 'indexInvalidValues', + name: DOCUMENT_VALUES_ACTUAL, + sortable: false, + truncateText: false, + width: '15%', + }, + { + field: 'description', + name: ECS_DESCRIPTION, + sortable: false, + truncateText: false, + width: '25%', + }, + ]); + }); + + describe('type column render()', () => { + test('it renders the expected type', () => { + const columns = getCommonTableColumns(); + const typeColumnRender = columns[1].render; + const expected = 'keyword'; + + render( + + {typeColumnRender != null && typeColumnRender(eventCategory.type, eventCategory)} + + ); + + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(expected); + }); + + test('it renders an empty placeholder when type is undefined', () => { + const columns = getCommonTableColumns(); + const typeColumnRender = columns[1].render; + + render( + + {typeColumnRender != null && typeColumnRender(undefined, eventCategory)} + + ); + + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(EMPTY_PLACEHOLDER); + }); + }); + + describe('indexFieldType column render()', () => { + describe("when the index field type does NOT match the ECS type, but it's in the SAME family", () => { + const indexFieldType = 'wildcard'; + + beforeEach(() => { + const columns = getCommonTableColumns(); + const indexFieldTypeColumnRender = columns[2].render; + + const withTypeMismatchSameFamily: EnrichedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType, // this index has a mapping of `wildcard` instead of `keyword` + isInSameFamily: true, // `wildcard` and `keyword` are in the same family + }; + + render( + + {indexFieldTypeColumnRender != null && + indexFieldTypeColumnRender( + withTypeMismatchSameFamily.indexFieldType, + withTypeMismatchSameFamily + )} + + ); + }); + + test('it renders the index field with a "success" style', () => { + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(indexFieldType); + }); + + test('it renders the same family badge', () => { + expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY_BADGE_LABEL); + }); + }); + + describe("when the index field type does NOT match the ECS type, but it's in a DIFFERENT family", () => { + const indexFieldType = 'text'; + + test('it renders the expected type with danger styling', () => { + const columns = getCommonTableColumns(); + const indexFieldTypeColumnRender = columns[2].render; + + const withTypeMismatchDifferentFamily: EnrichedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType, // this index has a mapping of `text` instead of `keyword` + isInSameFamily: false, // `text` and `wildcard` are not in the same family + }; + + render( + + {indexFieldTypeColumnRender != null && + indexFieldTypeColumnRender( + withTypeMismatchDifferentFamily.indexFieldType, + withTypeMismatchDifferentFamily + )} + + ); + + expect(screen.getByTestId('codeDanger')).toHaveTextContent(indexFieldType); + }); + }); + + describe('when the index field matches the ECS type', () => { + test('it renders the expected type with success styling', () => { + const columns = getCommonTableColumns(); + const indexFieldTypeColumnRender = columns[2].render; + + render( + + {indexFieldTypeColumnRender != null && + indexFieldTypeColumnRender(eventCategory.indexFieldType, eventCategory)} + + ); + + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(eventCategory.indexFieldType); + }); + }); + }); + + describe('allowed_values column render()', () => { + test('it renders the expected allowed values when provided', () => { + const columns = getCommonTableColumns(); + const allowedValuesolumnRender = columns[3].render; + + const expectedAllowedValuesNames = + eventCategory.allowed_values != null + ? eventCategory.allowed_values.map((x) => x.name).join('') + : 'unexpected'; + + render( + + {allowedValuesolumnRender != null && + allowedValuesolumnRender(eventCategory.allowed_values, eventCategory)} + + ); + + expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent(expectedAllowedValuesNames); + }); + + test('it renders a placeholder when allowed values is undefined', () => { + const columns = getCommonTableColumns(); + const allowedValuesolumnRender = columns[3].render; + + const withUndefinedAllowedValues: EnrichedFieldMetadata = { + ...eventCategory, + allowed_values: undefined, + }; + + render( + + {allowedValuesolumnRender != null && + allowedValuesolumnRender(undefined, withUndefinedAllowedValues)} + + ); + + expect(screen.getByTestId('ecsAllowedValuesEmpty')).toHaveTextContent(EMPTY_PLACEHOLDER); + }); + }); + + describe('indexInvalidValues column render()', () => { + test('it renders the expected index invalid values', () => { + const columns = getCommonTableColumns(); + const indexInvalidValuesRender = columns[4].render; + + render( + + {indexInvalidValuesRender != null && + indexInvalidValuesRender( + eventCategoryWithUnallowedValues.indexInvalidValues, + eventCategoryWithUnallowedValues + )} + + ); + + expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( + 'an_invalid_category (2)theory (1)' + ); + }); + }); + + describe('description column render()', () => { + test('it renders the expected description', () => { + const columns = getCommonTableColumns(); + const descriptionolumnRender = columns[5].render; + const expectedDescription = 'this is a test'; + + const withDescription: EnrichedFieldMetadata = { + ...eventCategory, + description: expectedDescription, + }; + + render( + + {descriptionolumnRender != null && + descriptionolumnRender(withDescription.description, withDescription)} + + ); + + expect(screen.getByTestId('description')).toHaveTextContent(expectedDescription); + }); + + test('it renders a placeholder when description is undefined', () => { + const columns = getCommonTableColumns(); + const descriptionolumnRender = columns[5].render; + + render( + + {descriptionolumnRender != null && descriptionolumnRender(undefined, someField)} + + ); + + expect(screen.getByTestId('emptyDescription')).toHaveTextContent(EMPTY_PLACEHOLDER); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx new file mode 100644 index 0000000000000..757294cc89c6d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx @@ -0,0 +1,107 @@ +/* + * 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 { EuiTableFieldDataColumnType } from '@elastic/eui'; +import { EuiCode } from '@elastic/eui'; +import React from 'react'; + +import { SameFamily } from '../same_family'; +import { EcsAllowedValues } from '../ecs_allowed_values'; +import { IndexInvalidValues } from '../index_invalid_values'; +import { CodeDanger, CodeSuccess } from '../../../../../../../../../styles'; +import * as i18n from '../translations'; +import type { + AllowedValue, + EnrichedFieldMetadata, + UnallowedValueCount, +} from '../../../../../../../../../types'; +import { getIsInSameFamily } from '../../../../utils/get_is_in_same_family'; + +export const EMPTY_PLACEHOLDER = '--'; + +export const getCommonTableColumns = (): Array< + EuiTableFieldDataColumnType +> => [ + { + field: 'indexFieldName', + name: i18n.FIELD, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'type', + name: i18n.ECS_MAPPING_TYPE_EXPECTED, + render: (type: string | undefined) => ( + + {type != null ? type : EMPTY_PLACEHOLDER} + + ), + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'indexFieldType', + name: i18n.INDEX_MAPPING_TYPE_ACTUAL, + render: (_, x) => { + // if custom field or ecs based field with mapping match + if (!x.hasEcsMetadata || x.indexFieldType === x.type) { + return {x.indexFieldType}; + } + + // mapping mismatch due to same family + if (getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType })) { + return ( +
+ {x.indexFieldType} + +
+ ); + } + + // mapping mismatch + return {x.indexFieldType}; + }, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'allowed_values', + name: i18n.ECS_VALUES_EXPECTED, + render: (allowedValues: AllowedValue[] | undefined) => ( + + ), + sortable: false, + truncateText: false, + width: '15%', + }, + { + field: 'indexInvalidValues', + name: i18n.DOCUMENT_VALUES_ACTUAL, + render: (indexInvalidValues: UnallowedValueCount[]) => ( + + ), + sortable: false, + truncateText: false, + width: '15%', + }, + { + field: 'description', + name: i18n.ECS_DESCRIPTION, + render: (description: string | undefined) => + description != null ? ( + {description} + ) : ( + {EMPTY_PLACEHOLDER} + ), + sortable: false, + truncateText: false, + width: '25%', + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx new file mode 100644 index 0000000000000..a1d37950da554 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx @@ -0,0 +1,131 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { omit } from 'lodash/fp'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { eventCategory } from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { EcsBasedFieldMetadata } from '../../../../../../../../../types'; +import { getIncompatibleMappingsTableColumns } from '.'; +import { SAME_FAMILY_BADGE_LABEL } from '../../../translate'; + +describe('getIncompatibleMappingsTableColumns', () => { + test('it returns the expected column configuration', () => { + const columns = getIncompatibleMappingsTableColumns().map((x) => omit('render', x)); + + expect(columns).toEqual([ + { + field: 'indexFieldName', + name: 'Field', + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'type', + name: 'ECS mapping type (expected)', + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'indexFieldType', + name: 'Index mapping type (actual)', + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: 'ECS description', + sortable: false, + truncateText: false, + width: '35%', + }, + ]); + }); + + describe('type column render()', () => { + test('it renders the expected type', () => { + const columns = getIncompatibleMappingsTableColumns(); + const typeColumnRender = columns[1].render; + const expected = 'keyword'; + + render( + + {typeColumnRender != null && typeColumnRender(eventCategory.type, eventCategory)} + + ); + + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(expected); + }); + }); + + describe('indexFieldType column render()', () => { + describe("when the index field type does NOT match the ECS type, but it's in the SAME family", () => { + const indexFieldType = 'wildcard'; + + beforeEach(() => { + const columns = getIncompatibleMappingsTableColumns(); + const indexFieldTypeColumnRender = columns[2].render; + + const withTypeMismatchSameFamily: EcsBasedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType, // this index has a mapping of `wildcard` instead of `keyword` + isInSameFamily: true, // `wildcard` and `keyword` are in the same family + }; + + render( + + {indexFieldTypeColumnRender != null && + indexFieldTypeColumnRender( + withTypeMismatchSameFamily.indexFieldType, + withTypeMismatchSameFamily + )} + + ); + }); + + test('it renders the expected type with a "success" style', () => { + expect(screen.getByTestId('codeSuccess')).toHaveTextContent(indexFieldType); + }); + + test('it renders the same family badge', () => { + expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY_BADGE_LABEL); + }); + }); + + describe("when the index field type does NOT match the ECS type, but it's in a DIFFERENT family", () => { + const indexFieldType = 'text'; + + test('it renders the expected type with danger styling', () => { + const columns = getIncompatibleMappingsTableColumns(); + const indexFieldTypeColumnRender = columns[2].render; + + const withTypeMismatchDifferentFamily: EcsBasedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType, // this index has a mapping of `text` instead of `keyword` + isInSameFamily: false, // `text` and `wildcard` are not in the same family + }; + + render( + + {indexFieldTypeColumnRender != null && + indexFieldTypeColumnRender( + withTypeMismatchDifferentFamily.indexFieldType, + withTypeMismatchDifferentFamily + )} + + ); + + expect(screen.getByTestId('codeDanger')).toHaveTextContent(indexFieldType); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx new file mode 100644 index 0000000000000..ba2e3e2035f68 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiTableFieldDataColumnType } from '@elastic/eui'; +import React from 'react'; + +import { SameFamily } from '../same_family'; +import { CodeDanger, CodeSuccess } from '../../../../../../../../../styles'; +import * as i18n from '../translations'; +import type { EcsBasedFieldMetadata } from '../../../../../../../../../types'; + +export const EMPTY_PLACEHOLDER = '--'; + +export const getIncompatibleMappingsTableColumns = (): Array< + EuiTableFieldDataColumnType +> => [ + { + field: 'indexFieldName', + name: i18n.FIELD, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'type', + name: i18n.ECS_MAPPING_TYPE_EXPECTED, + render: (type: string) => {type}, + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'indexFieldType', + name: i18n.INDEX_MAPPING_TYPE_ACTUAL, + render: (indexFieldType: string, x) => + x.isInSameFamily ? ( +
+ {indexFieldType} + +
+ ) : ( + {indexFieldType} + ), + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: i18n.ECS_DESCRIPTION, + sortable: false, + truncateText: false, + width: '35%', + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx new file mode 100644 index 0000000000000..8bf2861402c73 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx @@ -0,0 +1,359 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { omit } from 'lodash/fp'; +import React from 'react'; + +import { + getCustomTableColumns, + getEcsCompliantTableColumns, + getIncompatibleValuesTableColumns, +} from './helpers'; +import { + eventCategory, + eventCategoryWithUnallowedValues, + someField, +} from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../mock/test_providers/test_providers'; + +describe('helpers', () => { + describe('getCustomTableColumns', () => { + test('it returns the expected columns', () => { + expect(getCustomTableColumns().map((x) => omit('render', x))).toEqual([ + { + field: 'indexFieldName', + name: 'Field', + sortable: true, + truncateText: false, + width: '50%', + }, + { + field: 'indexFieldType', + name: 'Index mapping type', + sortable: true, + truncateText: false, + width: '50%', + }, + ]); + }); + + describe('indexFieldType render()', () => { + test('it renders the indexFieldType', () => { + const columns = getCustomTableColumns(); + const indexFieldTypeRender = columns[1].render; + + render( + + <> + {indexFieldTypeRender != null && + indexFieldTypeRender(someField.indexFieldType, someField)} + + + ); + + expect(screen.getByTestId('indexFieldType')).toHaveTextContent(someField.indexFieldType); + }); + }); + }); + + describe('getEcsCompliantTableColumns', () => { + test('it returns the expected columns', () => { + expect(getEcsCompliantTableColumns().map((x) => omit('render', x))).toEqual([ + { + field: 'indexFieldName', + name: 'Field', + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'type', + name: 'ECS mapping type', + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'allowed_values', + name: 'ECS values', + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: 'ECS description', + sortable: false, + truncateText: false, + width: '35%', + }, + ]); + }); + + describe('type render()', () => { + describe('when `type` exists', () => { + beforeEach(() => { + const columns = getEcsCompliantTableColumns(); + const typeRender = columns[1].render; + + render( + + <>{typeRender != null && typeRender(eventCategory.type, eventCategory)} + + ); + }); + + test('it renders the expected `type`', () => { + expect(screen.getByTestId('type')).toHaveTextContent('keyword'); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('typePlaceholder')).not.toBeInTheDocument(); + }); + }); + }); + + describe('allowed values render()', () => { + describe('when `allowedValues` exists', () => { + beforeEach(() => { + const columns = getEcsCompliantTableColumns(); + const allowedValuesRender = columns[2].render; + + render( + + <> + {allowedValuesRender != null && + allowedValuesRender(eventCategory.allowed_values, eventCategory)} + + + ); + }); + + test('it renders the expected `AllowedValue` names', () => { + expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( + eventCategory.allowed_values?.map(({ name }) => name).join('') ?? '' + ); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); + }); + }); + + describe('when `allowedValues` is undefined', () => { + const withUndefinedAllowedValues = { + ...eventCategory, + allowed_values: undefined, // <-- + }; + + beforeEach(() => { + const columns = getEcsCompliantTableColumns(); + const allowedValuesRender = columns[2].render; + + render( + + <> + {allowedValuesRender != null && + allowedValuesRender( + withUndefinedAllowedValues.allowed_values, + withUndefinedAllowedValues + )} + + + ); + }); + + test('it does NOT render the `AllowedValue` names', () => { + expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); + }); + + test('it renders the placeholder', () => { + expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); + }); + }); + }); + + describe('description render()', () => { + describe('when `description` exists', () => { + beforeEach(() => { + const columns = getEcsCompliantTableColumns(); + const descriptionRender = columns[3].render; + + render( + + <> + {descriptionRender != null && + descriptionRender(eventCategory.description, eventCategory)} + + + ); + }); + + test('it renders the expected `description`', () => { + expect(screen.getByTestId('description')).toHaveTextContent( + eventCategory.description?.replaceAll('\n', ' ') ?? '' + ); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); + }); + }); + }); + }); + + describe('getIncompatibleValuesTableColumns', () => { + test('it returns the expected columns', () => { + expect(getIncompatibleValuesTableColumns().map((x) => omit('render', x))).toEqual([ + { + field: 'indexFieldName', + name: 'Field', + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'allowed_values', + name: 'ECS values (expected)', + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'indexInvalidValues', + name: 'Document values (actual)', + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: 'ECS description', + sortable: false, + truncateText: false, + width: '35%', + }, + ]); + }); + + describe('allowed values render()', () => { + describe('when `allowedValues` exists', () => { + beforeEach(() => { + const columns = getIncompatibleValuesTableColumns(); + const allowedValuesRender = columns[1].render; + + render( + + <> + {allowedValuesRender != null && + allowedValuesRender(eventCategory.allowed_values, eventCategory)} + + + ); + }); + + test('it renders the expected `AllowedValue` names', () => { + expect(screen.getByTestId('ecsAllowedValues')).toHaveTextContent( + eventCategory.allowed_values?.map(({ name }) => name).join('') ?? '' + ); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('ecsAllowedValuesEmpty')).not.toBeInTheDocument(); + }); + }); + + describe('when `allowedValues` is undefined', () => { + const withUndefinedAllowedValues = { + ...eventCategory, + allowed_values: undefined, // <-- + }; + + beforeEach(() => { + const columns = getIncompatibleValuesTableColumns(); + const allowedValuesRender = columns[1].render; + + render( + + <> + {allowedValuesRender != null && + allowedValuesRender( + withUndefinedAllowedValues.allowed_values, + withUndefinedAllowedValues + )} + + + ); + }); + + test('it does NOT render the `AllowedValue` names', () => { + expect(screen.queryByTestId('ecsAllowedValues')).not.toBeInTheDocument(); + }); + + test('it renders the placeholder', () => { + expect(screen.getByTestId('ecsAllowedValuesEmpty')).toBeInTheDocument(); + }); + }); + }); + + describe('indexInvalidValues render()', () => { + describe('when `indexInvalidValues` is populated', () => { + beforeEach(() => { + const columns = getIncompatibleValuesTableColumns(); + const indexInvalidValuesRender = columns[2].render; + + render( + + <> + {indexInvalidValuesRender != null && + indexInvalidValuesRender( + eventCategoryWithUnallowedValues.indexInvalidValues, + eventCategoryWithUnallowedValues + )} + + + ); + }); + + test('it renders the expected `indexInvalidValues`', () => { + expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( + 'an_invalid_category (2)theory (1)' + ); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); + }); + }); + + describe('when `indexInvalidValues` is empty', () => { + beforeEach(() => { + const columns = getIncompatibleValuesTableColumns(); + const indexInvalidValuesRender = columns[2].render; + + render( + + <> + {indexInvalidValuesRender != null && + indexInvalidValuesRender(eventCategory.indexInvalidValues, eventCategory)} + + + ); + }); + + test('it does NOT render the index invalid values', () => { + expect(screen.queryByTestId('indexInvalidValues')).not.toBeInTheDocument(); + }); + + test('it renders the placeholder', () => { + expect(screen.getByTestId('emptyPlaceholder')).toBeInTheDocument(); + }); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx new file mode 100644 index 0000000000000..26e3a038b1ffe --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx @@ -0,0 +1,122 @@ +/* + * 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 { EuiTableFieldDataColumnType } from '@elastic/eui'; +import { EuiCode } from '@elastic/eui'; +import React from 'react'; + +import { EcsAllowedValues } from './ecs_allowed_values'; +import { IndexInvalidValues } from './index_invalid_values'; +import { CodeSuccess } from '../../../../../../../../styles'; +import * as i18n from './translations'; +import type { + AllowedValue, + CustomFieldMetadata, + EcsBasedFieldMetadata, + UnallowedValueCount, +} from '../../../../../../../../types'; + +export const EMPTY_PLACEHOLDER = '--'; + +export const getCustomTableColumns = (): Array< + EuiTableFieldDataColumnType +> => [ + { + field: 'indexFieldName', + name: i18n.FIELD, + sortable: true, + truncateText: false, + width: '50%', + }, + { + field: 'indexFieldType', + name: i18n.INDEX_MAPPING_TYPE, + render: (indexFieldType: string) => ( + {indexFieldType} + ), + sortable: true, + truncateText: false, + width: '50%', + }, +]; + +export const getEcsCompliantTableColumns = (): Array< + EuiTableFieldDataColumnType +> => [ + { + field: 'indexFieldName', + name: i18n.FIELD, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'type', + name: i18n.ECS_MAPPING_TYPE, + render: (type: string) => {type}, + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'allowed_values', + name: i18n.ECS_VALUES, + render: (allowedValues: AllowedValue[] | undefined) => ( + + ), + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: i18n.ECS_DESCRIPTION, + render: (description: string) => {description}, + sortable: false, + truncateText: false, + width: '35%', + }, +]; + +export const getIncompatibleValuesTableColumns = (): Array< + EuiTableFieldDataColumnType +> => [ + { + field: 'indexFieldName', + name: i18n.FIELD, + sortable: true, + truncateText: false, + width: '15%', + }, + { + field: 'allowed_values', + name: i18n.ECS_VALUES_EXPECTED, + render: (allowedValues: AllowedValue[] | undefined) => ( + + ), + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'indexInvalidValues', + name: i18n.DOCUMENT_VALUES_ACTUAL, + render: (indexInvalidValues: UnallowedValueCount[]) => ( + + ), + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'description', + name: i18n.ECS_DESCRIPTION, + sortable: false, + truncateText: false, + width: '35%', + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.tsx new file mode 100644 index 0000000000000..e7344dad4d55e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../incompatible_tab/translations'; +import { eventCategory } from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../mock/test_providers/test_providers'; +import { CompareFieldsTable } from '.'; +import { getIncompatibleMappingsTableColumns } from './get_incompatible_mappings_table_columns'; + +describe('CompareFieldsTable', () => { + describe('rendering', () => { + beforeEach(() => { + render( + + + + ); + }); + + test('it renders the expected title', () => { + expect(screen.getByTestId('title')).toHaveTextContent('Incompatible field mappings - foo'); + }); + + test('it renders the table', () => { + expect(screen.getByTestId('table')).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx new file mode 100644 index 0000000000000..8874bd8594866 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiTableFieldDataColumnType, Search } from '@elastic/eui'; +import { EuiInMemoryTable, EuiTitle, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; + +import * as i18n from './translations'; +import type { EnrichedFieldMetadata } from '../../../../../../../../types'; + +const search: Search = { + box: { + incremental: true, + placeholder: i18n.SEARCH_FIELDS, + schema: true, + }, +}; + +interface Props { + enrichedFieldMetadata: T[]; + getTableColumns: () => Array>; + title: string; +} + +const CompareFieldsTableComponent = ({ + enrichedFieldMetadata, + getTableColumns, + title, +}: Props): React.ReactElement => { + const columns = useMemo(() => getTableColumns(), [getTableColumns]); + + return ( + <> + + {title} + + + + + ); +}; + +CompareFieldsTableComponent.displayName = 'CompareFieldsTableComponent'; + +export const CompareFieldsTable = React.memo( + CompareFieldsTableComponent + // React.memo doesn't pass generics through so + // this is a cheap fix without sacrificing type safety +) as typeof CompareFieldsTableComponent; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx new file mode 100644 index 0000000000000..8a53f4cdaf546 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_PLACEHOLDER } from '../helpers'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { UnallowedValueCount } from '../../../../../../../../../types'; +import { IndexInvalidValues } from '.'; + +describe('IndexInvalidValues', () => { + test('it renders a placeholder with the expected content when `indexInvalidValues` is empty', () => { + render( + + + + ); + + expect(screen.getByTestId('emptyPlaceholder')).toHaveTextContent(EMPTY_PLACEHOLDER); + }); + + test('it renders the expected field names and counts when the index has invalid values', () => { + const indexInvalidValues: UnallowedValueCount[] = [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ]; + + render( + + + + ); + + expect(screen.getByTestId('indexInvalidValues')).toHaveTextContent( + 'an_invalid_category (2)theory (1)' + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.tsx new file mode 100644 index 0000000000000..7f83876423ba9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { EMPTY_PLACEHOLDER } from '../helpers'; +import { CodeDanger } from '../../../../../../../../../styles'; +import type { UnallowedValueCount } from '../../../../../../../../../types'; + +const IndexInvalidValueFlexItem = styled(EuiFlexItem)` + margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; +`; + +interface Props { + indexInvalidValues: UnallowedValueCount[]; +} + +const IndexInvalidValuesComponent: React.FC = ({ indexInvalidValues }) => + indexInvalidValues.length === 0 ? ( + {EMPTY_PLACEHOLDER} + ) : ( + + {indexInvalidValues.map(({ fieldName, count }, i) => ( + +
+ {fieldName}{' '} + + {'('} + {count} + {')'} + +
+
+ ))} +
+ ); + +IndexInvalidValuesComponent.displayName = 'IndexInvalidValuesComponent'; + +export const IndexInvalidValues = React.memo(IndexInvalidValuesComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx new file mode 100644 index 0000000000000..210fcc3a2c43b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx @@ -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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { SameFamily } from '.'; +import { SAME_FAMILY_BADGE_LABEL } from '../../../translate'; + +describe('SameFamily', () => { + test('it renders a badge with the expected content', () => { + render( + + + + ); + + expect(screen.getByTestId('sameFamily')).toHaveTextContent(SAME_FAMILY_BADGE_LABEL); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.tsx new file mode 100644 index 0000000000000..3ca603944c0d5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.tsx @@ -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 { EuiBadge } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; +import { SAME_FAMILY_BADGE_LABEL } from '../../../translate'; + +const SameFamilyBadge = styled(EuiBadge)` + margin: ${({ theme }) => `0 ${theme.eui.euiSizeXS}`}; +`; + +const SameFamilyComponent: React.FC = () => ( + + {SAME_FAMILY_BADGE_LABEL} + +); + +SameFamilyComponent.displayName = 'SameFamilyComponent'; + +export const SameFamily = React.memo(SameFamilyComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts new file mode 100644 index 0000000000000..5061a818e17fd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts @@ -0,0 +1,122 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { EcsVersion } from '@elastic/ecs'; + +import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../translations'; +import { + getAllCustomMarkdownComments, + getCustomMarkdownComment, + showCustomCallout, +} from './helpers'; +import { + hostNameKeyword, + someField, +} from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { EMPTY_STAT } from '../../../../../../../../constants'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +describe('helpers', () => { + describe('getCustomMarkdownComment', () => { + test('it returns a comment for custom fields with the expected field counts and ECS version', () => { + expect(getCustomMarkdownComment({ customFieldMetadata: [hostNameKeyword, someField] })) + .toEqual(`#### 2 Custom field mappings + +These fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}. + +${ECS_IS_A_PERMISSIVE_SCHEMA} +`); + }); + }); + + describe('showCustomCallout', () => { + test('it returns false when `enrichedFieldMetadata` is empty', () => { + expect(showCustomCallout([])).toBe(false); + }); + + test('it returns true when `enrichedFieldMetadata` is NOT empty', () => { + expect(showCustomCallout([someField])).toBe(true); + }); + }); + + describe('getAllCustomMarkdownComments', () => { + test('it returns the expected comment', () => { + expect( + getAllCustomMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, + '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', + ]); + }); + + test('it returns the expected comment without ILM Phase when isILMAvailable is false', () => { + expect( + getAllCustomMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, + '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', + ]); + }); + + test('it returns the expected comment without Size when Size is undefined', () => { + expect( + getAllCustomMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 4 Custom field mappings\n\nThese fields are not defined by the Elastic Common Schema (ECS), version ${EcsVersion}.\n\nECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.\n`, + '#### Custom fields - auditbeat-custom-index-1\n\n\n| Field | Index mapping type | \n|-------|--------------------|\n| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |\n', + ]); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts new file mode 100644 index 0000000000000..8beb64cfce88e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts @@ -0,0 +1,88 @@ +/* + * 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 { EcsVersion } from '@elastic/ecs'; + +import { FIELD, INDEX_MAPPING_TYPE } from '../compare_fields_table/translations'; +import { + getSummaryMarkdownComment, + getCustomMarkdownTableRows, + getMarkdownComment, + getMarkdownTable, + getTabCountsMarkdownComment, + getSummaryTableMarkdownComment, +} from '../../utils/markdown'; +import * as i18n from '../../../translations'; +import type { + CustomFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; + +export const getCustomMarkdownComment = ({ + customFieldMetadata, +}: { + customFieldMetadata: CustomFieldMetadata[]; +}): string => + getMarkdownComment({ + suggestedAction: `${i18n.CUSTOM_CALLOUT({ + fieldCount: customFieldMetadata.length, + version: EcsVersion, + })} + +${i18n.ECS_IS_A_PERMISSIVE_SCHEMA} +`, + title: i18n.CUSTOM_CALLOUT_TITLE(customFieldMetadata.length), + }); + +export const showCustomCallout = (customFieldMetadata: CustomFieldMetadata[]): boolean => + customFieldMetadata.length > 0; + +export const getAllCustomMarkdownComments = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + isILMAvailable: boolean; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +}): string[] => [ + getSummaryMarkdownComment(indexName), + getSummaryTableMarkdownComment({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }), + getTabCountsMarkdownComment(partitionedFieldMetadata), + getCustomMarkdownComment({ + customFieldMetadata: partitionedFieldMetadata.custom, + }), + getMarkdownTable({ + enrichedFieldMetadata: partitionedFieldMetadata.custom, + getMarkdownTableRows: getCustomMarkdownTableRows, + headerNames: [FIELD, INDEX_MAPPING_TYPE], + title: i18n.CUSTOM_FIELDS_TABLE_TITLE(indexName), + }), +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx new file mode 100644 index 0000000000000..2d7437e8f0638 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx @@ -0,0 +1,99 @@ +/* + * 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 { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; + +import { CustomCallout } from '../callouts/custom_callout'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getCustomTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; +import { getAllCustomMarkdownComments, showCustomCallout } from './helpers'; +import * as i18n from '../../../translations'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; +import { StickyActions } from '../sticky_actions'; + +interface Props { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +} + +const CustomTabComponent: React.FC = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}) => { + const { isILMAvailable } = useDataQualityContext(); + const markdownComment: string = useMemo( + () => + getAllCustomMarkdownComments({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }).join('\n'), + [ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + ] + ); + + const body = useMemo(() => , []); + const title = useMemo(() => , []); + + return ( +
+ {showCustomCallout(partitionedFieldMetadata.custom) ? ( + <> + + + + + + + + + + ) : ( + + )} +
+ ); +}; + +CustomTabComponent.displayName = 'CustomTabComponent'; + +export const CustomTab = React.memo(CustomTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx new file mode 100644 index 0000000000000..7455ae3f482b9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EcsVersion } from '@elastic/ecs'; + +import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + +import { CompareFieldsTable } from '../compare_fields_table'; +import { getEcsCompliantTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; +import { showMissingTimestampCallout } from '../helpers'; +import { CalloutItem } from '../styles'; +import * as i18n from '../../../translations'; +import type { PartitionedFieldMetadata } from '../../../../../../../../types'; + +const EmptyPromptContainer = styled.div` + width: 100%; +`; + +interface Props { + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; +} + +const EcsCompliantTabComponent: React.FC = ({ indexName, partitionedFieldMetadata }) => { + const emptyPromptBody = useMemo(() => , []); + const title = useMemo(() => , []); + + return ( +
+ {!showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant) ? ( + <> + +

+ {i18n.ECS_COMPLIANT_CALLOUT({ + fieldCount: partitionedFieldMetadata.ecsCompliant.length, + version: EcsVersion, + })} +

+ {i18n.PRE_BUILT_DETECTION_ENGINE_RULES_WORK} + {i18n.CUSTOM_DETECTION_ENGINE_RULES_WORK} + {i18n.PAGES_DISPLAY_EVENTS} + {i18n.OTHER_APP_CAPABILITIES_WORK_PROPERLY} + {i18n.ECS_COMPLIANT_MAPPINGS_ARE_FULLY_SUPPORTED} +
+ + + + ) : ( + + + + )} +
+ ); +}; + +EcsCompliantTabComponent.displayName = 'EcsCompliantTabComponent'; + +export const EcsCompliantTab = React.memo(EcsCompliantTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx new file mode 100644 index 0000000000000..4c30702fcef36 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx @@ -0,0 +1,100 @@ +/* + * 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 { omit } from 'lodash/fp'; + +import { + eventCategory, + timestamp, +} from '../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockPartitionedFieldMetadata } from '../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { mockStatsAuditbeatIndex } from '../../../../../../../mock/stats/mock_stats_packetbeat_index'; +import { + getEcsCompliantBadgeColor, + getMissingTimestampComment, + getTabs, + showMissingTimestampCallout, +} from './helpers'; + +describe('helpers', () => { + describe('getMissingTimestampComment', () => { + test('it returns the expected comment', () => { + expect(getMissingTimestampComment()).toEqual( + '#### Missing an @timestamp (date) field mapping for this index\n\nConsider adding an @timestamp (date) field mapping to this index, as required by the Elastic Common Schema (ECS), because:\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n' + ); + }); + }); + + describe('showMissingTimestampCallout', () => { + test('it returns true when `enrichedFieldMetadata` is empty', () => { + expect(showMissingTimestampCallout([])).toBe(true); + }); + + test('it returns false when `enrichedFieldMetadata` contains an @timestamp field', () => { + expect(showMissingTimestampCallout([timestamp, eventCategory])).toBe(false); + }); + + test('it returns true when `enrichedFieldMetadata` does NOT contain an @timestamp field', () => { + expect(showMissingTimestampCallout([eventCategory])).toBe(true); + }); + }); + + describe('getEcsCompliantBadgeColor', () => { + test('it returns the expected color for the ECS compliant data when the data includes an @timestamp', () => { + expect(getEcsCompliantBadgeColor(mockPartitionedFieldMetadata)).toBe('hollow'); + }); + + test('it returns the expected color for the ECS compliant data does NOT includes an @timestamp', () => { + const noTimestamp = { + ...mockPartitionedFieldMetadata, + ecsCompliant: mockPartitionedFieldMetadata.ecsCompliant.filter( + ({ name }) => name !== '@timestamp' + ), + }; + + expect(getEcsCompliantBadgeColor(noTimestamp)).toEqual('danger'); + }); + }); + + describe('getTabs', () => { + test('it returns the expected tabs', () => { + expect( + getTabs({ + docsCount: 4, + formatBytes: jest.fn(), + formatNumber: jest.fn(), + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + stats: mockStatsAuditbeatIndex, + }).map((x) => omit(['append', 'content'], x)) + ).toEqual([ + { + id: 'incompatibleTab', + name: 'Incompatible fields', + }, + { + id: 'sameFamilyTab', + name: 'Same family', + }, + { + id: 'customTab', + name: 'Custom fields', + }, + { + id: 'ecsCompliantTab', + name: 'ECS compliant fields', + }, + { + id: 'allTab', + name: 'All fields', + }, + ]); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx new file mode 100644 index 0000000000000..41b0c49e66ed1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx @@ -0,0 +1,154 @@ +/* + * 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 { EuiBadge } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { INCOMPATIBLE_FIELDS } from '../../../../../../../translations'; +import { getSizeInBytes } from '../../../../../../../utils/stats'; +import { getIncompatibleStatBadgeColor } from '../../../../../../../utils/get_incompatible_stat_badge_color'; +import { AllTab } from './all_tab'; +import { CustomTab } from './custom_tab'; +import { EcsCompliantTab } from './ecs_compliant_tab'; +import { IncompatibleTab } from './incompatible_tab'; +import { + ALL_TAB_ID, + CUSTOM_TAB_ID, + ECS_COMPLIANT_TAB_ID, + INCOMPATIBLE_TAB_ID, + SAME_FAMILY_TAB_ID, +} from '../constants'; +import * as i18n from '../../translations'; +import { SameFamilyTab } from './same_family_tab'; +import type { + EcsBasedFieldMetadata, + IlmPhase, + MeteringStatsIndex, + PartitionedFieldMetadata, +} from '../../../../../../../types'; +import { getMarkdownComment } from '../utils/markdown'; + +export const getMissingTimestampComment = (): string => + getMarkdownComment({ + suggestedAction: `${i18n.MISSING_TIMESTAMP_CALLOUT} + +${i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} +${i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} +`, + title: i18n.MISSING_TIMESTAMP_CALLOUT_TITLE, + }); + +export const showMissingTimestampCallout = ( + ecsBasedFieldMetadata: EcsBasedFieldMetadata[] +): boolean => !ecsBasedFieldMetadata.some((x) => x.name === '@timestamp'); + +export const getEcsCompliantBadgeColor = ( + partitionedFieldMetadata: PartitionedFieldMetadata +): string => + showMissingTimestampCallout(partitionedFieldMetadata.ecsCompliant) ? 'danger' : 'hollow'; + +const StyledBadge = styled(EuiBadge)` + text-align: right; + cursor: pointer; +`; + +export const getTabs = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + partitionedFieldMetadata, + patternDocsCount, + stats, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + docsCount: number; + ilmPhase: IlmPhase | undefined; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + stats: Record | null; +}) => [ + { + append: ( + + {partitionedFieldMetadata.incompatible.length} + + ), + content: ( + + ), + id: INCOMPATIBLE_TAB_ID, + name: INCOMPATIBLE_FIELDS, + }, + { + append: {partitionedFieldMetadata.sameFamily.length}, + content: ( + + ), + id: SAME_FAMILY_TAB_ID, + name: i18n.SAME_FAMILY, + }, + { + append: {partitionedFieldMetadata.custom.length}, + content: ( + + ), + id: CUSTOM_TAB_ID, + name: i18n.CUSTOM_FIELDS, + }, + { + append: ( + + {partitionedFieldMetadata.ecsCompliant.length} + + ), + content: ( + + ), + id: ECS_COMPLIANT_TAB_ID, + name: i18n.ECS_COMPLIANT_FIELDS, + }, + { + append: {partitionedFieldMetadata.all.length}, + content: , + id: ALL_TAB_ID, + name: i18n.ALL_FIELDS, + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts new file mode 100644 index 0000000000000..5d0e66daff88a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts @@ -0,0 +1,427 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { EcsVersion } from '@elastic/ecs'; + +import { + getAllIncompatibleMarkdownComments, + getIncompatibleFieldsMarkdownComment, + getIncompatibleFieldsMarkdownTablesComment, + getIncompatibleMappings, + getIncompatibleMappingsFields, + getIncompatibleValues, + getIncompatibleValuesFields, + showInvalidCallout, +} from './helpers'; +import { EMPTY_STAT } from '../../../../../../../../constants'; +import { + DETECTION_ENGINE_RULES_MAY_NOT_MATCH, + MAPPINGS_THAT_CONFLICT_WITH_ECS, + PAGES_MAY_NOT_DISPLAY_EVENTS, +} from '../../../translations'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { PartitionedFieldMetadata } from '../../../../../../../../types'; + +describe('helpers', () => { + describe('getIncompatibleFieldsMarkdownComment', () => { + test('it returns the expected counts and ECS version', () => { + expect(getIncompatibleFieldsMarkdownComment(11)).toEqual(`#### 11 incompatible fields + +Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}. + +${DETECTION_ENGINE_RULES_MAY_NOT_MATCH} +${PAGES_MAY_NOT_DISPLAY_EVENTS} +${MAPPINGS_THAT_CONFLICT_WITH_ECS} +`); + }); + }); + + describe('showInvalidCallout', () => { + test('it returns false when the `enrichedFieldMetadata` is empty', () => { + expect(showInvalidCallout([])).toBe(false); + }); + + test('it returns true when the `enrichedFieldMetadata` is NOT empty', () => { + expect(showInvalidCallout(mockPartitionedFieldMetadata.incompatible)).toBe(true); + }); + }); + + describe('getIncompatibleMappings', () => { + test('it (only) returns the mappings where type !== indexFieldType', () => { + expect(getIncompatibleMappings(mockPartitionedFieldMetadata.incompatible)).toEqual([ + { + dashed_name: 'host-name', + description: + 'Name of the host.\nIt can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.', + flat_name: 'host.name', + hasEcsMetadata: true, + ignore_above: 1024, + indexFieldName: 'host.name', + indexFieldType: 'text', + indexInvalidValues: [], + isEcsCompliant: false, + isInSameFamily: false, + level: 'core', + name: 'name', + normalize: [], + short: 'Name of the host.', + type: 'keyword', + }, + { + dashed_name: 'source-ip', + description: 'IP address of the source (IPv4 or IPv6).', + flat_name: 'source.ip', + hasEcsMetadata: true, + indexFieldName: 'source.ip', + indexFieldType: 'text', + indexInvalidValues: [], + isEcsCompliant: false, + isInSameFamily: false, + level: 'core', + name: 'ip', + normalize: [], + short: 'IP address of the source.', + type: 'ip', + }, + ]); + }); + + test('it filters-out ECS complaint fields', () => { + expect(getIncompatibleMappings(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); + }); + }); + + describe('getIncompatibleMappingsFields', () => { + test('it (only) returns the fields where type !== indexFieldType', () => { + expect(getIncompatibleMappingsFields(mockPartitionedFieldMetadata.incompatible)).toEqual([ + 'host.name', + 'source.ip', + ]); + }); + + test('it filters-out ECS complaint fields', () => { + expect(getIncompatibleMappingsFields(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); + }); + }); + + describe('getIncompatibleValues', () => { + test('it (only) returns the mappings with indexInvalidValues', () => { + expect(getIncompatibleValues(mockPartitionedFieldMetadata.incompatible)).toEqual([ + { + allowed_values: [ + { + description: + 'Events in this category are related to the challenge and response process in which credentials are supplied and verified to allow the creation of a session. Common sources for these logs are Windows event logs and ssh logs. Visualize and analyze events in this category to look for failed logins, and other authentication-related activity.', + expected_event_types: ['start', 'end', 'info'], + name: 'authentication', + }, + { + description: + 'Events in the configuration category have to deal with creating, modifying, or deleting the settings or parameters of an application, process, or system.\nExample sources include security policy change logs, configuration auditing logging, and system integrity monitoring.', + expected_event_types: ['access', 'change', 'creation', 'deletion', 'info'], + name: 'configuration', + }, + { + description: + 'The database category denotes events and metrics relating to a data storage and retrieval system. Note that use of this category is not limited to relational database systems. Examples include event logs from MS SQL, MySQL, Elasticsearch, MongoDB, etc. Use this category to visualize and analyze database activity such as accesses and changes.', + expected_event_types: ['access', 'change', 'info', 'error'], + name: 'database', + }, + { + description: + 'Events in the driver category have to do with operating system device drivers and similar software entities such as Windows drivers, kernel extensions, kernel modules, etc.\nUse events and metrics in this category to visualize and analyze driver-related activity and status on hosts.', + expected_event_types: ['change', 'end', 'info', 'start'], + name: 'driver', + }, + { + description: + 'This category is used for events relating to email messages, email attachments, and email network or protocol activity.\nEmails events can be produced by email security gateways, mail transfer agents, email cloud service providers, or mail server monitoring applications.', + expected_event_types: ['info'], + name: 'email', + }, + { + description: + 'Relating to a set of information that has been created on, or has existed on a filesystem. Use this category of events to visualize and analyze the creation, access, and deletions of files. Events in this category can come from both host-based and network-based sources. An example source of a network-based detection of a file transfer would be the Zeek file.log.', + expected_event_types: ['change', 'creation', 'deletion', 'info'], + name: 'file', + }, + { + description: + 'Use this category to visualize and analyze information such as host inventory or host lifecycle events.\nMost of the events in this category can usually be observed from the outside, such as from a hypervisor or a control plane\'s point of view. Some can also be seen from within, such as "start" or "end".\nNote that this category is for information about hosts themselves; it is not meant to capture activity "happening on a host".', + expected_event_types: ['access', 'change', 'end', 'info', 'start'], + name: 'host', + }, + { + description: + 'Identity and access management (IAM) events relating to users, groups, and administration. Use this category to visualize and analyze IAM-related logs and data from active directory, LDAP, Okta, Duo, and other IAM systems.', + expected_event_types: [ + 'admin', + 'change', + 'creation', + 'deletion', + 'group', + 'info', + 'user', + ], + name: 'iam', + }, + { + description: + 'Relating to intrusion detections from IDS/IPS systems and functions, both network and host-based. Use this category to visualize and analyze intrusion detection alerts from systems such as Snort, Suricata, and Palo Alto threat detections.', + expected_event_types: ['allowed', 'denied', 'info'], + name: 'intrusion_detection', + }, + { + description: + 'Malware detection events and alerts. Use this category to visualize and analyze malware detections from EDR/EPP systems such as Elastic Endpoint Security, Symantec Endpoint Protection, Crowdstrike, and network IDS/IPS systems such as Suricata, or other sources of malware-related events such as Palo Alto Networks threat logs and Wildfire logs.', + expected_event_types: ['info'], + name: 'malware', + }, + { + description: + 'Relating to all network activity, including network connection lifecycle, network traffic, and essentially any event that includes an IP address. Many events containing decoded network protocol transactions fit into this category. Use events in this category to visualize or analyze counts of network ports, protocols, addresses, geolocation information, etc.', + expected_event_types: [ + 'access', + 'allowed', + 'connection', + 'denied', + 'end', + 'info', + 'protocol', + 'start', + ], + name: 'network', + }, + { + description: + 'Relating to software packages installed on hosts. Use this category to visualize and analyze inventory of software installed on various hosts, or to determine host vulnerability in the absence of vulnerability scan data.', + expected_event_types: [ + 'access', + 'change', + 'deletion', + 'info', + 'installation', + 'start', + ], + name: 'package', + }, + { + description: + 'Use this category of events to visualize and analyze process-specific information such as lifecycle events or process ancestry.', + expected_event_types: ['access', 'change', 'end', 'info', 'start'], + name: 'process', + }, + { + description: + 'Having to do with settings and assets stored in the Windows registry. Use this category to visualize and analyze activity such as registry access and modifications.', + expected_event_types: ['access', 'change', 'creation', 'deletion'], + name: 'registry', + }, + { + description: + 'The session category is applied to events and metrics regarding logical persistent connections to hosts and services. Use this category to visualize and analyze interactive or automated persistent connections between assets. Data for this category may come from Windows Event logs, SSH logs, or stateless sessions such as HTTP cookie-based sessions, etc.', + expected_event_types: ['start', 'end', 'info'], + name: 'session', + }, + { + description: + "Use this category to visualize and analyze events describing threat actors' targets, motives, or behaviors.", + expected_event_types: ['indicator'], + name: 'threat', + }, + { + description: + 'Relating to vulnerability scan results. Use this category to analyze vulnerabilities detected by Tenable, Qualys, internal scanners, and other vulnerability management sources.', + expected_event_types: ['info'], + name: 'vulnerability', + }, + { + description: + 'Relating to web server access. Use this category to create a dashboard of web server/proxy activity from apache, IIS, nginx web servers, etc. Note: events from network observers such as Zeek http log may also be included in this category.', + expected_event_types: ['access', 'error', 'info'], + name: 'web', + }, + ], + dashed_name: 'event-category', + description: + 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', + example: 'authentication', + flat_name: 'event.category', + ignore_above: 1024, + level: 'core', + name: 'category', + normalize: ['array'], + short: 'Event category. The second categorization field in the hierarchy.', + type: 'keyword', + indexFieldName: 'event.category', + indexFieldType: 'keyword', + indexInvalidValues: [ + { count: 2, fieldName: 'an_invalid_category' }, + { count: 1, fieldName: 'theory' }, + ], + hasEcsMetadata: true, + isEcsCompliant: false, + isInSameFamily: false, + }, + ]); + }); + + test('it filters-out ECS complaint fields', () => { + expect(getIncompatibleValues(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); + }); + }); + + describe('getIncompatibleValuesFields', () => { + test('it (only) returns the fields with indexInvalidValues', () => { + expect(getIncompatibleValuesFields(mockPartitionedFieldMetadata.incompatible)).toEqual([ + 'event.category', + ]); + }); + + test('it filters-out ECS complaint fields', () => { + expect(getIncompatibleValuesFields(mockPartitionedFieldMetadata.ecsCompliant)).toEqual([]); + }); + }); + + describe('getIncompatibleFieldsMarkdownTablesComment', () => { + test('it returns the expected comment when the index has `incompatibleMappings` and `incompatibleValues`', () => { + expect( + getIncompatibleFieldsMarkdownTablesComment({ + incompatibleMappings: [ + mockPartitionedFieldMetadata.incompatible[1], + mockPartitionedFieldMetadata.incompatible[2], + ], + incompatibleValues: [mockPartitionedFieldMetadata.incompatible[0]], + indexName: 'auditbeat-custom-index-1', + }) + ).toEqual( + '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n' + ); + }); + + test('it returns the expected comment when the index does NOT have `incompatibleMappings` and `incompatibleValues`', () => { + expect( + getIncompatibleFieldsMarkdownTablesComment({ + incompatibleMappings: [], // <-- no `incompatibleMappings` + incompatibleValues: [], // <-- no `incompatibleValues` + indexName: 'auditbeat-custom-index-1', + }) + ).toEqual('\n\n\n'); + }); + }); + + describe('getAllIncompatibleMarkdownComments', () => { + const defaultBytesFormat = '0,0.[0]b'; + const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + + const defaultNumberFormat = '0,0.[000]'; + const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + + test('it returns the expected collection of comments', () => { + expect( + getAllIncompatibleMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + isILMAvailable: true, + indexName: 'auditbeat-custom-index-1', + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n${DETECTION_ENGINE_RULES_MAY_NOT_MATCH}\n${PAGES_MAY_NOT_DISPLAY_EVENTS}\n${MAPPINGS_THAT_CONFLICT_WITH_ECS}\n`, + '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', + ]); + }); + + test('it returns the expected comment when `incompatible` is empty', () => { + const emptyIncompatible: PartitionedFieldMetadata = { + ...mockPartitionedFieldMetadata, + incompatible: [], // <-- empty + }; + + expect( + getAllIncompatibleMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + partitionedFieldMetadata: emptyIncompatible, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 | `unmanaged` | 27.7KB |\n\n', + '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + '\n\n\n', + ]); + }); + + test('it returns the expected comment when `isILMAvailable` is false', () => { + const emptyIncompatible: PartitionedFieldMetadata = { + ...mockPartitionedFieldMetadata, + incompatible: [], // <-- empty + }; + + expect( + getAllIncompatibleMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: emptyIncompatible, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 |\n\n', + '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + '\n\n\n', + ]); + }); + + test('it returns the expected comment when `sizeInBytes` is not an integer', () => { + const emptyIncompatible: PartitionedFieldMetadata = { + ...mockPartitionedFieldMetadata, + incompatible: [], // <-- empty + }; + + expect( + getAllIncompatibleMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: emptyIncompatible, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ✅ | auditbeat-custom-index-1 | 4 (0.0%) | 0 |\n\n', + '### **Incompatible fields** `0` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + '\n\n\n', + ]); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts new file mode 100644 index 0000000000000..c7c93f67d80bb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts @@ -0,0 +1,190 @@ +/* + * 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 { EcsVersion } from '@elastic/ecs'; + +import { escapeNewlines } from '../../../../../../../../utils/markdown'; +import { + getSummaryMarkdownComment, + getIncompatibleMappingsMarkdownTableRows, + getIncompatibleValuesMarkdownTableRows, + getMarkdownComment, + getMarkdownTable, + getTabCountsMarkdownComment, + getSummaryTableMarkdownComment, +} from '../../utils/markdown'; +import * as i18n from '../../../translations'; +import type { + EcsBasedFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; +import { + INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, + INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, +} from './translations'; +import { + FIELD, + ECS_MAPPING_TYPE_EXPECTED, + INDEX_MAPPING_TYPE_ACTUAL, + DOCUMENT_VALUES_ACTUAL, + ECS_VALUES_EXPECTED, +} from '../compare_fields_table/translations'; +import { getIsInSameFamily } from '../../../utils/get_is_in_same_family'; + +export const getIncompatibleFieldsMarkdownComment = (incompatible: number): string => + getMarkdownComment({ + suggestedAction: `${i18n.INCOMPATIBLE_CALLOUT(EcsVersion)} + +${i18n.DETECTION_ENGINE_RULES_MAY_NOT_MATCH} +${i18n.PAGES_MAY_NOT_DISPLAY_EVENTS} +${i18n.MAPPINGS_THAT_CONFLICT_WITH_ECS} +`, + title: i18n.INCOMPATIBLE_CALLOUT_TITLE(incompatible), + }); + +export const showInvalidCallout = (ecsBasedFieldMetadata: EcsBasedFieldMetadata[]): boolean => + ecsBasedFieldMetadata.length > 0; + +export const getIncompatibleMappings = ( + ecsBasedFieldMetadata: EcsBasedFieldMetadata[] +): EcsBasedFieldMetadata[] => + ecsBasedFieldMetadata.filter( + (x) => + !x.isEcsCompliant && + x.type !== x.indexFieldType && + !getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType }) + ); + +export const getIncompatibleMappingsFields = ( + ecsBasedFieldMetadata: EcsBasedFieldMetadata[] +): string[] => + ecsBasedFieldMetadata.reduce((acc, x) => { + if ( + !x.isEcsCompliant && + x.type !== x.indexFieldType && + !getIsInSameFamily({ ecsExpectedType: x.type, type: x.indexFieldType }) + ) { + const field = escapeNewlines(x.indexFieldName); + if (field != null) { + return [...acc, field]; + } + } + return acc; + }, []); + +export const getSameFamilyFields = (ecsBasedFieldMetadata: EcsBasedFieldMetadata[]): string[] => + ecsBasedFieldMetadata.reduce((acc, x) => { + if (!x.isEcsCompliant && x.type !== x.indexFieldType && x.isInSameFamily) { + const field = escapeNewlines(x.indexFieldName); + if (field != null) { + return [...acc, field]; + } + } + return acc; + }, []); + +export const getIncompatibleValues = ( + ecsBasedFieldMetadata: EcsBasedFieldMetadata[] +): EcsBasedFieldMetadata[] => + ecsBasedFieldMetadata.filter((x) => !x.isEcsCompliant && x.indexInvalidValues.length > 0); + +export const getIncompatibleValuesFields = ( + ecsBasedFieldMetadata: EcsBasedFieldMetadata[] +): string[] => + ecsBasedFieldMetadata.reduce((acc, x) => { + if (!x.isEcsCompliant && x.indexInvalidValues.length > 0) { + const field = escapeNewlines(x.indexFieldName); + if (field != null) { + return [...acc, field]; + } + } + return acc; + }, []); + +export const getIncompatibleFieldsMarkdownTablesComment = ({ + incompatibleMappings, + incompatibleValues, + indexName, +}: { + incompatibleMappings: EcsBasedFieldMetadata[]; + incompatibleValues: EcsBasedFieldMetadata[]; + indexName: string; +}): string => ` +${ + incompatibleMappings.length > 0 + ? getMarkdownTable({ + enrichedFieldMetadata: incompatibleMappings, + getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, + headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], + title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), + }) + : '' +} +${ + incompatibleValues.length > 0 + ? getMarkdownTable({ + enrichedFieldMetadata: incompatibleValues, + getMarkdownTableRows: getIncompatibleValuesMarkdownTableRows, + headerNames: [FIELD, ECS_VALUES_EXPECTED, DOCUMENT_VALUES_ACTUAL], + title: INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE(indexName), + }) + : '' +} +`; + +export const getAllIncompatibleMarkdownComments = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + isILMAvailable: boolean; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +}): string[] => { + const incompatibleMappings = getIncompatibleMappings(partitionedFieldMetadata.incompatible); + const incompatibleValues = getIncompatibleValues(partitionedFieldMetadata.incompatible); + + const incompatibleFieldsMarkdownComment = + partitionedFieldMetadata.incompatible.length > 0 + ? getIncompatibleFieldsMarkdownComment(partitionedFieldMetadata.incompatible.length) + : ''; + + return [ + getSummaryMarkdownComment(indexName), + getSummaryTableMarkdownComment({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }), + getTabCountsMarkdownComment(partitionedFieldMetadata), + incompatibleFieldsMarkdownComment, + getIncompatibleFieldsMarkdownTablesComment({ + incompatibleMappings, + incompatibleValues, + indexName, + }), + ].filter((x) => x !== ''); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.tsx new file mode 100644 index 0000000000000..d24e82192291f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; + +import { IncompatibleCallout } from '../callouts/incompatible_callout'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getIncompatibleMappingsTableColumns } from '../compare_fields_table/get_incompatible_mappings_table_columns'; +import { getIncompatibleValuesTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; +import { + getAllIncompatibleMarkdownComments, + getIncompatibleMappings, + getIncompatibleValues, + showInvalidCallout, +} from './helpers'; +import * as i18n from '../../../translations'; +import { + INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, + INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, +} from './translations'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; +import { StickyActions } from '../sticky_actions'; + +interface Props { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +} + +const IncompatibleTabComponent: React.FC = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}) => { + const body = useMemo(() => , []); + const title = useMemo(() => , []); + const incompatibleMappings = useMemo( + () => getIncompatibleMappings(partitionedFieldMetadata.incompatible), + [partitionedFieldMetadata.incompatible] + ); + const incompatibleValues = useMemo( + () => getIncompatibleValues(partitionedFieldMetadata.incompatible), + [partitionedFieldMetadata.incompatible] + ); + + const { isILMAvailable } = useDataQualityContext(); + + const markdownComment: string = useMemo( + () => + getAllIncompatibleMarkdownComments({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }).join('\n'), + [ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + ] + ); + + return ( +
+ {showInvalidCallout(partitionedFieldMetadata.incompatible) ? ( + <> + + + <> + {incompatibleMappings.length > 0 && ( + <> + + + + + )} + + + <> + {incompatibleValues.length > 0 && ( + <> + + + + + )} + + + + + + ) : ( + + )} +
+ ); +}; + +IncompatibleTabComponent.displayName = 'IncompatibleTabComponent'; + +export const IncompatibleTab = React.memo(IncompatibleTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts new file mode 100644 index 0000000000000..6eedd81fae4a5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts @@ -0,0 +1,126 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { EcsVersion } from '@elastic/ecs'; + +import { + getAllSameFamilyMarkdownComments, + getSameFamilyMarkdownComment, + getSameFamilyMarkdownTablesComment, +} from './helpers'; +import { EMPTY_STAT } from '../../../../../../../../constants'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; + +describe('helpers', () => { + describe('getSameFamilyMarkdownComment', () => { + test('it returns the expected counts and ECS version', () => { + expect(getSameFamilyMarkdownComment(7)).toEqual(`#### 7 Same family field mappings + +These fields are defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but their mapping types don't exactly match. + +Fields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics. +`); + }); + }); + + describe('getSameFamilyMarkdownTablesComment', () => { + test('it returns the expected comment when the index has same family mappings', () => { + const expected = `\n#### Same family field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| agent.type | \`keyword\` | \`constant_keyword\` \`same family\` |\n\n`; + + expect( + getSameFamilyMarkdownTablesComment({ + sameFamilyMappings: [ + { + dashed_name: 'agent-type', + description: + 'Type of the agent.\nThe agent type always stays the same and should be given by the agent used. In case of Filebeat the agent would always be Filebeat also if two Filebeat instances are run on the same machine.', + example: 'filebeat', + flat_name: 'agent.type', + ignore_above: 1024, + level: 'core', + name: 'type', + normalize: [], + short: 'Type of the agent.', + type: 'keyword', + indexFieldName: 'agent.type', + indexFieldType: 'constant_keyword', + indexInvalidValues: [], + hasEcsMetadata: true, + isEcsCompliant: false, + isInSameFamily: true, + }, + ], + indexName: 'auditbeat-custom-index-1', + }) + ).toEqual(expected); + }); + + test('it returns the expected comment when the index does NOT have same family mappings', () => { + expect( + getSameFamilyMarkdownTablesComment({ + sameFamilyMappings: [], + indexName: 'auditbeat-custom-index-1', + }) + ).toEqual('\n\n'); + }); + }); + + describe('getAllSameFamilyMarkdownComments', () => { + const defaultBytesFormat = '0,0.[0]b'; + const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + + const defaultNumberFormat = '0,0.[000]'; + const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + + test('it returns the expected collection of comments', () => { + expect( + getAllSameFamilyMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadataWithSameFamily, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', + '### **Incompatible fields** `3` **Same family** `1` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `10`\n', + `#### 1 Same family field mapping\n\nThis field is defined by the Elastic Common Schema (ECS), version ${EcsVersion}, but its mapping type doesn't exactly match.\n\nFields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics.\n`, + '\n#### Same family field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| agent.type | `keyword` | `constant_keyword` `same family` |\n\n', + ]); + }); + + test('it returns the expected comment when `sameFamily` is empty', () => { + expect( + getAllSameFamilyMarkdownComments({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual([ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + '\n\n', + ]); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts new file mode 100644 index 0000000000000..e96e62704e812 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EcsVersion } from '@elastic/ecs'; + +import { + FIELD, + ECS_MAPPING_TYPE_EXPECTED, + INDEX_MAPPING_TYPE_ACTUAL, +} from '../compare_fields_table/translations'; +import { + getSummaryMarkdownComment, + getIncompatibleMappingsMarkdownTableRows, + getMarkdownComment, + getMarkdownTable, + getTabCountsMarkdownComment, + getSummaryTableMarkdownComment, +} from '../../utils/markdown'; +import * as i18n from '../../../translations'; +import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; +import type { + EcsBasedFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; + +export const getSameFamilyMarkdownComment = (fieldsInSameFamily: number): string => + getMarkdownComment({ + suggestedAction: `${i18n.SAME_FAMILY_CALLOUT({ + fieldCount: fieldsInSameFamily, + version: EcsVersion, + })} + +${i18n.FIELDS_WITH_MAPPINGS_SAME_FAMILY} +`, + title: i18n.SAME_FAMILY_CALLOUT_TITLE(fieldsInSameFamily), + }); + +export const getSameFamilyMappings = ( + enrichedFieldMetadata: EcsBasedFieldMetadata[] +): EcsBasedFieldMetadata[] => enrichedFieldMetadata.filter((x) => x.isInSameFamily); + +export const getSameFamilyMarkdownTablesComment = ({ + sameFamilyMappings, + indexName, +}: { + sameFamilyMappings: EcsBasedFieldMetadata[]; + indexName: string; +}): string => ` +${ + sameFamilyMappings.length > 0 + ? getMarkdownTable({ + enrichedFieldMetadata: sameFamilyMappings, + getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, + headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], + title: SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE(indexName), + }) + : '' +} +`; + +export const getAllSameFamilyMarkdownComments = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + isILMAvailable: boolean; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +}): string[] => { + const sameFamilyMappings = getSameFamilyMappings(partitionedFieldMetadata.sameFamily); + const fieldsInSameFamily = partitionedFieldMetadata.sameFamily.length; + + const incompatibleFieldsMarkdownComment = + partitionedFieldMetadata.sameFamily.length > 0 + ? getSameFamilyMarkdownComment(fieldsInSameFamily) + : ''; + + return [ + getSummaryMarkdownComment(indexName), + getSummaryTableMarkdownComment({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }), + getTabCountsMarkdownComment(partitionedFieldMetadata), + incompatibleFieldsMarkdownComment, + getSameFamilyMarkdownTablesComment({ + sameFamilyMappings, + indexName, + }), + ].filter((x) => x !== ''); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx new file mode 100644 index 0000000000000..8d91e26a0da09 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx @@ -0,0 +1,99 @@ +/* + * 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 { EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; + +import { SameFamilyCallout } from '../callouts/same_family_callout'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getIncompatibleMappingsTableColumns } from '../compare_fields_table/get_incompatible_mappings_table_columns'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; +import { getAllSameFamilyMarkdownComments, getSameFamilyMappings } from './helpers'; +import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; +import { StickyActions } from '../sticky_actions'; + +interface Props { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +} + +const SameFamilyTabComponent: React.FC = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}) => { + const sameFamilyMappings = useMemo( + () => getSameFamilyMappings(partitionedFieldMetadata.sameFamily), + [partitionedFieldMetadata.sameFamily] + ); + + const { isILMAvailable } = useDataQualityContext(); + const markdownComment: string = useMemo( + () => + getAllSameFamilyMarkdownComments({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }).join('\n'), + [ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + ] + ); + + return ( +
+ + + <> + {sameFamilyMappings.length > 0 && ( + <> + + + + + )} + + + 0 ? 'm' : 'l'} /> + +
+ ); +}; + +SameFamilyTabComponent.displayName = 'SameFamilyTabComponent'; + +export const SameFamilyTab = React.memo(SameFamilyTabComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx new file mode 100644 index 0000000000000..1cd2630e720d1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC } from 'react'; +import { EuiButtonEmpty } from '@elastic/eui'; + +import styled from 'styled-components'; +import { Actions } from '../../../../../../../../actions'; + +export const CopyToClipboardButton = styled(EuiButtonEmpty)` + margin-left: ${({ theme }) => theme.eui.euiSizeXS}; +`; + +interface Props { + markdownComment: string; + showAddToNewCaseAction?: boolean; + showCopyToClipboardAction?: boolean; + showChatAction?: boolean; + indexName?: string; +} + +const StyledStickyContainer = styled.div` + padding: ${({ theme }) => theme.eui.euiSizeL} 0; + background: ${({ theme }) => theme.eui.euiColorEmptyShade}; + position: sticky; + bottom: 0; + left: 0; + right: 0; + border-top: 1px solid ${({ theme }) => theme.eui.euiBorderColor}; +`; + +const StickyActionsComponent: FC = ({ + indexName, + markdownComment, + showCopyToClipboardAction, + showAddToNewCaseAction, + showChatAction, +}) => { + return ( + + + + ); +}; + +StickyActionsComponent.displayName = 'StickyActionsComponent'; + +export const StickyActions = React.memo(StickyActionsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles.tsx new file mode 100644 index 0000000000000..20976b1684003 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles.tsx @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexItem } from '@elastic/eui'; +import styled from 'styled-components'; + +export const DEFAULT_LEGEND_HEIGHT = 300; // px +export const DEFAULT_MAX_CHART_HEIGHT = 300; // px + +export const CalloutItem = styled.div` + margin-left: ${({ theme }) => theme.eui.euiSizeS}; +`; + +export const ChartFlexItem = styled(EuiFlexItem)<{ + $maxChartHeight: number | undefined; + $minChartHeight: number; +}>` + ${({ $maxChartHeight }) => ($maxChartHeight != null ? `max-height: ${$maxChartHeight}px;` : '')} + min-height: ${({ $minChartHeight }) => `${$minChartHeight}px`}; +`; + +export const LegendContainer = styled.div<{ + $height?: number; + $width?: number; +}>` + margin-left: ${({ theme }) => theme.eui.euiSizeM}; + margin-top: ${({ theme }) => theme.eui.euiSizeM}; + ${({ $height }) => ($height != null ? `height: ${$height}px;` : '')} + scrollbar-width: thin; + ${({ $width }) => ($width != null ? `width: ${$width}px;` : '')} +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/translate.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/translate.ts new file mode 100644 index 0000000000000..1a94c062f0079 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/translate.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 { i18n } from '@kbn/i18n'; + +export const SAME_FAMILY_BADGE_LABEL = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.sameFamilyBadgeLabel', + { + defaultMessage: 'same family', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.test.ts new file mode 100644 index 0000000000000..ba62b5b0f7874 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.test.ts @@ -0,0 +1,336 @@ +/* + * 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 numeral from '@elastic/numeral'; + +import { + eventCategory, + mockCustomFields, + mockIncompatibleMappings, + sourceIpWithTextMapping, +} from '../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { EMPTY_STAT } from '../../../../../../../constants'; +import { mockPartitionedFieldMetadata } from '../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { + escapePreserveNewlines, + getAllowedValues, + getCustomMarkdownTableRows, + getIncompatibleMappingsMarkdownTableRows, + getIncompatibleValuesMarkdownTableRows, + getIndexInvalidValues, + getMarkdownComment, + getMarkdownTable, + getSameFamilyBadge, + getSummaryMarkdownComment, + getSummaryTableMarkdownComment, + getTabCountsMarkdownComment, +} from './markdown'; +import { + ECS_MAPPING_TYPE_EXPECTED, + FIELD, + INDEX_MAPPING_TYPE_ACTUAL, +} from '../tabs/compare_fields_table/translations'; +import { mockAllowedValues } from '../../../../../../../mock/allowed_values/mock_allowed_values'; +import { EcsBasedFieldMetadata, UnallowedValueCount } from '../../../../../../../types'; +import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../tabs/incompatible_tab/translations'; +import { escapeNewlines } from '../../../../../../../utils/markdown'; +import { SAME_FAMILY_BADGE_LABEL } from '../translate'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const indexName = 'auditbeat-custom-index-1'; + +describe('getSummaryTableMarkdownComment', () => { + test('it returns the expected comment', () => { + expect( + getSummaryTableMarkdownComment({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual( + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n\n' + ); + }); + + test('it returns the expected comment when isILMAvailable is false', () => { + expect( + getSummaryTableMarkdownComment({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual( + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n' + ); + }); + + test('it returns the expected comment when sizeInBytes is undefined', () => { + expect( + getSummaryTableMarkdownComment({ + docsCount: 4, + formatBytes, + formatNumber, + ilmPhase: 'unmanaged', + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual( + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 |\n\n' + ); + }); +}); + +describe('escapeNewlines', () => { + test('it returns undefined when `content` is undefined', () => { + expect(escapeNewlines(undefined)).toBeUndefined(); + }); + + test("it returns the content unmodified when there's nothing to escape", () => { + const content = "there's nothing to escape in this content"; + expect(escapeNewlines(content)).toEqual(content); + }); + + test('it replaces all newlines in the content with spaces', () => { + const content = '\nthere were newlines in the beginning, middle,\nand end\n'; + expect(escapeNewlines(content)).toEqual( + ' there were newlines in the beginning, middle, and end ' + ); + }); + + test('it escapes all column separators in the content with spaces', () => { + const content = '|there were column separators in the beginning, middle,|and end|'; + expect(escapeNewlines(content)).toEqual( + '\\|there were column separators in the beginning, middle,\\|and end\\|' + ); + }); + + test('it escapes content containing BOTH newlines and column separators', () => { + const content = + '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; + expect(escapeNewlines(content)).toEqual( + '\\| there were newlines and column separators in the beginning, middle, \\|and end\\| ' + ); + }); +}); + +describe('escapePreserveNewlines', () => { + test('it returns undefined when `content` is undefined', () => { + expect(escapePreserveNewlines(undefined)).toBeUndefined(); + }); + + test("it returns the content unmodified when there's nothing to escape", () => { + const content = "there's (also) nothing to escape in this content"; + expect(escapePreserveNewlines(content)).toEqual(content); + }); + + test('it escapes all column separators in the content with spaces', () => { + const content = '|there were column separators in the beginning, middle,|and end|'; + expect(escapePreserveNewlines(content)).toEqual( + '\\|there were column separators in the beginning, middle,\\|and end\\|' + ); + }); + + test('it does NOT escape newlines in the content', () => { + const content = + '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; + expect(escapePreserveNewlines(content)).toEqual( + '\\|\nthere were newlines and column separators in the beginning, middle,\n\\|and end\\|\n' + ); + }); +}); + +describe('getAllowedValues', () => { + test('it returns the expected placeholder when `allowedValues` is undefined', () => { + expect(getAllowedValues(undefined)).toEqual('`--`'); + }); + + test('it joins the `allowedValues` `name`s as a markdown-code-formatted, comma separated, string', () => { + expect(getAllowedValues(mockAllowedValues)).toEqual( + '`authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web`' + ); + }); +}); + +describe('getIndexInvalidValues', () => { + test('it returns the expected placeholder when `indexInvalidValues` is empty', () => { + expect(getIndexInvalidValues([])).toEqual('`--`'); + }); + + test('it returns markdown-code-formatted `fieldName`s, and their associated `count`s', () => { + const indexInvalidValues: UnallowedValueCount[] = [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ]; + + expect(getIndexInvalidValues(indexInvalidValues)).toEqual( + `\`an_invalid_category\` (2), \`theory\` (1)` + ); + }); +}); + +describe('getCustomMarkdownTableRows', () => { + test('it returns the expected table rows', () => { + expect(getCustomMarkdownTableRows(mockCustomFields)).toEqual( + '| host.name.keyword | `keyword` | `--` |\n| some.field | `text` | `--` |\n| some.field.keyword | `keyword` | `--` |\n| source.ip.keyword | `keyword` | `--` |' + ); + }); +}); + +describe('getSameFamilyBadge', () => { + test('it returns the expected badge text when the field is in the same family', () => { + const inSameFamily = { + ...eventCategory, + isInSameFamily: true, + }; + + expect(getSameFamilyBadge(inSameFamily)).toEqual(`\`${SAME_FAMILY_BADGE_LABEL}\``); + }); + + test('it returns an empty string when the field is NOT the same family', () => { + const notInSameFamily = { + ...eventCategory, + isInSameFamily: false, + }; + + expect(getSameFamilyBadge(notInSameFamily)).toEqual(''); + }); +}); + +describe('getIncompatibleMappingsMarkdownTableRows', () => { + test('it returns the expected table rows when the field is in the same family', () => { + const eventCategoryWithWildcard: EcsBasedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType: 'wildcard', // this index has a mapping of `wildcard` instead of `keyword` + isInSameFamily: true, // `wildcard` and `keyword` are in the same family + }; + + expect( + getIncompatibleMappingsMarkdownTableRows([eventCategoryWithWildcard, sourceIpWithTextMapping]) + ).toEqual( + '| event.category | `keyword` | `wildcard` `same family` |\n| source.ip | `ip` | `text` |' + ); + }); + + test('it returns the expected table rows when the field is NOT in the same family', () => { + const eventCategoryWithText: EcsBasedFieldMetadata = { + ...eventCategory, // `event.category` is a `keyword` per the ECS spec + indexFieldType: 'text', // this index has a mapping of `text` instead of `keyword` + isInSameFamily: false, // `text` and `keyword` are NOT in the same family + }; + + expect( + getIncompatibleMappingsMarkdownTableRows([eventCategoryWithText, sourceIpWithTextMapping]) + ).toEqual('| event.category | `keyword` | `text` |\n| source.ip | `ip` | `text` |'); + }); +}); + +describe('getIncompatibleValuesMarkdownTableRows', () => { + test('it returns the expected table rows', () => { + expect( + getIncompatibleValuesMarkdownTableRows([ + { + ...eventCategory, + hasEcsMetadata: true, + indexInvalidValues: [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ], + isEcsCompliant: false, + }, + ]) + ).toEqual( + '| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |' + ); + }); +}); + +describe('getMarkdownComment', () => { + test('it returns the expected markdown comment', () => { + const suggestedAction = + '|\nthere were newlines and column separators in this suggestedAction beginning, middle,\n|and end|\n'; + const title = + '|\nthere were newlines and column separators in this title beginning, middle,\n|and end|\n'; + + expect(getMarkdownComment({ suggestedAction, title })).toEqual( + '#### \\| there were newlines and column separators in this title beginning, middle, \\|and end\\| \n\n\\|\nthere were newlines and column separators in this suggestedAction beginning, middle,\n\\|and end\\|\n' + ); + }); +}); + +describe('getMarkdownTable', () => { + test('it returns the expected table contents', () => { + expect( + getMarkdownTable({ + enrichedFieldMetadata: mockIncompatibleMappings, + getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, + headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], + title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), + }) + ).toEqual( + '#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n' + ); + }); + + test('it returns an empty string when `enrichedFieldMetadata` is empty', () => { + expect( + getMarkdownTable({ + enrichedFieldMetadata: [], // <-- empty + getMarkdownTableRows: getIncompatibleMappingsMarkdownTableRows, + headerNames: [FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL], + title: INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE(indexName), + }) + ).toEqual(''); + }); +}); + +describe('getSummaryMarkdownComment', () => { + test('it returns the expected markdown comment', () => { + expect(getSummaryMarkdownComment(indexName)).toEqual('### auditbeat-custom-index-1\n'); + }); +}); + +describe('getTabCountsMarkdownComment', () => { + test('it returns a comment with the expected counts', () => { + expect(getTabCountsMarkdownComment(mockPartitionedFieldMetadata)).toBe( + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n' + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.ts new file mode 100644 index 0000000000000..574408cfe600b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/utils/markdown.ts @@ -0,0 +1,163 @@ +/* + * 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 { INCOMPATIBLE_FIELDS } from '../../../../../../../translations'; +import { + escapeNewlines, + getCodeFormattedValue, + getMarkdownTableHeader, + getSummaryTableMarkdownHeader, + getSummaryTableMarkdownRow, +} from '../../../../../../../utils/markdown'; +import { + AllowedValue, + CustomFieldMetadata, + EcsBasedFieldMetadata, + EnrichedFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, + UnallowedValueCount, +} from '../../../../../../../types'; +import { ALL_FIELDS, CUSTOM_FIELDS, ECS_COMPLIANT_FIELDS, SAME_FAMILY } from '../../translations'; +import { SAME_FAMILY_BADGE_LABEL } from '../translate'; + +export const getSummaryTableMarkdownComment = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + indexName: string; + isILMAvailable: boolean; + partitionedFieldMetadata: PartitionedFieldMetadata; + patternDocsCount: number; + sizeInBytes: number | undefined; +}): string => + `${getSummaryTableMarkdownHeader(isILMAvailable)} +${getSummaryTableMarkdownRow({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + incompatible: partitionedFieldMetadata.incompatible.length, + patternDocsCount, + sizeInBytes, +})} +`; + +export const escapePreserveNewlines = (content: string | undefined): string | undefined => + content != null ? content.replaceAll('|', '\\|') : content; + +export const getAllowedValues = (allowedValues: AllowedValue[] | undefined): string => + allowedValues == null + ? getCodeFormattedValue(undefined) + : allowedValues.map((x) => getCodeFormattedValue(x.name)).join(', '); + +export const getIndexInvalidValues = (indexInvalidValues: UnallowedValueCount[]): string => + indexInvalidValues.length === 0 + ? getCodeFormattedValue(undefined) + : indexInvalidValues + .map( + ({ fieldName, count }) => `${getCodeFormattedValue(escapeNewlines(fieldName))} (${count})` + ) + .join(', '); // newlines are instead joined with spaces + +export const getCustomMarkdownTableRows = (customFieldMetadata: CustomFieldMetadata[]): string => + customFieldMetadata + .map( + (x) => + `| ${escapeNewlines(x.indexFieldName)} | ${getCodeFormattedValue( + x.indexFieldType + )} | ${getAllowedValues(undefined)} |` + ) + .join('\n'); + +export const getSameFamilyBadge = (ecsBasedFieldMetadata: EcsBasedFieldMetadata): string => + ecsBasedFieldMetadata.isInSameFamily ? getCodeFormattedValue(SAME_FAMILY_BADGE_LABEL) : ''; + +export const getIncompatibleMappingsMarkdownTableRows = ( + incompatibleMappings: EcsBasedFieldMetadata[] +): string => + incompatibleMappings + .map( + (x) => + `| ${escapeNewlines(x.indexFieldName)} | ${getCodeFormattedValue( + x.type + )} | ${getCodeFormattedValue(x.indexFieldType)} ${getSameFamilyBadge(x)} |` + ) + .join('\n'); + +export const getIncompatibleValuesMarkdownTableRows = ( + incompatibleValues: EcsBasedFieldMetadata[] +): string => + incompatibleValues + .map( + (x) => + `| ${escapeNewlines(x.indexFieldName)} | ${getAllowedValues( + x.allowed_values + )} | ${getIndexInvalidValues(x.indexInvalidValues)} |` + ) + .join('\n'); + +export const getMarkdownComment = ({ + suggestedAction, + title, +}: { + suggestedAction: string; + title: string; +}): string => + `#### ${escapeNewlines(title)} + +${escapePreserveNewlines(suggestedAction)}`; + +export const getMarkdownTable = ({ + enrichedFieldMetadata, + getMarkdownTableRows, + headerNames, + title, +}: { + enrichedFieldMetadata: T; + getMarkdownTableRows: (enrichedFieldMetadata: T) => string; + headerNames: string[]; + title: string; +}): string => + enrichedFieldMetadata.length > 0 + ? `#### ${escapeNewlines(title)} + +${getMarkdownTableHeader(headerNames)} +${getMarkdownTableRows(enrichedFieldMetadata)} +` + : ''; + +export const getSummaryMarkdownComment = (indexName: string) => + `### ${escapeNewlines(indexName)} +`; + +export const getTabCountsMarkdownComment = ( + partitionedFieldMetadata: PartitionedFieldMetadata +): string => + `### **${INCOMPATIBLE_FIELDS}** ${getCodeFormattedValue( + `${partitionedFieldMetadata.incompatible.length}` + )} **${SAME_FAMILY}** ${getCodeFormattedValue( + `${partitionedFieldMetadata.sameFamily.length}` + )} **${CUSTOM_FIELDS}** ${getCodeFormattedValue( + `${partitionedFieldMetadata.custom.length}` + )} **${ECS_COMPLIANT_FIELDS}** ${getCodeFormattedValue( + `${partitionedFieldMetadata.ecsCompliant.length}` + )} **${ALL_FIELDS}** ${getCodeFormattedValue(`${partitionedFieldMetadata.all.length}`)} +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.tsx new file mode 100644 index 0000000000000..b589eb09e8d12 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.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. + */ + +import React from 'react'; +import { screen, render } from '@testing-library/react'; + +import { IndexStatsPanel } from '.'; +import { TestExternalProviders } from '../../../../../../mock/test_providers/test_providers'; + +describe('IndexStatsPanel', () => { + it('renders stats panel', () => { + render( + + + + ); + + const container = screen.getByTestId('indexStatsPanel'); + + expect(container).toHaveTextContent('Docs123'); + expect(container).toHaveTextContent('ILM phasehot'); + expect(container).toHaveTextContent('Size789'); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.tsx new file mode 100644 index 0000000000000..2df01db28f8a2 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.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 { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { DOCS, ILM_PHASE, SIZE } from '../../../../../../translations'; +import { Stat } from '../../../../../../stat'; +import { getIlmPhaseDescription } from '../../../../../../utils/get_ilm_phase_description'; + +const StyledFlexItem = styled(EuiFlexItem)` + border-right: 1px solid ${({ theme }) => theme.eui.euiBorderColor}; + font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; + + &:last-child { + border-right: none; + } + + strong { + text-transform: capitalize; + } +`; + +export interface Props { + docsCount: string; + ilmPhase: string; + sizeInBytes: string; +} + +export const IndexStatsPanelComponent: React.FC = ({ docsCount, ilmPhase, sizeInBytes }) => ( + + + + {DOCS} + + {docsCount} + + +
+ {ILM_PHASE} + + +
+
+ + {SIZE} + + {sizeInBytes} + +
+
+); + +IndexStatsPanelComponent.displayName = 'IndexStatsPanelComponent'; + +export const IndexStatsPanel = React.memo(IndexStatsPanelComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/translations.ts new file mode 100644 index 0000000000000..402b58c4915db --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/translations.ts @@ -0,0 +1,479 @@ +/* + * 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 ADD_TO_NEW_CASE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.addToNewCaseButton', + { + defaultMessage: 'Add to new case', + } +); + +export const ALL_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allFieldsLabel', + { + defaultMessage: 'All fields', + } +); + +export const ALL_CALLOUT = (version: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCallout', { + values: { version }, + defaultMessage: + "All mappings for the fields in this index, including fields that comply with the Elastic Common Schema (ECS), version {version}, and fields that don't", + }); + +export const ALL_CALLOUT_TITLE = (fieldCount: number) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutTitle', + { + values: { fieldCount }, + defaultMessage: + 'All {fieldCount} {fieldCount, plural, =1 {field mapping} other {field mappings}}', + } + ); + +export const ALL_EMPTY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutEmptyContent', + { + defaultMessage: 'This index does not contain any mappings', + } +); + +export const ALL_EMPTY_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.allCalloutEmptyTitle', + { + defaultMessage: 'No mappings', + } +); + +export const ALL_FIELDS_TABLE_TITLE = (indexName: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.allTab.allFieldsTableTitle', { + values: { indexName }, + defaultMessage: 'All fields - {indexName}', + }); + +export const SUMMARY_MARKDOWN_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.summaryMarkdownTitle', + { + defaultMessage: 'Data quality', + } +); + +export const SUMMARY_MARKDOWN_DESCRIPTION = ({ + ecsFieldReferenceUrl, + ecsReferenceUrl, + indexName, + mappingUrl, + version, +}: { + ecsFieldReferenceUrl: string; + ecsReferenceUrl: string; + indexName: string; + mappingUrl: string; + version: string; +}) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.summaryMarkdownDescription', + { + values: { ecsFieldReferenceUrl, ecsReferenceUrl, indexName, mappingUrl, version }, + defaultMessage: + 'The `{indexName}` index has [mappings]({mappingUrl}) or field values that are different than the [Elastic Common Schema]({ecsReferenceUrl}) (ECS), version `{version}` [definitions]({ecsFieldReferenceUrl}).', + } + ); + +export const COPY_TO_CLIPBOARD = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.copyToClipboardButton', + { + defaultMessage: 'Copy to clipboard', + } +); + +export const CUSTOM_FIELDS_TABLE_TITLE = (indexName: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.customTab.customFieldsTableTitle', + { + values: { indexName }, + defaultMessage: 'Custom fields - {indexName}', + } + ); + +export const CUSTOM_DETECTION_ENGINE_RULES_WORK = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.custonDetectionEngineRulesWorkMessage', + { + defaultMessage: '✅ Custom detection engine rules work', + } +); + +export const ECS_COMPLIANT_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantFieldsLabel', + { + defaultMessage: 'ECS compliant fields', + } +); + +export const ECS_COMPLIANT_CALLOUT = ({ + fieldCount, + version, +}: { + fieldCount: number; + version: string; +}) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantCallout', + { + values: { fieldCount, version }, + defaultMessage: + 'The {fieldCount, plural, =1 {index mapping type and document values for this field comply} other {index mapping types and document values of these fields comply}} with the Elastic Common Schema (ECS), version {version}', + } + ); + +export const ECS_COMPLIANT_CALLOUT_TITLE = (fieldCount: number) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantCalloutTitle', + { + values: { fieldCount }, + defaultMessage: '{fieldCount} ECS compliant {fieldCount, plural, =1 {field} other {fields}}', + } + ); + +export const ECS_COMPLIANT_EMPTY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantEmptyContent', + { + defaultMessage: + 'None of the field mappings in this index comply with the Elastic Common Schema (ECS). The index must (at least) contain an @timestamp date field.', + } +); + +export const ECS_VERSION_MARKDOWN_COMMENT = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsVersionMarkdownComment', + { + defaultMessage: 'Elastic Common Schema (ECS) version', + } +); + +export const INDEX = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.indexMarkdown', + { + defaultMessage: 'Index', + } +); + +export const ECS_COMPLIANT_EMPTY_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantEmptyTitle', + { + defaultMessage: 'No ECS compliant Mappings', + } +); + +export const ECS_COMPLIANT_MAPPINGS_ARE_FULLY_SUPPORTED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsCompliantMappingsAreFullySupportedMessage', + { + defaultMessage: '✅ ECS compliant mappings and field values are fully supported', + } +); + +export const ERROR_LOADING_MAPPINGS_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMappingsTitle', + { + defaultMessage: 'Unable to load index mappings', + } +); + +export const ERROR_LOADING_MAPPINGS_BODY = (error: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMappingsBody', + { + values: { error }, + defaultMessage: 'There was a problem loading mappings: {error}', + } + ); + +export const ERROR_LOADING_UNALLOWED_VALUES_BODY = (error: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingUnallowedValuesBody', + { + values: { error }, + defaultMessage: 'There was a problem loading unallowed values: {error}', + } + ); + +export const ERROR_LOADING_UNALLOWED_VALUES_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingUnallowedValuesTitle', + { + defaultMessage: 'Unable to load unallowed values', + } +); + +export const ERROR_GENERIC_CHECK_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorGenericCheckTitle', + { + defaultMessage: 'An error occurred during the check', + } +); + +export const ECS_COMPLIANT_FIELDS_TABLE_TITLE = (indexName: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.customTab.ecsComplaintFieldsTableTitle', + { + values: { indexName }, + defaultMessage: 'ECS complaint fields - {indexName}', + } + ); + +export const LOADING_MAPPINGS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingMappingsPrompt', + { + defaultMessage: 'Loading mappings', + } +); + +export const LOADING_UNALLOWED_VALUES = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingUnallowedValuesPrompt', + { + defaultMessage: 'Loading unallowed values', + } +); + +export const CHECKING_INDEX = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.checkingIndexPrompt', + { + defaultMessage: 'Checking index', + } +); + +export const MISSING_TIMESTAMP_CALLOUT = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.missingTimestampCallout', + { + defaultMessage: + 'Consider adding an @timestamp (date) field mapping to this index, as required by the Elastic Common Schema (ECS), because:', + } +); + +export const MISSING_TIMESTAMP_CALLOUT_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.missingTimestampCalloutTitle', + { + defaultMessage: 'Missing an @timestamp (date) field mapping for this index', + } +); + +export const CUSTOM_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customFieldsLabel', + { + defaultMessage: 'Custom fields', + } +); + +export const CUSTOM_CALLOUT = ({ fieldCount, version }: { fieldCount: number; version: string }) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customCallout', { + values: { fieldCount, version }, + defaultMessage: + '{fieldCount, plural, =1 {This field is not} other {These fields are not}} defined by the Elastic Common Schema (ECS), version {version}.', + }); + +export const SAME_FAMILY_CALLOUT = ({ + fieldCount, + version, +}: { + fieldCount: number; + version: string; +}) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyCallout', + { + values: { fieldCount, version }, + defaultMessage: + "{fieldCount, plural, =1 {This field is} other {These fields are}} defined by the Elastic Common Schema (ECS), version {version}, but {fieldCount, plural, =1 {its mapping type doesn't} other {their mapping types don't}} exactly match.", + } + ); + +export const CUSTOM_CALLOUT_TITLE = (fieldCount: number) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customCalloutTitle', + { + values: { fieldCount }, + defaultMessage: + '{fieldCount} Custom {fieldCount, plural, =1 {field mapping} other {field mappings}}', + } + ); + +export const SAME_FAMILY_CALLOUT_TITLE = (fieldCount: number) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyCalloutTitle', + { + values: { fieldCount }, + defaultMessage: + '{fieldCount} Same family {fieldCount, plural, =1 {field mapping} other {field mappings}}', + } + ); + +export const CUSTOM_EMPTY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customEmptyContent', + { + defaultMessage: 'All the field mappings in this index are defined by the Elastic Common Schema', + } +); + +export const CUSTOM_EMPTY_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.customEmptyTitle', + { + defaultMessage: 'All field mappings defined by ECS', + } +); + +export const INCOMPATIBLE_CALLOUT = (version: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout', + { + values: { version }, + defaultMessage: + "Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version {version}.", + } + ); + +export const FIELDS_WITH_MAPPINGS_SAME_FAMILY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout.fieldsWithMappingsSameFamilyLabel', + { + defaultMessage: + 'Fields with mappings in the same family have exactly the same search behavior as the type specified by ECS, but may have different space usage or performance characteristics.', + } +); + +export const WHEN_A_FIELD_IS_INCOMPATIBLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCallout.whenAFieldIsIncompatibleLabel', + { + defaultMessage: 'When a field is incompatible:', + } +); + +export const INCOMPATIBLE_CALLOUT_TITLE = (fieldCount: number) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleCalloutTitle', + { + values: { fieldCount }, + defaultMessage: '{fieldCount} incompatible {fieldCount, plural, =1 {field} other {fields}}', + } + ); + +export const INCOMPATIBLE_EMPTY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleEmptyContent', + { + defaultMessage: + 'All of the field mappings and document values in this index are compliant with the Elastic Common Schema (ECS).', + } +); + +export const INCOMPATIBLE_EMPTY_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.incompatibleEmptyTitle', + { + defaultMessage: 'All field mappings and values are ECS compliant', + } +); + +export const DETECTION_ENGINE_RULES_WILL_WORK = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.detectionEngineRulesWillWorkMessage', + { + defaultMessage: '✅ Detection engine rules will work for these fields', + } +); + +export const DETECTION_ENGINE_RULES_MAY_NOT_MATCH = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.detectionEngineRulesWontWorkMessage', + { + defaultMessage: + '❌ Detection engine rules referencing these fields may not match them correctly', + } +); + +export const OTHER_APP_CAPABILITIES_WORK_PROPERLY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.otherAppCapabilitiesWorkProperlyMessage', + { + defaultMessage: '✅ Other app capabilities work properly', + } +); + +export const SAME_FAMILY_EMPTY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyEmptyContent', + { + defaultMessage: + 'All of the field mappings and document values in this index are compliant with the Elastic Common Schema (ECS).', + } +); + +export const SAME_FAMILY_EMPTY_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyEmptyTitle', + { + defaultMessage: 'All field mappings and values are ECS compliant', + } +); + +export const PAGES_DISPLAY_EVENTS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesDisplayEventsMessage', + { + defaultMessage: '✅ Pages display events and fields correctly', + } +); + +export const PAGES_MAY_NOT_DISPLAY_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesMayNotDisplayFieldsMessage', + { + defaultMessage: '🌕 Some pages and features may not display these fields', + } +); + +export const PAGES_MAY_NOT_DISPLAY_EVENTS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.pagesMayNotDisplayEventsMessage', + { + defaultMessage: + '❌ Pages may not display some events or fields due to unexpected field mappings or values', + } +); + +export const PRE_BUILT_DETECTION_ENGINE_RULES_WORK = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.preBuiltDetectionEngineRulesWorkMessage', + { + defaultMessage: '✅ Pre-built detection engine rules work', + } +); + +export const ECS_IS_A_PERMISSIVE_SCHEMA = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.ecsIsAPermissiveSchemaMessage', + { + defaultMessage: + 'ECS is a permissive schema. If your events have additional data that cannot be mapped to ECS, you can simply add them to your events, using custom field names.', + } +); + +export const SAME_FAMILY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sameFamilyTab', + { + defaultMessage: 'Same family', + } +); + +export const SOMETIMES_INDICES_CREATED_BY_OLDER = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.sometimesIndicesCreatedByOlderDescription', + { + defaultMessage: + 'Sometimes, indices created by older integrations will have mappings or values that were, but are no longer compliant.', + } +); + +export const MAPPINGS_THAT_CONFLICT_WITH_ECS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.mappingThatConflictWithEcsMessage', + { + defaultMessage: "❌ Mappings or field values that don't comply with ECS are not supported", + } +); + +export const UNKNOWN = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexProperties.unknownCategoryLabel', + { + defaultMessage: 'Unknown', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.test.ts new file mode 100644 index 0000000000000..68f4414a624a0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.test.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. + */ + +import { getIndexPropertiesContainerId } from './get_index_properties_container_id'; + +describe('getIndexPropertiesContainerId', () => { + const pattern = 'auditbeat-*'; + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + + test('it returns the expected id', () => { + expect(getIndexPropertiesContainerId({ indexName, pattern })).toEqual( + 'index-properties-container-auditbeat-*.ds-packetbeat-8.6.1-2023.02.04-000001' + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.ts new file mode 100644 index 0000000000000..2a7172d58a7b4 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_index_properties_container_id.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. + */ + +export const getIndexPropertiesContainerId = ({ + indexName, + pattern, +}: { + indexName: string; + pattern: string; +}): string => `index-properties-container-${pattern}${indexName}`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.test.ts new file mode 100644 index 0000000000000..63388b15c9495 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.test.ts @@ -0,0 +1,40 @@ +/* + * 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 { getIsInSameFamily } from './get_is_in_same_family'; + +describe('getIsInSameFamily', () => { + test('it returns false when ecsExpectedType is undefined', () => { + expect(getIsInSameFamily({ ecsExpectedType: undefined, type: 'keyword' })).toBe(false); + }); + + const expectedFamilyMembers: { + [key: string]: string[]; + } = { + constant_keyword: ['keyword', 'wildcard'], // `keyword` and `wildcard` in the same family as `constant_keyword` + keyword: ['constant_keyword', 'wildcard'], + match_only_text: ['text'], + text: ['match_only_text'], + wildcard: ['keyword', 'constant_keyword'], + }; + + const ecsExpectedTypes = Object.keys(expectedFamilyMembers); + + ecsExpectedTypes.forEach((ecsExpectedType) => { + const otherMembersOfSameFamily = expectedFamilyMembers[ecsExpectedType]; + + otherMembersOfSameFamily.forEach((type) => + test(`it returns true for ecsExpectedType '${ecsExpectedType}' when given '${type}', a type in the same family`, () => { + expect(getIsInSameFamily({ ecsExpectedType, type })).toBe(true); + }) + ); + + test(`it returns false for ecsExpectedType '${ecsExpectedType}' when given 'date', a type NOT in the same family`, () => { + expect(getIsInSameFamily({ ecsExpectedType, type: 'date' })).toBe(false); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.ts new file mode 100644 index 0000000000000..aa56bc472cbd0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family.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. + */ + +/** + * Per https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#_core_datatypes + * + * ``` + * Field types are grouped by _family_. Types in the same family have exactly + * the same search behavior but may have different space usage or + * performance characteristics. + * + * Currently, there are two type families, `keyword` and `text`. Other type + * families have only a single field type. For example, the `boolean` type + * family consists of one field type: `boolean`. + * ``` + */ +export const fieldTypeFamilies: Record> = { + keyword: new Set(['keyword', 'constant_keyword', 'wildcard']), + text: new Set(['text', 'match_only_text']), +}; + +export const getIsInSameFamily = ({ + ecsExpectedType, + type, +}: { + ecsExpectedType: string | undefined; + type: string; +}): boolean => { + if (ecsExpectedType != null) { + const allFamilies = Object.values(fieldTypeFamilies); + + return allFamilies.reduce( + (acc, family) => (acc !== true ? family.has(ecsExpectedType) && family.has(type) : acc), + false + ); + } else { + return false; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts new file mode 100644 index 0000000000000..e5915404cba02 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.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 { i18n } from '@kbn/i18n'; + +export const CHECK_NOW: string = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexCheckFlyout.checkNowButton', + { + defaultMessage: 'Check now', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx new file mode 100644 index 0000000000000..797b54bc26b91 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.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 React from 'react'; +import { screen, waitFor, render } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { IndexResultBadge } from '.'; + +describe('IndexResultBadge', () => { + it('should render the index result badge', () => { + render(); + + expect(screen.getByTestId('indexResultBadge')).toHaveTextContent('Pass'); + }); + + describe('when incompatible is > 0', () => { + it('should render the index result badge with `Fail` content', () => { + render(); + + expect(screen.getByTestId('indexResultBadge')).toHaveTextContent('Fail'); + }); + }); + + describe('when tooltipText is given', () => { + it('should render the index result badge with the given tooltip text', async () => { + render(); + + userEvent.hover(screen.getByTestId('indexResultBadge')); + + await waitFor(() => expect(screen.getByRole('tooltip')).toHaveTextContent('Tooltip text')); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx new file mode 100644 index 0000000000000..5128130971b09 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx @@ -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 { EuiBadge, EuiToolTip } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { getIndexResultToolTip } from '../utils/get_index_result_tooltip'; +import { getIndexResultBadgeColor } from './utils/get_index_result_badge_color'; +import * as i18n from './translations'; + +const StyledBadge = styled(EuiBadge)` + width: 44px; + text-align: center; + padding-inline: 0; + + .euiBadge__content { + justify-content: center; + } +`; + +export type Props = React.ComponentProps & { + incompatible: number; + tooltipText?: string; +}; + +export const IndexResultBadgeComponent: React.FC = ({ + incompatible, + tooltipText, + ...props +}) => { + return ( + + + {incompatible > 0 ? i18n.FAIL : i18n.PASS} + + + ); +}; + +IndexResultBadgeComponent.displayName = 'IndexCheckResultBadgeComponent'; + +export const IndexResultBadge = React.memo(IndexResultBadgeComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/translations.ts new file mode 100644 index 0000000000000..79dfb1bcaac22 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/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 FAIL = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexResultBadge.fail', + { + defaultMessage: 'Fail', + } +); + +export const PASS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexResultBadge.pass', + { + defaultMessage: 'Pass', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.test.ts new file mode 100644 index 0000000000000..68a5da877da9a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.test.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 { getIndexResultBadgeColor } from './get_index_result_badge_color'; + +describe('getIndexResultBadgeColor', () => { + test('it returns `ghost` when `incompatible` is undefined', () => { + expect(getIndexResultBadgeColor(undefined)).toEqual('ghost'); + }); + + test('it returns `success` when `incompatible` is zero', () => { + expect(getIndexResultBadgeColor(0)).toEqual('#6dcbb1'); + }); + + test('it returns `danger` when `incompatible` is NOT zero', () => { + expect(getIndexResultBadgeColor(1)).toEqual('danger'); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.ts new file mode 100644 index 0000000000000..61f3aaa89a372 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/utils/get_index_result_badge_color.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const getIndexResultBadgeColor = (incompatible: number | undefined): string => { + if (incompatible == null) { + return 'ghost'; + } else if (incompatible === 0) { + return '#6dcbb1'; + } else { + return 'danger'; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/loading_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/loading_empty_prompt/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx new file mode 100644 index 0000000000000..db4d95ba48b4f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx @@ -0,0 +1,58 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; + +import type { IlmExplainPhaseCounts } from '../../../../types'; +import { PatternLabel } from './pattern_label'; +import { StatsRollup } from '../../../../stats_rollup'; + +interface Props { + ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; + incompatible: number | undefined; + indices: number | undefined; + indicesChecked: number | undefined; + pattern: string; + patternDocsCount: number; + patternSizeInBytes: number | undefined; +} + +const PatternSummaryComponent: React.FC = ({ + ilmExplainPhaseCounts, + incompatible, + indices, + indicesChecked, + pattern, + patternDocsCount, + patternSizeInBytes, +}) => ( + + + + + + + + + +); + +export const PatternSummary = React.memo(PatternSummaryComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx new file mode 100644 index 0000000000000..5de02814fd5cd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx @@ -0,0 +1,86 @@ +/* + * 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 { + IlmExplainLifecycleLifecycleExplain, + IlmExplainLifecycleLifecycleExplainManaged, + IlmExplainLifecycleLifecycleExplainUnmanaged, +} from '@elastic/elasticsearch/lib/api/types'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../../../mock/test_providers/test_providers'; +import { IlmPhaseCounts } from '.'; +import { getIlmExplainPhaseCounts } from '../../../utils/ilm_explain'; + +const hot: IlmExplainLifecycleLifecycleExplainManaged = { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '3.98d', + lifecycle_date_millis: 1675536751379, + age: '3.98d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, +}; +const warm = { + ...hot, + phase: 'warm', +}; +const cold = { + ...hot, + phase: 'cold', +}; +const frozen = { + ...hot, + phase: 'frozen', +}; + +const managed: Record = { + hot, + warm, + cold, + frozen, +}; + +const unmanaged: IlmExplainLifecycleLifecycleExplainUnmanaged = { + index: 'foo', + managed: false, +}; + +const ilmExplain: Record = { + ...managed, + [unmanaged.index]: unmanaged, +}; + +const ilmExplainPhaseCounts = getIlmExplainPhaseCounts(ilmExplain); + +const pattern = 'packetbeat-*'; + +describe('IlmPhaseCounts', () => { + test('it renders the expected counts', () => { + render( + + + + ); + + expect(screen.getByTestId('ilmPhaseCounts')).toHaveTextContent( + 'hot (1)unmanaged (1)warm (1)cold (1)frozen (1)' + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx new file mode 100644 index 0000000000000..c1d1ead5e7891 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import type { IlmExplainPhaseCounts, IlmPhase } from '../../../../../../types'; +import { getPatternIlmPhaseDescription } from './utils/get_pattern_ilm_phase_description'; + +const PhaseCountsFlexGroup = styled(EuiFlexGroup)` + display: inline-flex; +`; + +export const phases: IlmPhase[] = ['hot', 'unmanaged', 'warm', 'cold', 'frozen']; + +interface Props { + ilmExplainPhaseCounts: IlmExplainPhaseCounts; + pattern: string; +} + +const IlmPhaseCountsComponent: React.FC = ({ ilmExplainPhaseCounts, pattern }) => ( + + {phases.map((phase) => + ilmExplainPhaseCounts[phase] != null && ilmExplainPhaseCounts[phase] > 0 ? ( + + + {`${phase} (${ilmExplainPhaseCounts[phase]})`} + + + ) : null + )} + +); + +IlmPhaseCountsComponent.displayName = 'IlmPhaseCountsComponent'; + +export const IlmPhaseCounts = React.memo(IlmPhaseCountsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/translations.ts new file mode 100644 index 0000000000000..d6a87384c9ae4 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/translations.ts @@ -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 { i18n } from '@kbn/i18n'; + +export const UNMANAGED_PATTERN_TOOLTIP = ({ + indices, + pattern, +}: { + indices: number; + pattern: string; +}) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.unmanagedPatternTooltip', { + values: { indices, pattern }, + defaultMessage: `{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} unmanaged by Index Lifecycle Management (ILM)`, + }); + +export const WARM_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.warmPatternTooltip', { + values: { indices, pattern }, + defaultMessage: + '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} warm. Warm indices are no longer being updated but are still being queried.', + }); + +export const HOT_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.hotPatternTooltip', { + values: { indices, pattern }, + defaultMessage: + '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} hot. Hot indices are actively being updated and queried.', + }); + +export const FROZEN_PATTERN_TOOLTIP = ({ + indices, + pattern, +}: { + indices: number; + pattern: string; +}) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.frozenPatternTooltip', { + values: { indices, pattern }, + defaultMessage: `{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.`, + }); + +export const COLD_PATTERN_TOOLTIP = ({ indices, pattern }: { indices: number; pattern: string }) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.coldPatternTooltip', { + values: { indices, pattern }, + defaultMessage: + '{indices} {indices, plural, =1 {index} other {indices}} matching the {pattern} pattern {indices, plural, =1 {is} other {are}} cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', + }); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.test.ts new file mode 100644 index 0000000000000..3faff162dbffa --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.test.ts @@ -0,0 +1,106 @@ +/* + * 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 { getPatternIlmPhaseDescription } from './get_pattern_ilm_phase_description'; + +describe('getPatternIlmPhaseDescription', () => { + const phases: Array<{ + expected: string; + indices: number; + pattern: string; + phase: string; + }> = [ + { + expected: + '1 index matching the .alerts-security.alerts-default pattern is hot. Hot indices are actively being updated and queried.', + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'hot', + }, + { + expected: + '2 indices matching the .alerts-security.alerts-default pattern are hot. Hot indices are actively being updated and queried.', + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'hot', + }, + { + expected: + '1 index matching the .alerts-security.alerts-default pattern is warm. Warm indices are no longer being updated but are still being queried.', + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'warm', + }, + { + expected: + '2 indices matching the .alerts-security.alerts-default pattern are warm. Warm indices are no longer being updated but are still being queried.', + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'warm', + }, + { + expected: + '1 index matching the .alerts-security.alerts-default pattern is cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'cold', + }, + { + expected: + '2 indices matching the .alerts-security.alerts-default pattern are cold. Cold indices are no longer being updated and are queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'cold', + }, + { + expected: + "1 index matching the .alerts-security.alerts-default pattern is frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.", + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'frozen', + }, + { + expected: + "2 indices matching the .alerts-security.alerts-default pattern are frozen. Frozen indices are no longer being updated and are queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.", + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'frozen', + }, + { + expected: + '1 index matching the .alerts-security.alerts-default pattern is unmanaged by Index Lifecycle Management (ILM)', + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'unmanaged', + }, + { + expected: + '2 indices matching the .alerts-security.alerts-default pattern are unmanaged by Index Lifecycle Management (ILM)', + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'unmanaged', + }, + { + expected: '', + indices: 1, + pattern: '.alerts-security.alerts-default', + phase: 'some-other-phase', + }, + { + expected: '', + indices: 2, + pattern: '.alerts-security.alerts-default', + phase: 'some-other-phase', + }, + ]; + + phases.forEach(({ expected, indices, pattern, phase }) => { + test(`it returns the expected description when indices is ${indices}, pattern is ${pattern}, and phase is ${phase}`, () => { + expect(getPatternIlmPhaseDescription({ indices, pattern, phase })).toBe(expected); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.ts new file mode 100644 index 0000000000000..20adb0c0c5bf9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/utils/get_pattern_ilm_phase_description.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as i18n from '../translations'; + +export const getPatternIlmPhaseDescription = ({ + indices, + pattern, + phase, +}: { + indices: number; + pattern: string; + phase: string; +}): string => { + switch (phase) { + case 'hot': + return i18n.HOT_PATTERN_TOOLTIP({ indices, pattern }); + case 'warm': + return i18n.WARM_PATTERN_TOOLTIP({ indices, pattern }); + case 'cold': + return i18n.COLD_PATTERN_TOOLTIP({ indices, pattern }); + case 'frozen': + return i18n.FROZEN_PATTERN_TOOLTIP({ indices, pattern }); + case 'unmanaged': + return i18n.UNMANAGED_PATTERN_TOOLTIP({ indices, pattern }); + default: + return ''; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx new file mode 100644 index 0000000000000..f88c9b8f977b0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx @@ -0,0 +1,75 @@ +/* + * 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 { EuiTitle, EuiToolTip, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; + +import type { IlmExplainPhaseCounts } from '../../../../../types'; +import { IndexResultBadge } from '../../index_result_badge'; +import * as i18n from '../translations'; +import { IlmPhaseCounts } from './ilm_phase_counts'; +import { getPatternResultTooltip } from './utils/get_pattern_result_tooltip'; +import { showResult } from './utils/show_result'; + +interface Props { + incompatible: number | undefined; + indices: number | undefined; + indicesChecked: number | undefined; + ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; + pattern: string; +} + +const PatternLabelComponent: React.FC = ({ + ilmExplainPhaseCounts, + incompatible, + indices, + indicesChecked, + pattern, +}) => { + // this is a workaround for type guard limitation + // TS does not type narrow value passed to the type guard function + // if that value is proxied via another key like for example {incompatible: *incompatible*} + // so we need a reference object to pass it to the type guard + // and then check the keys of that object (resultOpts) for type guarded result + // to be properly type narrowed instead + const resultOpts = { + incompatible, + indices, + indicesChecked, + }; + + return ( + + {showResult(resultOpts) && ( + + + + )} + + + + +

{pattern}

+
+
+
+ + {ilmExplainPhaseCounts && ( + + + + )} +
+ ); +}; + +PatternLabelComponent.displayName = 'PatternLabelComponent'; + +export const PatternLabel = React.memo(PatternLabelComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts new file mode 100644 index 0000000000000..c53602120a9d8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts @@ -0,0 +1,30 @@ +/* + * 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 ALL_PASSED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.allPassedTooltip', + { + defaultMessage: 'All indices matching this pattern passed the data quality checks', + } +); + +export const SOME_FAILED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.someFailedTooltip', + { + defaultMessage: 'At least one index matching this pattern failed a data quality check', + } +); + +export const SOME_UNCHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternLabel.someUncheckedTooltip', + { + defaultMessage: + 'At least one index matching this pattern has not been checked for data quality', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.test.ts new file mode 100644 index 0000000000000..525eaab098ba6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.test.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 { getPatternResultTooltip } from './get_pattern_result_tooltip'; +import { ALL_PASSED, SOME_FAILED, SOME_UNCHECKED } from '../translations'; + +describe('helpers', () => { + describe('getPatternResultTooltip', () => { + test('it returns the expected tool tip when `incompatible` is undefined', () => { + expect(getPatternResultTooltip(undefined)).toEqual(SOME_UNCHECKED); + }); + + test('it returns the expected tool tip when `incompatible` is zero', () => { + expect(getPatternResultTooltip(0)).toEqual(ALL_PASSED); + }); + + test('it returns the expected tool tip when `incompatible` is non-zero', () => { + expect(getPatternResultTooltip(1)).toEqual(SOME_FAILED); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.ts new file mode 100644 index 0000000000000..2bb51c19ced31 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.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. + */ + +import * as i18n from '../translations'; + +export const getPatternResultTooltip = (incompatible: number | undefined): string => { + if (incompatible == null) { + return i18n.SOME_UNCHECKED; + } else if (incompatible === 0) { + return i18n.ALL_PASSED; + } else { + return i18n.SOME_FAILED; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.test.ts new file mode 100644 index 0000000000000..4957f8c65c2da --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.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 { showResult } from './show_result'; + +describe('showResult', () => { + test('it returns true when `incompatible` is defined, and `indicesChecked` equals `indices`', () => { + const incompatible = 0; // none of the indices checked had incompatible fields + const indicesChecked = 2; // all indices were checked + const indices = 2; // total indices + + expect( + showResult({ + incompatible, + indices, + indicesChecked, + }) + ).toBe(true); + }); + + test('it returns false when `incompatible` is defined, and `indices` does NOT equal `indicesChecked`', () => { + const incompatible = 0; // the one index checked (so far) didn't have any incompatible fields + const indicesChecked = 1; // only one index has been checked so far + const indices = 2; // total indices + + expect( + showResult({ + incompatible, + indices, + indicesChecked, + }) + ).toBe(false); + }); + + test('it returns false when `incompatible` is undefined', () => { + const incompatible = undefined; // a state of undefined indicates there are no results + const indicesChecked = 1; // all indices were checked + const indices = 1; // total indices + + expect( + showResult({ + incompatible, + indices, + indicesChecked, + }) + ).toBe(false); + }); + + test('it returns false when `indices` is undefined', () => { + const incompatible = 0; // none of the indices checked had incompatible fields + const indicesChecked = 2; // all indices were checked + const indices = undefined; // the total number of indices is unknown + + expect( + showResult({ + incompatible, + indices, + indicesChecked, + }) + ).toBe(false); + }); + + test('it returns false when `indicesChecked` is undefined', () => { + const incompatible = 0; // none of the indices checked had incompatible fields + const indicesChecked = undefined; // no indices were checked + const indices = 2; // total indices + + expect( + showResult({ + incompatible, + indices, + indicesChecked, + }) + ).toBe(false); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.ts new file mode 100644 index 0000000000000..df7be212f4bc0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.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. + */ + +interface ShowResultProps { + incompatible: T; + indices: T; + indicesChecked: T; +} + +export const showResult = ( + opts: ShowResultProps +): opts is ShowResultProps> => + opts.incompatible != null && + opts.indices != null && + opts.indicesChecked != null && + opts.indices === opts.indicesChecked; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts new file mode 100644 index 0000000000000..2fdc82300d00d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const DOCS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.docsLabel', + { + defaultMessage: 'Docs', + } +); + +export const INDICES = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.indicesLabel', + { + defaultMessage: 'Indices', + } +); + +export const PATTERN_OR_INDEX_TOOLTIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.patternSummary.patternOrIndexTooltip', + { + defaultMessage: 'Index name or pattern', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx new file mode 100644 index 0000000000000..d2b2e7d1b4934 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiAccordion } from '@elastic/eui'; +import styled from 'styled-components'; + +export const PatternAccordion = styled(EuiAccordion)` + .euiAccordion__triggerWrapper { + padding: 14px ${({ theme }) => theme.eui.euiSize}; + border: 1px solid ${({ theme }) => theme.eui.euiBorderColor}; + border-radius: ${({ theme }) => theme.eui.euiBorderRadius}; + } + + .euiAccordion__button:is(:hover, :focus) { + text-decoration: none; + } + + .euiAccordion__buttonContent { + flex-grow: 1; + } +`; + +export const PatternAccordionChildren = styled.div` + padding: ${({ theme }) => theme.eui.euiSize}; + padding-bottom: 0; + border: 1px solid ${({ theme }) => theme.eui.euiBorderColor}; + border-radius: 0 0 ${({ theme }) => `${theme.eui.euiBorderRadius} ${theme.eui.euiBorderRadius}`}; + border-top: none; + width: calc(100% - ${({ theme }) => theme.eui.euiSizeS} * 2); + margin: auto; +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx new file mode 100644 index 0000000000000..223eaf29dd469 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx @@ -0,0 +1,112 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_STAT } from '../../../../constants'; +import { getSummaryTableColumns } from './utils/columns'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { mockStats } from '../../../../mock/stats/mock_stats'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../../mock/test_providers/test_providers'; +import { SortConfig } from '../../../../types'; +import { Props, SummaryTable } from '.'; +import { getSummaryTableItems } from '../../../../utils/get_summary_table_items'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const indexNames = [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-empty-index-1', + 'auditbeat-custom-index-1', + '.internal.alerts-security.alerts-default-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + '.ds-packetbeat-8.6.1-2023.02.04-000001', +]; + +const defaultSort: SortConfig = { + sort: { + direction: 'desc', + field: 'docsCount', + }, +}; + +const pattern = 'auditbeat-*'; + +const items = getSummaryTableItems({ + ilmExplain: mockIlmExplain, + indexNames: indexNames ?? [], + isILMAvailable: true, + pattern, + patternDocsCount: auditbeatWithAllResults?.docsCount ?? 0, + results: auditbeatWithAllResults?.results, + sortByColumn: defaultSort.sort.field, + sortByDirection: defaultSort.sort.direction, + stats: mockStats, +}); + +const defaultProps: Props = { + getTableColumns: getSummaryTableColumns, + items, + pageIndex: 0, + pageSize: 10, + pattern, + setPageIndex: jest.fn(), + setPageSize: jest.fn(), + setSorting: jest.fn(), + sorting: defaultSort, + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: Object.fromEntries( + indexNames.map((indexName) => [ + indexName, + { + isChecking: false, + isLoadingMappings: false, + isLoadingUnallowedValues: false, + indexes: null, + mappingsProperties: null, + unallowedValues: null, + genericError: null, + mappingsError: null, + unallowedValuesError: null, + partitionedFieldMetadata: null, + isCheckComplete: false, + searchResults: null, + }, + ]) + ), +}; + +describe('SummaryTable', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders the summary table', () => { + expect(screen.getByTestId('summaryTable')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx new file mode 100644 index 0000000000000..bc4e572e892fa --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx @@ -0,0 +1,129 @@ +/* + * 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 { CriteriaWithPagination, EuiBasicTableColumn, Pagination } from '@elastic/eui'; +import { EuiInMemoryTable } from '@elastic/eui'; +import React, { useCallback, useMemo } from 'react'; + +import { defaultSort } from '../../../../constants'; +import { IndexSummaryTableItem, SortConfig } from '../../../../types'; +import { useDataQualityContext } from '../../../../data_quality_context'; +import { UseIndicesCheckCheckState } from '../../../../hooks/use_indices_check/types'; +import { MIN_PAGE_SIZE } from '../constants'; +import { getShowPagination } from './utils/get_show_pagination'; + +export interface Props { + getTableColumns: ({ + formatBytes, + formatNumber, + checkState, + isILMAvailable, + pattern, + onExpandAction, + onCheckNowAction, + }: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + checkState: UseIndicesCheckCheckState; + isILMAvailable: boolean; + pattern: string; + onExpandAction: (indexName: string) => void; + onCheckNowAction: (indexName: string) => void; + }) => Array>; + items: IndexSummaryTableItem[]; + pageIndex: number; + pageSize: number; + pattern: string; + setPageIndex: (pageIndex: number) => void; + setPageSize: (pageSize: number) => void; + setSorting: (sortConfig: SortConfig) => void; + sorting: SortConfig; + onExpandAction: (indexName: string) => void; + onCheckNowAction: (indexName: string) => void; + checkState: UseIndicesCheckCheckState; +} + +const SummaryTableComponent: React.FC = ({ + getTableColumns, + items, + pageIndex, + pageSize, + pattern, + setPageIndex, + setPageSize, + setSorting, + sorting, + onExpandAction, + onCheckNowAction, + checkState, +}) => { + const { isILMAvailable, formatBytes, formatNumber } = useDataQualityContext(); + const columns = useMemo( + () => + getTableColumns({ + formatBytes, + formatNumber, + checkState, + isILMAvailable, + pattern, + onExpandAction, + onCheckNowAction, + }), + [ + formatBytes, + formatNumber, + getTableColumns, + checkState, + isILMAvailable, + onCheckNowAction, + onExpandAction, + pattern, + ] + ); + const getItemId = useCallback((item: IndexSummaryTableItem) => item.indexName, []); + + const onChange = useCallback( + ({ page, sort }: CriteriaWithPagination) => { + setSorting({ sort: sort ?? defaultSort.sort }); + setPageIndex(page.index); + setPageSize(page.size); + }, + [setPageIndex, setPageSize, setSorting] + ); + + const pagination: Pagination = useMemo( + () => ({ + pageIndex, + pageSize, + showPerPageOptions: true, + totalItemCount: items.length, + }), + [items, pageIndex, pageSize] + ); + + return ( + + ); +}; + +SummaryTableComponent.displayName = 'SummaryTableComponent'; + +export const SummaryTable = React.memo(SummaryTableComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts new file mode 100644 index 0000000000000..c3302d7be4b57 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const COLLAPSE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.collapseLabel', + { + defaultMessage: 'Collapse', + } +); + +export const VIEW_CHECK_DETAILS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.viewCheckDetailsLabel', + { + defaultMessage: 'View check details', + } +); + +export const EXPAND_ROWS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.expandRowsColumn', + { + defaultMessage: 'Expand rows', + } +); + +export const INDEX_NAME_LABEL = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indexesNameLabel', + { + defaultMessage: 'Index name', + } +); + +export const INDEX_TOOL_TIP = (pattern: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.summaryTable.indexToolTip', { + values: { pattern }, + defaultMessage: 'This index matches the pattern or index name: {pattern}', + }); + +export const LAST_CHECK = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.lastCheckColumn', + { + defaultMessage: 'Last check', + } +); + +export const ACTIONS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.actionsColumn', + { + defaultMessage: 'Actions', + } +); + +export const CHECK_INDEX = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.summaryTable.checkIndexButton', + { + defaultMessage: 'Check index', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.test.tsx new file mode 100644 index 0000000000000..930b2a6bfbf96 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.test.tsx @@ -0,0 +1,604 @@ +/* + * 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 { + CustomItemAction, + EuiTableActionsColumnType, + EuiTableFieldDataColumnType, +} from '@elastic/eui'; +import numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { omit } from 'lodash/fp'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; +import { EMPTY_STAT } from '../../../../../constants'; +import { + getIncompatibleStatColor, + getSummaryTableColumns, + getSummaryTableILMPhaseColumn, + getSummaryTableSizeInBytesColumn, +} from './columns'; +import { CHECK_INDEX, VIEW_CHECK_DETAILS } from '../translations'; +import { IndexSummaryTableItem } from '../../../../../types'; +import { getCheckState } from '../../../../../stub/get_check_state'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +describe('helpers', () => { + describe('getSummaryTableColumns', () => { + const indexName = '.ds-auditbeat-8.6.1-2023.02.07-000001'; + const isILMAvailable = true; + + const indexSummaryTableItem: IndexSummaryTableItem = { + indexName, + docsCount: 2796, + incompatible: undefined, + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 57410, + sizeInBytes: 103344068, + checkedAt: Date.now(), + }; + + const hasIncompatible: IndexSummaryTableItem = { + ...indexSummaryTableItem, + incompatible: 1, // <-- one incompatible field + }; + + test('it returns the expected column configuration', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }).map((x) => omit('render', x)); + + expect(columns).toEqual([ + { + name: 'Actions', + align: 'center', + width: '65px', + actions: [ + { + name: 'View check details', + render: expect.any(Function), + }, + { + name: 'Check index', + render: expect.any(Function), + }, + ], + }, + { + field: 'incompatible', + name: 'Result', + sortable: true, + truncateText: false, + width: '65px', + }, + { field: 'indexName', name: 'Index', sortable: true, truncateText: false }, + { field: 'docsCount', name: 'Docs', sortable: true, truncateText: false, width: '150px' }, + { + field: 'incompatible', + name: 'Incompatible fields', + sortable: true, + truncateText: false, + width: '140px', + }, + { + field: 'ilmPhase', + name: 'ILM Phase', + sortable: true, + truncateText: false, + width: '92px', + }, + { field: 'sizeInBytes', name: 'Size', sortable: true, truncateText: false, width: '67px' }, + { + field: 'checkedAt', + name: 'Last check', + sortable: true, + truncateText: false, + width: '120px', + }, + ]); + }); + + describe('action columns render()', () => { + test('it renders check index button', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const checkNowRender = ( + (columns[0] as EuiTableActionsColumnType) + .actions[1] as CustomItemAction + ).render; + + render( + + {checkNowRender != null && checkNowRender(indexSummaryTableItem, true)} + + ); + + expect(screen.getByLabelText(CHECK_INDEX)).toBeInTheDocument(); + }); + + test('it invokes the `onCheckNowAction` with the index name when the check index button is clicked', () => { + const onCheckNowAction = jest.fn(); + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction, + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const checkNowRender = ( + (columns[0] as EuiTableActionsColumnType) + .actions[1] as CustomItemAction + ).render; + + render( + + {checkNowRender != null && checkNowRender(indexSummaryTableItem, true)} + + ); + + const button = screen.getByLabelText(CHECK_INDEX); + userEvent.click(button); + + expect(onCheckNowAction).toBeCalledWith(indexSummaryTableItem.indexName); + }); + + test('it renders disabled check index with loading indicator when check state is loading', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName, { isChecking: true }), + }); + + const checkNowRender = ( + (columns[0] as EuiTableActionsColumnType) + .actions[1] as CustomItemAction + ).render; + + render( + + {checkNowRender != null && checkNowRender(indexSummaryTableItem, true)} + + ); + + expect(screen.getByLabelText(CHECK_INDEX)).toBeDisabled(); + expect(screen.getByLabelText('Loading')).toBeInTheDocument(); + }); + + test('it invokes the `onExpandAction` with the index name when the view check details button is clicked', () => { + const onExpandAction = jest.fn(); + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction, + checkState: getCheckState(indexName), + }); + + const expandActionRender = ( + (columns[0] as EuiTableActionsColumnType) + .actions[0] as CustomItemAction + ).render; + + render( + + {expandActionRender != null && expandActionRender(indexSummaryTableItem, true)} + + ); + + const button = screen.getByLabelText(VIEW_CHECK_DETAILS); + userEvent.click(button); + + expect(onExpandAction).toBeCalledWith(indexSummaryTableItem.indexName); + }); + }); + + describe('incompatible render()', () => { + test('it renders a placeholder when incompatible is undefined', () => { + const incompatibleIsUndefined: IndexSummaryTableItem = { + ...indexSummaryTableItem, + incompatible: undefined, // <-- + }; + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const incompatibleRender = ( + columns[1] as EuiTableFieldDataColumnType + ).render; + + render( + + {incompatibleRender != null && + incompatibleRender(incompatibleIsUndefined, incompatibleIsUndefined)} + + ); + + expect(screen.getByTestId('incompatiblePlaceholder')).toHaveTextContent(EMPTY_STAT); + }); + + test('it renders Fail badge when there are incompatible fields', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const incompatibleRender = ( + columns[1] as EuiTableFieldDataColumnType + ).render; + + render( + + {incompatibleRender != null && incompatibleRender(hasIncompatible, hasIncompatible)} + + ); + + expect(screen.getByText('Fail')).toBeInTheDocument(); + }); + + test('it renders the expected icon when there are zero fields', () => { + const zeroIncompatible: IndexSummaryTableItem = { + ...indexSummaryTableItem, + incompatible: 0, // <-- one incompatible field + }; + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const incompatibleRender = ( + columns[1] as EuiTableFieldDataColumnType + ).render; + + render( + + {incompatibleRender != null && incompatibleRender(zeroIncompatible, zeroIncompatible)} + + ); + + expect(screen.getByText('Pass')).toBeInTheDocument(); + }); + }); + + describe('indexName render()', () => { + test('it renders the index name', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const indexNameRender = (columns[2] as EuiTableFieldDataColumnType) + .render; + + render( + + {indexNameRender != null && + indexNameRender(indexSummaryTableItem, indexSummaryTableItem)} + + ); + + expect(screen.getByTestId('indexName')).toHaveTextContent(indexName); + }); + }); + + describe('docsCount render()', () => { + beforeEach(() => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const docsCountRender = (columns[3] as EuiTableFieldDataColumnType) + .render; + + render( + + {docsCountRender != null && docsCountRender(hasIncompatible, hasIncompatible)} + + ); + }); + + test('it renders the expected value', () => { + expect(screen.getByTestId('docsCount')).toHaveAttribute( + 'value', + String(hasIncompatible.docsCount) + ); + }); + + test('it renders the expected max (progress)', () => { + expect(screen.getByTestId('docsCount')).toHaveAttribute( + 'max', + String(hasIncompatible.patternDocsCount) + ); + }); + }); + + describe('incompatible column render()', () => { + test('it renders the expected value', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const incompatibleRender = ( + columns[4] as EuiTableFieldDataColumnType + ).render; + + render( + + {incompatibleRender != null && incompatibleRender(hasIncompatible, hasIncompatible)} + + ); + + expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('1'); + }); + + test('it renders the expected placeholder when incompatible is undefined', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const incompatibleRender = ( + columns[4] as EuiTableFieldDataColumnType + ).render; + + render( + + {incompatibleRender != null && + incompatibleRender(indexSummaryTableItem, indexSummaryTableItem)} + + ); + + expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('--'); + }); + }); + + describe('getSummaryTableILMPhaseColumn', () => { + test('it returns the expected column configuration when `isILMAvailable` is true', () => { + const column = getSummaryTableILMPhaseColumn(isILMAvailable); + expect(column.length).toEqual(1); + expect(column[0].name).toEqual('ILM Phase'); + }); + + test('it returns an emptry array when `isILMAvailable` is false', () => { + const column = getSummaryTableILMPhaseColumn(false); + expect(column.length).toEqual(0); + }); + }); + + describe('getSummaryTableSizeInBytesColumn', () => { + test('it returns the expected column configuration when `isILMAvailable` is true', () => { + const column = getSummaryTableSizeInBytesColumn({ + isILMAvailable: true, + formatBytes: jest.fn(), + }); + expect(column.length).toEqual(1); + expect(column[0].name).toEqual('Size'); + }); + + test('it returns an emptry array when `isILMAvailable` is false', () => { + const column = getSummaryTableSizeInBytesColumn({ + isILMAvailable: false, + formatBytes: jest.fn(), + }); + expect(column.length).toEqual(0); + }); + }); + + describe('ilmPhase column render()', () => { + test('it renders the expected ilmPhase badge content', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) + .render; + + render( + + {ilmPhaseRender != null && ilmPhaseRender(hasIncompatible, hasIncompatible)} + + ); + + expect(screen.getByTestId('ilmPhase')).toHaveTextContent('hot'); + }); + + test('it does NOT render the ilmPhase badge when `ilmPhase` is undefined', () => { + const ilmPhaseIsUndefined: IndexSummaryTableItem = { + ...indexSummaryTableItem, + ilmPhase: undefined, // <-- + }; + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) + .render; + + render( + + {ilmPhaseRender != null && ilmPhaseRender(ilmPhaseIsUndefined, ilmPhaseIsUndefined)} + + ); + + expect(screen.queryByTestId('ilmPhase')).not.toBeInTheDocument(); + }); + + test('it does NOT render the ilmPhase badge when `isILMAvailable` is false', () => { + const ilmPhaseIsUndefined: IndexSummaryTableItem = { + ...indexSummaryTableItem, + }; + + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable: false, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + const ilmPhaseRender = (columns[5] as EuiTableFieldDataColumnType) + .render; + + render( + + {ilmPhaseRender != null && ilmPhaseRender(ilmPhaseIsUndefined, ilmPhaseIsUndefined)} + + ); + + expect(screen.queryByTestId('ilmPhase')).not.toBeInTheDocument(); + }); + }); + + describe('sizeInBytes render()', () => { + test('it renders the expected formatted bytes', () => { + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + + const sizeInBytesRender = (columns[6] as EuiTableFieldDataColumnType) + .render; + + render( + + {sizeInBytesRender != null && + sizeInBytesRender(indexSummaryTableItem, indexSummaryTableItem)} + + ); + + expect(screen.getByTestId('sizeInBytes')).toHaveTextContent('98.6MB'); + }); + + test('it should not render sizeInBytes if it is not a number', () => { + const testIndexSummaryTableItem = { ...indexSummaryTableItem, sizeInBytes: undefined }; + const columns = getSummaryTableColumns({ + formatBytes, + formatNumber, + isILMAvailable, + pattern: 'auditbeat-*', + onCheckNowAction: jest.fn(), + onExpandAction: jest.fn(), + checkState: getCheckState(indexName), + }); + + const sizeInBytesRender = (columns[6] as EuiTableFieldDataColumnType) + .render; + + render( + + {sizeInBytesRender != null && + sizeInBytesRender(testIndexSummaryTableItem, testIndexSummaryTableItem)} + + ); + + expect(screen.queryByTestId('sizeInBytes')).toBeNull(); + }); + }); + }); + + describe('getIncompatibleStatColor', () => { + test('it returns the expected color when incompatible is greater than zero', () => { + const incompatible = 123; + + expect(getIncompatibleStatColor(incompatible)).toBe('#bd271e'); + }); + + test('it returns undefined when incompatible is zero', () => { + const incompatible = 0; + + expect(getIncompatibleStatColor(incompatible)).toBeUndefined(); + }); + + test('it returns undefined when incompatible is undefined', () => { + const incompatible = undefined; + + expect(getIncompatibleStatColor(incompatible)).toBeUndefined(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx new file mode 100644 index 0000000000000..8cdac8e35d1b3 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx @@ -0,0 +1,231 @@ +/* + * 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 { + EuiBasicTableColumn, + EuiText, + EuiProgress, + EuiToolTip, + CENTER_ALIGNMENT, + EuiButtonIcon, +} from '@elastic/eui'; +import React from 'react'; +import moment from 'moment'; +import styled from 'styled-components'; + +import { euiThemeVars } from '@kbn/ui-theme'; +import { getDocsCountPercent } from '../../../../../utils/stats'; +import { IndexSummaryTableItem } from '../../../../../types'; +import { EMPTY_STAT } from '../../../../../constants'; +import { getIlmPhaseDescription } from '../../../../../utils/get_ilm_phase_description'; +import { INCOMPATIBLE_INDEX_TOOL_TIP } from '../../../../../stat_label/translations'; +import { + DOCS, + ILM_PHASE_CAPITALIZED, + INCOMPATIBLE_FIELDS, + INDEX, + INDEX_SIZE_TOOLTIP, + RESULT, + SIZE, +} from '../../../../../translations'; +import * as i18n from '../translations'; +import { UseIndicesCheckCheckState } from '../../../../../hooks/use_indices_check/types'; +import { IndexResultBadge } from '../../index_result_badge'; +import { Stat } from '../../../../../stat'; +import { getIndexResultToolTip } from '../../utils/get_index_result_tooltip'; + +const ProgressContainer = styled.div` + width: 150px; +`; + +export const getSummaryTableILMPhaseColumn = ( + isILMAvailable: boolean +): Array> => + isILMAvailable + ? [ + { + field: 'ilmPhase', + name: ILM_PHASE_CAPITALIZED, + render: (_, { ilmPhase }) => + ilmPhase != null ? ( + + ) : null, + sortable: true, + truncateText: false, + width: '92px', + }, + ] + : []; + +export const getSummaryTableSizeInBytesColumn = ({ + isILMAvailable, + formatBytes, +}: { + isILMAvailable: boolean; + formatBytes: (value: number | undefined) => string; +}): Array> => + isILMAvailable + ? [ + { + field: 'sizeInBytes', + name: SIZE, + render: (_, { sizeInBytes }) => + Number.isInteger(sizeInBytes) ? ( + + {formatBytes(sizeInBytes)} + + ) : null, + sortable: true, + truncateText: false, + width: '67px', + }, + ] + : []; + +export const getIncompatibleStatColor = (incompatible: number | undefined): string | undefined => + incompatible != null && incompatible > 0 ? euiThemeVars.euiColorDanger : undefined; + +export const getSummaryTableColumns = ({ + formatBytes, + formatNumber, + isILMAvailable, + pattern, + onExpandAction, + onCheckNowAction, + checkState, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + isILMAvailable: boolean; + pattern: string; + onExpandAction: (indexName: string) => void; + onCheckNowAction: (indexName: string) => void; + checkState: UseIndicesCheckCheckState; +}): Array> => [ + { + name: i18n.ACTIONS, + align: CENTER_ALIGNMENT, + width: '65px', + actions: [ + { + name: i18n.VIEW_CHECK_DETAILS, + render: (item) => { + return ( + + onExpandAction(item.indexName)} + /> + + ); + }, + }, + { + name: i18n.CHECK_INDEX, + render: (item) => { + const isChecking = checkState[item.indexName]?.isChecking ?? false; + return ( + + onCheckNowAction(item.indexName)} + /> + + ); + }, + }, + ], + }, + { + field: 'incompatible', + name: RESULT, + render: (_, { incompatible }) => + incompatible != null ? ( + + ) : ( + + {EMPTY_STAT} + + ), + sortable: true, + truncateText: false, + width: '65px', + }, + { + field: 'indexName', + name: INDEX, + render: (_, { indexName }) => ( + + + {indexName} + + + ), + sortable: true, + truncateText: false, + }, + { + field: 'docsCount', + name: DOCS, + render: (_, { docsCount, patternDocsCount }) => ( + + + + ), + sortable: true, + truncateText: false, + width: '150px', + }, + { + field: 'incompatible', + name: INCOMPATIBLE_FIELDS, + render: (_, { incompatible }) => ( + + + {incompatible ?? EMPTY_STAT} + + + ), + sortable: true, + truncateText: false, + width: '140px', + }, + ...getSummaryTableILMPhaseColumn(isILMAvailable), + ...getSummaryTableSizeInBytesColumn({ isILMAvailable, formatBytes }), + { + field: 'checkedAt', + name: i18n.LAST_CHECK, + render: (_, { checkedAt }) => ( + + {checkedAt && moment(checkedAt).isValid() ? moment(checkedAt).fromNow() : EMPTY_STAT} + + ), + sortable: true, + truncateText: false, + width: '120px', + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.test.ts new file mode 100644 index 0000000000000..7438431e85535 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getShowPagination } from './get_show_pagination'; + +describe('getShowPagination', () => { + test('it returns true when `totalItemCount` is greater than `minPageSize`', () => { + expect( + getShowPagination({ + minPageSize: 10, + totalItemCount: 11, + }) + ).toBe(true); + }); + + test('it returns false when `totalItemCount` equals `minPageSize`', () => { + expect( + getShowPagination({ + minPageSize: 10, + totalItemCount: 10, + }) + ).toBe(false); + }); + + test('it returns false when `totalItemCount` is less than `minPageSize`', () => { + expect( + getShowPagination({ + minPageSize: 10, + totalItemCount: 9, + }) + ).toBe(false); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.ts new file mode 100644 index 0000000000000..5cf90b3f7a712 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.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. + */ + +export const getShowPagination = ({ + minPageSize, + totalItemCount, +}: { + minPageSize: number; + totalItemCount: number; +}): boolean => totalItemCount > minPageSize; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts new file mode 100644 index 0000000000000..8e13a4be4cc30 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const ERROR_LOADING_METADATA_TITLE = (pattern: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyErrorPrompt.errorLoadingMetadataTitle', + { + values: { pattern }, + defaultMessage: "Indices matching the {pattern} pattern won't be checked", + } + ); + +export const LOADING_STATS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingStatsPrompt', + { + defaultMessage: 'Loading stats', + } +); + +export const PASSED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.passedTooltip', + { + defaultMessage: 'Passed', + } +); + +export const FAILED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.failedTooltip', + { + defaultMessage: 'Failed', + } +); + +export const THIS_INDEX_HAS_NOT_BEEN_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.thisIndexHasNotBeenCheckedTooltip', + { + defaultMessage: 'This index has not been checked', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.test.ts new file mode 100644 index 0000000000000..4869aed07941b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FAILED, PASSED, THIS_INDEX_HAS_NOT_BEEN_CHECKED } from '../translations'; +import { getIndexResultToolTip } from './get_index_result_tooltip'; + +describe('getIndexResultToolTip', () => { + test('it returns "this index has not been checked" when `incompatible` is undefined', () => { + expect(getIndexResultToolTip(undefined)).toEqual(THIS_INDEX_HAS_NOT_BEEN_CHECKED); + }); + + test('it returns Passed when `incompatible` is zero', () => { + expect(getIndexResultToolTip(0)).toEqual(PASSED); + }); + + test('it returns Failed when `incompatible` is NOT zero', () => { + expect(getIndexResultToolTip(1)).toEqual(FAILED); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.ts new file mode 100644 index 0000000000000..7b2bb9fb0507e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.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. + */ + +import { FAILED, PASSED, THIS_INDEX_HAS_NOT_BEEN_CHECKED } from '../translations'; + +export const getIndexResultToolTip = (incompatible: number | undefined): string => { + if (incompatible == null) { + return THIS_INDEX_HAS_NOT_BEEN_CHECKED; + } else if (incompatible === 0) { + return PASSED; + } else { + return FAILED; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.test.ts new file mode 100644 index 0000000000000..b2746c830b6de --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.test.ts @@ -0,0 +1,360 @@ +/* + * 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 { mockDataQualityCheckResult } from '../../../../mock/data_quality_check_result/mock_index'; +import { IndexSummaryTableItem } from '../../../../types'; +import { getIndexIncompatible } from '../../../../utils/stats'; +import { getPageIndex } from './get_page_index'; + +describe('helpers', () => { + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + describe('getIndexIncompatible', () => { + test('it returns undefined when `results` is undefined', () => { + expect( + getIndexIncompatible({ + indexName, + results: undefined, // <-- + }) + ).toBeUndefined(); + }); + + test('it returns undefined when `indexName` is not in the `results`', () => { + expect( + getIndexIncompatible({ + indexName: 'not_in_the_results', // <-- + results: mockDataQualityCheckResult, + }) + ).toBeUndefined(); + }); + + test('it returns the expected count', () => { + expect( + getIndexIncompatible({ + indexName: 'auditbeat-custom-index-1', + results: mockDataQualityCheckResult, + }) + ).toEqual(3); + }); + }); + + describe('getPageIndex', () => { + const getPageIndexArgs: { + indexName: string; + items: IndexSummaryTableItem[]; + pageSize: number; + } = { + indexName: 'auditbeat-7.17.9-2023.04.09-000001', // <-- on page 2 of 3 (page index 1) + items: [ + { + docsCount: 48077, + incompatible: undefined, + indexName: 'auditbeat-7.14.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 43357342, + checkedAt: 1706526408000, + }, + { + docsCount: 48068, + incompatible: undefined, + indexName: 'auditbeat-7.3.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 32460397, + checkedAt: 1706526408000, + }, + { + docsCount: 48064, + incompatible: undefined, + indexName: 'auditbeat-7.11.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 42782794, + checkedAt: 1706526408000, + }, + { + docsCount: 47868, + incompatible: undefined, + indexName: 'auditbeat-7.6.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 31575964, + checkedAt: 1706526408000, + }, + { + docsCount: 47827, + incompatible: 20, + indexName: 'auditbeat-7.15.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 44130657, + checkedAt: 1706526408000, + }, + { + docsCount: 47642, + incompatible: undefined, + indexName: '.ds-auditbeat-8.4.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 42412521, + checkedAt: 1706526408000, + }, + { + docsCount: 47545, + incompatible: undefined, + indexName: 'auditbeat-7.16.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41423244, + checkedAt: 1706526408000, + }, + { + docsCount: 47531, + incompatible: undefined, + indexName: 'auditbeat-7.5.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 32394133, + checkedAt: 1706526408000, + }, + { + docsCount: 47530, + incompatible: undefined, + indexName: 'auditbeat-7.12.1-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 43015519, + checkedAt: 1706526408000, + }, + { + docsCount: 47520, + incompatible: undefined, + indexName: '.ds-auditbeat-8.0.1-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 42230604, + checkedAt: 1706526408000, + }, + { + docsCount: 47496, + incompatible: undefined, + indexName: '.ds-auditbeat-8.2.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41710968, + checkedAt: 1706526408000, + }, + { + docsCount: 47486, + incompatible: undefined, + indexName: '.ds-auditbeat-8.5.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 42295944, + checkedAt: 1706526408000, + }, + { + docsCount: 47486, + incompatible: undefined, + indexName: '.ds-auditbeat-8.3.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41761321, + checkedAt: 1706526408000, + }, + { + docsCount: 47460, + incompatible: undefined, + indexName: 'auditbeat-7.2.1-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 30481198, + checkedAt: 1706526408000, + }, + { + docsCount: 47439, + incompatible: undefined, + indexName: 'auditbeat-7.17.9-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41554041, + checkedAt: 1706526408000, + }, + { + docsCount: 47395, + incompatible: undefined, + indexName: 'auditbeat-7.9.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 42815907, + checkedAt: 1706526408000, + }, + { + docsCount: 47394, + incompatible: undefined, + indexName: '.ds-auditbeat-8.7.0-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41157112, + checkedAt: 1706526408000, + }, + { + docsCount: 47372, + incompatible: undefined, + indexName: 'auditbeat-7.4.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 31626792, + checkedAt: 1706526408000, + }, + { + docsCount: 47369, + incompatible: undefined, + indexName: 'auditbeat-7.13.4-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41828969, + checkedAt: 1706526408000, + }, + { + docsCount: 47348, + incompatible: undefined, + indexName: 'auditbeat-7.7.1-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 40010773, + checkedAt: 1706526408000, + }, + { + docsCount: 47339, + incompatible: undefined, + indexName: 'auditbeat-7.10.2-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 43480570, + checkedAt: 1706526408000, + }, + { + docsCount: 47325, + incompatible: undefined, + indexName: '.ds-auditbeat-8.1.3-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 41822475, + checkedAt: 1706526408000, + }, + { + docsCount: 47294, + incompatible: undefined, + indexName: 'auditbeat-7.8.0-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 43018490, + checkedAt: 1706526408000, + }, + { + docsCount: 24276, + incompatible: undefined, + indexName: '.ds-auditbeat-8.6.1-2023.04.09-000001', + ilmPhase: 'hot', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 23579440, + checkedAt: 1706526408000, + }, + { + docsCount: 4, + incompatible: undefined, + indexName: 'auditbeat-custom-index-1', + ilmPhase: 'unmanaged', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 28409, + checkedAt: 1706526408000, + }, + { + docsCount: 0, + incompatible: undefined, + indexName: 'auditbeat-custom-empty-index-1', + ilmPhase: 'unmanaged', + pattern: 'auditbeat-*', + patternDocsCount: 1118155, + sizeInBytes: 247, + checkedAt: 1706526408000, + }, + ], + pageSize: 10, + }; + + test('it returns the expected page index', () => { + expect(getPageIndex(getPageIndexArgs)).toEqual(1); + }); + + test('it returns the expected page index for the first item', () => { + const firstItemIndexName = 'auditbeat-7.14.2-2023.04.09-000001'; + + expect( + getPageIndex({ + ...getPageIndexArgs, + indexName: firstItemIndexName, + }) + ).toEqual(0); + }); + + test('it returns the expected page index for the last item', () => { + const lastItemIndexName = 'auditbeat-custom-empty-index-1'; + + expect( + getPageIndex({ + ...getPageIndexArgs, + indexName: lastItemIndexName, + }) + ).toEqual(2); + }); + + test('it returns null when the index cannot be found', () => { + expect( + getPageIndex({ + ...getPageIndexArgs, + indexName: 'does_not_exist', // <-- this index is not in the items + }) + ).toBeNull(); + }); + + test('it returns null when `pageSize` is zero', () => { + expect( + getPageIndex({ + ...getPageIndexArgs, + pageSize: 0, // <-- invalid + }) + ).toBeNull(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.ts new file mode 100644 index 0000000000000..3aff52ca9d3f8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.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 { IndexSummaryTableItem } from '../../../../types'; + +export const getPageIndex = ({ + indexName, + items, + pageSize, +}: { + indexName: string; + items: IndexSummaryTableItem[]; + pageSize: number; +}): number | null => { + const index = items.findIndex((x) => x.indexName === indexName); + + if (index !== -1 && pageSize !== 0) { + return Math.floor(index / pageSize); + } else { + return null; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts new file mode 100644 index 0000000000000..ad588af866c88 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts @@ -0,0 +1,173 @@ +/* + * 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 { + IlmExplainLifecycleLifecycleExplain, + IlmExplainLifecycleLifecycleExplainManaged, + IlmExplainLifecycleLifecycleExplainUnmanaged, +} from '@elastic/elasticsearch/lib/api/types'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { getIlmExplainPhaseCounts, getPhaseCount, isManaged } from './ilm_explain'; + +const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + +const hot: IlmExplainLifecycleLifecycleExplainManaged = { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '3.98d', + lifecycle_date_millis: 1675536751379, + age: '3.98d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, +}; +const warm = { + ...hot, + phase: 'warm', +}; +const cold = { + ...hot, + phase: 'cold', +}; +const frozen = { + ...hot, + phase: 'frozen', +}; + +const managed: Record = { + hot, + warm, + cold, + frozen, +}; + +const unmanaged: IlmExplainLifecycleLifecycleExplainUnmanaged = { + index: 'michael', + managed: false, +}; + +describe('isManaged', () => { + test('it returns true when the `ilmExplainRecord` `managed` property is true', () => { + const ilmExplain = mockIlmExplain[indexName]; + + expect(isManaged(ilmExplain)).toBe(true); + }); + + test('it returns false when the `ilmExplainRecord` is undefined', () => { + expect(isManaged(undefined)).toBe(false); + }); +}); + +describe('getPhaseCount', () => { + test('it returns the expected count when an index with the specified `ilmPhase` exists in the `IlmExplainLifecycleLifecycleExplain` record', () => { + expect( + getPhaseCount({ + ilmExplain: mockIlmExplain, + ilmPhase: 'hot', // this phase is in the record + indexName, // valid index name + }) + ).toEqual(1); + }); + + test('it returns zero when `ilmPhase` is null', () => { + expect( + getPhaseCount({ + ilmExplain: null, + ilmPhase: 'hot', + indexName, + }) + ).toEqual(0); + }); + + test('it returns zero when the `indexName` does NOT exist in the `IlmExplainLifecycleLifecycleExplain` record', () => { + expect( + getPhaseCount({ + ilmExplain: mockIlmExplain, + ilmPhase: 'hot', + indexName: 'invalid', // this index does NOT exist + }) + ).toEqual(0); + }); + + test('it returns zero when the specified `ilmPhase` does NOT exist in the `IlmExplainLifecycleLifecycleExplain` record', () => { + expect( + getPhaseCount({ + ilmExplain: mockIlmExplain, + ilmPhase: 'warm', // this phase is NOT in the record + indexName, // valid index name + }) + ).toEqual(0); + }); + + describe('when `ilmPhase` is `unmanaged`', () => { + test('it returns the expected count for an `unmanaged` index', () => { + const index = 'auditbeat-custom-index-1'; + const ilmExplainRecord: IlmExplainLifecycleLifecycleExplain = { + index, + managed: false, + }; + const ilmExplain = { + [index]: ilmExplainRecord, + }; + + expect( + getPhaseCount({ + ilmExplain, + ilmPhase: 'unmanaged', // ilmPhase is unmanaged + indexName: index, // an unmanaged index + }) + ).toEqual(1); + }); + + test('it returns zero for a managed index', () => { + expect( + getPhaseCount({ + ilmExplain: mockIlmExplain, + ilmPhase: 'unmanaged', // ilmPhase is unmanaged + indexName, // a managed (`hot`) index + }) + ).toEqual(0); + }); + }); +}); + +describe('getIlmExplainPhaseCounts', () => { + test('it returns the expected counts (all zeros) when `ilmExplain` is null', () => { + expect(getIlmExplainPhaseCounts(null)).toEqual({ + cold: 0, + frozen: 0, + hot: 0, + unmanaged: 0, + warm: 0, + }); + }); + + test('it returns the expected counts', () => { + const ilmExplain: Record = { + ...managed, + [unmanaged.index]: unmanaged, + }; + + expect(getIlmExplainPhaseCounts(ilmExplain)).toEqual({ + cold: 1, + frozen: 1, + hot: 1, + unmanaged: 1, + warm: 1, + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts new file mode 100644 index 0000000000000..c47353162b003 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts @@ -0,0 +1,87 @@ +/* + * 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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; + +import { IlmExplainPhaseCounts, IlmPhase } from '../../../../types'; + +export const isManaged = ( + ilmExplainRecord: IlmExplainLifecycleLifecycleExplain | undefined +): boolean => ilmExplainRecord?.managed === true; + +export const getPhaseCount = ({ + ilmExplain, + ilmPhase, + indexName, +}: { + ilmExplain: Record | null; + ilmPhase: IlmPhase; + indexName: string; +}): number => { + const ilmExplainRecord = ilmExplain != null ? ilmExplain[indexName] : undefined; + + if (ilmPhase === 'unmanaged') { + return isManaged(ilmExplainRecord) ? 0 : 1; + } else if (ilmExplainRecord != null && 'phase' in ilmExplainRecord) { + return ilmExplainRecord.phase === ilmPhase ? 1 : 0; + } + + return 0; +}; + +export const getIlmExplainPhaseCounts = ( + ilmExplain: Record | null +): IlmExplainPhaseCounts => { + const indexNames = ilmExplain != null ? Object.keys(ilmExplain) : []; + + return indexNames.reduce( + (acc, indexName) => ({ + hot: + acc.hot + + getPhaseCount({ + ilmExplain, + ilmPhase: 'hot', + indexName, + }), + warm: + acc.warm + + getPhaseCount({ + ilmExplain, + ilmPhase: 'warm', + indexName, + }), + cold: + acc.cold + + getPhaseCount({ + ilmExplain, + ilmPhase: 'cold', + indexName, + }), + frozen: + acc.frozen + + getPhaseCount({ + ilmExplain, + ilmPhase: 'frozen', + indexName, + }), + unmanaged: + acc.unmanaged + + getPhaseCount({ + ilmExplain, + ilmPhase: 'unmanaged', + indexName, + }), + }), + { + hot: 0, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 0, + } + ); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.test.ts new file mode 100644 index 0000000000000..7d663b82fc1ff --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.test.ts @@ -0,0 +1,103 @@ +/* + * 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 { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { shouldCreateIndexNames } from './should_create_index_names'; +import { mockStats } from '../../../../mock/stats/mock_stats'; + +describe('shouldCreateIndexNames', () => { + const indexNames = [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + 'auditbeat-custom-index-1', + ]; + const isILMAvailable = true; + + test('returns true when `indexNames` does NOT exist, and the required `stats` and `ilmExplain` are available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: mockIlmExplain, + indexNames: undefined, + isILMAvailable, + newIndexNames: [], + stats: mockStats, + }) + ).toBe(true); + }); + + test('returns true when `isILMAvailable` is false, and the required `stats` is available, and `ilmExplain` is not available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: null, + indexNames: undefined, + isILMAvailable: false, + newIndexNames: [], + stats: mockStats, + }) + ).toBe(true); + }); + + test('returns false when `indexNames` exists, and the required `stats` and `ilmExplain` are available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: mockIlmExplain, + indexNames, + isILMAvailable, + newIndexNames: indexNames, + stats: mockStats, + }) + ).toBe(false); + }); + + test('returns false when `indexNames` does NOT exist, `stats` is NOT available, and `ilmExplain` is available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: mockIlmExplain, + indexNames: undefined, + isILMAvailable, + newIndexNames: [], + stats: null, + }) + ).toBe(false); + }); + + test('returns false when `indexNames` does NOT exist, `stats` is available, and `ilmExplain` is NOT available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: null, + indexNames: undefined, + isILMAvailable, + newIndexNames: [], + stats: mockStats, + }) + ).toBe(false); + }); + + test('returns false when `indexNames` does NOT exist, `stats` is NOT available, and `ilmExplain` is NOT available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: null, + indexNames: undefined, + isILMAvailable, + newIndexNames: [], + stats: null, + }) + ).toBe(false); + }); + + test('returns false when `indexNames` exists, `stats` is NOT available, and `ilmExplain` is NOT available', () => { + expect( + shouldCreateIndexNames({ + ilmExplain: null, + indexNames, + isILMAvailable, + newIndexNames: [], + stats: null, + }) + ).toBe(false); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.ts new file mode 100644 index 0000000000000..25a6038ae9078 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.ts @@ -0,0 +1,30 @@ +/* + * 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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; + +import { isEqual } from 'lodash/fp'; +import { MeteringStatsIndex } from '../../../../types'; + +export const shouldCreateIndexNames = ({ + ilmExplain, + indexNames, + isILMAvailable, + newIndexNames, + stats, +}: { + ilmExplain: Record | null; + indexNames: string[] | undefined; + isILMAvailable: boolean; + newIndexNames: string[]; + stats: Record | null; +}): boolean => { + return ( + !isEqual(newIndexNames, indexNames) && + stats != null && + ((isILMAvailable && ilmExplain != null) || !isILMAvailable) + ); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.test.ts new file mode 100644 index 0000000000000..1adb851d8aafc --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.test.ts @@ -0,0 +1,139 @@ +/* + * 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 { mockStats } from '../../../../mock/stats/mock_stats'; +import { shouldCreatePatternRollup } from './should_create_pattern_rollup'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { getIndexNames, getPatternDocsCount } from './stats'; + +describe('shouldCreatePatternRollup', () => { + const isILMAvailable = true; + const newIndexNames = getIndexNames({ + stats: mockStats, + ilmExplain: mockIlmExplain, + ilmPhases: ['hot', 'unmanaged'], + isILMAvailable, + }); + const newDocsCount = getPatternDocsCount({ indexNames: newIndexNames, stats: mockStats }); + test('it returns false when the `patternRollup.docsCount` equals newDocsCount', () => { + expect( + shouldCreatePatternRollup({ + error: null, + ilmExplain: mockIlmExplain, + isILMAvailable, + newDocsCount: auditbeatWithAllResults.docsCount as number, + patternRollup: auditbeatWithAllResults, + stats: mockStats, + }) + ).toBe(false); + }); + + test('it returns true when all data and ILMExplain were loaded', () => { + expect( + shouldCreatePatternRollup({ + error: null, + ilmExplain: mockIlmExplain, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: mockStats, + }) + ).toBe(true); + }); + + test('it returns true when all data was loaded and ILM is not available', () => { + expect( + shouldCreatePatternRollup({ + error: null, + ilmExplain: null, + isILMAvailable: false, + newDocsCount, + patternRollup: undefined, + stats: mockStats, + }) + ).toBe(true); + }); + + test('it returns false when `stats`, but NOT `ilmExplain` was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: null, + ilmExplain: null, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: mockStats, + }) + ).toBe(false); + }); + + test('it returns false when `stats` was NOT loaded, and `ilmExplain` was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: null, + ilmExplain: mockIlmExplain, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: null, + }) + ).toBe(false); + }); + + test('it returns true if an error occurred, and NO data was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: 'whoops', + ilmExplain: null, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: null, + }) + ).toBe(true); + }); + + test('it returns true if an error occurred, and just `stats` was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: 'something went', + ilmExplain: null, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: mockStats, + }) + ).toBe(true); + }); + + test('it returns true if an error occurred, and just `ilmExplain` was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: 'horribly wrong', + ilmExplain: mockIlmExplain, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: null, + }) + ).toBe(true); + }); + + test('it returns true if an error occurred, and all data was loaded', () => { + expect( + shouldCreatePatternRollup({ + error: 'over here', + ilmExplain: mockIlmExplain, + isILMAvailable, + newDocsCount, + patternRollup: undefined, + stats: mockStats, + }) + ).toBe(true); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.ts new file mode 100644 index 0000000000000..87773ac01de17 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; + +import { MeteringStatsIndex, PatternRollup } from '../../../../types'; + +export const shouldCreatePatternRollup = ({ + error, + ilmExplain, + isILMAvailable, + newDocsCount, + patternRollup, + stats, +}: { + error: string | null; + ilmExplain: Record | null; + isILMAvailable: boolean; + newDocsCount: number; + patternRollup: PatternRollup | undefined; + stats: Record | null; +}): boolean => { + if (patternRollup?.docsCount === newDocsCount) { + return false; + } + + const allDataLoaded: boolean = + stats != null && ((isILMAvailable && ilmExplain != null) || !isILMAvailable); + const errorOccurred: boolean = error != null; + + return allDataLoaded || errorOccurred; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts new file mode 100644 index 0000000000000..306c9f93d83b6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts @@ -0,0 +1,234 @@ +/* + * 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 { omit } from 'lodash/fp'; + +import { mockStatsAuditbeatIndex } from '../../../../mock/stats/mock_stats_packetbeat_index'; +import { mockStatsPacketbeatIndex } from '../../../../mock/stats/mock_stats_auditbeat_index'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { mockStats } from '../../../../mock/stats/mock_stats'; +import { getIndexNames, getPatternDocsCount, getPatternSizeInBytes } from './stats'; +import { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; + +describe('getIndexNames', () => { + const isILMAvailable = true; + const ilmPhases = ['hot', 'warm', 'unmanaged']; + + test('returns the expected index names when they have an ILM phase included in the ilmPhases list', () => { + expect( + getIndexNames({ + ilmExplain: mockIlmExplain, // <-- the mock indexes have 'hot' ILM phases + ilmPhases, + isILMAvailable, + stats: mockStats, + }) + ).toEqual([ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + 'auditbeat-custom-index-1', + ]); + }); + + test('returns the expected filtered index names when they do NOT have an ILM phase included in the ilmPhases list', () => { + expect( + getIndexNames({ + ilmExplain: mockIlmExplain, // <-- the mock indexes have 'hot' and 'unmanaged' ILM phases... + ilmPhases: ['warm', 'unmanaged'], // <-- ...but we don't ask for 'hot' + isILMAvailable, + stats: mockStats, + }) + ).toEqual(['auditbeat-custom-index-1']); // <-- the 'unmanaged' index + }); + + test('returns the expected index names when the `ilmExplain` is missing a record for an index', () => { + // the following `ilmExplain` is missing a record for one of the two packetbeat indexes: + const ilmExplainWithMissingIndex: Record = omit( + '.ds-packetbeat-8.6.1-2023.02.04-000001', + mockIlmExplain + ); + + expect( + getIndexNames({ + ilmExplain: ilmExplainWithMissingIndex, // <-- the mock indexes have 'hot' ILM phases... + ilmPhases: ['hot', 'warm', 'unmanaged'], + isILMAvailable, + stats: mockStats, + }) + ).toEqual(['.ds-packetbeat-8.5.3-2023.02.04-000001', 'auditbeat-custom-index-1']); // <-- only includes two of the three indices, because the other one is missing an ILM explain record + }); + + test('returns empty index names when `ilmPhases` is empty', () => { + expect( + getIndexNames({ + ilmExplain: mockIlmExplain, + ilmPhases: [], + isILMAvailable, + stats: mockStats, + }) + ).toEqual([]); + }); + + test('returns empty index names when they have an ILM phase that matches', () => { + expect( + getIndexNames({ + ilmExplain: null, + ilmPhases, + isILMAvailable, + stats: mockStats, + }) + ).toEqual([]); + }); + + test('returns empty index names when just `stats` is null', () => { + expect( + getIndexNames({ + ilmExplain: mockIlmExplain, + ilmPhases, + isILMAvailable, + stats: null, + }) + ).toEqual([]); + }); + + test('returns empty index names when both `ilmExplain` and `stats` are null', () => { + expect( + getIndexNames({ + ilmExplain: null, + ilmPhases, + isILMAvailable, + stats: null, + }) + ).toEqual([]); + }); +}); + +describe('getPatternDocsCount', () => { + test('it returns the expected total given a subset of index names in the stats', () => { + const indexName = '.ds-packetbeat-8.5.3-2023.02.04-000001'; + const expectedCount = mockStatsPacketbeatIndex[indexName].num_docs; + + expect( + getPatternDocsCount({ + indexNames: [indexName], + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(expectedCount); + }); + + test('it returns the expected total given all index names in the stats', () => { + const allIndexNamesInStats = [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + ]; + + expect( + getPatternDocsCount({ + indexNames: allIndexNamesInStats, + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(3258632); + }); + + test('it returns zero given an empty collection of index names', () => { + expect( + getPatternDocsCount({ + indexNames: [], // <-- empty + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(0); + }); + + test('it returns the expected total for a green index', () => { + const indexName = 'auditbeat-custom-index-1'; + const expectedCount = mockStatsAuditbeatIndex[indexName].num_docs; + + expect( + getPatternDocsCount({ + indexNames: [indexName], + stats: mockStatsAuditbeatIndex, + }) + ).toEqual(expectedCount); + }); +}); + +describe('getPatternSizeInBytes', () => { + test('it returns the expected total given a subset of index names in the stats', () => { + const indexName = '.ds-packetbeat-8.5.3-2023.02.04-000001'; + const expectedCount = mockStatsPacketbeatIndex[indexName].size_in_bytes; + + expect( + getPatternSizeInBytes({ + indexNames: [indexName], + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(expectedCount); + }); + + test('it returns the expected total given all index names in the stats', () => { + const allIndexNamesInStats = [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + ]; + + expect( + getPatternSizeInBytes({ + indexNames: allIndexNamesInStats, + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(1464758182); + }); + + test('it returns undefined given an empty collection of index names', () => { + expect( + getPatternSizeInBytes({ + indexNames: [], // <-- empty + stats: mockStatsPacketbeatIndex, + }) + ).toBeUndefined(); + }); + + test('it returns undefined if sizeInByte in not an integer', () => { + const indexName = 'auditbeat-custom-index-1'; + + expect( + getPatternSizeInBytes({ + indexNames: [indexName], + stats: { [indexName]: { ...mockStatsAuditbeatIndex[indexName], size_in_bytes: null } }, + }) + ).toBeUndefined(); + }); + + test('it returns the expected total for an index', () => { + const indexName = 'auditbeat-custom-index-1'; + const expectedCount = mockStatsAuditbeatIndex[indexName].size_in_bytes; + + expect( + getPatternSizeInBytes({ + indexNames: [indexName], + stats: mockStatsAuditbeatIndex, + }) + ).toEqual(expectedCount); + }); + + test('it returns the expected total for indices', () => { + const expectedCount = Object.values(mockStatsPacketbeatIndex).reduce( + (acc, { size_in_bytes: sizeInBytes }) => { + return acc + (sizeInBytes ?? 0); + }, + 0 + ); + + expect( + getPatternSizeInBytes({ + indexNames: [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + ], + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(expectedCount); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.ts new file mode 100644 index 0000000000000..63505211e82a1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; + +import { getIlmPhase } from '../../../../utils/get_ilm_phase'; +import { getDocsCount, getSizeInBytes } from '../../../../utils/stats'; +import { MeteringStatsIndex } from '../../../../types'; + +export const getPatternDocsCount = ({ + indexNames, + stats, +}: { + indexNames: string[]; + stats: Record | null; +}): number => + indexNames.reduce( + (acc: number, indexName: string) => acc + getDocsCount({ stats, indexName }), + 0 + ); + +export const getPatternSizeInBytes = ({ + indexNames, + stats, +}: { + indexNames: string[]; + stats: Record | null; +}): number | undefined => { + let sum; + for (let i = 0; i < indexNames.length; i++) { + const currentSizeInBytes = getSizeInBytes({ stats, indexName: indexNames[i] }); + if (currentSizeInBytes != null) { + if (sum == null) { + sum = 0; + } + sum += currentSizeInBytes; + } else { + return undefined; + } + } + return sum; +}; + +const EMPTY_INDEX_NAMES: string[] = []; +export const getIndexNames = ({ + ilmExplain, + ilmPhases, + isILMAvailable, + stats, +}: { + ilmExplain: Record | null; + ilmPhases: string[]; + isILMAvailable: boolean; + stats: Record | null; +}): string[] => { + if (((isILMAvailable && ilmExplain != null) || !isILMAvailable) && stats != null) { + const allIndexNames = Object.keys(stats); + const filteredByIlmPhase = isILMAvailable + ? allIndexNames.filter((indexName) => + ilmPhases.includes(getIlmPhase(ilmExplain?.[indexName], isILMAvailable) ?? '') + ) + : allIndexNames; + + return filteredByIlmPhase; + } else { + return EMPTY_INDEX_NAMES; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx new file mode 100644 index 0000000000000..3ebb44a8306ef --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.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 numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_STAT } from '../../constants'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; +import { Props, StorageDetails } from '.'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +const onIndexSelected = jest.fn(); + +const defaultProps: Props = { + onIndexSelected, +}; + +describe('StorageDetails', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders the treemap', () => { + expect(screen.getByTestId('storageTreemap').querySelector('.echChart')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx new file mode 100644 index 0000000000000..23a4fc46f6ad4 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx @@ -0,0 +1,57 @@ +/* + * 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 { useResultsRollupContext } from '../../contexts/results_rollup_context'; +import { StorageTreemap } from './storage_treemap'; +import { DEFAULT_MAX_CHART_HEIGHT } from '../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; +import { SelectedIndex } from '../../types'; +import { useDataQualityContext } from '../../data_quality_context'; +import { DOCS_UNIT } from './translations'; +import { getFlattenedBuckets } from './utils/get_flattened_buckets'; + +export interface Props { + onIndexSelected: ({ indexName, pattern }: SelectedIndex) => void; +} + +const StorageDetailsComponent: React.FC = ({ onIndexSelected }) => { + const { patternRollups } = useResultsRollupContext(); + const { isILMAvailable, ilmPhases, formatBytes, formatNumber } = useDataQualityContext(); + + const flattenedBuckets = useMemo( + () => + getFlattenedBuckets({ + ilmPhases, + isILMAvailable, + patternRollups, + }), + [ilmPhases, isILMAvailable, patternRollups] + ); + const accessor = flattenedBuckets[0]?.sizeInBytes != null ? 'sizeInBytes' : 'docsCount'; + const valueFormatter = useCallback( + (d: number) => + accessor === 'sizeInBytes' ? formatBytes(d) : `${formatNumber(d)} ${DOCS_UNIT(d)}`, + [accessor, formatBytes, formatNumber] + ); + + return ( +
+ +
+ ); +}; + +StorageDetailsComponent.displayName = 'StorageDetailsComponent'; +export const StorageDetails = React.memo(StorageDetailsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx new file mode 100644 index 0000000000000..3264696e59ddd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx @@ -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 { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiLink, EuiText, EuiToolTip } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +const DEFAULT_DATA_TEST_SUBJ = 'chartLegendItem'; + +export const ChartLegendLink = styled(EuiLink)` + width: 100%; +`; +export const FixedWidthLegendText = styled(EuiText)<{ + $width: number | undefined; +}>` + text-align: left; + ${({ $width }) => ($width != null ? `width: ${$width}px;` : '')} +`; + +interface Props { + color: string | null; + count: number | string; + dataTestSubj?: string; + onClick: (() => void) | undefined; + text: string; + textWidth?: number; +} + +const ChartLegendItemComponent: React.FC = ({ + color, + count, + dataTestSubj = DEFAULT_DATA_TEST_SUBJ, + onClick, + text, + textWidth, +}) => ( + + + + + {color != null ? ( + + + {text} + + + ) : ( + + {text} + + )} + + + + + {count} + + + +); + +ChartLegendItemComponent.displayName = 'ChartLegendItemComponent'; + +export const ChartLegendItem = React.memo(ChartLegendItemComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.ts new file mode 100644 index 0000000000000..c67b052fbf2b5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { euiThemeVars } from '@kbn/ui-theme'; + +export const DEFAULT_INDEX_COLOR = euiThemeVars.euiColorPrimary; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx new file mode 100644 index 0000000000000..7e1834e05ed4c --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx @@ -0,0 +1,159 @@ +/* + * 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 { DARK_THEME, Settings } from '@elastic/charts'; +import numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import React from 'react'; + +import { EMPTY_STAT } from '../../../constants'; +import { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../mock/test_providers/test_providers'; +import type { Props } from '.'; +import { StorageTreemap } from '.'; +import { DEFAULT_MAX_CHART_HEIGHT } from '../../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; +import { NO_DATA_LABEL } from './translations'; +import { PatternRollup } from '../../../types'; +import { FlattenedBucket } from '../types'; +import { getFlattenedBuckets } from '../utils/get_flattened_buckets'; +import { getLegendItems } from './utils/get_legend_items'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, +}); + +const onIndexSelected = jest.fn(); + +const defaultProps: Props = { + accessor: 'sizeInBytes', + flattenedBuckets, + maxChartHeight: DEFAULT_MAX_CHART_HEIGHT, + onIndexSelected, + patternRollups, + valueFormatter: formatBytes, +}; + +jest.mock('@elastic/charts', () => { + const actual = jest.requireActual('@elastic/charts'); + return { + ...actual, + Settings: jest.fn().mockReturnValue(null), + }; +}); + +describe('StorageTreemap', () => { + describe('when data is provided', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders the treemap', () => { + expect(screen.getByTestId('storageTreemap').querySelector('.echChart')).toBeInTheDocument(); + }); + + test('it renders the legend with the expected overflow-y style', () => { + expect(screen.getByTestId('legend')).toHaveClass('eui-yScroll'); + }); + + test('it uses a theme with the expected `minFontSize` to show more labels at various screen resolutions', () => { + expect((Settings as jest.Mock).mock.calls[0][0].theme[0].partition.minFontSize).toEqual(4); + }); + + describe('legend items', () => { + const allLegendItems = getLegendItems({ patterns, flattenedBuckets, patternRollups }); + + describe('pattern legend items', () => { + const justPatterns = allLegendItems.filter((x) => x.ilmPhase == null); + + justPatterns.forEach(({ ilmPhase, index, pattern, sizeInBytes }) => { + test(`it renders the expend legend item for pattern: ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { + expect( + screen.getByTestId(`chart-legend-item-${ilmPhase}${pattern}${index}`) + ).toHaveTextContent(`${pattern}${formatBytes(sizeInBytes)}`); + }); + }); + }); + + describe('index legend items', () => { + const justIndices = allLegendItems.filter((x) => x.ilmPhase != null); + + justIndices.forEach(({ ilmPhase, index, pattern, sizeInBytes }) => { + test(`it renders the expend legend item for index: ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { + expect( + screen.getByTestId(`chart-legend-item-${ilmPhase}${pattern}${index}`) + ).toHaveTextContent(`${index}${formatBytes(sizeInBytes)}`); + }); + + test(`it invokes onIndexSelected() with the expected values for ilmPhase ${ilmPhase} pattern ${pattern} index ${index}`, () => { + const legendItem = screen.getByTestId( + `chart-legend-item-${ilmPhase}${pattern}${index}` + ); + + userEvent.click(legendItem); + + expect(onIndexSelected).toBeCalledWith({ indexName: index, pattern }); + }); + }); + }); + }); + }); + + describe('when the response does NOT have data', () => { + const emptyFlattenedBuckets: FlattenedBucket[] = []; + + beforeEach(() => { + render( + + + + + + ); + }); + + test('it does NOT render the treemap', () => { + expect(screen.queryByTestId('storageTreemap')).not.toBeInTheDocument(); + }); + + test('it does NOT render the legend', () => { + expect(screen.queryByTestId('legend')).not.toBeInTheDocument(); + }); + + test('it renders the "no data" message', () => { + expect(screen.getByText(NO_DATA_LABEL)).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx new file mode 100644 index 0000000000000..5a0a7be5bab3d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx @@ -0,0 +1,204 @@ +/* + * 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 { isEmpty } from 'lodash/fp'; +import type { + Datum, + ElementClickListener, + FlameElementEvent, + HeatmapElementEvent, + MetricElementEvent, + PartialTheme, + PartitionElementEvent, + WordCloudElementEvent, + XYChartElementEvent, +} from '@elastic/charts'; +import { Chart, Partition, PartitionLayout, Settings } from '@elastic/charts'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React, { useCallback, useMemo } from 'react'; + +import { i18n } from '@kbn/i18n'; +import { ChartLegendItem } from './chart_legend_item'; +import { NoData } from './no_data'; +import { + ChartFlexItem, + LegendContainer, +} from '../../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; +import { PatternRollup, SelectedIndex } from '../../../types'; +import { useDataQualityContext } from '../../../data_quality_context'; +import { FlattenedBucket } from '../types'; +import { getPathToFlattenedBucketMap } from './utils/get_path_to_flattened_bucket_map'; +import { getLayersMultiDimensional } from './utils/get_layers_multi_dimensional'; +import { getLegendItems } from './utils/get_legend_items'; + +export const DEFAULT_MIN_CHART_HEIGHT = 240; // px +export const LEGEND_WIDTH = 220; // px +export const LEGEND_TEXT_WITH = 120; // px + +export interface Props { + accessor: 'sizeInBytes' | 'docsCount'; + flattenedBuckets: FlattenedBucket[]; + maxChartHeight?: number; + minChartHeight?: number; + onIndexSelected: ({ indexName, pattern }: SelectedIndex) => void; + patternRollups: Record; + valueFormatter: (value: number) => string; +} + +interface GetGroupByFieldsResult { + pattern: string; + indexName: string; +} + +export const getGroupByFieldsOnClick = ( + elements: Array< + | FlameElementEvent + | HeatmapElementEvent + | MetricElementEvent + | PartitionElementEvent + | WordCloudElementEvent + | XYChartElementEvent + > +): GetGroupByFieldsResult => { + const flattened = elements.flat(2); + + const pattern = + flattened.length > 0 && 'groupByRollup' in flattened[0] && flattened[0].groupByRollup != null + ? `${flattened[0].groupByRollup}` + : ''; + + const indexName = + flattened.length > 1 && 'groupByRollup' in flattened[1] && flattened[1].groupByRollup != null + ? `${flattened[1].groupByRollup}` + : ''; + + return { + pattern, + indexName, + }; +}; + +const StorageTreemapComponent: React.FC = ({ + accessor, + flattenedBuckets, + maxChartHeight, + minChartHeight = DEFAULT_MIN_CHART_HEIGHT, + onIndexSelected, + patternRollups, + valueFormatter, +}: Props) => { + const { theme, baseTheme, patterns } = useDataQualityContext(); + const fillColor = useMemo( + () => theme?.background?.color ?? baseTheme.background.color, + [theme?.background?.color, baseTheme.background.color] + ); + + const treemapTheme = useMemo( + () => ({ + partition: { + fillLabel: { valueFont: { fontWeight: 700 } }, + idealFontSizeJump: 1.15, + maxFontSize: 16, + minFontSize: 4, + sectorLineStroke: fillColor, // draws the light or dark "lines" between partitions + sectorLineWidth: 1.5, + }, + }), + [fillColor] + ); + + const onElementClick: ElementClickListener = useCallback( + (event) => { + const { indexName, pattern } = getGroupByFieldsOnClick(event); + + if (!isEmpty(indexName) && !isEmpty(pattern)) { + onIndexSelected({ indexName, pattern }); + } + }, + [onIndexSelected] + ); + + const pathToFlattenedBucketMap = getPathToFlattenedBucketMap(flattenedBuckets); + + const layers = useMemo( + () => + getLayersMultiDimensional({ + valueFormatter, + layer0FillColor: fillColor, + pathToFlattenedBucketMap, + }), + [fillColor, valueFormatter, pathToFlattenedBucketMap] + ); + + const valueAccessor = useCallback((d: Datum) => d[accessor], [accessor]); + + const legendItems = useMemo( + () => getLegendItems({ patterns, flattenedBuckets, patternRollups }), + [flattenedBuckets, patternRollups, patterns] + ); + + if (flattenedBuckets.length === 0) { + return ; + } + + return ( + + + {flattenedBuckets.length === 0 ? ( + + ) : ( + + + + + )} + + + + + {legendItems.map(({ color, ilmPhase, index, pattern, sizeInBytes, docsCount }) => ( + { + onIndexSelected({ indexName: index, pattern }); + } + : undefined + } + text={index ?? pattern} + textWidth={LEGEND_TEXT_WITH} + /> + ))} + + + + ); +}; + +export const StorageTreemap = React.memo(StorageTreemapComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx new file mode 100644 index 0000000000000..dbb6dd955c9ea --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx @@ -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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import * as i18n from '../translations'; + +import { NoData } from '.'; +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; + +describe('NoData', () => { + test('renders the expected "no data" message', () => { + render( + + + + ); + + expect(screen.getByText(i18n.NO_DATA_LABEL)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx new file mode 100644 index 0000000000000..4e5e8a46e62fd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import * as i18n from '../translations'; + +const NoDataLabel = styled(EuiText)` + text-align: center; +`; + +interface Props { + reason?: string; +} + +const StyledContainer = styled.div` + padding: ${({ theme }) => theme.eui.euiSizeM} 0; +`; + +const NoDataComponent: React.FC = ({ reason }) => ( + + + + + {i18n.NO_DATA_LABEL} + + + {reason != null && ( + <> + + + {reason} + + + )} + + + +); + +NoDataComponent.displayName = 'NoDataComponent'; + +export const NoData = React.memo(NoDataComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.test.ts new file mode 100644 index 0000000000000..41ce95e50cfbd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.test.ts @@ -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 { euiThemeVars } from '@kbn/ui-theme'; + +import { getFillColor } from './get_fill_color'; +import { DEFAULT_INDEX_COLOR } from '../constants'; + +describe('getFillColor', () => { + test('it returns success when `incompatible` is zero', () => { + const incompatible = 0; + + expect(getFillColor(incompatible)).toEqual(euiThemeVars.euiColorSuccess); + }); + + test('it returns danger when `incompatible` is greater than 0', () => { + const incompatible = 1; + + expect(getFillColor(incompatible)).toEqual(euiThemeVars.euiColorDanger); + }); + + test('it returns the default color when `incompatible` is undefined', () => { + const incompatible = undefined; + + expect(getFillColor(incompatible)).toEqual(DEFAULT_INDEX_COLOR); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.ts new file mode 100644 index 0000000000000..5c2d43a66ee15 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.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. + */ +import { euiThemeVars } from '@kbn/ui-theme'; +import { DEFAULT_INDEX_COLOR } from '../constants'; + +export const getFillColor = (incompatible: number | undefined): string => { + if (incompatible === 0) { + return euiThemeVars.euiColorSuccess; + } else if (incompatible != null && incompatible > 0) { + return euiThemeVars.euiColorDanger; + } else { + return DEFAULT_INDEX_COLOR; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.test.ts new file mode 100644 index 0000000000000..aa6aee9fafc29 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.test.ts @@ -0,0 +1,90 @@ +/* + * 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 numeral from '@elastic/numeral'; + +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { getFlattenedBuckets } from '../../utils/get_flattened_buckets'; +import { getGroupFromPath, getLayersMultiDimensional } from './get_layers_multi_dimensional'; +import { getPathToFlattenedBucketMap } from './get_path_to_flattened_bucket_map'; +import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { PatternRollup } from '../../../../types'; +import { EMPTY_STAT } from '../../../../constants'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +describe('getGroupFromPath', () => { + it('returns the expected group from the path', () => { + expect( + getGroupFromPath([ + { + index: 0, + value: '__null_small_multiples_key__', + }, + { + index: 0, + value: '__root_key__', + }, + { + index: 0, + value: 'auditbeat-*', + }, + { + index: 1, + value: 'auditbeat-custom-empty-index-1', + }, + ]) + ).toEqual('auditbeat-*'); + }); + + it('returns undefined when path is an empty array', () => { + expect(getGroupFromPath([])).toBeUndefined(); + }); + + it('returns undefined when path is an array with only one value', () => { + expect(getGroupFromPath([{ index: 0, value: '__null_small_multiples_key__' }])).toBeUndefined(); + }); +}); + +describe('getLayersMultiDimensional', () => { + const layer0FillColor = 'transparent'; + const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, + }); + const pathToFlattenedBucketMap = getPathToFlattenedBucketMap(flattenedBuckets); + + it('returns the expected number of layers', () => { + expect( + getLayersMultiDimensional({ + valueFormatter: formatBytes, + layer0FillColor, + pathToFlattenedBucketMap, + }).length + ).toEqual(2); + }); + + it('returns the expected fillLabel valueFormatter function', () => { + getLayersMultiDimensional({ + valueFormatter: formatBytes, + layer0FillColor, + pathToFlattenedBucketMap, + }).forEach((x) => expect(x.fillLabel.valueFormatter(123)).toEqual('123B')); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.ts new file mode 100644 index 0000000000000..da5947f742138 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ArrayNode, Datum, Key } from '@elastic/charts'; + +import { FlattenedBucket } from '../../types'; +import { getFillColor } from './get_fill_color'; + +const groupByRollup = (d: Datum) => d.pattern; // the treemap is grouped by this field + +/** + * Extracts the first group name from the data representing the second group + */ +export const getGroupFromPath = (path: ArrayNode['path']): string | undefined => { + const OFFSET_FROM_END = 2; // The offset from the end of the path array containing the group + const groupIndex = path.length - OFFSET_FROM_END; + return groupIndex > 0 ? path[groupIndex].value : undefined; +}; + +export const getLayersMultiDimensional = ({ + valueFormatter, + layer0FillColor, + pathToFlattenedBucketMap, +}: { + valueFormatter: (value: number) => string; + layer0FillColor: string; + pathToFlattenedBucketMap: Record; +}) => { + return [ + { + fillLabel: { + valueFormatter, + }, + groupByRollup, + nodeLabel: (ilmPhase: Datum) => ilmPhase, + shape: { + fillColor: layer0FillColor, + }, + }, + { + fillLabel: { + valueFormatter, + }, + groupByRollup: (d: Datum) => d.indexName, + nodeLabel: (indexName: Datum) => indexName, + shape: { + fillColor: (indexName: Key, _sortIndex: number, node: Pick) => { + const pattern = getGroupFromPath(node.path) ?? ''; + const flattenedBucket = pathToFlattenedBucketMap[`${pattern}${indexName}`]; + + return getFillColor(flattenedBucket?.incompatible); + }, + }, + }, + ]; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.test.ts new file mode 100644 index 0000000000000..eee30b2d974cf --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.test.ts @@ -0,0 +1,196 @@ +/* + * 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 { euiThemeVars } from '@kbn/ui-theme'; + +import { getFlattenedBuckets } from '../../utils/get_flattened_buckets'; +import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { PatternRollup } from '../../../../types'; +import { getLegendItems, getLegendItemsForPattern, getPatternLegendItem } from './get_legend_items'; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +describe('getPatternLegendItem', () => { + test('it returns the expected legend item', () => { + const pattern = 'auditbeat-*'; + + expect(getPatternLegendItem({ pattern, patternRollups })).toEqual({ + color: null, + ilmPhase: null, + index: null, + pattern, + sizeInBytes: auditbeatWithAllResults.sizeInBytes, + docsCount: auditbeatWithAllResults.docsCount, + }); + }); +}); + +describe('getLegendItemsForPattern', () => { + test('it returns the expected legend items', () => { + const pattern = 'auditbeat-*'; + const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, + }); + + expect(getLegendItemsForPattern({ pattern, flattenedBuckets })).toEqual([ + { + color: euiThemeVars.euiColorSuccess, + ilmPhase: 'hot', + index: '.ds-auditbeat-8.6.1-2023.02.07-000001', + pattern: 'auditbeat-*', + sizeInBytes: 18791790, + docsCount: 19123, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: 'unmanaged', + index: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 28409, + docsCount: 4, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: 'unmanaged', + index: 'auditbeat-custom-empty-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 247, + docsCount: 0, + }, + ]); + }); + + test('it returns the expected legend items when isILMAvailable is false', () => { + const pattern = 'auditbeat-*'; + const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: false, + patternRollups, + }); + expect(getLegendItemsForPattern({ pattern, flattenedBuckets })).toEqual([ + { + color: euiThemeVars.euiColorSuccess, + ilmPhase: null, + index: '.ds-auditbeat-8.6.1-2023.02.07-000001', + pattern: 'auditbeat-*', + sizeInBytes: 18791790, + docsCount: 19123, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: null, + index: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 28409, + docsCount: 4, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: null, + index: 'auditbeat-custom-empty-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 247, + docsCount: 0, + }, + ]); + }); +}); + +describe('getLegendItems', () => { + test('it returns the expected legend items', () => { + const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, + }); + + expect(getLegendItems({ flattenedBuckets, patterns, patternRollups })).toEqual([ + { + color: null, + ilmPhase: null, + index: null, + pattern: '.alerts-security.alerts-default', + sizeInBytes: 29717961631, + docsCount: 26093, + }, + { + color: euiThemeVars.euiColorSuccess, + ilmPhase: 'hot', + index: '.internal.alerts-security.alerts-default-000001', + pattern: '.alerts-security.alerts-default', + sizeInBytes: 0, + docsCount: 26093, + }, + { + color: null, + ilmPhase: null, + index: null, + pattern: 'auditbeat-*', + sizeInBytes: 18820446, + docsCount: 19127, + }, + { + color: euiThemeVars.euiColorSuccess, + ilmPhase: 'hot', + index: '.ds-auditbeat-8.6.1-2023.02.07-000001', + pattern: 'auditbeat-*', + sizeInBytes: 18791790, + docsCount: 19123, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: 'unmanaged', + index: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 28409, + docsCount: 4, + }, + { + color: euiThemeVars.euiColorDanger, + ilmPhase: 'unmanaged', + index: 'auditbeat-custom-empty-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 247, + docsCount: 0, + }, + { + color: null, + ilmPhase: null, + index: null, + pattern: 'packetbeat-*', + sizeInBytes: 1096520898, + docsCount: 3258632, + }, + { + color: euiThemeVars.euiColorPrimary, + ilmPhase: 'hot', + index: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 584326147, + docsCount: 1630289, + }, + { + color: euiThemeVars.euiColorPrimary, + ilmPhase: 'hot', + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 512194751, + docsCount: 1628343, + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.ts new file mode 100644 index 0000000000000..16816dcf2a3c6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.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 { orderBy } from 'lodash/fp'; + +import { PatternRollup } from '../../../../types'; +import { FlattenedBucket, LegendItem } from '../../types'; +import { getFillColor } from './get_fill_color'; +import { getPatternDocsCount, getPatternSizeInBytes } from './stats'; + +export const getLegendItemsForPattern = ({ + pattern, + flattenedBuckets, +}: { + pattern: string; + flattenedBuckets: FlattenedBucket[]; +}): LegendItem[] => + orderBy( + ['sizeInBytes'], + ['desc'], + flattenedBuckets + .filter((x) => x.pattern === pattern) + .map((flattenedBucket) => ({ + color: getFillColor(flattenedBucket.incompatible), + ilmPhase: flattenedBucket.ilmPhase ?? null, + index: flattenedBucket.indexName ?? null, + pattern: flattenedBucket.pattern, + sizeInBytes: flattenedBucket.sizeInBytes, + docsCount: flattenedBucket.docsCount, + })) + ); + +export const getPatternLegendItem = ({ + pattern, + patternRollups, +}: { + pattern: string; + patternRollups: Record; +}): LegendItem => ({ + color: null, + ilmPhase: null, + index: null, + pattern, + sizeInBytes: getPatternSizeInBytes({ pattern, patternRollups }), + docsCount: getPatternDocsCount({ pattern, patternRollups }), +}); + +export const getLegendItems = ({ + patterns, + flattenedBuckets, + patternRollups, +}: { + patterns: string[]; + flattenedBuckets: FlattenedBucket[]; + patternRollups: Record; +}): LegendItem[] => + patterns.reduce( + (acc, pattern) => [ + ...acc, + getPatternLegendItem({ pattern, patternRollups }), + ...getLegendItemsForPattern({ pattern, flattenedBuckets }), + ], + [] + ); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.test.ts new file mode 100644 index 0000000000000..f7a3be93fcc85 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.test.ts @@ -0,0 +1,82 @@ +/* + * 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 { PatternRollup } from '../../../../types'; +import { getFlattenedBuckets } from '../../utils/get_flattened_buckets'; +import { getPathToFlattenedBucketMap } from './get_path_to_flattened_bucket_map'; +import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +describe('helpers', () => { + describe('getPathToFlattenedBucketMap', () => { + test('it returns the expected map', () => { + const flattenedBuckets = getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, + }); + + expect(getPathToFlattenedBucketMap(flattenedBuckets)).toEqual({ + '.alerts-security.alerts-default.internal.alerts-security.alerts-default-000001': { + pattern: '.alerts-security.alerts-default', + indexName: '.internal.alerts-security.alerts-default-000001', + ilmPhase: 'hot', + incompatible: 0, + sizeInBytes: 0, + docsCount: 26093, + }, + 'auditbeat-*.ds-auditbeat-8.6.1-2023.02.07-000001': { + pattern: 'auditbeat-*', + indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', + ilmPhase: 'hot', + incompatible: 0, + sizeInBytes: 18791790, + docsCount: 19123, + }, + 'auditbeat-*auditbeat-custom-empty-index-1': { + pattern: 'auditbeat-*', + indexName: 'auditbeat-custom-empty-index-1', + ilmPhase: 'unmanaged', + incompatible: 1, + sizeInBytes: 247, + docsCount: 0, + }, + 'auditbeat-*auditbeat-custom-index-1': { + pattern: 'auditbeat-*', + indexName: 'auditbeat-custom-index-1', + ilmPhase: 'unmanaged', + incompatible: 3, + sizeInBytes: 28409, + docsCount: 4, + }, + 'packetbeat-*.ds-packetbeat-8.6.1-2023.02.04-000001': { + pattern: 'packetbeat-*', + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + ilmPhase: 'hot', + sizeInBytes: 512194751, + docsCount: 1628343, + }, + 'packetbeat-*.ds-packetbeat-8.5.3-2023.02.04-000001': { + docsCount: 1630289, + pattern: 'packetbeat-*', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + ilmPhase: 'hot', + sizeInBytes: 584326147, + }, + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.ts new file mode 100644 index 0000000000000..4afbe4c1b73cd --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.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. + */ + +import { FlattenedBucket } from '../../types'; + +export const getPathToFlattenedBucketMap = ( + flattenedBuckets: FlattenedBucket[] +): Record => + flattenedBuckets.reduce>( + (acc, { pattern, indexName, ...remaining }) => ({ + ...acc, + [`${pattern}${indexName}`]: { pattern, indexName, ...remaining }, + }), + {} + ); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.ts new file mode 100644 index 0000000000000..b2b31eac00ab0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.ts @@ -0,0 +1,61 @@ +/* + * 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 { PatternRollup } from '../../../../types'; +import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { getPatternSizeInBytes } from './stats'; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +/** a valid `PatternRollup` that has an undefined `sizeInBytes` */ +const noSizeInBytes: Record = { + 'valid-*': { + docsCount: 19127, + error: null, + ilmExplain: null, + ilmExplainPhaseCounts: { + hot: 1, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 2, + }, + indices: 3, + pattern: 'valid-*', + results: undefined, + sizeInBytes: undefined, // <-- + stats: null, + }, +}; + +describe('getPatternSizeInBytes', () => { + test('it returns the expected size when the pattern exists in the rollup', () => { + const pattern = 'auditbeat-*'; + + expect(getPatternSizeInBytes({ pattern, patternRollups })).toEqual( + auditbeatWithAllResults.sizeInBytes + ); + }); + + test('it returns undefined when the pattern exists in the rollup, but does not have a sizeInBytes', () => { + const pattern = 'valid-*'; + + expect(getPatternSizeInBytes({ pattern, patternRollups: noSizeInBytes })).toBeUndefined(); + }); + + test('it returns undefined when the pattern does NOT exist in the rollup', () => { + const pattern = 'does-not-exist-*'; + + expect(getPatternSizeInBytes({ pattern, patternRollups })).toBeUndefined(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.ts new file mode 100644 index 0000000000000..9d999266a40f5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.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 { PatternRollup } from '../../../../types'; + +export const getPatternSizeInBytes = ({ + pattern, + patternRollups, +}: { + pattern: string; + patternRollups: Record; +}): number | undefined => { + if (patternRollups[pattern] != null) { + return patternRollups[pattern].sizeInBytes; + } else { + return undefined; + } +}; + +export const getPatternDocsCount = ({ + pattern, + patternRollups, +}: { + pattern: string; + patternRollups: Record; +}): number => { + if (patternRollups[pattern] != null) { + return patternRollups[pattern].docsCount ?? 0; + } else { + return 0; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts new file mode 100644 index 0000000000000..a1507d1ad9bcb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts @@ -0,0 +1,24 @@ +/* + * 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 LegendItem { + color: string | null; + ilmPhase: string | null; + index: string | null; + pattern: string; + sizeInBytes: number | undefined; + docsCount: number; +} + +export interface FlattenedBucket { + ilmPhase: string | undefined; + incompatible: number | undefined; + indexName: string | undefined; + pattern: string; + sizeInBytes: number | undefined; + docsCount: number; +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts new file mode 100644 index 0000000000000..7aaff4888186a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts @@ -0,0 +1,135 @@ +/* + * 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 { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { PatternRollup } from '../../../types'; +import { getFlattenedBuckets } from './get_flattened_buckets'; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +describe('getFlattenedBuckets', () => { + test('it returns the expected flattened buckets', () => { + expect( + getFlattenedBuckets({ + ilmPhases, + isILMAvailable: true, + patternRollups, + }) + ).toEqual([ + { + ilmPhase: 'hot', + incompatible: 0, + indexName: '.internal.alerts-security.alerts-default-000001', + pattern: '.alerts-security.alerts-default', + sizeInBytes: 0, + docsCount: 26093, + }, + { + ilmPhase: 'hot', + incompatible: 0, + indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', + pattern: 'auditbeat-*', + sizeInBytes: 18791790, + docsCount: 19123, + }, + { + ilmPhase: 'unmanaged', + incompatible: 1, + indexName: 'auditbeat-custom-empty-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 247, + docsCount: 0, + }, + { + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 28409, + docsCount: 4, + }, + { + ilmPhase: 'hot', + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 512194751, + docsCount: 1628343, + }, + { + ilmPhase: 'hot', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 584326147, + docsCount: 1630289, + }, + ]); + }); + + test('it returns the expected flattened buckets when isILMAvailable is false', () => { + expect( + getFlattenedBuckets({ + ilmPhases, + isILMAvailable: false, + patternRollups, + }) + ).toEqual([ + { + docsCount: 26093, + ilmPhase: undefined, + incompatible: 0, + indexName: '.internal.alerts-security.alerts-default-000001', + pattern: '.alerts-security.alerts-default', + sizeInBytes: 0, + }, + { + docsCount: 19123, + ilmPhase: undefined, + incompatible: 0, + indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', + pattern: 'auditbeat-*', + sizeInBytes: 18791790, + }, + { + docsCount: 0, + ilmPhase: undefined, + incompatible: 1, + indexName: 'auditbeat-custom-empty-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 247, + }, + { + docsCount: 4, + ilmPhase: undefined, + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + sizeInBytes: 28409, + }, + { + docsCount: 1628343, + ilmPhase: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 512194751, + }, + { + docsCount: 1630289, + ilmPhase: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + sizeInBytes: 584326147, + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.ts new file mode 100644 index 0000000000000..7363ae1df2c33 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.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 { PatternRollup } from '../../../types'; +import { getIlmPhase } from '../../../utils/get_ilm_phase'; +import { getDocsCount, getSizeInBytes } from '../../../utils/stats'; +import { FlattenedBucket } from '../types'; + +export const getFlattenedBuckets = ({ + ilmPhases, + isILMAvailable, + patternRollups, +}: { + ilmPhases: string[]; + isILMAvailable: boolean; + patternRollups: Record; +}): FlattenedBucket[] => + Object.values(patternRollups).reduce((acc, patternRollup) => { + // enables fast lookup of valid phase names: + const ilmPhasesMap = ilmPhases.reduce>( + (phasesMap, phase) => ({ ...phasesMap, [phase]: 0 }), + {} + ); + const { ilmExplain, pattern, results, stats } = patternRollup; + + if (((isILMAvailable && ilmExplain != null) || !isILMAvailable) && stats != null) { + return [ + ...acc, + ...Object.entries(stats).reduce((validStats, [indexName]) => { + const ilmPhase = getIlmPhase(ilmExplain?.[indexName], isILMAvailable); + const isSelectedPhase = + (isILMAvailable && ilmPhase != null && ilmPhasesMap[ilmPhase] != null) || + !isILMAvailable; + + if (isSelectedPhase) { + const incompatible = + results != null && results[indexName] != null + ? results[indexName].incompatible + : undefined; + const sizeInBytes = getSizeInBytes({ indexName, stats }); + const docsCount = getDocsCount({ stats, indexName }); + return [ + ...validStats, + { + ilmPhase, + incompatible, + indexName, + pattern, + sizeInBytes, + docsCount, + }, + ]; + } else { + return validStats; + } + }, []), + ]; + } + + return acc; + }, []); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx new file mode 100644 index 0000000000000..4a821d1251ddc --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx @@ -0,0 +1,133 @@ +/* + * 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 { render, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { IlmPhaseFilter } from '.'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; +import { + COLD_DESCRIPTION, + FROZEN_DESCRIPTION, + HOT_DESCRIPTION, + INDEX_LIFECYCLE_MANAGEMENT_PHASES, + UNMANAGED_DESCRIPTION, + WARM_DESCRIPTION, +} from '../../translations'; + +describe('IlmPhaseFilter', () => { + it('renders combobox with ilmPhase label and preselected hot, warm, unmanaged options', () => { + render( + + + + + + ); + expect(screen.getByTestId('selectIlmPhases')).toBeInTheDocument(); + expect(screen.getByLabelText('ILM phase')).toBeInTheDocument(); + expect(screen.getByText('hot')).toBeInTheDocument(); + expect(screen.getByText('warm')).toBeInTheDocument(); + expect(screen.getByText('unmanaged')).toBeInTheDocument(); + }); + + it('does not preselect disabled cold, frozen options', () => { + render( + + + + + + ); + expect(screen.queryByText('cold')).not.toBeInTheDocument(); + expect(screen.queryByText('frozen')).not.toBeInTheDocument(); + }); + + describe('when dropdown opened', () => { + it('shows remaining disabled options', () => { + render( + + + + + + ); + const searchInput = screen.getByTestId('comboBoxSearchInput'); + + userEvent.click(searchInput); + + expect(screen.getByTitle('frozen')).toHaveAttribute('role', 'option'); + expect(screen.getByTitle('frozen')).toBeDisabled(); + expect(screen.getByTitle('cold')).toHaveAttribute('role', 'option'); + expect(screen.getByTitle('cold')).toBeDisabled(); + }); + }); + + describe('when hovering over search input', () => { + it('shows a tooltip with the ilm check description', async () => { + render( + + + + + + ); + + userEvent.hover(screen.getByTestId('comboBoxSearchInput')); + + await waitFor(() => + expect(screen.getByRole('tooltip')).toHaveTextContent(INDEX_LIFECYCLE_MANAGEMENT_PHASES) + ); + }); + }); + + describe('when hovering over options in dropdown', () => { + describe.each([ + { option: 'hot', tooltipDescription: HOT_DESCRIPTION }, + { option: 'warm', tooltipDescription: WARM_DESCRIPTION }, + { option: 'unmanaged', tooltipDescription: UNMANAGED_DESCRIPTION }, + { + option: 'cold', + tooltipDescription: COLD_DESCRIPTION, + }, + { + option: 'frozen', + tooltipDescription: FROZEN_DESCRIPTION, + }, + ])('when hovering over $option option', ({ option, tooltipDescription }) => { + it(`shows a tooltip with the ${option} description`, async () => { + render( + + + + + + ); + + expect(screen.getByPlaceholderText('Select one or more ILM phases')).toBeInTheDocument(); + + const searchInput = screen.getByTestId('comboBoxSearchInput'); + userEvent.click(searchInput); + userEvent.hover(screen.getByText(option.toLowerCase()), undefined, { + skipPointerEventsCheck: true, + }); + + await waitFor(() => + expect(screen.getByRole('tooltip')).toHaveTextContent(tooltipDescription) + ); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx new file mode 100644 index 0000000000000..cd7148d38b3aa --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx @@ -0,0 +1,74 @@ +/* + * 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 { + EuiComboBox, + EuiComboBoxOptionOption, + EuiFormLabel, + EuiToolTip, + useGeneratedHtmlId, +} from '@elastic/eui'; +import React, { useCallback, useMemo } from 'react'; + +import { ilmPhaseOptionsStatic } from '../../constants'; +import { getIlmPhaseDescription } from '../../utils/get_ilm_phase_description'; +import { + ILM_PHASE, + INDEX_LIFECYCLE_MANAGEMENT_PHASES, + SELECT_ONE_OR_MORE_ILM_PHASES, +} from '../../translations'; +import { useDataQualityContext } from '../../data_quality_context'; +import { StyledFormControlLayout, StyledOption, StyledOptionLabel } from './styles'; + +const renderOption = ( + option: EuiComboBoxOptionOption +): React.ReactNode => ( + + + {`${option.label}`} + {': '} + {getIlmPhaseDescription(option.label)} + + +); + +const IlmPhaseFilterComponent: React.FC = () => { + const { selectedIlmPhaseOptions, setSelectedIlmPhaseOptions } = useDataQualityContext(); + const labelInputId = useGeneratedHtmlId({ prefix: 'labelInput' }); + const ilmFormLabel = useMemo( + () => {ILM_PHASE}, + [labelInputId] + ); + + const handleSetSelectedOptions = useCallback( + (selectedOptions: EuiComboBoxOptionOption[]) => { + setSelectedIlmPhaseOptions(selectedOptions); + }, + [setSelectedIlmPhaseOptions] + ); + + return ( + + + + + + ); +}; + +IlmPhaseFilterComponent.displayName = 'IlmPhaseFilterComponent'; + +export const IlmPhaseFilter = React.memo(IlmPhaseFilterComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx new file mode 100644 index 0000000000000..f2ff23d441165 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.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. + */ + +import { EuiFormControlLayout } from '@elastic/eui'; +import styled from 'styled-components'; + +export const StyledOption = styled.div` + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 100%; +`; + +export const StyledOptionLabel = styled.span` + font-weight: ${({ theme }) => theme.eui.euiFontWeightBold}; +`; + +export const StyledFormControlLayout = styled(EuiFormControlLayout)` + height: 42px; + + .euiFormControlLayout__childrenWrapper { + overflow: visible; + } +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx new file mode 100644 index 0000000000000..322d30be6dd81 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx @@ -0,0 +1,105 @@ +/* + * 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 numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { EMPTY_STAT } from '../constants'; +import { alertIndexWithAllResults } from '../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../mock/test_providers/test_providers'; +import { PatternRollup } from '../types'; +import { DataQualitySummary } from '.'; +import { + getTotalDocsCount, + getTotalIncompatible, + getTotalIndices, + getTotalIndicesChecked, + getTotalSizeInBytes, +} from '../hooks/use_results_rollup/utils/stats'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +const patternIndexNames: Record = { + 'auditbeat-*': [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-empty-index-1', + 'auditbeat-custom-index-1', + ], + '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], + 'packetbeat-*': [ + '.ds-packetbeat-8.5.3-2023.02.04-000001', + '.ds-packetbeat-8.6.1-2023.02.04-000001', + ], +}; + +const lastChecked = '2023-03-28T23:27:28.159Z'; + +const totalDocsCount = getTotalDocsCount(patternRollups); +const totalIncompatible = getTotalIncompatible(patternRollups); +const totalIndices = getTotalIndices(patternRollups); +const totalIndicesChecked = getTotalIndicesChecked(patternRollups); +const totalSizeInBytes = getTotalSizeInBytes(patternRollups); + +describe('DataQualitySummary', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders the summary actions', () => { + expect(screen.getByTestId('summaryActions')).toBeInTheDocument(); + }); + + test('it renders the stats rollup', () => { + expect(screen.getByTestId('statsRollup')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx new file mode 100644 index 0000000000000..09c98c1a84197 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx @@ -0,0 +1,82 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { StatsRollup } from '../stats_rollup'; +import { SummaryActions } from './summary_actions'; +import { IlmPhaseFilter } from './ilm_phase_filter'; +import { useDataQualityContext } from '../data_quality_context'; +import { useResultsRollupContext } from '../contexts/results_rollup_context'; + +const MAX_SUMMARY_ACTIONS_CONTAINER_WIDTH = 400; +const MIN_SUMMARY_ACTIONS_CONTAINER_WIDTH = 235; + +const StyledFlexGroup = styled(EuiFlexGroup)` + min-height: calc(174px - ${({ theme }) => theme.eui.euiSizeL} * 2); +`; + +const StyledFlexItem = styled(EuiFlexItem)` + gap: ${({ theme }) => theme.eui.euiSizeL}; +`; + +const SummaryActionsContainerFlexItem = styled(EuiFlexItem)` + max-width: ${MAX_SUMMARY_ACTIONS_CONTAINER_WIDTH}px; + min-width: ${MIN_SUMMARY_ACTIONS_CONTAINER_WIDTH}px; +`; + +const StyledIlmPhaseFilterContainer = styled.div` + width: 100%; + max-width: 432px; + align-self: flex-end; +`; + +const StyledRollupContainer = styled.div` + margin-top: auto; +`; + +const DataQualitySummaryComponent: React.FC = () => { + const { isILMAvailable } = useDataQualityContext(); + const { totalIndices, totalDocsCount, totalIndicesChecked, totalIncompatible, totalSizeInBytes } = + useResultsRollupContext(); + + return ( + + + + + + + + {isILMAvailable && ( + + + + )} + + + + + + + ); +}; + +export const DataQualitySummary = React.memo(DataQualitySummaryComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx new file mode 100644 index 0000000000000..14368907362fb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx @@ -0,0 +1,420 @@ +/* + * 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 numeral from '@elastic/numeral'; +import userEvent from '@testing-library/user-event'; +import { act, render, screen, waitFor } from '@testing-library/react'; +import React from 'react'; + +import { mockMappingsResponse } from '../../../mock/mappings_response/mock_mappings_response'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../mock/test_providers/test_providers'; +import { mockUnallowedValuesResponse } from '../../../mock/unallowed_values/mock_unallowed_values'; +import { CANCEL, CHECK_ALL } from '../../../translations'; +import { OnCheckCompleted, UnallowedValueRequestItem } from '../../../types'; +import { CheckAll } from '.'; +import { EMPTY_STAT } from '../../../constants'; + +const defaultBytesFormat = '0,0.[0]b'; +const mockFormatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const mockFormatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const mockFetchMappings = jest.fn(() => + Promise.resolve( + mockMappingsResponse // happy path + ) +); + +jest.mock('../../../utils/fetch_mappings', () => { + const original = jest.requireActual('../../../utils/fetch_mappings'); + return { + ...original, + fetchMappings: (_: { abortController: AbortController; patternOrIndexName: string }) => + mockFetchMappings(), + }; +}); + +const mockFetchUnallowedValues = jest.fn(() => Promise.resolve(mockUnallowedValuesResponse)); + +jest.mock('../../../utils/fetch_unallowed_values', () => { + const original = jest.requireActual('../../../utils/fetch_unallowed_values'); + return { + ...original, + fetchUnallowedValues: (_: { + abortController: AbortController; + indexName: string; + requestItems: UnallowedValueRequestItem[]; + }) => mockFetchUnallowedValues(), + }; +}); + +const patternIndexNames = { + '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], + 'auditbeat-*': [ + 'auditbeat-7.3.2-2023.03.27-000001', + '.ds-auditbeat-8.6.1-2023.03.29-000001', + 'auditbeat-custom-empty-index-1', + 'auditbeat-7.10.2-2023.03.27-000001', + 'auditbeat-7.2.1-2023.03.27-000001', + 'auditbeat-custom-index-1', + ], + 'logs-*': [ + '.ds-logs-endpoint.events.process-default-2023.03.27-000001', + '.ds-logs-endpoint.alerts-default-2023.03.27-000001', + ], + 'packetbeat-*': [ + '.ds-packetbeat-8.6.1-2023.03.27-000001', + '.ds-packetbeat-8.5.3-2023.03.27-000001', + ], +}; + +const ilmPhases: string[] = ['hot', 'warm', 'unmanaged']; + +describe('CheckAll', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it renders the expected button text when a check is NOT running', () => { + render( + + + + + + ); + + expect(screen.getByTestId('checkAll')).toHaveTextContent(CHECK_ALL); + }); + + test('it renders a disabled button when ILM available and ilmPhases is an empty array', () => { + render( + + + + + + ); + + expect(screen.getByTestId('checkAll').hasAttribute('disabled')).toBeTruthy(); + }); + + test('it renders the expected button when ILM is NOT available', () => { + render( + + + + + + ); + + expect(screen.getByTestId('checkAll').hasAttribute('disabled')).toBeFalsy(); + }); + + test('it renders the expected button text when a check is running', () => { + render( + + + + + + ); + + const button = screen.getByTestId('checkAll'); + + userEvent.click(button); // <-- START the check + + expect(screen.getByTestId('checkAll')).toHaveTextContent(CANCEL); + }); + + describe('formatNumber', () => { + test('it renders a comma-separated `value` via the `defaultNumberFormat`', async () => { + /** stores the result of invoking `CheckAll`'s `formatNumber` function */ + let formatNumberResult = ''; + + const onCheckCompleted: OnCheckCompleted = jest.fn(({ formatBytes, formatNumber }) => { + const value = 123456789; // numeric input to `CheckAll`'s `formatNumber` function + + formatNumberResult = formatNumber(value); + }); + + render( + + + + + + ); + + const button = screen.getByTestId('checkAll'); + + userEvent.click(button); // <-- START the check + + await waitFor(() => { + expect(formatNumberResult).toEqual('123,456,789'); // a comma-separated `value`, because it's numeric + }); + }); + + test('it renders an empty stat placeholder when `value` is undefined', async () => { + /** stores the result of invoking `CheckAll`'s `formatNumber` function */ + let formatNumberResult = ''; + + const onCheckCompleted: OnCheckCompleted = jest.fn(({ formatBytes, formatNumber }) => { + const value = undefined; // undefined input to `CheckAll`'s `formatNumber` function + formatNumberResult = formatNumber(value); + }); + + render( + + + + + + ); + + const button = screen.getByTestId('checkAll'); + + userEvent.click(button); // <-- START the check + + await waitFor(() => { + expect(formatNumberResult).toEqual(EMPTY_STAT); // a placeholder, because `value` is undefined + }); + }); + }); + + describe('when a running check is cancelled', () => { + const setCheckAllIndiciesChecked = jest.fn(); + const setCheckAllTotalIndiciesToCheck = jest.fn(); + + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + + const button = screen.getByTestId('checkAll'); + + userEvent.click(button); // <-- START the check + + userEvent.click(button); // <-- STOP the check + }); + + test('it invokes `setCheckAllIndiciesChecked` twice: when the check was started, and when it was cancelled', () => { + expect(setCheckAllIndiciesChecked).toHaveBeenCalledTimes(2); + }); + + test('it invokes `setCheckAllTotalIndiciesToCheck` with the expected index count when the check is STARTED', () => { + expect(setCheckAllTotalIndiciesToCheck.mock.calls[0][0]).toEqual(11); + }); + + test('it invokes `setCheckAllTotalIndiciesToCheck` with the expected index count when the check is STOPPED', () => { + expect(setCheckAllTotalIndiciesToCheck.mock.calls[1][0]).toEqual(0); + }); + }); + + describe('when all checks have completed', () => { + const setIndexToCheck = jest.fn(); + const onCheckCompleted = jest.fn(); + beforeEach(async () => { + jest.clearAllMocks(); + jest.useFakeTimers(); + + render( + + + + + + ); + + const button = screen.getByTestId('checkAll'); + + userEvent.click(button); // <-- start the check + + const totalIndexNames = Object.values(patternIndexNames).reduce( + (total, indices) => total + indices.length, + 0 + ); + + // simulate the wall clock advancing + for (let i = 0; i < totalIndexNames + 1; i++) { + act(() => { + jest.advanceTimersByTime(1000 * 10); + }); + + await waitFor(() => {}); + } + }); + + afterEach(() => { + jest.useRealTimers(); + }); + + test('it invokes setIndexToCheck with `null` after all the checks have completed', () => { + expect(setIndexToCheck).toBeCalledWith(null); + }); + + test('it invokes onCheckAllCompleted after all the checks have completed', () => { + expect(onCheckCompleted).toHaveBeenCalled(); + }); + + // test all the patterns + Object.entries(patternIndexNames).forEach((pattern) => { + const [patternName, indexNames] = pattern; + + // test each index in the pattern + indexNames.forEach((indexName) => { + test(`it invokes setIndexToCheck with the expected value for the '${patternName}' pattern's index, named '${indexName}'`, () => { + expect(setIndexToCheck).toBeCalledWith({ + indexName, + pattern: patternName, + }); + }); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx new file mode 100644 index 0000000000000..9e90b28e71a9e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx @@ -0,0 +1,163 @@ +/* + * 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 { EuiButton } from '@elastic/eui'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled from 'styled-components'; +import { v4 as uuidv4 } from 'uuid'; + +import { getAllIndicesToCheck } from './utils/get_all_indices_to_check'; +import { useResultsRollupContext } from '../../../contexts/results_rollup_context'; +import { checkIndex } from '../../../utils/check_index'; +import { useDataQualityContext } from '../../../data_quality_context'; +import * as i18n from '../../../translations'; +import type { IndexToCheck } from '../../../types'; + +const CheckAllButton = styled(EuiButton)` + width: 112px; +`; + +async function wait(ms: number) { + const delay = () => + new Promise((resolve) => + setTimeout(() => { + resolve(''); + }, ms) + ); + + return delay(); +} + +interface Props { + incrementCheckAllIndiciesChecked: () => void; + setCheckAllIndiciesChecked: (checkAllIndiciesChecked: number) => void; + setCheckAllTotalIndiciesToCheck: (checkAllTotalIndiciesToCheck: number) => void; + setIndexToCheck: (indexToCheck: IndexToCheck | null) => void; +} + +const DELAY_AFTER_EVERY_CHECK_COMPLETES = 3000; // ms + +const CheckAllComponent: React.FC = ({ + incrementCheckAllIndiciesChecked, + setCheckAllIndiciesChecked, + setCheckAllTotalIndiciesToCheck, + setIndexToCheck, +}) => { + const { httpFetch, isILMAvailable, formatBytes, formatNumber, ilmPhases, patterns } = + useDataQualityContext(); + const { onCheckCompleted, patternIndexNames } = useResultsRollupContext(); + const abortController = useRef(new AbortController()); + const [isRunning, setIsRunning] = useState(false); + + const cancelIfRunning = useCallback(() => { + if (isRunning) { + if (!abortController.current.signal.aborted) { + setIndexToCheck(null); + setIsRunning(false); + setCheckAllIndiciesChecked(0); + setCheckAllTotalIndiciesToCheck(0); + abortController.current.abort(); + } + } + }, [isRunning, setCheckAllIndiciesChecked, setCheckAllTotalIndiciesToCheck, setIndexToCheck]); + + const onClick = useCallback(() => { + async function beginCheck() { + const allIndicesToCheck = getAllIndicesToCheck(patternIndexNames); + const startTime = Date.now(); + const batchId = uuidv4(); + let checked = 0; + + setCheckAllIndiciesChecked(0); + setCheckAllTotalIndiciesToCheck(allIndicesToCheck.length); + + for (const { indexName, pattern } of allIndicesToCheck) { + if (!abortController.current.signal.aborted) { + setIndexToCheck({ + indexName, + pattern, + }); + + await checkIndex({ + abortController: abortController.current, + batchId, + checkAllStartTime: startTime, + formatBytes, + formatNumber, + isCheckAll: true, + httpFetch, + indexName, + isLastCheck: + allIndicesToCheck.length > 0 ? checked === allIndicesToCheck.length - 1 : true, + onCheckCompleted, + pattern, + }); + + if (!abortController.current.signal.aborted) { + await wait(DELAY_AFTER_EVERY_CHECK_COMPLETES); + incrementCheckAllIndiciesChecked(); + checked++; + } + } + } + + if (!abortController.current.signal.aborted) { + setIndexToCheck(null); + setIsRunning(false); + } + } + + if (isRunning) { + cancelIfRunning(); + } else { + abortController.current = new AbortController(); + setIsRunning(true); + beginCheck(); + } + }, [ + cancelIfRunning, + formatBytes, + formatNumber, + httpFetch, + incrementCheckAllIndiciesChecked, + isRunning, + onCheckCompleted, + patternIndexNames, + setCheckAllIndiciesChecked, + setCheckAllTotalIndiciesToCheck, + setIndexToCheck, + ]); + + useEffect(() => { + return () => { + // cancel any checks in progress when the patterns or ilm phases change + cancelIfRunning(); + }; + }, [cancelIfRunning, ilmPhases, patterns]); + + useEffect(() => { + return () => { + abortController.current.abort(); + }; + }, [abortController]); + + const disabled = isILMAvailable && ilmPhases.length === 0; + + return ( + + {isRunning ? i18n.CANCEL : i18n.CHECK_ALL} + + ); +}; + +export const CheckAll = React.memo(CheckAllComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.test.ts new file mode 100644 index 0000000000000..3a3bbf5880455 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.test.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 { getAllIndicesToCheck, getIndexToCheck } from './get_all_indices_to_check'; + +const patternIndexNames: Record = { + 'packetbeat-*': [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + ], + 'auditbeat-*': [ + 'auditbeat-7.17.9-2023.02.13-000001', + 'auditbeat-custom-index-1', + '.ds-auditbeat-8.6.1-2023.02.13-000001', + ], + 'logs-*': [ + '.ds-logs-endpoint.alerts-default-2023.02.24-000001', + '.ds-logs-endpoint.events.process-default-2023.02.24-000001', + ], + 'remote:*': [], + '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], +}; + +describe('getIndexToCheck', () => { + test('it returns the expected `IndexToCheck`', () => { + expect( + getIndexToCheck({ + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + }) + ).toEqual({ + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + }); + }); +}); + +describe('getAllIndicesToCheck', () => { + test('it returns the sorted collection of `IndexToCheck`', () => { + expect(getAllIndicesToCheck(patternIndexNames)).toEqual([ + { + indexName: '.internal.alerts-security.alerts-default-000001', + pattern: '.alerts-security.alerts-default', + }, + { + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + }, + { + indexName: 'auditbeat-7.17.9-2023.02.13-000001', + pattern: 'auditbeat-*', + }, + { + indexName: '.ds-auditbeat-8.6.1-2023.02.13-000001', + pattern: 'auditbeat-*', + }, + { + indexName: '.ds-logs-endpoint.events.process-default-2023.02.24-000001', + pattern: 'logs-*', + }, + { + indexName: '.ds-logs-endpoint.alerts-default-2023.02.24-000001', + pattern: 'logs-*', + }, + { + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + { + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.ts new file mode 100644 index 0000000000000..dbe1b113bc9aa --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.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 { orderBy } from 'lodash/fp'; + +import type { IndexToCheck } from '../../../../types'; + +export const getIndexToCheck = ({ + indexName, + pattern, +}: { + indexName: string; + pattern: string; +}): IndexToCheck => { + return { + pattern, + indexName, + }; +}; + +export const getAllIndicesToCheck = ( + patternIndexNames: Record +): IndexToCheck[] => { + const allPatterns: string[] = Object.keys(patternIndexNames); + + // sort the patterns A-Z: + const sortedPatterns = [...allPatterns].sort((a, b) => { + return a.localeCompare(b); + }); + + // return all `IndexToCheck` sorted first by pattern A-Z: + return sortedPatterns.reduce((acc, pattern) => { + const indexNames = patternIndexNames[pattern]; + const indicesToCheck = indexNames.map((indexName) => + getIndexToCheck({ indexName, pattern }) + ); + + const sortedIndicesToCheck = orderBy(['indexName'], ['desc'], indicesToCheck); + + return [...acc, ...sortedIndicesToCheck]; + }, []); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx new file mode 100644 index 0000000000000..13b2e5e88605a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx @@ -0,0 +1,122 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { omit } from 'lodash/fp'; +import React from 'react'; + +import { getErrorsViewerTableColumns } from './helpers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; +import { ErrorSummary } from '../../../../../types'; + +const errorSummary: ErrorSummary[] = [ + { + pattern: '.alerts-security.alerts-default', + indexName: null, + error: 'Error loading stats: Error: Forbidden', + }, + { + error: + 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', + indexName: 'auditbeat-7.2.1-2023.02.13-000001', + pattern: 'auditbeat-*', + }, +]; + +const noIndexName: ErrorSummary = errorSummary[0]; // <-- indexName: null +const hasIndexName: ErrorSummary = errorSummary[1]; + +describe('helpers', () => { + describe('getCommonTableColumns', () => { + test('it returns the expected column configuration', () => { + const columns = getErrorsViewerTableColumns().map((x) => omit('render', x)); + + expect(columns).toEqual([ + { + field: 'pattern', + name: 'Pattern', + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'indexName', + name: 'Index', + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'error', + name: 'Error', + sortable: false, + truncateText: false, + width: '50%', + }, + ]); + }); + + describe('indexName column render()', () => { + describe('when the `ErrorSummary` has an `indexName`', () => { + beforeEach(() => { + const columns = getErrorsViewerTableColumns(); + const indexNameRender = columns[1].render; + + render( + + {indexNameRender != null && indexNameRender(hasIndexName.indexName, hasIndexName)} + + ); + }); + + test('it renders the expected `indexName`', () => { + expect(screen.getByTestId('indexName')).toHaveTextContent(String(hasIndexName.indexName)); + }); + + test('it does NOT render the placeholder', () => { + expect(screen.queryByTestId('emptyPlaceholder')).not.toBeInTheDocument(); + }); + }); + + describe('when the `ErrorSummary` does NOT have an `indexName`', () => { + beforeEach(() => { + const columns = getErrorsViewerTableColumns(); + const indexNameRender = columns[1].render; + + render( + + {indexNameRender != null && indexNameRender(noIndexName.indexName, noIndexName)} + + ); + }); + + test('it does NOT render `indexName`', () => { + expect(screen.queryByTestId('indexName')).not.toBeInTheDocument(); + }); + + test('it renders the placeholder', () => { + expect(screen.getByTestId('emptyPlaceholder')).toBeInTheDocument(); + }); + }); + }); + + describe('indexName error render()', () => { + test('it renders the expected `error`', () => { + const columns = getErrorsViewerTableColumns(); + const indexNameRender = columns[2].render; + + render( + + {indexNameRender != null && indexNameRender(hasIndexName.error, hasIndexName)} + + ); + + expect(screen.getByTestId('error')).toHaveTextContent(hasIndexName.error); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx new file mode 100644 index 0000000000000..8644a0a89c02a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx @@ -0,0 +1,50 @@ +/* + * 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 { EuiTableFieldDataColumnType } from '@elastic/eui'; +import { EuiCode } from '@elastic/eui'; +import React from 'react'; + +import type { ErrorSummary } from '../../../../../types'; +import { INDEX } from '../../../../../translations'; +import { ERROR, PATTERN } from '../../../translations'; + +export const EMPTY_PLACEHOLDER = '--'; + +export const ERRORS_CONTAINER_MAX_WIDTH = 600; // px +export const ERRORS_CONTAINER_MIN_WIDTH = 450; // px + +export const getErrorsViewerTableColumns = (): Array> => [ + { + field: 'pattern', + name: PATTERN, + sortable: true, + truncateText: false, + width: '25%', + }, + { + field: 'indexName', + name: INDEX, + render: (indexName: string | null) => + indexName != null && indexName !== '' ? ( + {indexName} + ) : ( + {EMPTY_PLACEHOLDER} + ), + sortable: false, + truncateText: false, + width: '25%', + }, + { + field: 'error', + name: ERROR, + render: (errorText) => {errorText}, + sortable: false, + truncateText: false, + width: '50%', + }, +]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx new file mode 100644 index 0000000000000..aa74e3632b723 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx @@ -0,0 +1,78 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import React from 'react'; + +import { INDEX } from '../../../../../translations'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; +import { ErrorSummary } from '../../../../../types'; +import { ERROR, PATTERN } from '../../../translations'; +import { ErrorsViewer } from '.'; + +interface ExpectedColumns { + id: string; + expected: string; +} + +const errorSummary: ErrorSummary[] = [ + { + pattern: '.alerts-security.alerts-default', + indexName: null, + error: 'Error loading stats: Error: Forbidden', + }, + { + error: + 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', + indexName: 'auditbeat-7.2.1-2023.02.13-000001', + pattern: 'auditbeat-*', + }, +]; + +describe('ErrorsViewer', () => { + const expectedColumns: ExpectedColumns[] = [ + { + id: 'pattern', + expected: PATTERN, + }, + { + id: 'indexName', + expected: INDEX, + }, + { + id: 'error', + expected: ERROR, + }, + ]; + + expectedColumns.forEach(({ id, expected }, i) => { + test(`it renders the expected '${id}' column header`, () => { + render( + + + + ); + + expect(screen.getByTestId(`tableHeaderCell_${id}_${i}`)).toHaveTextContent(expected); + }); + }); + + test(`it renders the expected the errors`, () => { + render( + + + + ); + + expect( + screen + .getAllByTestId('error') + .map((x) => x.textContent ?? '') + .reduce((acc, x) => acc.concat(x), '') + ).toEqual(`${errorSummary[0].error}${errorSummary[1].error}`); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx new file mode 100644 index 0000000000000..363127e4f919c --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiInMemoryTable } from '@elastic/eui'; +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + +import { + ERRORS_CONTAINER_MAX_WIDTH, + ERRORS_CONTAINER_MIN_WIDTH, + getErrorsViewerTableColumns, +} from './helpers'; +import type { ErrorSummary } from '../../../../../types'; + +const ErrorsViewerContainer = styled.div` + max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; + min-width: ${ERRORS_CONTAINER_MIN_WIDTH}px; +`; + +interface Props { + errorSummary: ErrorSummary[]; +} + +const ErrorsViewerComponent: React.FC = ({ errorSummary }) => { + const columns = useMemo(() => getErrorsViewerTableColumns(), []); + + return ( + + + + ); +}; + +ErrorsViewerComponent.displayName = 'ErrorsViewerComponent'; + +export const ErrorsViewer = React.memo(ErrorsViewerComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx new file mode 100644 index 0000000000000..43cd0b7d215c6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import userEvent from '@testing-library/user-event'; +import { act, render, screen } from '@testing-library/react'; +import React from 'react'; + +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +import { ErrorsPopover } from '.'; + +const mockCopyToClipboard = jest.fn((value) => true); +jest.mock('@elastic/eui', () => { + const original = jest.requireActual('@elastic/eui'); + return { + ...original, + copyToClipboard: (value: string) => mockCopyToClipboard(value), + }; +}); + +const errorSummary = [ + { + pattern: '.alerts-security.alerts-default', + indexName: null, + error: 'Error loading stats: Error: Forbidden', + }, +]; + +describe('ErrorsPopover', () => { + beforeEach(() => { + document.execCommand = jest.fn(); + }); + + test('it disables the view errors button when `errorSummary` is empty', () => { + render( + + + + ); + + expect(screen.getByTestId('viewErrors')).toBeDisabled(); + }); + + test('it enables the view errors button when `errorSummary` is NOT empty', () => { + render( + + + + ); + + expect(screen.getByTestId('viewErrors')).not.toBeDisabled(); + }); + + describe('popover content', () => { + const addSuccessToast = jest.fn(); + + beforeEach(() => { + jest.resetAllMocks(); + + render( + + + + ); + + const viewErrorsButton = screen.getByTestId('viewErrors'); + + act(() => { + userEvent.click(viewErrorsButton); + }); + }); + + test('it renders the expected callout content', () => { + expect(screen.getByTestId('callout')).toHaveTextContent( + "ErrorsSome indices were not checked for Data QualityErrors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for accessThe following privileges are required to check an index:monitor or manageview_index_metadatareadCopy to clipboard" + ); + }); + + test('it invokes `addSuccessToast` when the copy button is clicked', () => { + const copyToClipboardButton = screen.getByTestId('copyToClipboard'); + act(() => { + userEvent.click(copyToClipboardButton, undefined, { skipPointerEventsCheck: true }); + }); + + expect(addSuccessToast).toBeCalledWith({ title: 'Copied errors to the clipboard' }); + }); + + test('it renders the expected error summary text in the errors viewer', () => { + expect(screen.getByTestId('errorsViewer').textContent?.includes(errorSummary[0].error)).toBe( + true + ); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx new file mode 100644 index 0000000000000..18824bd310ac7 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx @@ -0,0 +1,130 @@ +/* + * 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 { + copyToClipboard, + EuiButtonEmpty, + EuiCallOut, + EuiCode, + EuiPopover, + EuiSpacer, +} from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import styled from 'styled-components'; + +import { + COPY_TO_CLIPBOARD, + ERRORS_CALLOUT_SUMMARY, + ERRORS_MAY_OCCUR, + INDEX, + MANAGE, + MONITOR, + OR, + READ, + THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED, + VIEW_INDEX_METADATA, +} from '../../../../translations'; +import { ErrorsViewer } from './errors_viewer'; +import { ERRORS_CONTAINER_MAX_WIDTH } from './errors_viewer/helpers'; +import type { ErrorSummary } from '../../../../types'; +import { getErrorsMarkdownTable, getErrorsMarkdownTableRows } from '../../utils/markdown'; +import { ERROR, ERRORS, PATTERN } from '../../translations'; +import { COPIED_ERRORS_TOAST_TITLE, VIEW_ERRORS } from './translations'; + +const CallOut = styled(EuiCallOut)` + max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; +`; + +interface Props { + addSuccessToast: (toast: { title: string }) => void; + errorSummary: ErrorSummary[]; +} + +const ErrorsPopoverComponent: React.FC = ({ addSuccessToast, errorSummary }) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const onClick = useCallback(() => setIsPopoverOpen((isOpen) => !isOpen), []); + const closePopover = useCallback(() => setIsPopoverOpen(false), []); + + const onCopy = useCallback(() => { + const markdown = getErrorsMarkdownTable({ + errorSummary, + getMarkdownTableRows: getErrorsMarkdownTableRows, + headerNames: [PATTERN, INDEX, ERROR], + title: ERRORS, + }); + copyToClipboard(markdown); + + closePopover(); + + addSuccessToast({ + title: COPIED_ERRORS_TOAST_TITLE, + }); + }, [addSuccessToast, closePopover, errorSummary]); + + const button = useMemo( + () => ( + + {VIEW_ERRORS} + + ), + [errorSummary.length, onClick] + ); + + return ( + + +

{ERRORS_CALLOUT_SUMMARY}

+ +

{ERRORS_MAY_OCCUR}

+ + {THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} +
    +
  • + {MONITOR} {OR} {MANAGE} +
  • +
  • + {VIEW_INDEX_METADATA} +
  • +
  • + {READ} +
  • +
+ + + {COPY_TO_CLIPBOARD} + +
+ + + + +
+ ); +}; + +ErrorsPopoverComponent.displayName = 'ErrorsPopoverComponent'; + +export const ErrorsPopover = React.memo(ErrorsPopoverComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts new file mode 100644 index 0000000000000..55662b81a0578 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/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 COPIED_ERRORS_TOAST_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.toasts.copiedErrorsToastTitle', + { + defaultMessage: 'Copied errors to the clipboard', + } +); + +export const VIEW_ERRORS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errorsPopover.viewErrorsButton', + { + defaultMessage: 'View errors', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx new file mode 100644 index 0000000000000..a09a65f32b46e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx @@ -0,0 +1,208 @@ +/* + * 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 { act, render, screen } from '@testing-library/react'; +import React from 'react'; + +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../../mock/test_providers/test_providers'; +import { IndexToCheck } from '../../../types'; +import { CheckStatus, EMPTY_LAST_CHECKED_DATE } from '.'; + +const indexToCheck: IndexToCheck = { + pattern: 'auditbeat-*', + indexName: '.ds-auditbeat-8.6.1-2023.02.13-000001', +}; +const checkAllIndiciesChecked = 2; +const checkAllTotalIndiciesToCheck = 3; + +describe('CheckStatus', () => { + describe('when `indexToCheck` is not null', () => { + beforeEach(() => { + render( + + + + + + ); + }); + + test('it renders progress with the expected max value', () => { + expect(screen.getByTestId('progress')).toHaveAttribute( + 'max', + String(checkAllTotalIndiciesToCheck) + ); + }); + + test('it renders progress with the expected current value', () => { + expect(screen.getByTestId('progress')).toHaveAttribute( + 'value', + String(checkAllIndiciesChecked) + ); + }); + + test('it renders the expected "checking " message', () => { + expect(screen.getByTestId('checking')).toHaveTextContent( + `Checking ${indexToCheck.indexName}` + ); + }); + + test('it does NOT render the last checked message', () => { + expect(screen.queryByTestId('lastChecked')).not.toBeInTheDocument(); + }); + }); + + describe('when `indexToCheck` is null', () => { + beforeEach(() => { + render( + + + + + + ); + }); + + test('it does NOT render the progress bar', () => { + expect(screen.queryByTestId('progress')).not.toBeInTheDocument(); + }); + + test('it does NOT render the "checking " message', () => { + expect(screen.queryByTestId('checking')).not.toBeInTheDocument(); + }); + + test('it renders the expected last checked message', () => { + expect(screen.getByTestId('lastChecked')).toHaveTextContent(EMPTY_LAST_CHECKED_DATE); + }); + }); + + test('it renders the errors popover when errors have occurred', () => { + const errorSummary = [ + { + pattern: '.alerts-security.alerts-default', + indexName: null, + error: 'Error loading stats: Error: Forbidden', + }, + ]; + + render( + + + + + + ); + + expect(screen.getByTestId('errorsPopover')).toBeInTheDocument(); + }); + + test('it does NOT render the errors popover when errors have NOT occurred', () => { + render( + + + + + + ); + + expect(screen.queryByTestId('errorsPopover')).not.toBeInTheDocument(); + }); + + test('it invokes the `setLastChecked` callback when indexToCheck is not null', () => { + jest.useFakeTimers(); + const date = '2023-03-28T22:27:28.159Z'; + jest.setSystemTime(new Date(date)); + + const setLastChecked = jest.fn(); + + render( + + + + + + ); + + expect(setLastChecked).toBeCalledWith(date); + jest.useRealTimers(); + }); + + test('it updates the formatted date', async () => { + jest.useFakeTimers(); + const date = '2023-03-28T23:27:28.159Z'; + jest.setSystemTime(new Date(date)); + + const { rerender } = render( + + + + + + ); + + // re-render with an updated `lastChecked` + const lastChecked = '2023-03-28T22:27:28.159Z'; + + act(() => { + jest.advanceTimersByTime(1000 * 61); + }); + + rerender( + + + + + + ); + + act(() => { + // once again, advance time + jest.advanceTimersByTime(1000 * 61); + }); + + expect(await screen.getByTestId('lastChecked')).toHaveTextContent('Last checked: an hour ago'); + jest.useRealTimers(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx new file mode 100644 index 0000000000000..694bab1b97efe --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx @@ -0,0 +1,102 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiSpacer, EuiText } from '@elastic/eui'; +import React, { useEffect, useState } from 'react'; +import moment from 'moment'; + +import { ErrorsPopover } from './errors_popover'; +import * as i18n from '../../../translations'; +import type { ErrorSummary, IndexToCheck } from '../../../types'; +import { useDataQualityContext } from '../../../data_quality_context'; + +export const EMPTY_LAST_CHECKED_DATE = '--'; + +interface Props { + checkAllIndiciesChecked: number; + checkAllTotalIndiciesToCheck: number; + errorSummary: ErrorSummary[]; + indexToCheck: IndexToCheck | null; +} + +const CheckStatusComponent: React.FC = ({ + checkAllIndiciesChecked, + checkAllTotalIndiciesToCheck, + errorSummary, + indexToCheck, +}) => { + const { addSuccessToast, lastChecked, setLastChecked } = useDataQualityContext(); + const [formattedDate, setFormattedDate] = useState(EMPTY_LAST_CHECKED_DATE); + + useEffect(() => { + // update the lastCheckedDate whenever the next to check is updated + if (indexToCheck != null) { + setLastChecked(new Date().toISOString()); + } + }, [indexToCheck, setLastChecked]); + + useEffect(() => { + // immediately update the formatted date when lastCheckedDate is updated + if (moment(lastChecked).isValid()) { + setFormattedDate(moment(lastChecked).fromNow()); + } + + // periodically update the formatted date as time passes + const intervalId = setInterval(() => { + if (moment(lastChecked).isValid()) { + setFormattedDate(moment(lastChecked).fromNow()); + } + }, 10000); + + return () => clearInterval(intervalId); + }, [lastChecked]); + + return ( + + {indexToCheck != null && ( + <> + + + {i18n.CHECKING(indexToCheck.indexName)} + + + + + + + + + + )} + + + {indexToCheck == null && ( + + {i18n.LAST_CHECKED} + {': '} + {formattedDate} + + )} + + {errorSummary.length > 0 && ( +
+ +
+ )} +
+
+ ); +}; + +CheckStatusComponent.displayName = 'CheckStatusComponent'; + +export const CheckStatus = React.memo(CheckStatusComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx new file mode 100644 index 0000000000000..1bcfc9ec12aa3 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import numeral from '@elastic/numeral'; +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import React from 'react'; + +import { EMPTY_STAT } from '../../constants'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; +import { SummaryActions } from '.'; +import { + getTotalDocsCount, + getTotalIncompatible, + getTotalIndices, + getTotalIndicesChecked, + getTotalSizeInBytes, +} from '../../hooks/use_results_rollup/utils/stats'; + +const mockCopyToClipboard = jest.fn((value) => true); +jest.mock('@elastic/eui', () => { + const original = jest.requireActual('@elastic/eui'); + return { + ...original, + copyToClipboard: (value: string) => mockCopyToClipboard(value), + }; +}); + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +const ilmPhases = ['hot', 'warm', 'unmanaged']; +const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'packetbeat-*']; + +const patternRollups: Record = { + '.alerts-security.alerts-default': alertIndexWithAllResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, +}; + +const patternIndexNames: Record = { + 'auditbeat-*': [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-empty-index-1', + 'auditbeat-custom-index-1', + ], + '.alerts-security.alerts-default': ['.internal.alerts-security.alerts-default-000001'], + 'packetbeat-*': [ + '.ds-packetbeat-8.5.3-2023.02.04-000001', + '.ds-packetbeat-8.6.1-2023.02.04-000001', + ], +}; + +const addSuccessToast = jest.fn(); + +const lastChecked = '2023-03-28T23:27:28.159Z'; + +const totalDocsCount = getTotalDocsCount(patternRollups); +const totalIncompatible = getTotalIncompatible(patternRollups); +const totalIndices = getTotalIndices(patternRollups); +const totalIndicesChecked = getTotalIndicesChecked(patternRollups); +const totalSizeInBytes = getTotalSizeInBytes(patternRollups); + +describe('SummaryActions', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + + + ); + }); + + test('it renders the check all button', () => { + expect(screen.getByTestId('checkAll')).toBeInTheDocument(); + }); + + test('it renders the check status indicator', () => { + expect(screen.getByTestId('checkStatus')).toBeInTheDocument(); + }); + + test('it renders the actions', () => { + expect(screen.getByTestId('actions')).toBeInTheDocument(); + }); + + test('it invokes addSuccessToast when the copy to clipboard button is clicked', () => { + const button = screen.getByTestId('copyToClipboard'); + + userEvent.click(button); + + expect(addSuccessToast).toBeCalledWith({ + title: 'Copied results to the clipboard', + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx new file mode 100644 index 0000000000000..88d6e42af97ac --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { sortBy } from 'lodash/fp'; +import React, { useCallback, useMemo, useState } from 'react'; +import styled from 'styled-components'; + +import { CheckAll } from './check_all'; +import { CheckStatus } from './check_status'; +import type { DataQualityCheckResult, IndexToCheck, PatternRollup } from '../../types'; +import { useDataQualityContext } from '../../data_quality_context'; +import { useResultsRollupContext } from '../../contexts/results_rollup_context'; +import { Actions } from '../../actions'; +import { getErrorSummaries } from './utils/get_error_summaries'; +import { getSizeInBytes } from '../../utils/stats'; +import { getSummaryTableItems } from '../../utils/get_summary_table_items'; +import { defaultSort } from '../../constants'; +import { + getDataQualitySummaryMarkdownComment, + getErrorsMarkdownTable, + getErrorsMarkdownTableRows, + getPatternSummaryMarkdownComment, +} from './utils/markdown'; +import { getSummaryTableMarkdownHeader, getSummaryTableMarkdownRow } from '../../utils/markdown'; +import { ERROR, ERRORS, PATTERN } from './translations'; +import { INDEX } from '../../translations'; + +const StyledActionsContainerFlexItem = styled(EuiFlexItem)` + margin-top: auto; + padding-bottom: 3px; +`; + +export const getResultsSortedByDocsCount = ( + results: Record | undefined +): DataQualityCheckResult[] => + results != null ? sortBy('docsCount', Object.values(results)).reverse() : []; + +export const getAllMarkdownCommentsFromResults = ({ + formatBytes, + formatNumber, + isILMAvailable, + patternIndexNames, + patternRollup, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + isILMAvailable: boolean; + patternIndexNames: Record; + patternRollup: PatternRollup; +}): string[] => { + const results = patternRollup.results; + const sortedResults = getResultsSortedByDocsCount(results); + + const summaryTableItems = getSummaryTableItems({ + ilmExplain: patternRollup.ilmExplain, + indexNames: patternIndexNames[patternRollup.pattern] ?? [], + isILMAvailable, + pattern: patternRollup.pattern, + patternDocsCount: patternRollup.docsCount ?? 0, + results: patternRollup.results, + sortByColumn: defaultSort.sort.field, + sortByDirection: defaultSort.sort.direction, + stats: patternRollup.stats, + }); + + const summaryTableMarkdownRows: string[] = summaryTableItems.map((item) => { + const result: DataQualityCheckResult | undefined = + patternRollup.results != null ? patternRollup.results[item.indexName] : undefined; + const sizeInBytes = getSizeInBytes({ indexName: item.indexName, stats: patternRollup.stats }); + + return getSummaryTableMarkdownRow({ + docsCount: item.docsCount, + formatBytes, + formatNumber, + ilmPhase: item.ilmPhase, + indexName: item.indexName, + incompatible: result?.incompatible, + isILMAvailable, + patternDocsCount: patternRollup.docsCount ?? 0, + sizeInBytes, + }).trim(); + }); + + const initialComments: string[] = + summaryTableMarkdownRows.length > 0 + ? [getSummaryTableMarkdownHeader(isILMAvailable), ...summaryTableMarkdownRows] + : []; + + return sortedResults.reduce( + (acc, result) => [...acc, ...result.markdownComments], + initialComments + ); +}; + +export const getAllMarkdownComments = ({ + formatBytes, + formatNumber, + isILMAvailable, + patternIndexNames, + patternRollups, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + isILMAvailable: boolean; + patternIndexNames: Record; + patternRollups: Record; +}): string[] => { + const allPatterns: string[] = Object.keys(patternRollups); + + // sort the patterns A-Z: + const sortedPatterns = [...allPatterns].sort((a, b) => { + return a.localeCompare(b); + }); + + return sortedPatterns.reduce( + (acc, pattern) => [ + ...acc, + getPatternSummaryMarkdownComment({ + formatBytes, + formatNumber, + patternRollup: patternRollups[pattern], + }), + ...getAllMarkdownCommentsFromResults({ + formatBytes, + formatNumber, + isILMAvailable, + patternRollup: patternRollups[pattern], + patternIndexNames, + }), + ], + [] + ); +}; + +const SummaryActionsComponent: React.FC = () => { + const { isILMAvailable, formatBytes, formatNumber } = useDataQualityContext(); + const { + patternRollups, + totalIndices, + totalDocsCount, + totalIndicesChecked, + totalIncompatible, + patternIndexNames, + totalSizeInBytes, + } = useResultsRollupContext(); + const errorSummary = useMemo(() => getErrorSummaries(patternRollups), [patternRollups]); + const [indexToCheck, setIndexToCheck] = useState(null); + const [checkAllIndiciesChecked, setCheckAllIndiciesChecked] = useState(0); + const [checkAllTotalIndiciesToCheck, setCheckAllTotalIndiciesToCheck] = useState(0); + const incrementCheckAllIndiciesChecked = useCallback(() => { + setCheckAllIndiciesChecked((current) => current + 1); + }, []); + + const markdownComment = useMemo( + () => + [ + getDataQualitySummaryMarkdownComment({ + formatBytes, + formatNumber, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + sizeInBytes: totalSizeInBytes, + }), + ...getAllMarkdownComments({ + formatBytes, + formatNumber, + isILMAvailable, + patternIndexNames, + patternRollups, + }), + getErrorsMarkdownTable({ + errorSummary, + getMarkdownTableRows: getErrorsMarkdownTableRows, + headerNames: [PATTERN, INDEX, ERROR], + title: ERRORS, + }), + ].join('\n'), + [ + errorSummary, + formatBytes, + formatNumber, + isILMAvailable, + patternIndexNames, + patternRollups, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + totalSizeInBytes, + ] + ); + + return ( + <> + + + + + + + + + + + + + + + ); +}; + +SummaryActionsComponent.displayName = 'SummaryActionsComponent'; + +export const SummaryActions = React.memo(SummaryActionsComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.ts new file mode 100644 index 0000000000000..be47859ccabd1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.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 { i18n } from '@kbn/i18n'; + +export const DATA_QUALITY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.dataQuality', + { + defaultMessage: 'Data quality', + } +); + +export const ERROR = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.error', + { + defaultMessage: 'Error', + } +); + +export const ERRORS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.errors', + { + defaultMessage: 'Errors', + } +); + +export const PATTERN = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.pattern', + { + defaultMessage: 'Pattern', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.ts new file mode 100644 index 0000000000000..c1e78b92c0fd8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.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 { alertIndexNoResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { + auditbeatNoResults, + auditbeatWithAllResults, +} from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { + packetbeatNoResults, + packetbeatWithSomeErrors, +} from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { DataQualityCheckResult, PatternRollup } from '../../../types'; +import { + getErrorSummaries, + getErrorSummariesForRollup, + getErrorSummary, +} from './get_error_summaries'; + +describe('getErrorSummary', () => { + test('it returns the expected error summary', () => { + const resultWithError: DataQualityCheckResult = { + docsCount: 1630289, + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }; + + expect(getErrorSummary(resultWithError)).toEqual({ + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }); + }); +}); + +describe('getErrorSummariesForRollup', () => { + test('it returns the expected array of `ErrorSummary` when the `PatternRollup` contains errors', () => { + expect(getErrorSummariesForRollup(packetbeatWithSomeErrors)).toEqual([ + { + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + ]); + }); + + test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` contains all results, with NO errors', () => { + expect(getErrorSummariesForRollup(auditbeatWithAllResults)).toEqual([]); + }); + + test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` has NO results', () => { + expect(getErrorSummariesForRollup(auditbeatNoResults)).toEqual([]); + }); + + test('it returns the an empty array of `ErrorSummary` when the `PatternRollup` is undefined', () => { + expect(getErrorSummariesForRollup(undefined)).toEqual([]); + }); + + test('it returns BOTH the expected (root) pattern-level error, and an index-level error when `PatternRollup` has both', () => { + const withPatternLevelError: PatternRollup = { + ...packetbeatWithSomeErrors, + error: 'This is a pattern-level error', + }; + + expect(getErrorSummariesForRollup(withPatternLevelError)).toEqual([ + { + error: 'This is a pattern-level error', + indexName: null, + pattern: 'packetbeat-*', + }, + { + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + ]); + }); + + test('it returns the expected (root) pattern-level error when there are no index-level results', () => { + const withPatternLevelError: PatternRollup = { + ...auditbeatNoResults, + error: 'This is a pattern-level error', + }; + + expect(getErrorSummariesForRollup(withPatternLevelError)).toEqual([ + { + error: 'This is a pattern-level error', + indexName: null, + pattern: 'auditbeat-*', + }, + ]); + }); +}); + +describe('getErrorSummaries', () => { + test('it returns an empty array when patternRollups is empty', () => { + expect(getErrorSummaries({})).toEqual([]); + }); + + test('it returns an empty array when none of the patternRollups have errors', () => { + expect( + getErrorSummaries({ + '.alerts-security.alerts-default': alertIndexNoResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, + }) + ).toEqual([]); + }); + + test('it returns the expected array of `ErrorSummary` when some of the `PatternRollup` contain errors', () => { + expect( + getErrorSummaries({ + '.alerts-security.alerts-default': alertIndexNoResults, + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatWithSomeErrors, // <-- has errors + }) + ).toEqual([ + { + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + ]); + }); + + test('it returns the expected array of `ErrorSummary` when there are both pattern-level and index-level errors', () => { + const withPatternLevelError: PatternRollup = { + ...auditbeatNoResults, + error: 'This is a pattern-level error', + }; + + expect( + getErrorSummaries({ + '.alerts-security.alerts-default': alertIndexNoResults, + 'auditbeat-*': withPatternLevelError, // <-- has pattern-level errors + 'packetbeat-*': packetbeatWithSomeErrors, // <-- has index-level errors + }) + ).toEqual([ + { + error: 'This is a pattern-level error', + indexName: null, + pattern: 'auditbeat-*', + }, + { + error: + 'Error loading mappings for .ds-packetbeat-8.5.3-2023.02.04-000001: Error: simulated error fetching index .ds-packetbeat-8.5.3-2023.02.04-000001', + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'packetbeat-*', + }, + ]); + }); + + test('it returns the expected array of `ErrorSummary` when there are just pattern-level errors', () => { + const withPatternLevelError: PatternRollup = { + ...auditbeatNoResults, + error: 'This is a pattern-level error', + }; + + expect( + getErrorSummaries({ + '.alerts-security.alerts-default': alertIndexNoResults, + 'auditbeat-*': withPatternLevelError, // <-- has pattern-level errors + 'packetbeat-*': packetbeatNoResults, + }) + ).toEqual([ + { + error: 'This is a pattern-level error', + indexName: null, + pattern: 'auditbeat-*', + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.ts new file mode 100644 index 0000000000000..a3b6b8ac7d1d8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.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 sortBy from 'lodash/fp/sortBy'; +import { DataQualityCheckResult, ErrorSummary, PatternRollup } from '../../../types'; + +export const getErrorSummary = ({ + error, + indexName, + pattern, +}: DataQualityCheckResult): ErrorSummary => ({ + error: String(error), + indexName, + pattern, +}); + +export const getErrorSummariesForRollup = ( + patternRollup: PatternRollup | undefined +): ErrorSummary[] => { + const maybePatternErrorSummary: ErrorSummary[] = + patternRollup != null && patternRollup.error != null + ? [{ pattern: patternRollup.pattern, indexName: null, error: patternRollup.error }] + : []; + + if (patternRollup != null && patternRollup.results != null) { + const unsortedResults: DataQualityCheckResult[] = Object.values(patternRollup.results); + const sortedResults = sortBy('indexName', unsortedResults); + + return sortedResults.reduce( + (acc, result) => [...acc, ...(result.error != null ? [getErrorSummary(result)] : [])], + maybePatternErrorSummary + ); + } else { + return maybePatternErrorSummary; + } +}; + +export const getErrorSummaries = ( + patternRollups: Record +): ErrorSummary[] => { + const allPatterns: string[] = Object.keys(patternRollups); + + // sort the patterns A-Z: + const sortedPatterns = [...allPatterns].sort((a, b) => { + return a.localeCompare(b); + }); + + return sortedPatterns.reduce( + (acc, pattern) => [...acc, ...getErrorSummariesForRollup(patternRollups[pattern])], + [] + ); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts new file mode 100644 index 0000000000000..c52a4784f876d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts @@ -0,0 +1,212 @@ +/* + * 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 numeral from '@elastic/numeral'; + +import { EMPTY_STAT } from '../../../constants'; +import { + auditbeatNoResults, + auditbeatWithAllResults, +} from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { INDEX } from '../../../translations'; +import { ErrorSummary, PatternRollup } from '../../../types'; +import { ERROR, ERRORS, PATTERN } from '../translations'; +import { + getDataQualitySummaryMarkdownComment, + getErrorsMarkdownTable, + getErrorsMarkdownTableRows, + getIlmExplainPhaseCountsMarkdownComment, + getPatternSummaryMarkdownComment, +} from './markdown'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +describe('getIlmExplainPhaseCountsMarkdownComment', () => { + test('it returns the expected comment when _all_ of the counts are greater than zero', () => { + expect( + getIlmExplainPhaseCountsMarkdownComment({ + hot: 99, + warm: 8, + unmanaged: 77, + cold: 6, + frozen: 55, + }) + ).toEqual('`hot(99)` `warm(8)` `unmanaged(77)` `cold(6)` `frozen(55)`'); + }); + + test('it returns the expected comment when _some_ of the counts are greater than zero', () => { + expect( + getIlmExplainPhaseCountsMarkdownComment({ + hot: 9, + warm: 0, + unmanaged: 2, + cold: 1, + frozen: 0, + }) + ).toEqual('`hot(9)` `unmanaged(2)` `cold(1)`'); + }); + + test('it returns the expected comment when _none_ of the counts are greater than zero', () => { + expect( + getIlmExplainPhaseCountsMarkdownComment({ + hot: 0, + warm: 0, + unmanaged: 0, + cold: 0, + frozen: 0, + }) + ).toEqual(''); + }); +}); + +describe('getPatternSummaryMarkdownComment', () => { + test('it returns the expected comment when the rollup contains results for all of the indices in the pattern', () => { + expect( + getPatternSummaryMarkdownComment({ + formatBytes, + formatNumber, + patternRollup: auditbeatWithAllResults, + }) + ).toEqual( + '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 19,127 |\n\n' + ); + }); + + test('it returns the expected comment when the rollup contains no results', () => { + expect( + getPatternSummaryMarkdownComment({ + formatBytes, + formatNumber, + patternRollup: auditbeatNoResults, + }) + ).toEqual( + '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| -- | 0 | 3 | 17.9MB | 19,127 |\n\n' + ); + }); + + test('it returns the expected comment when the rollup does NOT have `ilmExplainPhaseCounts`', () => { + const noIlmExplainPhaseCounts: PatternRollup = { + ...auditbeatWithAllResults, + ilmExplainPhaseCounts: undefined, // <-- + }; + + expect( + getPatternSummaryMarkdownComment({ + formatBytes, + formatNumber, + patternRollup: noIlmExplainPhaseCounts, + }) + ).toEqual( + '## auditbeat-*\n\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 19,127 |\n\n' + ); + }); + + test('it returns the expected comment when `docsCount` is undefined', () => { + const noDocsCount: PatternRollup = { + ...auditbeatWithAllResults, + docsCount: undefined, // <-- + }; + + expect( + getPatternSummaryMarkdownComment({ + formatBytes, + formatNumber, + patternRollup: noDocsCount, + }) + ).toEqual( + '## auditbeat-*\n`hot(1)` `unmanaged(2)`\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 3 | 3 | 17.9MB | 0 |\n\n' + ); + }); +}); + +describe('getDataQualitySummaryMarkdownComment', () => { + test('it returns the expected comment', () => { + expect( + getDataQualitySummaryMarkdownComment({ + formatBytes, + formatNumber, + totalDocsCount: 3343719, + totalIncompatible: 4, + totalIndices: 30, + totalIndicesChecked: 2, + sizeInBytes: 4294967296, + }) + ).toEqual( + '# Data quality\n\n| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 4 | 2 | 30 | 4GB | 3,343,719 |\n\n' + ); + }); + + test('it returns the expected comment when optional values are undefined', () => { + expect( + getDataQualitySummaryMarkdownComment({ + formatBytes, + formatNumber, + totalDocsCount: undefined, + totalIncompatible: undefined, + totalIndices: undefined, + totalIndicesChecked: undefined, + sizeInBytes: undefined, + }) + ).toEqual( + '# Data quality\n\n| Incompatible fields | Indices checked | Indices | Docs |\n|---------------------|-----------------|---------|------|\n| -- | -- | -- | 0 |\n\n' + ); + }); +}); + +const errorSummary: ErrorSummary[] = [ + { + pattern: '.alerts-security.alerts-default', + indexName: null, + error: 'Error loading stats: Error: Forbidden', + }, + { + error: + 'Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden', + indexName: 'auditbeat-7.2.1-2023.02.13-000001', + pattern: 'auditbeat-*', + }, +]; + +describe('getErrorsMarkdownTableRows', () => { + test('it returns the expected markdown table rows', () => { + expect(getErrorsMarkdownTableRows(errorSummary)).toEqual( + '| .alerts-security.alerts-default | -- | `Error loading stats: Error: Forbidden` |\n| auditbeat-* | auditbeat-7.2.1-2023.02.13-000001 | `Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden` |' + ); + }); +}); + +describe('getErrorsMarkdownTable', () => { + test('it returns the expected table contents', () => { + expect( + getErrorsMarkdownTable({ + errorSummary, + getMarkdownTableRows: getErrorsMarkdownTableRows, + headerNames: [PATTERN, INDEX, ERROR], + title: ERRORS, + }) + ).toEqual( + `## Errors\n\nSome indices were not checked for Data Quality\n\nErrors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for access\n\nThe following privileges are required to check an index:\n- \`monitor\` or \`manage\`\n- \`view_index_metadata\`\n- \`read\`\n\n\n| Pattern | Index | Error | \n|---------|-------|-------|\n| .alerts-security.alerts-default | -- | \`Error loading stats: Error: Forbidden\` |\n| auditbeat-* | auditbeat-7.2.1-2023.02.13-000001 | \`Error: Error loading unallowed values for index auditbeat-7.2.1-2023.02.13-000001: Forbidden\` |\n` + ); + }); + + test('it returns an empty string when the error summary is empty', () => { + expect( + getErrorsMarkdownTable({ + errorSummary: [], // <-- empty + getMarkdownTableRows: getErrorsMarkdownTableRows, + headerNames: [PATTERN, INDEX, ERROR], + title: ERRORS, + }) + ).toEqual(''); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts new file mode 100644 index 0000000000000..2ee2209dbb789 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts @@ -0,0 +1,145 @@ +/* + * 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 { EMPTY_PLACEHOLDER } from '../../../constants'; +import { + COLD, + ERRORS_CALLOUT_SUMMARY, + ERRORS_MAY_OCCUR, + FROZEN, + HOT, + MANAGE, + MONITOR, + OR, + READ, + THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED, + UNMANAGED, + VIEW_INDEX_METADATA, + WARM, +} from '../../../translations'; +import { ErrorSummary, IlmExplainPhaseCounts, PatternRollup } from '../../../types'; +import { + escapeNewlines, + getCodeFormattedValue, + getMarkdownTableHeader, + getStatsRollupMarkdownComment, +} from '../../../utils/markdown'; +import { getTotalPatternIncompatible, getTotalPatternIndicesChecked } from '../../../utils/stats'; +import { DATA_QUALITY } from '../translations'; + +export const getIlmExplainPhaseCountsMarkdownComment = ({ + hot, + warm, + unmanaged, + cold, + frozen, +}: IlmExplainPhaseCounts): string => + [ + hot > 0 ? getCodeFormattedValue(`${HOT}(${hot})`) : '', + warm > 0 ? getCodeFormattedValue(`${WARM}(${warm})`) : '', + unmanaged > 0 ? getCodeFormattedValue(`${UNMANAGED}(${unmanaged})`) : '', + cold > 0 ? getCodeFormattedValue(`${COLD}(${cold})`) : '', + frozen > 0 ? getCodeFormattedValue(`${FROZEN}(${frozen})`) : '', + ] + .filter((x) => x !== '') // prevents extra whitespace + .join(' '); + +export const getPatternSummaryMarkdownComment = ({ + formatBytes, + formatNumber, + patternRollup, + patternRollup: { docsCount, indices, ilmExplainPhaseCounts, pattern, results }, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + patternRollup: PatternRollup; +}): string => + `## ${escapeNewlines(pattern)} +${ + ilmExplainPhaseCounts != null + ? getIlmExplainPhaseCountsMarkdownComment(ilmExplainPhaseCounts) + : '' +} + +${getStatsRollupMarkdownComment({ + docsCount: docsCount ?? 0, + formatBytes, + formatNumber, + incompatible: getTotalPatternIncompatible(results), + indices, + indicesChecked: getTotalPatternIndicesChecked(patternRollup), + sizeInBytes: patternRollup.sizeInBytes, +})} +`; + +export const getDataQualitySummaryMarkdownComment = ({ + formatBytes, + formatNumber, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + sizeInBytes, +}: { + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + totalDocsCount: number | undefined; + totalIncompatible: number | undefined; + totalIndices: number | undefined; + totalIndicesChecked: number | undefined; + sizeInBytes: number | undefined; +}): string => + `# ${DATA_QUALITY} + +${getStatsRollupMarkdownComment({ + docsCount: totalDocsCount ?? 0, + formatBytes, + formatNumber, + incompatible: totalIncompatible, + indices: totalIndices, + indicesChecked: totalIndicesChecked, + sizeInBytes, +})} +`; + +export const getErrorsMarkdownTable = ({ + errorSummary, + getMarkdownTableRows, + headerNames, + title, +}: { + errorSummary: ErrorSummary[]; + getMarkdownTableRows: (errorSummary: ErrorSummary[]) => string; + headerNames: string[]; + title: string; +}): string => + errorSummary.length > 0 + ? `## ${escapeNewlines(title)} + +${ERRORS_CALLOUT_SUMMARY} + +${ERRORS_MAY_OCCUR} + +${THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED} +- \`${MONITOR}\` ${OR} \`${MANAGE}\` +- \`${VIEW_INDEX_METADATA}\` +- \`${READ}\` + +${getMarkdownTableHeader(headerNames)} +${getMarkdownTableRows(errorSummary)} +` + : ''; + +export const getErrorsMarkdownTableRows = (errorSummary: ErrorSummary[]): string => + errorSummary + .map( + ({ pattern, indexName, error }) => + `| ${escapeNewlines(pattern)} | ${escapeNewlines( + indexName ?? EMPTY_PLACEHOLDER + )} | ${getCodeFormattedValue(error)} |` + ) + .join('\n'); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx new file mode 100644 index 0000000000000..f16803936794d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx @@ -0,0 +1,386 @@ +/* + * 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 { act, renderHook } from '@testing-library/react-hooks'; + +import { useIndicesCheck } from '.'; + +import * as utilsCheckIndex from '../../utils/check_index'; +import { mockUnallowedValuesResponse } from '../../mock/unallowed_values/mock_unallowed_values'; +import { mockMappingsResponse } from '../../mock/mappings_response/mock_mappings_response'; +import { HttpHandler } from '@kbn/core-http-browser'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; +import { UnallowedValueSearchResult } from '../../types'; +import { getInitialCheckStateValue } from './reducer'; + +const getSpies = () => { + return { + checkIndexSpy: jest.spyOn(utilsCheckIndex, 'checkIndex').mockImplementation(jest.fn()), + }; +}; + +describe('useIndicesCheck', () => { + beforeEach(() => { + jest.restoreAllMocks(); + jest.clearAllMocks(); + }); + + it('should return checkIndex and checkState', () => { + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + expect(result.current).toEqual({ + checkIndex: expect.any(Function), + checkState: expect.any(Object), + }); + }); + + describe('checkIndex', () => { + it('should call checkIndex with the correct arguments', () => { + const { checkIndexSpy } = getSpies(); + + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + const props = { + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'indexName', + pattern: 'pattern', + httpFetch: jest.fn(), + }; + + act(() => { + result.current.checkIndex(props); + }); + + expect(checkIndexSpy).toHaveBeenCalledWith({ + ...props, + onCheckCompleted: expect.any(Function), + onLoadMappingsStart: expect.any(Function), + onLoadMappingsSuccess: expect.any(Function), + onLoadUnallowedValuesStart: expect.any(Function), + onLoadUnallowedValuesSuccess: expect.any(Function), + onStart: expect.any(Function), + onSuccess: expect.any(Function), + onError: expect.any(Function), + }); + }); + }); + + describe('checkState', () => { + it('should be empty by default', () => { + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + expect(result.current.checkState).toEqual({}); + }); + + describe('when checkIndex completes', () => { + it('should set correct data', async () => { + const { result, waitFor } = renderHook(() => + useIndicesCheck({ onCheckCompleted: jest.fn() }) + ); + + const httpFetchMock = jest.fn((route) => { + if (route.startsWith('/internal/ecs_data_quality_dashboard/mappings')) { + return Promise.resolve(mockMappingsResponse); + } + + if (route.startsWith('/internal/ecs_data_quality_dashboard/unallowed_field_values')) { + return Promise.resolve(mockUnallowedValuesResponse); + } + }); + + act(() => { + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: httpFetchMock as unknown as HttpHandler, + }); + }); + + await waitFor(() => + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + indexes: expect.any(Object), + partitionedFieldMetadata: expect.any(Object), + searchResults: expect.any(Object), + unallowedValues: expect.any(Object), + mappingsProperties: expect.any(Object), + isCheckComplete: true, + }) + ); + }); + }); + + describe('errors', () => { + describe('when mappings request errors', () => { + it('should set mappingsError', async () => { + const { result, waitFor } = renderHook(() => + useIndicesCheck({ onCheckCompleted: jest.fn() }) + ); + + const httpFetchMock = jest.fn((route) => { + if (route.startsWith('/internal/ecs_data_quality_dashboard/mappings')) { + return Promise.reject(new Error('mappings error')); + } + + if (route.startsWith('/internal/ecs_data_quality_dashboard/unallowed_field_values')) { + return Promise.reject(new Error('unallowed values error')); + } + }); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: httpFetchMock as unknown as HttpHandler, + }) + ); + + await waitFor(() => + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + mappingsError: expect.any(MappingsError), + }) + ); + }); + }); + + describe('when unallowed values request errors', () => { + it('should set unallowedValuesError', async () => { + const { result, waitFor } = renderHook(() => + useIndicesCheck({ onCheckCompleted: jest.fn() }) + ); + + const httpFetchMock = jest.fn((route) => { + if (route.startsWith('/internal/ecs_data_quality_dashboard/mappings')) { + return Promise.resolve(mockMappingsResponse); + } + + if (route.startsWith('/internal/ecs_data_quality_dashboard/unallowed_field_values')) { + return Promise.reject(new Error('unallowed values error')); + } + }); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: httpFetchMock as unknown as HttpHandler, + }) + ); + + await waitFor(() => + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + unallowedValuesError: expect.any(UnallowedValuesError), + }) + ); + }); + }); + + describe('when anything else errors', () => { + it('should set genericError', () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onError }) => { + onError?.(new Error('generic error')); + }); + + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + genericError: expect.any(Error), + }); + }); + }); + }); + + describe('lifecycle states', () => { + describe('when check is started', () => { + it('it should set isChecking to true', async () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onStart }) => { + onStart?.(); + }); + + const { result, waitFor } = renderHook(() => + useIndicesCheck({ onCheckCompleted: jest.fn() }) + ); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + await waitFor(() => + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + isChecking: true, + }) + ); + }); + }); + + describe('when mappings are loading', () => { + it('it should set isLoadingMappings to true', () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onStart, onLoadMappingsStart }) => { + onStart?.(); + onLoadMappingsStart?.(); + }); + + const { result, waitFor } = renderHook(() => + useIndicesCheck({ onCheckCompleted: jest.fn() }) + ); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + waitFor(() => + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + isChecking: true, + isLoadingMappings: true, + }) + ); + }); + }); + + describe('when unallowed values are loading', () => { + it('it should set isLoadingUnallowedValues to true', () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onStart, onLoadUnallowedValuesStart }) => { + onStart?.(); + onLoadUnallowedValuesStart?.(); + }); + + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + isChecking: true, + isLoadingUnallowedValues: true, + }); + }); + }); + + describe('when mappings are loaded', () => { + it('should set indexes', () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onStart, onLoadMappingsSuccess }) => { + onStart?.(); + onLoadMappingsSuccess?.( + mockMappingsResponse as Record + ); + }); + + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + indexes: mockMappingsResponse, + }); + }); + }); + + describe('when unallowed values are loaded', () => { + it('should set searchResults', () => { + const { checkIndexSpy } = getSpies(); + + checkIndexSpy.mockImplementation(async ({ onStart, onLoadUnallowedValuesSuccess }) => { + onStart?.(); + onLoadUnallowedValuesSuccess?.( + mockUnallowedValuesResponse as unknown as UnallowedValueSearchResult[] + ); + }); + + const { result } = renderHook(() => useIndicesCheck({ onCheckCompleted: jest.fn() })); + + act(() => + result.current.checkIndex({ + abortController: new AbortController(), + formatBytes: jest.fn(), + formatNumber: jest.fn(), + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + httpFetch: jest.fn(), + }) + ); + + expect(result.current.checkState['auditbeat-custom-index-1']).toEqual({ + ...getInitialCheckStateValue(), + searchResults: mockUnallowedValuesResponse, + }); + }); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx new file mode 100644 index 0000000000000..6ad00aacb338d --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx @@ -0,0 +1,105 @@ +/* + * 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 { useReducer, useCallback } from 'react'; +import { OnCheckCompleted } from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { checkIndex as _checkIndex, CheckIndexProps } from '../../utils/check_index'; +import { initialState, reducer } from './reducer'; +import { UseIndicesCheckReturnValue } from './types'; +import { useIsMounted } from '../use_is_mounted'; + +export const useIndicesCheck = ({ + onCheckCompleted, +}: { + onCheckCompleted: OnCheckCompleted; +}): UseIndicesCheckReturnValue => { + const { isMountedRef } = useIsMounted(); + const [state, dispatch] = useReducer(reducer, initialState); + + const checkIndex = useCallback( + ({ + abortController, + formatBytes, + formatNumber, + httpFetch, + indexName, + pattern, + batchId, + checkAllStartTime, + isCheckAll, + isLastCheck, + }: Omit) => { + _checkIndex({ + batchId, + abortController, + formatBytes, + formatNumber, + httpFetch, + indexName, + onCheckCompleted, + pattern, + checkAllStartTime, + isCheckAll, + isLastCheck, + onStart: () => { + if (!isMountedRef.current) return; + dispatch({ type: 'START', data: { indexName } }); + }, + onLoadMappingsStart: () => { + if (!isMountedRef.current) return; + dispatch({ type: 'LOAD_MAPPINGS_START', data: { indexName } }); + }, + onLoadUnallowedValuesStart: () => { + if (!isMountedRef.current) return; + dispatch({ type: 'LOAD_UNALLOWED_VALUES_START', data: { indexName } }); + }, + onSuccess: ({ partitionedFieldMetadata, mappingsProperties, unallowedValues }) => { + if (!isMountedRef.current) return; + dispatch({ + type: 'SUCCESS', + data: { + indexName, + partitionedFieldMetadata, + mappingsProperties, + unallowedValues, + }, + }); + }, + onLoadMappingsSuccess: (indexes) => { + if (!isMountedRef.current) return; + dispatch({ type: 'LOAD_MAPPINGS_SUCCESS', data: { indexName, indexes } }); + }, + onLoadUnallowedValuesSuccess: (searchResults) => { + if (!isMountedRef.current) return; + dispatch({ type: 'LOAD_UNALLOWED_VALUES_SUCCESS', data: { indexName, searchResults } }); + }, + onError: (error) => { + if (!isMountedRef.current) return; + if (error instanceof MappingsError) { + dispatch({ type: 'LOAD_MAPPINGS_ERROR', data: { indexName, error } }); + } else if (error instanceof UnallowedValuesError) { + dispatch({ type: 'LOAD_UNALLOWED_VALUES_ERROR', data: { indexName, error } }); + } else { + if (error instanceof Error) { + dispatch({ type: 'GENERIC_ERROR', data: { indexName, error } }); + } else { + dispatch({ type: 'GENERIC_ERROR', data: { indexName, error: 'Unknown error' } }); + } + } + }, + }); + }, + [isMountedRef, onCheckCompleted] + ); + + return { + ...state, + checkIndex, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts new file mode 100644 index 0000000000000..73bb4c1a98df1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts @@ -0,0 +1,194 @@ +/* + * 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 { + IndicesGetMappingIndexMappingRecord, + MappingProperty, +} from '@elastic/elasticsearch/lib/api/types'; + +import { + PartitionedFieldMetadata, + UnallowedValueCount, + UnallowedValueSearchResult, +} from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { UseIndicesCheckState } from './types'; + +type Action = { data: { indexName: string } } & ( + | { + type: 'START' | 'LOAD_MAPPINGS_START' | 'LOAD_UNALLOWED_VALUES_START'; + } + | { + type: 'SUCCESS'; + data: { + partitionedFieldMetadata: PartitionedFieldMetadata; + mappingsProperties: Record | null; + unallowedValues: Record; + }; + } + | { + type: 'LOAD_MAPPINGS_SUCCESS'; + data: { indexes: Record }; + } + | { + type: 'LOAD_UNALLOWED_VALUES_SUCCESS'; + data: { searchResults: UnallowedValueSearchResult[] }; + } + | { type: 'GENERIC_ERROR'; data: { error: string | Error } } + | { type: 'LOAD_MAPPINGS_ERROR'; data: { error: MappingsError } } + | { type: 'LOAD_UNALLOWED_VALUES_ERROR'; data: { error: UnallowedValuesError } } +); + +// intentionally returning a new object every time +// instead of caching the initial state +// to avoid potential mutations when spreaded +// across actions +export const getInitialCheckStateValue = () => ({ + isChecking: false, + isLoadingMappings: false, + isLoadingUnallowedValues: false, + indexes: null, + partitionedFieldMetadata: null, + searchResults: null, + unallowedValues: null, + mappingsProperties: null, + genericError: null, + mappingsError: null, + unallowedValuesError: null, + isCheckComplete: false, +}); + +export const initialState: UseIndicesCheckState = { + checkState: {}, +}; + +export const reducer = (state: UseIndicesCheckState, action: Action): UseIndicesCheckState => { + switch (action.type) { + case 'START': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...getInitialCheckStateValue(), + isChecking: true, + }, + }, + }; + case 'LOAD_MAPPINGS_START': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...state.checkState[action.data.indexName], + isChecking: true, + isLoadingMappings: true, + }, + }, + }; + case 'LOAD_UNALLOWED_VALUES_START': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...state.checkState[action.data.indexName], + isChecking: true, + isLoadingUnallowedValues: true, + }, + }, + }; + case 'SUCCESS': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...state.checkState[action.data.indexName], + isChecking: false, + isLoadingMappings: false, + isLoadingUnallowedValues: false, + genericError: null, + mappingsError: null, + unallowedValuesError: null, + partitionedFieldMetadata: action.data.partitionedFieldMetadata, + unallowedValues: action.data.unallowedValues, + mappingsProperties: action.data.mappingsProperties, + isCheckComplete: true, + }, + }, + }; + case 'LOAD_MAPPINGS_SUCCESS': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...state.checkState[action.data.indexName], + isChecking: false, + isLoadingMappings: false, + isLoadingUnallowedValues: false, + genericError: null, + mappingsError: null, + indexes: action.data.indexes, + }, + }, + }; + case 'LOAD_UNALLOWED_VALUES_SUCCESS': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...state.checkState[action.data.indexName], + isChecking: false, + isLoadingUnallowedValues: false, + genericError: null, + unallowedValuesError: null, + searchResults: action.data.searchResults, + }, + }, + }; + case 'GENERIC_ERROR': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...getInitialCheckStateValue(), + genericError: action.data.error, + }, + }, + }; + case 'LOAD_MAPPINGS_ERROR': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...getInitialCheckStateValue(), + mappingsError: action.data.error, + }, + }, + }; + case 'LOAD_UNALLOWED_VALUES_ERROR': + return { + ...state, + checkState: { + ...state.checkState, + [action.data.indexName]: { + ...getInitialCheckStateValue(), + unallowedValuesError: action.data.error, + }, + }, + }; + default: + throw new Error('Invalid action type'); + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts new file mode 100644 index 0000000000000..2b9ecf147e0a3 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts @@ -0,0 +1,44 @@ +/* + * 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 { + IndicesGetMappingIndexMappingRecord, + MappingProperty, +} from '@elastic/elasticsearch/lib/api/types'; +import { + PartitionedFieldMetadata, + UnallowedValueCount, + UnallowedValueSearchResult, +} from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { CheckIndexProps } from '../../utils/check_index'; + +export interface UseIndicesCheckCheckState { + [indexName: string]: { + isChecking: boolean; + isLoadingMappings: boolean; + isLoadingUnallowedValues: boolean; + indexes: Record | null; + partitionedFieldMetadata: PartitionedFieldMetadata | null; + searchResults: UnallowedValueSearchResult[] | null; + unallowedValues: Record | null; + mappingsProperties: Record | null; + genericError: string | Error | null; + mappingsError: MappingsError | null; + unallowedValuesError: UnallowedValuesError | null; + isCheckComplete: boolean; + }; +} + +export interface UseIndicesCheckState { + checkState: UseIndicesCheckCheckState; +} + +export interface UseIndicesCheckReturnValue extends UseIndicesCheckState { + checkIndex: (props: Omit) => void; +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.test.tsx new file mode 100644 index 0000000000000..d29aaf8ace201 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.test.tsx @@ -0,0 +1,24 @@ +/* + * 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 { act, renderHook } from '@testing-library/react-hooks'; + +import { useIsMounted } from '.'; + +describe('useIsMounted', () => { + it('should return a ref that is true when mounted and false when unmounted', () => { + const { result, unmount } = renderHook(() => useIsMounted()); + + expect(result.current.isMountedRef.current).toBe(true); + + act(() => { + unmount(); + }); + + expect(result.current.isMountedRef.current).toBe(false); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.tsx new file mode 100644 index 0000000000000..6ba5ebacf8ea0 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.tsx @@ -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 { MutableRefObject, useEffect, useRef } from 'react'; + +/** + * Hook that returns a ref that is true when mounted and false when unmounted. + * + * Main use case is to avoid setting state on an unmounted component. + */ +export const useIsMounted = (): { isMountedRef: MutableRefObject } => { + const isMountedRef = useRef(true); + + useEffect(() => { + return () => { + isMountedRef.current = false; + }; + }, []); + + return { isMountedRef }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.ts new file mode 100644 index 0000000000000..e2251d526136f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const POST_INDEX_RESULTS = '/internal/ecs_data_quality_dashboard/results'; +export const GET_INDEX_RESULTS_LATEST = + '/internal/ecs_data_quality_dashboard/results_latest/{pattern}'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx new file mode 100644 index 0000000000000..e2571b5d0a75c --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx @@ -0,0 +1,269 @@ +/* + * 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, useState } from 'react'; +import { EcsVersion } from '@elastic/ecs'; +import { isEmpty } from 'lodash/fp'; +import { IToasts } from '@kbn/core-notifications-browser'; +import { HttpHandler } from '@kbn/core-http-browser'; + +import { + getTotalDocsCount, + getTotalIncompatible, + getTotalIndices, + getTotalIndicesChecked, + getTotalSameFamily, + getTotalSizeInBytes, + getTotalPatternSameFamily, + getIndexId, +} from './utils/stats'; +import { + getStorageResults, + postStorageResult, + formatStorageResult, + formatResultFromStorage, +} from './utils/storage'; +import { getPatternRollupsWithLatestCheckResult } from './utils/get_pattern_rollups_with_latest_check_result'; +import type { + DataQualityCheckResult, + OnCheckCompleted, + PatternRollup, + TelemetryEvents, +} from '../../types'; +import { + getIncompatibleMappingsFields, + getIncompatibleValuesFields, + getSameFamilyFields, +} from '../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers'; +import { UseResultsRollupReturnValue } from './types'; +import { useIsMounted } from '../use_is_mounted'; +import { getDocsCount, getIndexIncompatible, getSizeInBytes } from '../../utils/stats'; +import { getIlmPhase } from '../../utils/get_ilm_phase'; + +interface Props { + ilmPhases: string[]; + patterns: string[]; + toasts: IToasts; + httpFetch: HttpHandler; + telemetryEvents: TelemetryEvents; + isILMAvailable: boolean; +} +const useStoredPatternResults = (patterns: string[], toasts: IToasts, httpFetch: HttpHandler) => { + const { isMountedRef } = useIsMounted(); + const [storedPatternResults, setStoredPatternResults] = useState< + Array<{ pattern: string; results: Record }> + >([]); + + useEffect(() => { + if (isEmpty(patterns)) { + return; + } + + let ignore = false; + const abortController = new AbortController(); + const fetchStoredPatternResults = async () => { + const requests = patterns.map((pattern) => + getStorageResults({ pattern, httpFetch, abortController, toasts }).then((results = []) => ({ + pattern, + results: Object.fromEntries( + results.map((storageResult) => [ + storageResult.indexName, + formatResultFromStorage({ storageResult, pattern }), + ]) + ), + })) + ); + const patternResults = await Promise.all(requests); + if (patternResults?.length && !ignore) { + if (isMountedRef.current) { + setStoredPatternResults(patternResults); + } + } + }; + + fetchStoredPatternResults(); + return () => { + ignore = true; + }; + }, [httpFetch, isMountedRef, patterns, toasts]); + + return storedPatternResults; +}; + +export const useResultsRollup = ({ + httpFetch, + toasts, + ilmPhases, + patterns, + isILMAvailable, + telemetryEvents, +}: Props): UseResultsRollupReturnValue => { + const [patternIndexNames, setPatternIndexNames] = useState>({}); + const [patternRollups, setPatternRollups] = useState>({}); + + const storedPatternsResults = useStoredPatternResults(patterns, toasts, httpFetch); + + useEffect(() => { + if (!isEmpty(storedPatternsResults)) { + setPatternRollups((current) => + storedPatternsResults.reduce( + (acc, { pattern, results }) => ({ + ...acc, + [pattern]: { + ...current[pattern], + pattern, + results, + }, + }), + current + ) + ); + } + }, [storedPatternsResults]); + + const updatePatternRollup = useCallback((patternRollup: PatternRollup) => { + setPatternRollups((current) => ({ + ...current, + [patternRollup.pattern]: { + ...patternRollup, + results: patternRollup.results ?? current[patternRollup.pattern]?.results, // prevent undefined results override existing + }, + })); + }, []); + + const totalDocsCount = useMemo(() => getTotalDocsCount(patternRollups), [patternRollups]); + const totalIncompatible = useMemo(() => getTotalIncompatible(patternRollups), [patternRollups]); + const totalIndices = useMemo(() => getTotalIndices(patternRollups), [patternRollups]); + const totalIndicesChecked = useMemo( + () => getTotalIndicesChecked(patternRollups), + [patternRollups] + ); + const totalSameFamily = useMemo(() => getTotalSameFamily(patternRollups), [patternRollups]); + const totalSizeInBytes = useMemo(() => getTotalSizeInBytes(patternRollups), [patternRollups]); + + const updatePatternIndexNames = useCallback( + ({ indexNames, pattern }: { indexNames: string[]; pattern: string }) => { + setPatternIndexNames((current) => ({ ...current, [pattern]: indexNames })); + }, + [] + ); + + const onCheckCompleted: OnCheckCompleted = useCallback( + ({ + batchId, + checkAllStartTime, + error, + formatBytes, + formatNumber, + indexName, + partitionedFieldMetadata, + pattern, + requestTime, + isLastCheck, + isCheckAll, + }) => { + setPatternRollups((currentPatternRollups) => { + const updatedRollups = getPatternRollupsWithLatestCheckResult({ + error, + formatBytes, + formatNumber, + indexName, + isILMAvailable, + partitionedFieldMetadata, + pattern, + patternRollups: currentPatternRollups, + }); + + const updatedRollup = updatedRollups[pattern]; + const { stats, results, ilmExplain } = updatedRollup; + const indexId = getIndexId({ indexName, stats }); + + if ( + stats && + results && + requestTime != null && + requestTime > 0 && + partitionedFieldMetadata + ) { + const report = { + batchId, + ecsVersion: EcsVersion, + errorCount: error ? 1 : 0, + ilmPhase: getIlmPhase(ilmExplain?.[indexName], isILMAvailable), + indexId, + indexName, + isCheckAll, + numberOfDocuments: getDocsCount({ indexName, stats }), + numberOfFields: partitionedFieldMetadata.all.length, + numberOfIncompatibleFields: getIndexIncompatible({ + indexName, + results, + }), + numberOfEcsFields: partitionedFieldMetadata.ecsCompliant.length, + numberOfCustomFields: partitionedFieldMetadata.custom.length, + numberOfIndices: 1, + numberOfIndicesChecked: 1, + numberOfSameFamily: getTotalPatternSameFamily(results), + sameFamilyFields: getSameFamilyFields(partitionedFieldMetadata.sameFamily), + sizeInBytes: getSizeInBytes({ stats, indexName }), + timeConsumedMs: requestTime, + unallowedMappingFields: getIncompatibleMappingsFields( + partitionedFieldMetadata.incompatible + ), + unallowedValueFields: getIncompatibleValuesFields( + partitionedFieldMetadata.incompatible + ), + }; + telemetryEvents.reportDataQualityIndexChecked?.(report); + + const result = results[indexName]; + if (result) { + const storageResult = formatStorageResult({ result, report, partitionedFieldMetadata }); + postStorageResult({ storageResult, httpFetch, toasts }); + } + } + + if (isLastCheck) { + telemetryEvents.reportDataQualityCheckAllCompleted?.({ + batchId, + ecsVersion: EcsVersion, + isCheckAll: true, + numberOfDocuments: getTotalDocsCount(updatedRollups), + numberOfIncompatibleFields: getTotalIncompatible(updatedRollups), + numberOfIndices: getTotalIndices(updatedRollups), + numberOfIndicesChecked: getTotalIndicesChecked(updatedRollups), + numberOfSameFamily: getTotalSameFamily(updatedRollups), + sizeInBytes: getTotalSizeInBytes(updatedRollups), + timeConsumedMs: Date.now() - checkAllStartTime, + }); + } + return updatedRollups; + }); + }, + [httpFetch, isILMAvailable, telemetryEvents, toasts] + ); + + useEffect(() => { + // reset all state + setPatternRollups({}); + setPatternIndexNames({}); + }, [ilmPhases, patterns]); + + return { + onCheckCompleted, + patternIndexNames, + patternRollups, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + totalSameFamily, + totalSizeInBytes, + updatePatternIndexNames, + updatePatternRollup, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts new file mode 100644 index 0000000000000..093ee8fdd645c --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts @@ -0,0 +1,61 @@ +/* + * 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 { + IlmPhase, + IncompatibleFieldMappingItem, + IncompatibleFieldValueItem, + OnCheckCompleted, + PatternRollup, + SameFamilyFieldItem, +} from '../../types'; + +export interface UseResultsRollupReturnValue { + onCheckCompleted: OnCheckCompleted; + patternIndexNames: Record; + patternRollups: Record; + totalDocsCount: number | undefined; + totalIncompatible: number | undefined; + totalIndices: number | undefined; + totalIndicesChecked: number | undefined; + totalSameFamily: number | undefined; + totalSizeInBytes: number | undefined; + updatePatternIndexNames: ({ + indexNames, + pattern, + }: { + indexNames: string[]; + pattern: string; + }) => void; + updatePatternRollup: (patternRollup: PatternRollup) => void; +} + +export interface StorageResult { + batchId: string; + indexName: string; + indexPattern: string; + isCheckAll: boolean; + checkedAt: number; + docsCount: number; + totalFieldCount: number; + ecsFieldCount: number; + customFieldCount: number; + incompatibleFieldCount: number; + incompatibleFieldMappingItems: IncompatibleFieldMappingItem[]; + incompatibleFieldValueItems: IncompatibleFieldValueItem[]; + sameFamilyFieldCount: number; + sameFamilyFields: string[]; + sameFamilyFieldItems: SameFamilyFieldItem[]; + unallowedMappingFields: string[]; + unallowedValueFields: string[]; + sizeInBytes: number; + ilmPhase?: IlmPhase; + markdownComments: string[]; + ecsVersion: string; + indexId: string; + error: string | null; +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.test.ts new file mode 100644 index 0000000000000..f6cd702ef139f --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.test.ts @@ -0,0 +1,415 @@ +/* + * 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 numeral from '@elastic/numeral'; + +import { getPatternRollupsWithLatestCheckResult } from './get_pattern_rollups_with_latest_check_result'; +import { mockPacketbeatPatternRollup } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { MeteringStatsIndex, PatternRollup } from '../../../types'; +import { EMPTY_STAT } from '../../../constants'; +import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { EcsVersion } from '@elastic/ecs'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +describe('helpers', () => { + let originalFetch: (typeof global)['fetch']; + + beforeAll(() => { + originalFetch = global.fetch; + }); + + afterAll(() => { + global.fetch = originalFetch; + }); + + describe('updateResultOnCheckCompleted', () => { + const packetbeatStats861: MeteringStatsIndex = + mockPacketbeatPatternRollup.stats != null + ? mockPacketbeatPatternRollup.stats['.ds-packetbeat-8.6.1-2023.02.04-000001'] + : ({} as MeteringStatsIndex); + const packetbeatStats853: MeteringStatsIndex = + mockPacketbeatPatternRollup.stats != null + ? mockPacketbeatPatternRollup.stats['.ds-packetbeat-8.5.3-2023.02.04-000001'] + : ({} as MeteringStatsIndex); + + test('it returns the updated rollups', () => { + expect( + getPatternRollupsWithLatestCheckResult({ + error: null, + formatBytes, + formatNumber, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + pattern: 'packetbeat-*', + patternRollups: { + 'packetbeat-*': mockPacketbeatPatternRollup, + }, + }) + ).toEqual({ + 'packetbeat-*': { + docsCount: 3258632, + error: null, + ilmExplain: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536751379, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + '.ds-packetbeat-8.5.3-2023.02.04-000001': { + index: '.ds-packetbeat-8.5.3-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536774084, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536774084, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536774416, + action: 'rollover', + action_time_millis: 1675536774416, + step: 'check-rollover-ready', + step_time_millis: 1675536774416, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + }, + ilmExplainPhaseCounts: { + hot: 2, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 0, + }, + indices: 2, + pattern: 'packetbeat-*', + results: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + docsCount: 1628343, + error: null, + ilmPhase: 'hot', + incompatible: 3, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + markdownComments: [ + '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 (50.0%) | 3 | `hot` | 697.7MB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, + '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', + ], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: expect.any(Number), + }, + }, + sizeInBytes: 1464758182, + stats: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, + '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, + }, + }, + }); + }); + + test('it returns the expected results when `patternRollup` does NOT have a `docsCount`', () => { + const noDocsCount = { + ...mockPacketbeatPatternRollup, + docsCount: undefined, // <-- + }; + + expect( + getPatternRollupsWithLatestCheckResult({ + error: null, + formatBytes, + formatNumber, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + pattern: 'packetbeat-*', + patternRollups: { + 'packetbeat-*': noDocsCount, + }, + }) + ).toEqual({ + 'packetbeat-*': { + docsCount: undefined, // <-- + error: null, + ilmExplain: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536751379, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + '.ds-packetbeat-8.5.3-2023.02.04-000001': { + index: '.ds-packetbeat-8.5.3-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536774084, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536774084, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536774416, + action: 'rollover', + action_time_millis: 1675536774416, + step: 'check-rollover-ready', + step_time_millis: 1675536774416, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + }, + ilmExplainPhaseCounts: { + hot: 2, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 0, + }, + indices: 2, + pattern: 'packetbeat-*', + results: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + docsCount: 1628343, + error: null, + ilmPhase: 'hot', + incompatible: 3, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + markdownComments: [ + '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 () | 3 | `hot` | 697.7MB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, + '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', + ], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: expect.any(Number), + }, + }, + sizeInBytes: 1464758182, + stats: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, + '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, + }, + }, + }); + }); + + test('it returns the expected results when `partitionedFieldMetadata` is null', () => { + expect( + getPatternRollupsWithLatestCheckResult({ + error: null, + formatBytes, + formatNumber, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + isILMAvailable: true, + partitionedFieldMetadata: null, // <-- + pattern: 'packetbeat-*', + patternRollups: { + 'packetbeat-*': mockPacketbeatPatternRollup, + }, + }) + ).toEqual({ + 'packetbeat-*': { + docsCount: 3258632, + error: null, + ilmExplain: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536751379, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + '.ds-packetbeat-8.5.3-2023.02.04-000001': { + index: '.ds-packetbeat-8.5.3-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536774084, + time_since_index_creation: '25.26d', + lifecycle_date_millis: 1675536774084, + age: '25.26d', + phase: 'hot', + phase_time_millis: 1675536774416, + action: 'rollover', + action_time_millis: 1675536774416, + step: 'check-rollover-ready', + step_time_millis: 1675536774416, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, + }, + }, + ilmExplainPhaseCounts: { + hot: 2, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 0, + }, + indices: 2, + pattern: 'packetbeat-*', + results: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + docsCount: 1628343, + error: null, + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + markdownComments: [], + pattern: 'packetbeat-*', + checkedAt: undefined, + }, + }, + sizeInBytes: 1464758182, + stats: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, + '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, + }, + }, + }); + }); + + test('it returns the updated rollups when there is no `partitionedFieldMetadata`', () => { + const noIlmExplain = { + ...mockPacketbeatPatternRollup, + ilmExplain: null, + }; + + expect( + getPatternRollupsWithLatestCheckResult({ + error: null, + formatBytes, + formatNumber, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + pattern: 'packetbeat-*', + patternRollups: { + 'packetbeat-*': noIlmExplain, + }, + }) + ).toEqual({ + 'packetbeat-*': { + docsCount: 3258632, + error: null, + ilmExplain: null, + ilmExplainPhaseCounts: { + hot: 2, + warm: 0, + cold: 0, + frozen: 0, + unmanaged: 0, + }, + indices: 2, + pattern: 'packetbeat-*', + results: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + docsCount: 1628343, + error: null, + ilmPhase: undefined, + incompatible: 3, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + markdownComments: [ + '### .ds-packetbeat-8.6.1-2023.02.04-000001\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|\n| ❌ | .ds-packetbeat-8.6.1-2023.02.04-000001 | 1,628,343 (50.0%) | 3 | -- | 697.7MB |\n\n', + '### **Incompatible fields** `3` **Same family** `0` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + `#### 3 incompatible fields\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version ${EcsVersion}.\n\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n`, + '\n#### Incompatible field mappings - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - .ds-packetbeat-8.6.1-2023.02.04-000001\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2), `theory` (1) |\n\n', + ], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: expect.any(Number), + }, + }, + sizeInBytes: 1464758182, + stats: { + '.ds-packetbeat-8.6.1-2023.02.04-000001': packetbeatStats861, + '.ds-packetbeat-8.5.3-2023.02.04-000001': packetbeatStats853, + }, + }, + }); + }); + + test('it returns the unmodified rollups when `pattern` is not a member of `patternRollups`', () => { + const shouldNotBeModified: Record = { + 'packetbeat-*': mockPacketbeatPatternRollup, + }; + + expect( + getPatternRollupsWithLatestCheckResult({ + error: null, + formatBytes, + formatNumber, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + isILMAvailable: true, + partitionedFieldMetadata: mockPartitionedFieldMetadata, + pattern: 'this-pattern-is-not-in-pattern-rollups', // <-- + patternRollups: shouldNotBeModified, + }) + ).toEqual(shouldNotBeModified); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.ts new file mode 100644 index 0000000000000..e826730df89cc --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.ts @@ -0,0 +1,92 @@ +/* + * 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 { getAllIncompatibleMarkdownComments } from '../../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers'; +import { getSizeInBytes } from '../../../utils/stats'; +import type { IlmPhase, PartitionedFieldMetadata, PatternRollup } from '../../../types'; +import { getIndexDocsCountFromRollup } from './stats'; +import { getIlmPhase } from '../../../utils/get_ilm_phase'; + +export const getPatternRollupsWithLatestCheckResult = ({ + error, + formatBytes, + formatNumber, + indexName, + isILMAvailable, + partitionedFieldMetadata, + pattern, + patternRollups, +}: { + error: string | null; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + indexName: string; + isILMAvailable: boolean; + partitionedFieldMetadata: PartitionedFieldMetadata | null; + pattern: string; + patternRollups: Record; +}): Record => { + const patternRollup: PatternRollup | undefined = patternRollups[pattern]; + + if (patternRollup != null) { + const ilmExplain = patternRollup.ilmExplain; + + const ilmPhase: IlmPhase | undefined = + ilmExplain != null ? getIlmPhase(ilmExplain[indexName], isILMAvailable) : undefined; + + const docsCount = getIndexDocsCountFromRollup({ + indexName, + patternRollup, + }); + + const patternDocsCount = patternRollup.docsCount ?? 0; + + const sizeInBytes = getSizeInBytes({ indexName, stats: patternRollup.stats }); + + const markdownComments = + partitionedFieldMetadata != null + ? getAllIncompatibleMarkdownComments({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + indexName, + isILMAvailable, + partitionedFieldMetadata, + patternDocsCount, + sizeInBytes, + }) + : []; + + const incompatible = partitionedFieldMetadata?.incompatible.length; + const sameFamily = partitionedFieldMetadata?.sameFamily.length; + const checkedAt = partitionedFieldMetadata ? Date.now() : undefined; + + return { + ...patternRollups, + [pattern]: { + ...patternRollup, + results: { + ...(patternRollup.results ?? {}), + [indexName]: { + docsCount, + error, + ilmPhase, + incompatible, + indexName, + markdownComments, + pattern, + sameFamily, + checkedAt, + }, + }, + }, + }; + } else { + return patternRollups; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts new file mode 100644 index 0000000000000..0d48a794670d5 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts @@ -0,0 +1,257 @@ +/* + * 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 { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { + mockPacketbeatPatternRollup, + packetbeatNoResults, + packetbeatWithSomeErrors, +} from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { mockStats } from '../../../mock/stats/mock_stats'; +import { DataQualityCheckResult, PatternRollup } from '../../../types'; +import { + getIndexDocsCountFromRollup, + getIndexId, + getTotalDocsCount, + getTotalIncompatible, + getTotalIndices, + getTotalIndicesChecked, + getTotalPatternSameFamily, + getTotalSameFamily, +} from './stats'; + +const patternRollups: Record = { + 'auditbeat-*': auditbeatWithAllResults, // indices: 3 + 'packetbeat-*': mockPacketbeatPatternRollup, // indices: 2 +}; + +describe('getTotalPatternSameFamily', () => { + const baseResult: DataQualityCheckResult = { + docsCount: 4, + error: null, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + markdownComments: [ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase |\n|--------|-------|------|---------------------|-----------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` |\n\n', + '### **Incompatible fields** `3` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + "#### 3 incompatible fields, 0 fields with mappings in the same family\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.1.\n\nIncompatible fields with mappings in the same family have exactly the same search behavior but may have different space usage or performance characteristics.\n\nWhen an incompatible field is not in the same family:\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n", + '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2),\n`theory` (1) |\n\n', + ], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }; + + it('returns undefined when results is undefined', () => { + expect(getTotalPatternSameFamily(undefined)).toBeUndefined(); + }); + + it('returns 0 when results is an empty object', () => { + expect(getTotalPatternSameFamily({})).toBe(0); + }); + + it('should sum sameFamily values and return the total', () => { + const results: Record = { + a: { + ...baseResult, + indexName: 'a', + markdownComments: [], + pattern: 'pattern', + sameFamily: 2, + }, + b: { + ...baseResult, + indexName: 'b', + markdownComments: [], + pattern: 'pattern', + sameFamily: 3, + }, + c: { ...baseResult, indexName: 'c', markdownComments: [], pattern: 'pattern' }, + }; + + expect(getTotalPatternSameFamily(results)).toBe(5); + }); + + it('handles a mix of defined and undefined sameFamily values', () => { + const results: Record = { + a: { + ...baseResult, + indexName: 'a', + markdownComments: [], + pattern: 'pattern', + sameFamily: 1, + }, + b: { + ...baseResult, + indexName: 'b', + markdownComments: [], + pattern: 'pattern', + sameFamily: undefined, + }, + c: { + ...baseResult, + indexName: 'c', + markdownComments: [], + pattern: 'pattern', + sameFamily: 2, + }, + }; + + expect(getTotalPatternSameFamily(results)).toBe(3); + }); +}); + +describe('getTotalSameFamily', () => { + const defaultDataQualityCheckResult: DataQualityCheckResult = { + docsCount: 26093, + error: null, + ilmPhase: 'hot', + incompatible: 0, + indexName: '.internal.alerts-security.alerts-default-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: '.alerts-security.alerts-default', + sameFamily: 7, + checkedAt: 1706526408000, + }; + + const alertIndexWithSameFamily: PatternRollup = { + ...alertIndexWithAllResults, + results: { + '.internal.alerts-security.alerts-default-000001': { + ...defaultDataQualityCheckResult, + }, + }, + }; + + const withSameFamily: Record = { + '.internal.alerts-security.alerts-default-000001': alertIndexWithSameFamily, + }; + + test('it returns the expected count when patternRollups has sameFamily', () => { + expect(getTotalSameFamily(withSameFamily)).toEqual(7); + }); + + test('it returns undefined when patternRollups is empty', () => { + expect(getTotalSameFamily({})).toBeUndefined(); + }); + + test('it returns zero when none of the rollups have same family', () => { + expect(getTotalSameFamily(patternRollups)).toEqual(0); + }); +}); + +describe('getTotalIndices', () => { + test('it returns the expected total when ALL `PatternRollup`s have an `indices`', () => { + expect(getTotalIndices(patternRollups)).toEqual(5); + }); + + test('it returns undefined when only SOME of the `PatternRollup`s have an `indices`', () => { + const someIndicesAreUndefined: Record = { + 'auditbeat-*': { + ...auditbeatWithAllResults, + indices: undefined, // <-- + }, + 'packetbeat-*': mockPacketbeatPatternRollup, // indices: 2 + }; + + expect(getTotalIndices(someIndicesAreUndefined)).toBeUndefined(); + }); +}); + +describe('getTotalDocsCount', () => { + test('it returns the expected total when ALL `PatternRollup`s have a `docsCount`', () => { + expect(getTotalDocsCount(patternRollups)).toEqual( + Number(auditbeatWithAllResults.docsCount) + Number(mockPacketbeatPatternRollup.docsCount) + ); + }); + + test('it returns undefined when only SOME of the `PatternRollup`s have a `docsCount`', () => { + const someIndicesAreUndefined: Record = { + 'auditbeat-*': { + ...auditbeatWithAllResults, + docsCount: undefined, // <-- + }, + 'packetbeat-*': mockPacketbeatPatternRollup, + }; + + expect(getTotalDocsCount(someIndicesAreUndefined)).toBeUndefined(); + }); +}); + +describe('getTotalIncompatible', () => { + test('it returns the expected total when ALL `PatternRollup`s have `results`', () => { + expect(getTotalIncompatible(patternRollups)).toEqual(4); + }); + + test('it returns the expected total when only SOME of the `PatternRollup`s have `results`', () => { + const someResultsAreUndefined: Record = { + 'auditbeat-*': auditbeatWithAllResults, + 'packetbeat-*': packetbeatNoResults, // <-- results is undefined + }; + + expect(getTotalIncompatible(someResultsAreUndefined)).toEqual(4); + }); + + test('it returns undefined when NONE of the `PatternRollup`s have `results`', () => { + const someResultsAreUndefined: Record = { + 'packetbeat-*': packetbeatNoResults, // <-- results is undefined + }; + + expect(getTotalIncompatible(someResultsAreUndefined)).toBeUndefined(); + }); +}); + +describe('getTotalIndicesChecked', () => { + test('it returns the expected total', () => { + expect(getTotalIndicesChecked(patternRollups)).toEqual(3); + }); + + test('it returns the expected total when errors have occurred', () => { + const someErrors: Record = { + 'auditbeat-*': auditbeatWithAllResults, // indices: 3 + 'packetbeat-*': packetbeatWithSomeErrors, // <-- indices: 2, but one has errors + }; + + expect(getTotalIndicesChecked(someErrors)).toEqual(4); + }); +}); + +describe('getIndexId', () => { + it('returns the expected index ID', () => { + expect(getIndexId({ indexName: 'auditbeat-custom-index-1', stats: mockStats })).toEqual( + 'uyJDDqGrRQqdBTN0mCF-iw' + ); + }); +}); + +describe('getIndexDocsCountFromRollup', () => { + test('it returns the expected count when the `patternRollup` has `stats`', () => { + expect( + getIndexDocsCountFromRollup({ + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + patternRollup: mockPacketbeatPatternRollup, + }) + ).toEqual(1628343); + }); + + test('it returns zero when the `patternRollup` `stats` is null', () => { + const patternRollup = { + ...mockPacketbeatPatternRollup, + stats: null, // <-- + }; + + expect( + getIndexDocsCountFromRollup({ + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + patternRollup, + }) + ).toEqual(0); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts new file mode 100644 index 0000000000000..80965c706d9f3 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts @@ -0,0 +1,119 @@ +/* + * 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 { DataQualityCheckResult, MeteringStatsIndex, PatternRollup } from '../../../types'; +import { + getDocsCount, + getTotalPatternIncompatible, + getTotalPatternIndicesChecked, +} from '../../../utils/stats'; + +export const getTotalPatternSameFamily = ( + results: Record | undefined +): number | undefined => { + if (results == null) { + return undefined; + } + + const allResults = Object.values(results); + + return allResults.reduce((acc, { sameFamily }) => acc + (sameFamily ?? 0), 0); +}; + +export const getTotalIndices = ( + patternRollups: Record +): number | undefined => { + const allRollups = Object.values(patternRollups); + const allRollupsHaveIndices = allRollups.every(({ indices }) => Number.isInteger(indices)); + + // only return the total when all `PatternRollup`s have a `indices`: + return allRollupsHaveIndices + ? allRollups.reduce((acc, { indices }) => acc + Number(indices), 0) + : undefined; +}; + +export const getTotalDocsCount = ( + patternRollups: Record +): number | undefined => { + const allRollups = Object.values(patternRollups); + const allRollupsHaveDocsCount = allRollups.every(({ docsCount }) => Number.isInteger(docsCount)); + + // only return the total when all `PatternRollup`s have a `docsCount`: + return allRollupsHaveDocsCount + ? allRollups.reduce((acc, { docsCount }) => acc + Number(docsCount), 0) + : undefined; +}; + +export const getTotalSizeInBytes = ( + patternRollups: Record +): number | undefined => { + const allRollups = Object.values(patternRollups); + const allRollupsHaveSizeInBytes = allRollups.every(({ sizeInBytes }) => + Number.isInteger(sizeInBytes) + ); + + // only return the total when all `PatternRollup`s have a `sizeInBytes`: + return allRollupsHaveSizeInBytes + ? allRollups.reduce((acc, { sizeInBytes }) => acc + Number(sizeInBytes), 0) + : undefined; +}; + +export const getTotalIncompatible = ( + patternRollups: Record +): number | undefined => { + const allRollups = Object.values(patternRollups); + const anyRollupsHaveResults = allRollups.some(({ results }) => results != null); + + // only return the total when at least one `PatternRollup` has results: + return anyRollupsHaveResults + ? allRollups.reduce((acc, { results }) => acc + (getTotalPatternIncompatible(results) ?? 0), 0) + : undefined; +}; + +export const getTotalSameFamily = ( + patternRollups: Record +): number | undefined => { + const allRollups = Object.values(patternRollups); + const anyRollupsHaveResults = allRollups.some(({ results }) => results != null); + + // only return the total when at least one `PatternRollup` has results: + return anyRollupsHaveResults + ? allRollups.reduce((acc, { results }) => acc + (getTotalPatternSameFamily(results) ?? 0), 0) + : undefined; +}; + +export const getTotalIndicesChecked = (patternRollups: Record): number => { + const allRollups = Object.values(patternRollups); + + return allRollups.reduce( + (acc, patternRollup) => acc + getTotalPatternIndicesChecked(patternRollup), + 0 + ); +}; + +export const getIndexId = ({ + indexName, + stats, +}: { + indexName: string; + stats: Record | null; +}): string | null | undefined => stats && stats[indexName]?.uuid; + +export const getIndexDocsCountFromRollup = ({ + indexName, + patternRollup, +}: { + indexName: string; + patternRollup: PatternRollup; +}): number => { + const stats: Record | null = patternRollup?.stats ?? null; + + return getDocsCount({ + indexName, + stats, + }); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts new file mode 100644 index 0000000000000..0e894694ed1e9 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts @@ -0,0 +1,202 @@ +/* + * 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 { httpServiceMock } from '@kbn/core-http-browser-mocks'; +import { mockPartitionedFieldMetadataWithSameFamily } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; +import { StorageResult } from '../types'; +import { formatStorageResult, getStorageResults, postStorageResult } from './storage'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; + +describe('formatStorageResult', () => { + it('should correctly format the input data into a StorageResult object', () => { + const inputData: Parameters[number] = { + result: { + indexName: 'testIndex', + pattern: 'testPattern', + checkedAt: 1627545600000, + docsCount: 100, + incompatible: 3, + sameFamily: 1, + ilmPhase: 'hot', + markdownComments: ['test comments'], + error: null, + }, + report: { + batchId: 'testBatch', + isCheckAll: true, + sameFamilyFields: ['agent.type'], + unallowedMappingFields: ['event.category', 'host.name', 'source.ip'], + unallowedValueFields: ['event.category'], + sizeInBytes: 5000, + ecsVersion: '1.0.0', + indexName: 'testIndex', + indexId: 'testIndexId', + }, + partitionedFieldMetadata: mockPartitionedFieldMetadataWithSameFamily, + }; + + const expectedResult: StorageResult = { + batchId: 'testBatch', + indexName: 'testIndex', + indexPattern: 'testPattern', + isCheckAll: true, + checkedAt: 1627545600000, + docsCount: 100, + totalFieldCount: 10, + ecsFieldCount: 2, + customFieldCount: 4, + incompatibleFieldCount: 3, + incompatibleFieldMappingItems: [ + { + fieldName: 'event.category', + expectedValue: 'keyword', + actualValue: 'constant_keyword', + description: + 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', + }, + { + fieldName: 'host.name', + expectedValue: 'keyword', + actualValue: 'text', + description: + 'Name of the host.\nIt can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.', + }, + { + fieldName: 'source.ip', + expectedValue: 'ip', + actualValue: 'text', + description: 'IP address of the source (IPv4 or IPv6).', + }, + ], + incompatibleFieldValueItems: [ + { + fieldName: 'event.category', + expectedValues: [ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ], + actualValues: [{ name: 'an_invalid_category', count: 2 }], + description: + 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', + }, + ], + sameFamilyFieldCount: 1, + sameFamilyFields: ['agent.type'], + sameFamilyFieldItems: [ + { + fieldName: 'agent.type', + expectedValue: 'keyword', + actualValue: 'constant_keyword', + description: + 'Type of the agent.\nThe agent type always stays the same and should be given by the agent used. In case of Filebeat the agent would always be Filebeat also if two Filebeat instances are run on the same machine.', + }, + ], + unallowedMappingFields: ['event.category', 'host.name', 'source.ip'], + unallowedValueFields: ['event.category'], + sizeInBytes: 5000, + ilmPhase: 'hot', + markdownComments: ['test comments'], + ecsVersion: '1.0.0', + indexId: 'testIndexId', + error: null, + }; + + expect(formatStorageResult(inputData)).toEqual(expectedResult); + }); +}); + +describe('postStorageResult', () => { + const { fetch } = httpServiceMock.createStartContract(); + const { toasts } = notificationServiceMock.createStartContract(); + beforeEach(() => { + fetch.mockClear(); + }); + + test('it posts the result', async () => { + const storageResult = { indexName: 'test' } as unknown as StorageResult; + await postStorageResult({ + storageResult, + httpFetch: fetch, + abortController: new AbortController(), + toasts, + }); + + expect(fetch).toHaveBeenCalledWith( + '/internal/ecs_data_quality_dashboard/results', + expect.objectContaining({ + method: 'POST', + body: JSON.stringify(storageResult), + }) + ); + }); + + test('it throws error', async () => { + const storageResult = { indexName: 'test' } as unknown as StorageResult; + fetch.mockRejectedValueOnce('test-error'); + await postStorageResult({ + httpFetch: fetch, + storageResult, + abortController: new AbortController(), + toasts, + }); + expect(toasts.addError).toHaveBeenCalledWith('test-error', { title: expect.any(String) }); + }); +}); + +describe('getStorageResults', () => { + const { fetch } = httpServiceMock.createStartContract(); + const { toasts } = notificationServiceMock.createStartContract(); + beforeEach(() => { + fetch.mockClear(); + }); + + test('it gets the results', async () => { + await getStorageResults({ + httpFetch: fetch, + abortController: new AbortController(), + pattern: 'auditbeat-*', + toasts, + }); + + expect(fetch).toHaveBeenCalledWith( + '/internal/ecs_data_quality_dashboard/results_latest/auditbeat-*', + expect.objectContaining({ + method: 'GET', + }) + ); + }); + + it('should catch error', async () => { + fetch.mockRejectedValueOnce('test-error'); + + const results = await getStorageResults({ + httpFetch: fetch, + abortController: new AbortController(), + pattern: 'auditbeat-*', + toasts, + }); + + expect(toasts.addError).toHaveBeenCalledWith('test-error', { title: expect.any(String) }); + expect(results).toEqual([]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts new file mode 100644 index 0000000000000..b7b3b120441d3 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts @@ -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 { HttpHandler } from '@kbn/core-http-browser'; +import { IToasts } from '@kbn/core-notifications-browser'; + +import { + DataQualityCheckResult, + DataQualityIndexCheckedParams, + IncompatibleFieldMappingItem, + IncompatibleFieldValueItem, + PartitionedFieldMetadata, + SameFamilyFieldItem, +} from '../../../types'; +import { StorageResult } from '../types'; +import { GET_INDEX_RESULTS_LATEST, POST_INDEX_RESULTS } from '../constants'; +import { INTERNAL_API_VERSION } from '../../../constants'; +import { GET_RESULTS_ERROR_TITLE, POST_RESULT_ERROR_TITLE } from '../../../translations'; + +export const formatStorageResult = ({ + result, + report, + partitionedFieldMetadata, +}: { + result: DataQualityCheckResult; + report: DataQualityIndexCheckedParams; + partitionedFieldMetadata: PartitionedFieldMetadata; +}): StorageResult => { + const incompatibleFieldMappingItems: IncompatibleFieldMappingItem[] = []; + const incompatibleFieldValueItems: IncompatibleFieldValueItem[] = []; + const sameFamilyFieldItems: SameFamilyFieldItem[] = []; + + partitionedFieldMetadata.incompatible.forEach((field) => { + if (field.type !== field.indexFieldType) { + incompatibleFieldMappingItems.push({ + fieldName: field.indexFieldName, + expectedValue: field.type, + actualValue: field.indexFieldType, + description: field.description, + }); + } + + if (field.indexInvalidValues.length > 0) { + incompatibleFieldValueItems.push({ + fieldName: field.indexFieldName, + expectedValues: field.allowed_values?.map((x) => x.name) ?? [], + actualValues: field.indexInvalidValues.map((v) => ({ name: v.fieldName, count: v.count })), + description: field.description, + }); + } + }); + + partitionedFieldMetadata.sameFamily.forEach((field) => { + sameFamilyFieldItems.push({ + fieldName: field.indexFieldName, + expectedValue: field.type, + actualValue: field.indexFieldType, + description: field.description, + }); + }); + + return { + batchId: report.batchId, + indexName: result.indexName, + indexPattern: result.pattern, + isCheckAll: report.isCheckAll, + checkedAt: result.checkedAt ?? Date.now(), + docsCount: result.docsCount ?? 0, + totalFieldCount: partitionedFieldMetadata.all.length, + ecsFieldCount: partitionedFieldMetadata.ecsCompliant.length, + customFieldCount: partitionedFieldMetadata.custom.length, + incompatibleFieldCount: partitionedFieldMetadata.incompatible.length, + incompatibleFieldMappingItems, + incompatibleFieldValueItems, + sameFamilyFieldCount: partitionedFieldMetadata.sameFamily.length, + sameFamilyFields: report.sameFamilyFields ?? [], + sameFamilyFieldItems, + unallowedMappingFields: report.unallowedMappingFields ?? [], + unallowedValueFields: report.unallowedValueFields ?? [], + sizeInBytes: report.sizeInBytes ?? 0, + ilmPhase: result.ilmPhase, + markdownComments: result.markdownComments, + ecsVersion: report.ecsVersion, + indexId: report.indexId ?? '', + error: result.error, + }; +}; + +export const formatResultFromStorage = ({ + storageResult, + pattern, +}: { + storageResult: StorageResult; + pattern: string; +}): DataQualityCheckResult => ({ + docsCount: storageResult.docsCount, + error: storageResult.error, + ilmPhase: storageResult.ilmPhase, + incompatible: storageResult.incompatibleFieldCount, + indexName: storageResult.indexName, + markdownComments: storageResult.markdownComments, + sameFamily: storageResult.sameFamilyFieldCount, + checkedAt: storageResult.checkedAt, + pattern, +}); + +export async function postStorageResult({ + storageResult, + httpFetch, + toasts, + abortController = new AbortController(), +}: { + storageResult: StorageResult; + httpFetch: HttpHandler; + toasts: IToasts; + abortController?: AbortController; +}): Promise { + try { + await httpFetch(POST_INDEX_RESULTS, { + method: 'POST', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + body: JSON.stringify(storageResult), + }); + } catch (err) { + toasts.addError(err, { title: POST_RESULT_ERROR_TITLE }); + } +} + +export async function getStorageResults({ + pattern, + httpFetch, + toasts, + abortController, +}: { + pattern: string; + httpFetch: HttpHandler; + toasts: IToasts; + abortController: AbortController; +}): Promise { + try { + const route = GET_INDEX_RESULTS_LATEST.replace('{pattern}', pattern); + const results = await httpFetch(route, { + method: 'GET', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + }); + return results; + } catch (err) { + toasts.addError(err, { title: GET_RESULTS_ERROR_TITLE }); + return []; + } +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx new file mode 100644 index 0000000000000..b7ea6613dac62 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx @@ -0,0 +1,84 @@ +/* + * 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 { DARK_THEME } from '@elastic/charts'; +import { render, screen } from '@testing-library/react'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import React from 'react'; + +import { TestExternalProviders } from './mock/test_providers/test_providers'; +import { mockUseResultsRollup } from './mock/use_results_rollup/mock_use_results_rollup'; +import { getCheckState } from './stub/get_check_state'; +import * as useResultsRollup from './hooks/use_results_rollup'; +import * as useIndicesCheck from './hooks/use_indices_check'; +import { DataQualityPanel } from '.'; + +jest.mock('./data_quality_details/indices_details/pattern/hooks/use_stats', () => ({ + useStats: jest.fn(() => ({ + stats: {}, + error: null, + loading: false, + })), +})); + +jest.mock('./data_quality_details/indices_details/pattern/hooks/use_ilm_explain', () => ({ + useIlmExplain: jest.fn(() => ({ + error: null, + ilmExplain: {}, + loading: false, + })), +})); + +jest.spyOn(useResultsRollup, 'useResultsRollup').mockImplementation(() => mockUseResultsRollup); + +jest.spyOn(useIndicesCheck, 'useIndicesCheck').mockImplementation(() => ({ + checkIndex: jest.fn(), + checkState: { + ...getCheckState('auditbeat-*'), + }, +})); + +const { toasts } = notificationServiceMock.createSetupContract(); + +const patterns = ['auditbeat-*']; + +describe('DataQualityPanel', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + ); + }); + + it('renders the data quality summary', () => { + expect(screen.getByTestId('dataQualitySummary')).toBeInTheDocument(); + }); + + it(`renders the '${patterns.join(', ')}' patterns`, () => { + for (const pattern of patterns) { + expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); + } + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx new file mode 100644 index 0000000000000..7d1a106d83570 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx @@ -0,0 +1,163 @@ +/* + * 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 { HttpHandler } from '@kbn/core-http-browser'; +import numeral from '@elastic/numeral'; +import type { PartialTheme, Theme } from '@elastic/charts'; +import React, { useCallback, useMemo, useState } from 'react'; + +import type { IToasts } from '@kbn/core-notifications-browser'; +import { EuiComboBoxOptionOption, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import { DataQualityProvider } from './data_quality_context'; +import { ReportDataQualityCheckAllCompleted, ReportDataQualityIndexChecked } from './types'; +import { ResultsRollupContext } from './contexts/results_rollup_context'; +import { IndicesCheckContext } from './contexts/indices_check_context'; +import { useIndicesCheck } from './hooks/use_indices_check'; +import { useResultsRollup } from './hooks/use_results_rollup'; +import { ilmPhaseOptionsStatic, EMPTY_STAT } from './constants'; +import { DataQualitySummary } from './data_quality_summary'; +import { DataQualityDetails } from './data_quality_details'; + +interface Props { + toasts: IToasts; + baseTheme: Theme; + canUserCreateAndReadCases: () => boolean; + defaultNumberFormat: string; + defaultBytesFormat: string; + endDate?: string | null; + httpFetch: HttpHandler; + isAssistantEnabled: boolean; + isILMAvailable: boolean; + lastChecked: string; + openCreateCaseFlyout: ({ + comments, + headerContent, + }: { + comments: string[]; + headerContent?: React.ReactNode; + }) => void; + patterns: string[]; + reportDataQualityIndexChecked?: ReportDataQualityIndexChecked; + reportDataQualityCheckAllCompleted?: ReportDataQualityCheckAllCompleted; + setLastChecked: (lastChecked: string) => void; + startDate?: string | null; + theme?: PartialTheme; +} + +const defaultSelectedIlmPhaseOptions: EuiComboBoxOptionOption[] = ilmPhaseOptionsStatic.filter( + (option) => !option.disabled +); + +/** Renders the `Data Quality` dashboard content */ +const DataQualityPanelComponent: React.FC = ({ + toasts, + baseTheme, + canUserCreateAndReadCases, + defaultBytesFormat, + defaultNumberFormat, + endDate, + httpFetch, + isAssistantEnabled, + isILMAvailable, + lastChecked, + openCreateCaseFlyout, + patterns, + reportDataQualityIndexChecked, + reportDataQualityCheckAllCompleted, + setLastChecked, + startDate, + theme, +}) => { + const [selectedIlmPhaseOptions, setSelectedIlmPhaseOptions] = useState( + defaultSelectedIlmPhaseOptions + ); + const formatBytes = useCallback( + (value: number | undefined): string => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT, + [defaultBytesFormat] + ); + + const formatNumber = useCallback( + (value: number | undefined): string => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT, + [defaultNumberFormat] + ); + + const telemetryEvents = useMemo( + () => ({ reportDataQualityCheckAllCompleted, reportDataQualityIndexChecked }), + [reportDataQualityCheckAllCompleted, reportDataQualityIndexChecked] + ); + + const addSuccessToast = useCallback( + (toast: { title: string }) => { + toasts.addSuccess(toast); + }, + [toasts] + ); + const ilmPhases: string[] = useMemo( + () => selectedIlmPhaseOptions.map(({ label }) => label), + [selectedIlmPhaseOptions] + ); + + const resultsRollupHookReturnValue = useResultsRollup({ + ilmPhases, + patterns, + httpFetch, + toasts, + isILMAvailable, + telemetryEvents, + }); + + const indicesCheckHookReturnValue = useIndicesCheck({ + onCheckCompleted: resultsRollupHookReturnValue.onCheckCompleted, + }); + + return ( + + + + + + + + + + + + + + + + + ); +}; + +DataQualityPanelComponent.displayName = 'DataQualityPanelComponent'; + +/** Renders the `Data Quality` dashboard content */ +export const DataQualityPanel = React.memo(DataQualityPanelComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/allowed_values/mock_allowed_values.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/allowed_values/mock_allowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/allowed_values/mock_allowed_values.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/allowed_values/mock_allowed_values.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/data_quality_check_result/mock_index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/data_quality_check_result/mock_index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/data_quality_check_result/mock_index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/data_quality_check_result/mock_index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/enriched_field_metadata/mock_enriched_field_metadata.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/enriched_field_metadata/mock_enriched_field_metadata.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/ilm_explain/mock_ilm_explain.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/ilm_explain/mock_ilm_explain.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/ilm_explain/mock_ilm_explain.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/ilm_explain/mock_ilm_explain.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_properties/mock_mappings_properties.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_properties/mock_mappings_properties.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_properties/mock_mappings_properties.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_properties/mock_mappings_properties.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_response/mock_mappings_response.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_response/mock_mappings_response.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_response/mock_mappings_response.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_response/mock_mappings_response.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_alerts_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_alerts_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_auditbeat_index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_auditbeat_index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_packetbeat_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_packetbeat_index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_packetbeat_index.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_packetbeat_index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx new file mode 100644 index 0000000000000..922d9b54612a6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx @@ -0,0 +1,173 @@ +/* + * 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 { actionTypeRegistryMock } from '@kbn/triggers-actions-ui-plugin/public/application/action_type_registry.mock'; +import { httpServiceMock } from '@kbn/core-http-browser-mocks'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import { AssistantAvailability, AssistantProvider } from '@kbn/elastic-assistant'; +import { I18nProvider } from '@kbn/i18n-react'; +import { euiDarkVars } from '@kbn/ui-theme'; +import React from 'react'; +import { ThemeProvider } from 'styled-components'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { Theme } from '@elastic/charts'; + +import { DataQualityProvider, DataQualityProviderProps } from '../../data_quality_context'; +import { ResultsRollupContext } from '../../contexts/results_rollup_context'; +import { IndicesCheckContext } from '../../contexts/indices_check_context'; +import { UseIndicesCheckReturnValue } from '../../hooks/use_indices_check/types'; +import { UseResultsRollupReturnValue } from '../../hooks/use_results_rollup/types'; +import { getMergeResultsRollupContextProps } from './utils/get_merged_results_rollup_context_props'; +import { getMergedDataQualityContextProps } from './utils/get_merged_data_quality_context_props'; +import { getMergedIndicesCheckContextProps } from './utils/get_merged_indices_check_context_props'; + +interface TestExternalProvidersProps { + children: React.ReactNode; +} + +window.scrollTo = jest.fn(); + +/** A utility for wrapping children in the providers required to run tests */ +const TestExternalProvidersComponent: React.FC = ({ children }) => { + const actionTypeRegistry = actionTypeRegistryMock.create(); + const mockGetComments = jest.fn(() => []); + const mockHttp = httpServiceMock.createStartContract({ basePath: '/test' }); + const mockNavigateToApp = jest.fn(); + const mockAssistantAvailability: AssistantAvailability = { + hasAssistantPrivilege: false, + hasConnectorsAllPrivilege: true, + hasConnectorsReadPrivilege: true, + hasUpdateAIAssistantAnonymization: true, + isAssistantEnabled: true, + }; + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, + logger: { + log: jest.fn(), + warn: jest.fn(), + error: () => {}, + }, + }); + + return ( + + ({ eui: euiDarkVars, darkMode: true })}> + + + {children} + + + + + ); +}; + +TestExternalProvidersComponent.displayName = 'TestExternalProvidersComponent'; + +export const TestExternalProviders = React.memo(TestExternalProvidersComponent); + +export interface TestDataQualityProvidersProps { + children: React.ReactNode; + dataQualityContextProps?: Partial; + indicesCheckContextProps?: Partial; + resultsRollupContextProps?: Partial; +} + +const TestDataQualityProvidersComponent: React.FC = ({ + children, + dataQualityContextProps, + resultsRollupContextProps, + indicesCheckContextProps, +}) => { + const http = httpServiceMock.createSetupContract({ basePath: '/test' }); + const { toasts } = notificationServiceMock.createSetupContract(); + const mockTelemetryEvents = { + reportDataQualityIndexChecked: jest.fn(), + reportDataQualityCheckAllCompleted: jest.fn(), + }; + + const { + isILMAvailable, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, + } = getMergedDataQualityContextProps(dataQualityContextProps); + + const mergedResultsRollupContextProps = + getMergeResultsRollupContextProps(resultsRollupContextProps); + + return ( + + + + {children} + + + + ); +}; + +TestDataQualityProvidersComponent.displayName = 'TestDataQualityProvidersComponent'; + +export const TestDataQualityProviders = React.memo(TestDataQualityProvidersComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts new file mode 100644 index 0000000000000..264198e510b5e --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import numeral from '@elastic/numeral'; + +import { DataQualityProviderProps } from '../../../data_quality_context'; +import { EMPTY_STAT } from '../../../constants'; + +export const getMergedDataQualityContextProps = ( + dataQualityContextProps?: Partial +) => { + const { + isILMAvailable, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, + } = { + isILMAvailable: true, + addSuccessToast: jest.fn(), + canUserCreateAndReadCases: jest.fn(() => true), + endDate: null, + formatBytes: (value: number | undefined) => + value != null ? numeral(value).format('0,0.[0]b') : EMPTY_STAT, + formatNumber: (value: number | undefined) => + value != null ? numeral(value).format('0,0.[000]') : EMPTY_STAT, + isAssistantEnabled: true, + lastChecked: '2023-03-28T22:27:28.159Z', + openCreateCaseFlyout: jest.fn(), + patterns: ['auditbeat-*'], + setLastChecked: jest.fn(), + startDate: null, + theme: { + background: { + color: '#000', + }, + }, + baseTheme: { + background: { + color: '#000', + }, + }, + ilmPhases: ['hot', 'warm', 'unmanaged'], + selectedIlmPhaseOptions: [ + { + label: 'hot', + value: 'hot', + }, + { + label: 'warm', + value: 'warm', + }, + { + label: 'unmanaged', + value: 'unmanaged', + }, + ], + setSelectedIlmPhaseOptions: jest.fn(), + ...dataQualityContextProps, + }; + + return { + isILMAvailable, + addSuccessToast, + canUserCreateAndReadCases, + endDate, + formatBytes, + formatNumber, + isAssistantEnabled, + lastChecked, + openCreateCaseFlyout, + patterns, + setLastChecked, + startDate, + theme, + baseTheme, + ilmPhases, + selectedIlmPhaseOptions, + setSelectedIlmPhaseOptions, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts new file mode 100644 index 0000000000000..74817057ee377 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.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 { getCheckState } from '../../../stub/get_check_state'; +import { + UseIndicesCheckCheckState, + UseIndicesCheckReturnValue, +} from '../../../hooks/use_indices_check/types'; + +export const getMergedIndicesCheckContextProps = ( + patternIndexNames: Record, + indicesCheckContextProps?: Partial +): UseIndicesCheckReturnValue => { + const checkState = Object.keys(patternIndexNames).reduce( + (acc, key) => { + for (const indexName of patternIndexNames[key]) { + acc[indexName] = { + ...getCheckState(indexName)[indexName], + }; + } + + return acc; + }, + {} + ); + + return { + checkIndex: jest.fn(), + checkState, + ...indicesCheckContextProps, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts new file mode 100644 index 0000000000000..352b50ec1ef2a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts @@ -0,0 +1,44 @@ +/* + * 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 { UseResultsRollupReturnValue } from '../../../hooks/use_results_rollup/types'; +import { mockUseResultsRollup } from '../../use_results_rollup/mock_use_results_rollup'; + +export const getMergeResultsRollupContextProps = ( + resultsRollupContextProps?: Partial +) => { + const { + onCheckCompleted, + patternIndexNames, + patternRollups, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + totalSameFamily, + totalSizeInBytes, + updatePatternIndexNames, + updatePatternRollup, + } = { + ...mockUseResultsRollup, + ...resultsRollupContextProps, + }; + + return { + onCheckCompleted, + patternIndexNames, + patternRollups, + totalDocsCount, + totalIncompatible, + totalIndices, + totalIndicesChecked, + totalSameFamily, + totalSizeInBytes, + updatePatternIndexNames, + updatePatternRollup, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/unallowed_values/mock_unallowed_values.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/unallowed_values/mock_unallowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/unallowed_values/mock_unallowed_values.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/unallowed_values/mock_unallowed_values.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts new file mode 100644 index 0000000000000..d3259d8c4c6d8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts @@ -0,0 +1,30 @@ +/* + * 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 { auditbeatWithAllResults } from '../pattern_rollup/mock_auditbeat_pattern_rollup'; + +export const mockUseResultsRollup = { + onCheckCompleted: jest.fn(), + patternIndexNames: { + 'auditbeat-*': [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-index-1', + 'auditbeat-custom-empty-index-1', + ], + }, + patternRollups: { + 'auditbeat-*': auditbeatWithAllResults, + }, + totalDocsCount: 19127, + totalIncompatible: 4, + totalIndices: 3, + totalIndicesChecked: 3, + totalSameFamily: 0, + totalSizeInBytes: 18820446, + updatePatternIndexNames: jest.fn(), + updatePatternRollup: jest.fn(), +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx new file mode 100644 index 0000000000000..0db273d5d3024 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { Props, Stat, arePropsEqualOneLevelDeep } from '.'; +import { TestExternalProviders } from '../mock/test_providers/test_providers'; + +describe('Stat', () => { + it('renders stat with badge', () => { + render(); + expect(screen.getByTestId('stat')).toHaveTextContent('thebadge'); + }); + + it('renders stat with tooltip', async () => { + render(); + userEvent.hover(screen.getByText('thebadge')); + expect(screen.getByText('thebadge')).toBeInTheDocument(); + await waitFor(() => expect(screen.getByText('thetooltip')).toBeInTheDocument()); + }); + + it('renders stat with children', () => { + render( + + + {'thechildren'} + + + ); + expect(screen.getByText('thechildren')).toBeInTheDocument(); + expect(screen.getByText('thebadge')).toBeInTheDocument(); + }); +}); + +describe('arePropsEqualOneLevelDeep', () => { + describe('when badgeProps are equal', () => { + it('returns true', () => { + const prevProps = { badgeProps: { color: 'hollow' } } as Props; + const nextProps = { badgeProps: { color: 'hollow' } } as Props; + + expect(arePropsEqualOneLevelDeep(prevProps, nextProps)).toBe(true); + }); + }); + + describe('when badgeProps are not equal', () => { + it('returns false', () => { + const prevProps = { badgeProps: { color: 'hollow' } } as Props; + const nextProps = { badgeProps: { color: 'primary' } } as Props; + + expect(arePropsEqualOneLevelDeep(prevProps, nextProps)).toBe(false); + }); + }); + + describe('when other props are passed', () => { + describe('when props are equal', () => { + it('returns true', () => { + const prevProps = { badgeText: '1' } as Props; + const nextProps = { badgeText: '1' } as Props; + + expect(arePropsEqualOneLevelDeep(prevProps, nextProps)).toBe(true); + }); + }); + + describe('when props are not equal', () => { + it('returns false', () => { + const prevProps = { badgeText: '1' } as Props; + const nextProps = { badgeText: '2' } as Props; + + expect(arePropsEqualOneLevelDeep(prevProps, nextProps)).toBe(false); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx new file mode 100644 index 0000000000000..a7d9286561a5b --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.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 from 'react'; +import { EuiBadge, EuiText, EuiToolTip } from '@elastic/eui'; +import styled from 'styled-components'; + +const StyledText = styled(EuiText)` + white-space: nowrap; +`; + +const StyledDescription = styled.span` + margin-right: ${({ theme }) => theme.eui.euiSizeS}; + vertical-align: baseline; +`; + +export interface Props { + badgeText: string; + badgeColor?: string; + tooltipText?: string; + children?: React.ReactNode; + badgeProps?: React.ComponentProps; +} + +const StatComponent: React.FC = ({ + badgeColor = 'hollow', + badgeText, + tooltipText, + children, + badgeProps, +}) => { + return ( + + + {children && {children}} + + {badgeText} + + + + ); +}; + +StatComponent.displayName = 'StatComponent'; + +// The badgeProps object requires a deeper level of comparison than the default shallow comparison. +// However, using _.isEqual for this purpose would be excessive. +// The other properties should continue to be checked shallowly. +// In essence, only badgeProps needs a deeper comparison, +// while the remaining properties can be compared using React's internal Object.is comparison. +export const arePropsEqualOneLevelDeep = (prevProps: T, nextProps: T): boolean => { + for (const key of Object.keys(prevProps) as Array) { + if (key === 'badgeProps') { + const prevValue = prevProps[key]; + const nextValue = nextProps[key]; + if (prevValue && nextValue) { + return arePropsEqualOneLevelDeep( + prevValue as unknown as Props, + nextValue as unknown as Props + ); + } + } + + if (!Object.is(prevProps[key], nextProps[key])) { + return false; + } + } + + return true; +}; + +export const Stat = React.memo(StatComponent, arePropsEqualOneLevelDeep); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts new file mode 100644 index 0000000000000..8f654de4461e6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts @@ -0,0 +1,135 @@ +/* + * 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 CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.checkedLabel', + { + defaultMessage: 'checked', + } +); + +export const DOCS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.docsLabel', + { + defaultMessage: 'Docs', + } +); + +export const SIZE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.sizeLabel', + { + defaultMessage: 'Size', + } +); + +export const INCOMPATIBLE_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.incompatibleFieldsLabel', + { + defaultMessage: 'Incompatible fields', + } +); + +export const INDICES = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indicesLabel', + { + defaultMessage: 'Indices', + } +); + +export const INDICES_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.indicesCheckedLabel', + { + defaultMessage: 'Indices checked', + } +); + +export const SAME_FAMILY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.sameFamilyLabel', + { + defaultMessage: 'Same family', + } +); + +export const INCOMPATIBLE_INDEX_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.incompatibleIndexToolTip', + { + defaultMessage: 'Mappings and values incompatible with ECS', + } +); + +export const TOTAL_INCOMPATIBLE_PATTERN_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIncompatiblePatternToolTip', + { + defaultMessage: + 'Total number of checked fields incompatible with ECS in indices matching this index pattern', + } +); + +export const TOTAL_DOCS_PATTERN_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalDocsPatternToolTip', + { + defaultMessage: 'Total number of docs in indices matching this index pattern', + } +); + +export const TOTAL_SIZE_PATTERN_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalSizePatternToolTip', + { + defaultMessage: 'Total size of indices (excluding replicas) matching this index pattern', + } +); + +export const TOTAL_CHECKED_INDICES_PATTERN_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalCheckedIndicesPatternToolTip', + { + defaultMessage: 'Total number of checked indices matching this index pattern', + } +); + +export const TOTAL_INDICES_PATTERN_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIndicesPatternToolTip', + { + defaultMessage: 'Total number of indices matching this index pattern', + } +); + +export const TOTAL_DOCS_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalDocsToolTip', + { + defaultMessage: 'Total number of docs in all indices', + } +); + +export const TOTAL_INCOMPATIBLE_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIncompatibleToolTip', + { + defaultMessage: 'Total number of checked fields incompatible with ECS', + } +); + +export const TOTAL_CHECKED_INDICES_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalCheckedIndicesToolTip', + { + defaultMessage: 'Total number of checked indices', + } +); + +export const TOTAL_INDICES_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalIndicesToolTip', + { + defaultMessage: 'Total number of indices', + } +); + +export const TOTAL_SIZE_TOOL_TIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.statLabels.totalSizeToolTip', + { + defaultMessage: 'Total size of indices (excluding replicas)', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx new file mode 100644 index 0000000000000..6b8106f33c157 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx @@ -0,0 +1,159 @@ +/* + * 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 { screen, render, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { + TestDataQualityProviders, + TestExternalProviders, +} from '../mock/test_providers/test_providers'; +import { StatsRollup } from '.'; + +describe('StatsRollup', () => { + it('should render properly formatted stats rollup', () => { + render( + + + + + + ); + + const container = screen.getByTestId('statsRollup'); + + expect(container).toHaveTextContent('Incompatible fields2,222,222'); + expect(container).toHaveTextContent('Indices checked4,444,444'); + expect(container).toHaveTextContent('Indices3,333,333'); + expect(container).toHaveTextContent('Size5.3MB'); + expect(container).toHaveTextContent('Docs1,111,111'); + }); + + describe.each([ + ['Docs', '--'], + ['Incompatible fields', '--'], + ['Indices', '0'], + ['Indices checked', '--'], + ])('when %s count is not provided', (statLabel, emptyText) => { + it(`should render empty ${statLabel} stat`, () => { + render( + + + + + + ); + + const container = screen.getByTestId('statsRollup'); + + expect(container).toHaveTextContent(`${statLabel}${emptyText}`); + }); + }); + + describe('when size count is not provided', () => { + it('should not render size stat', () => { + render( + + + + + + ); + + const container = screen.getByTestId('statsRollup'); + + expect(container).not.toHaveTextContent('Size'); + }); + }); + + describe.each([ + [ + 'Docs', + 'Total number of docs in indices matching this index pattern', + 'Total number of docs in all indices', + ], + [ + 'Incompatible fields', + 'Total number of checked fields incompatible with ECS in indices matching this index pattern', + 'Total number of checked fields incompatible with ECS', + ], + ['Indices', 'Total number of indices matching this index pattern', 'Total number of indices'], + [ + 'Indices checked', + 'Total number of checked indices matching this index pattern', + 'Total number of checked indices', + ], + [ + 'Size', + 'Total size of indices (excluding replicas) matching this index pattern', + 'Total size of indices (excluding replicas)', + ], + ])('%s count tooltips', (statLabelText, patternTooltipText, noPatternTooltipText) => { + describe('when pattern is provided', () => { + it('should render pattern specific tooltip', async () => { + render( + + + + + + ); + + userEvent.hover(screen.getByText(statLabelText)); + + await waitFor(() => + expect(screen.getByRole('tooltip')).toHaveTextContent( + patternTooltipText.replace('{pattern}', 'my-pattern') + ) + ); + }); + }); + + describe('when pattern is not provided', () => { + it('should render default tooltip', async () => { + render( + + + + + + ); + + userEvent.hover(screen.getByText(statLabelText)); + + await waitFor(() => + expect(screen.getByRole('tooltip')).toHaveTextContent(noPatternTooltipText) + ); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx new file mode 100644 index 0000000000000..7a0fb2deaf5bb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx @@ -0,0 +1,125 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import styled from 'styled-components'; + +import { EMPTY_STAT } from '../constants'; +import { useDataQualityContext } from '../data_quality_context'; +import * as i18n from '../stat_label/translations'; +import { Stat } from '../stat'; +import { getIncompatibleStatBadgeColor } from '../utils/get_incompatible_stat_badge_color'; + +const StyledStatWrapperFlexItem = styled(EuiFlexItem)` + padding: 0 ${({ theme }) => theme.eui.euiSize}; + border-right: ${({ theme }) => theme.eui.euiBorderThin}; + border-color: ${({ theme }) => theme.eui.euiBorderColor}; + + &:last-child { + padding-right: 0; + border-right: none; + } + &:first-child { + padding-left: 0; + } +`; + +interface Props { + docsCount?: number; + incompatible?: number; + indices?: number; + indicesChecked?: number; + pattern?: string; + sizeInBytes?: number; +} + +const StatsRollupComponent: React.FC = ({ + docsCount, + incompatible, + indices, + indicesChecked, + pattern, + sizeInBytes, +}) => { + const { formatNumber, formatBytes } = useDataQualityContext(); + + return ( + + + + {i18n.INCOMPATIBLE_FIELDS} + + + + + + {i18n.INDICES_CHECKED} + + + + + + {i18n.INDICES} + + + + {sizeInBytes != null && ( + + + {i18n.SIZE} + + + )} + + + + {i18n.DOCS} + + + + ); +}; + +StatsRollupComponent.displayName = 'StatsRollupComponent'; + +export const StatsRollup = React.memo(StatsRollupComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts new file mode 100644 index 0000000000000..1c56d25367e3a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts @@ -0,0 +1,57 @@ +/* + * 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 { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; + +import { mockMappingsResponse } from '../../mock/mappings_response/mock_mappings_response'; +import { UseIndicesCheckCheckState } from '../../hooks/use_indices_check/types'; +import { getUnallowedValues } from '../../utils/fetch_unallowed_values'; +import { getUnallowedValueRequestItems } from '../../utils/get_unallowed_value_request_items'; +import { EcsFlatTyped } from '../../constants'; +import { mockUnallowedValuesResponse } from '../../mock/unallowed_values/mock_unallowed_values'; +import { UnallowedValueSearchResult } from '../../types'; +import { getMappingsProperties, getSortedPartitionedFieldMetadata } from '../../utils/metadata'; + +export const getCheckState = ( + indexName: string, + indexCheckState?: Partial +) => { + const mappingsProperties = getMappingsProperties({ + indexName, + indexes: mockMappingsResponse as Record, + }); + const unallowedValues = getUnallowedValues({ + requestItems: getUnallowedValueRequestItems({ + ecsMetadata: EcsFlatTyped, + indexName, + }), + searchResults: mockUnallowedValuesResponse as unknown as UnallowedValueSearchResult[], + }); + const partitionedFieldMetadata = getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties, + unallowedValues, + }); + return { + [indexName]: { + isChecking: false, + isLoadingMappings: false, + isLoadingUnallowedValues: false, + indexes: mockMappingsResponse as Record, + partitionedFieldMetadata, + searchResults: mockUnallowedValuesResponse as unknown as UnallowedValueSearchResult[], + unallowedValues, + mappingsProperties, + genericError: null, + mappingsError: null, + unallowedValuesError: null, + isCheckComplete: true, + ...indexCheckState, + }, + }; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx new file mode 100644 index 0000000000000..d54ea9d6316e2 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiCode } from '@elastic/eui'; +import { euiThemeVars } from '@kbn/ui-theme'; + +import styled from 'styled-components'; + +export const CodeDanger = styled(EuiCode)` + color: ${euiThemeVars.euiColorDanger}; +`; + +export const CodeSuccess = styled(EuiCode)` + color: ${euiThemeVars.euiColorSuccess}; +`; + +export const CodeWarning = styled(EuiCode)` + color: ${euiThemeVars.euiColorWarning}; +`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts new file mode 100644 index 0000000000000..4b0e698d0afb2 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts @@ -0,0 +1,391 @@ +/* + * 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 ADD_TO_NEW_CASE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.addToNewCaseButton', + { + defaultMessage: 'Add to new case', + } +); + +export const CANCEL = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.cancelButton', + { + defaultMessage: 'Cancel', + } +); + +export const CHECK_ALL = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.checkAllButton', + { + defaultMessage: 'Check all', + } +); + +export const CHECKING = (index: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.checkingLabel', { + values: { index }, + defaultMessage: 'Checking {index}', + }); + +export const COLD_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.coldDescription', + { + defaultMessage: + 'The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower.', + } +); + +export const COPIED_RESULTS_TOAST_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.toasts.copiedResultsToastTitle', + { + defaultMessage: 'Copied results to the clipboard', + } +); + +export const COPY_TO_CLIPBOARD = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.copyToClipboardButton', + { + defaultMessage: 'Copy to clipboard', + } +); + +export const DATA_QUALITY_PROMPT_CONTEXT_PILL = (indexName: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.dataQualityPromptContextPill', { + values: { indexName }, + defaultMessage: 'Data Quality ({indexName})', + }); + +export const DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.dataQualityPromptContextPillTooltip', + { + defaultMessage: 'Add this Data Quality report as context', + } +); + +/** The subtitle displayed on the Data Quality dashboard */ +export const DATA_QUALITY_SUBTITLE: string = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.securitySolutionPackages.ecsDataQualityDashboardSubtitle', + { + defaultMessage: 'Check index mappings and values for compatibility with the', + } +); + +export const DATA_QUALITY_SUGGESTED_USER_PROMPT = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.dataQualitySuggestedUserPrompt', + { + defaultMessage: + 'Explain the results above, and describe some options to fix incompatibilities.', + } +); + +export const DEFAULT_PANEL_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.defaultPanelTitle', + { + defaultMessage: 'Check index mappings', + } +); + +export const ECS_VERSION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ecsVersionStat', + { + defaultMessage: 'ECS version', + } +); + +export const ERROR_LOADING_ILM_EXPLAIN = (details: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingIlmExplainLabel', { + values: { details }, + defaultMessage: 'Error loading ILM Explain: {details}', + }); + +export const ERROR_LOADING_MAPPINGS = ({ + details, + patternOrIndexName, +}: { + details: string; + patternOrIndexName: string; +}) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingMappingsLabel', { + values: { details, patternOrIndexName }, + defaultMessage: 'Error loading mappings for {patternOrIndexName}: {details}', + }); + +export const ERROR_LOADING_STATS = (details: string) => + i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errorLoadingStatsLabel', { + values: { details }, + defaultMessage: 'Error loading stats: {details}', + }); + +export const ERROR_LOADING_UNALLOWED_VALUES = ({ + details, + indexName, +}: { + details: string; + indexName: string; +}) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errorLoadingUnallowedValuesLabel', + { + values: { details, indexName }, + defaultMessage: 'Error loading unallowed values for index {indexName}: {details}', + } + ); + +export const FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.fieldsLabel', + { + defaultMessage: 'Fields', + } +); + +export const FROZEN_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.frozenDescription', + { + defaultMessage: `The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it's okay if those queries are extremely slow.`, + } +); + +export const HOT_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.hotDescription', + { + defaultMessage: 'The index is actively being updated and queried', + } +); + +/** The tooltip for the `ILM phase` combo box on the Data Quality Dashboard */ +export const INDEX_LIFECYCLE_MANAGEMENT_PHASES: string = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexLifecycleManagementPhasesTooltip', + { + defaultMessage: + 'Indices with these Index Lifecycle Management (ILM) phases will be checked for data quality', + } +); + +export const INDEX_NAME = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexNameLabel', + { + defaultMessage: 'Index name', + } +); + +/** The label displayed for the `ILM phase` combo box on the Data Quality dashboard */ +export const ILM_PHASE: string = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseLabel', + { + defaultMessage: 'ILM phase', + } +); + +export const ILM_PHASE_CAPITALIZED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseCapitalized', + { + defaultMessage: 'ILM Phase', + } +); + +export const LAST_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.lastCheckedLabel', + { + defaultMessage: 'Last checked', + } +); + +export const LOADING_ECS_METADATA = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.emptyLoadingPrompt.loadingEcsMetadataPrompt', + { + defaultMessage: 'Loading ECS metadata', + } +); + +export const SELECT_AN_INDEX = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.selectAnIndexPrompt', + { + defaultMessage: 'Select an index to compare it against ECS version', + } +); + +/** The placeholder for the `ILM phase` combo box on the Data Quality Dashboard */ +export const SELECT_ONE_OR_MORE_ILM_PHASES: string = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.selectOneOrMorPhasesPlaceholder', + { + defaultMessage: 'Select one or more ILM phases', + } +); + +export const INDEX_SIZE_TOOLTIP = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indexSizeTooltip', + { + defaultMessage: 'Size of index (exluding replicas)', + } +); + +export const TIMESTAMP_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.timestampDescriptionLabel', + { + defaultMessage: + 'Date/time when the event originated. This is the date/time extracted from the event, typically representing when the event was generated by the source. If the event source has no original timestamp, this value is typically populated by the first time the event was received by the pipeline. Required field for all events.', + } +); + +export const UNMANAGED_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.unmanagedDescription', + { + defaultMessage: `The index isn't managed by Index Lifecycle Management (ILM)`, + } +); + +export const WARM_DESCRIPTION = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.warmDescription', + { + defaultMessage: 'The index is no longer being updated but is still being queried', + } +); + +export const POST_RESULT_ERROR_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.postResultErrorTitle', + { defaultMessage: 'Error writing saved data quality check results' } +); + +export const GET_RESULTS_ERROR_TITLE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.getResultErrorTitle', + { defaultMessage: 'Error reading saved data quality check results' } +); + +export const COLD = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseCold', + { + defaultMessage: 'cold', + } +); + +export const FROZEN = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseFrozen', + { + defaultMessage: 'frozen', + } +); + +export const HOT = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseHot', { + defaultMessage: 'hot', +}); + +export const WARM = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseWarm', + { + defaultMessage: 'warm', + } +); + +export const UNMANAGED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.ilmPhaseUnmanaged', + { + defaultMessage: 'unmanaged', + } +); + +export const DATA_QUALITY_DASHBOARD_CONVERSATION_ID = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.dataQualityDashboardConversationId', + { + defaultMessage: 'Data Quality dashboard', + } +); + +export const AN_ERROR_OCCURRED_CHECKING_INDEX = (indexName: string) => + i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.checkAllErrorCheckingIndexMessage', + { + values: { indexName }, + defaultMessage: 'An error occurred checking index {indexName}', + } + ); + +export const DOCS = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.docs', { + defaultMessage: 'Docs', +}); + +export const INCOMPATIBLE_FIELDS = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.incompatibleFields', + { + defaultMessage: 'Incompatible fields', + } +); + +export const INDICES = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.indices', { + defaultMessage: 'Indices', +}); + +export const INDICES_CHECKED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.indicesChecked', + { + defaultMessage: 'Indices checked', + } +); + +export const INDEX = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.index', { + defaultMessage: 'Index', +}); + +export const SIZE = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.size', { + defaultMessage: 'Size', +}); + +export const RESULT = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.result', { + defaultMessage: 'Result', +}); + +export const ERRORS_CALLOUT_SUMMARY = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.errorsCalloutSummary', + { + defaultMessage: 'Some indices were not checked for Data Quality', + } +); + +export const ERRORS_MAY_OCCUR = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.errorMayOccurLabel', + { + defaultMessage: + "Errors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for access", + } +); + +export const MANAGE = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.manage', + { + defaultMessage: 'manage', + } +); + +export const MONITOR = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.monitor', + { + defaultMessage: 'monitor', + } +); + +export const OR = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errors.or', { + defaultMessage: 'or', +}); + +export const READ = i18n.translate('securitySolutionPackages.ecsDataQualityDashboard.errors.read', { + defaultMessage: 'read', +}); + +export const THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.theFollowingPrivilegesLabel', + { + defaultMessage: 'The following privileges are required to check an index:', + } +); +export const VIEW_INDEX_METADATA = i18n.translate( + 'securitySolutionPackages.ecsDataQualityDashboard.errors.viewIndexMetadata', + { + defaultMessage: 'view_index_metadata', + } +); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts new file mode 100644 index 0000000000000..08c964d423101 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts @@ -0,0 +1,289 @@ +/* + * 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 { + IlmExplainLifecycleLifecycleExplain, + IndicesGetMappingIndexMappingRecord, +} from '@elastic/elasticsearch/lib/api/types'; +import type { Direction } from '@elastic/eui'; + +export interface Mappings { + pattern: string; + indexes: Record; +} + +export interface EcsFieldMetadata { + dashed_name: string; + description: string; + flat_name: string; + level: string; + name: string; + normalize: string[]; + short: string; + type: string; + + allowed_values?: AllowedValue[]; + beta?: string; + doc_values?: boolean; + example?: string | number | boolean; + expected_values?: string[]; + format?: string; + ignore_above?: number; + index?: boolean; + input_format?: string; + multi_fields?: MultiField[]; + object_type?: string; + original_fieldset?: string; + output_format?: string; + output_precision?: number; + pattern?: string; + required?: boolean; + scaling_factor?: number; +} + +export interface AllowedValue { + description: string; + name: string; + expected_event_types?: string[]; + beta?: string; +} + +export interface MultiField { + flat_name: string; + name: string; + type: string; +} + +export interface CustomFieldMetadata { + hasEcsMetadata: false; + indexFieldName: string; + indexFieldType: string; + indexInvalidValues: []; + isEcsCompliant: false; + isInSameFamily: false; +} +export interface EcsBasedFieldMetadata extends EcsFieldMetadata { + hasEcsMetadata: true; + indexFieldName: string; + indexFieldType: string; + indexInvalidValues: UnallowedValueCount[]; + isEcsCompliant: boolean; + isInSameFamily: boolean; +} + +export type EnrichedFieldMetadata = EcsBasedFieldMetadata | CustomFieldMetadata; + +export interface PartitionedFieldMetadata { + all: EnrichedFieldMetadata[]; + custom: CustomFieldMetadata[]; + ecsCompliant: EcsBasedFieldMetadata[]; + incompatible: EcsBasedFieldMetadata[]; + sameFamily: EcsBasedFieldMetadata[]; +} + +export interface UnallowedValueRequestItem { + allowedValues: string[]; + indexFieldName: string; + indexName: string; +} + +export interface Bucket { + key: string; + doc_count: number; +} + +export interface UnallowedValueCount { + fieldName: string; + count: number; +} + +export interface UnallowedValueSearchResult { + aggregations?: { + [x: string]: { + buckets?: Bucket[]; + }; + }; +} + +export type IlmPhase = 'hot' | 'warm' | 'cold' | 'frozen' | 'unmanaged'; + +export interface IncompatibleFieldMappingItem { + fieldName: string; + expectedValue: string; + actualValue: string; + description: string; +} + +export interface ActualIncompatibleValue { + name: string; + count: number; +} + +export interface IncompatibleFieldValueItem { + fieldName: string; + expectedValues: string[]; + actualValues: ActualIncompatibleValue[]; + description: string; +} + +export interface SameFamilyFieldItem { + fieldName: string; + expectedValue: string; + actualValue: string; + description: string; +} + +export interface IlmExplainPhaseCounts { + hot: number; + warm: number; + cold: number; + frozen: number; + unmanaged: number; +} + +export interface DataQualityCheckResult { + docsCount: number | undefined; + error: string | null; + ilmPhase: IlmPhase | undefined; + incompatible: number | undefined; + indexName: string; + markdownComments: string[]; + sameFamily: number | undefined; + pattern: string; + checkedAt: number | undefined; +} + +export interface PatternRollup { + docsCount: number | undefined; + error: string | null; + ilmExplain: Record | null; + ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; + indices: number | undefined; + pattern: string; + results: Record | undefined; + sizeInBytes: number | undefined; + stats: Record | null; +} + +export interface CheckIndexRequest { + pattern: string; + indexName: string; +} + +export interface RequestQueueRequest { + topicId: string; + request: T; +} + +export interface RequestQueueResponse { + topicId: string; + request: T; + response: U; +} + +export interface IndexToCheck { + pattern: string; + indexName: string; +} + +export type OnCheckCompleted = (param: { + batchId: string; + isCheckAll: boolean; + isLastCheck: boolean; + checkAllStartTime: number; + error: string | null; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + indexName: string; + partitionedFieldMetadata: PartitionedFieldMetadata | null; + pattern: string; + requestTime?: number; +}) => void; + +export interface ErrorSummary { + error: string; + indexName: string | null; + pattern: string; +} + +export interface SortConfig { + sort: { + direction: Direction; + field: string; + }; +} + +export interface SelectedIndex { + indexName: string; + pattern: string; +} + +export interface MeteringStatsIndex { + uuid?: string; + name: string; + num_docs: number | null; + size_in_bytes: number | null; + data_stream?: string; +} + +export interface MeteringIndicesStatsResponse { + _shards: { + total: number; + successful: number; + failed: number; + }; + indices: MeteringStatsIndex[]; + datastreams: Array<{ name: string; num_docs: number; size_in_bytes: number }>; + total: { + num_docs: number; + size_in_bytes: number; + }; +} + +export type DataQualityIndexCheckedParams = DataQualityCheckAllCompletedParams & { + errorCount?: number; + ilmPhase?: string; + indexId?: string | null; + indexName: string; + sameFamilyFields?: string[]; + unallowedMappingFields?: string[]; + unallowedValueFields?: string[]; +}; + +export interface DataQualityCheckAllCompletedParams { + batchId: string; + ecsVersion: string; + isCheckAll: boolean; + numberOfDocuments?: number; + numberOfIncompatibleFields?: number; + numberOfIndices?: number; + numberOfIndicesChecked?: number; + numberOfSameFamily?: number; + sizeInBytes?: number; + timeConsumedMs?: number; +} + +export type ReportDataQualityIndexChecked = (params: DataQualityIndexCheckedParams) => void; +export type ReportDataQualityCheckAllCompleted = ( + params: DataQualityCheckAllCompletedParams +) => void; + +export interface TelemetryEvents { + reportDataQualityIndexChecked?: ReportDataQualityIndexChecked; + reportDataQualityCheckAllCompleted?: ReportDataQualityCheckAllCompleted; +} + +export interface IndexSummaryTableItem { + docsCount: number; + incompatible: number | undefined; + indexName: string; + ilmPhase: IlmPhase | undefined; + pattern: string; + patternDocsCount: number; + sizeInBytes: number | undefined; + checkedAt: number | undefined; +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts new file mode 100644 index 0000000000000..77538a60c65c1 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts @@ -0,0 +1,466 @@ +/* + * 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 { checkIndex, EMPTY_PARTITIONED_FIELD_METADATA } from './check_index'; +import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; +import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; +import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types'; +import { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; +import { getUnallowedValues } from './fetch_unallowed_values'; +import { getUnallowedValueRequestItems } from './get_unallowed_value_request_items'; +import { EcsFlatTyped, EMPTY_STAT } from '../constants'; +import { getMappingsProperties, getSortedPartitionedFieldMetadata } from './metadata'; + +let mockFetchMappings = jest.fn( + (_: { abortController: AbortController; patternOrIndexName: string }) => + Promise.resolve(mockMappingsResponse) +); + +jest.mock('./fetch_mappings', () => { + const original = jest.requireActual('./fetch_mappings'); + return { + ...original, + fetchMappings: ({ + abortController, + patternOrIndexName, + }: { + abortController: AbortController; + patternOrIndexName: string; + }) => + mockFetchMappings({ + abortController, + patternOrIndexName, + }), + }; +}); + +const mockFetchUnallowedValues = jest.fn( + (_: { + abortController: AbortController; + indexName: string; + requestItems: UnallowedValueRequestItem[]; + }) => Promise.resolve(mockUnallowedValuesResponse) +); + +jest.mock('./fetch_unallowed_values', () => { + const original = jest.requireActual('./fetch_unallowed_values'); + + return { + ...original, + fetchUnallowedValues: ({ + abortController, + indexName, + requestItems, + }: { + abortController: AbortController; + indexName: string; + requestItems: UnallowedValueRequestItem[]; + }) => + mockFetchUnallowedValues({ + abortController, + indexName, + requestItems, + }), + }; +}); + +describe('checkIndex', () => { + const defaultBytesFormat = '0,0.[0]b'; + const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + + const defaultNumberFormat = '0,0.[000]'; + const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + + const indexName = 'auditbeat-custom-index-1'; + const pattern = 'auditbeat-*'; + const httpFetch = jest.fn(); + + describe('when `checkIndex` successfully completes the check', () => { + const onCheckCompleted = jest.fn(); + + beforeEach(async () => { + jest.clearAllMocks(); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + }); + }); + + test('it invokes onCheckCompleted with a null `error`', () => { + expect(onCheckCompleted.mock.calls[0][0].error).toBeNull(); + }); + + test('it invokes onCheckCompleted with the expected `indexName`', () => { + expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); + }); + + test('it invokes onCheckCompleted with the non-default `partitionedFieldMetadata`', () => { + expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).not.toEqual( + EMPTY_PARTITIONED_FIELD_METADATA + ); + }); + + test('it invokes onCheckCompleted with the expected`pattern`', () => { + expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); + }); + }); + + describe('lifecycle hooks', () => { + const orderOfCalls: string[] = []; + const onStart = jest.fn(() => orderOfCalls.push('onStart')); + const onSuccess = jest.fn(() => orderOfCalls.push('onSuccess')); + const onError = jest.fn(() => orderOfCalls.push('onError')); + const onLoadMappingsStart = jest.fn(() => orderOfCalls.push('onLoadMappingsStart')); + const onLoadMappingsSuccess = jest.fn(() => orderOfCalls.push('onLoadMappingsSuccess')); + const onLoadUnallowedValuesStart = jest.fn(() => + orderOfCalls.push('onLoadUnallowedValuesStart') + ); + const onLoadUnallowedValuesSuccess = jest.fn(() => + orderOfCalls.push('onLoadUnallowedValuesSuccess') + ); + + beforeEach(async () => { + orderOfCalls.length = 0; + jest.clearAllMocks(); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted: jest.fn(), + pattern, + onError, + onLoadMappingsStart, + onLoadMappingsSuccess, + onLoadUnallowedValuesStart, + onLoadUnallowedValuesSuccess, + onStart, + onSuccess, + }); + }); + + test('it invokes `onStart`', () => { + expect(onStart).toBeCalled(); + }); + + test('it invokes `onLoadMappingsStart`', () => { + expect(onLoadMappingsStart).toBeCalled(); + }); + + test('it invokes `onLoadMappingsSuccess` with mappings response', () => { + expect(onLoadMappingsSuccess).toBeCalledWith(mockMappingsResponse); + }); + + test('it invokes `onLoadUnallowedValuesStart`', () => { + expect(onLoadUnallowedValuesStart).toBeCalled(); + }); + + test('it invokes `onLoadUnallowedValuesSuccess` with unallowed value search results', () => { + expect(onLoadUnallowedValuesSuccess).toBeCalledWith(mockUnallowedValuesResponse); + }); + + test('it invokes `onSuccess` with the expected arguments', () => { + const mappingsProperties = getMappingsProperties({ + indexName, + indexes: mockMappingsResponse as Record, + }); + const unallowedValues = getUnallowedValues({ + requestItems: getUnallowedValueRequestItems({ + ecsMetadata: EcsFlatTyped, + indexName, + }), + searchResults: mockUnallowedValuesResponse as unknown as UnallowedValueSearchResult[], + }); + const partitionedFieldMetadata = getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties, + unallowedValues, + }); + expect(onSuccess).toBeCalledWith({ + partitionedFieldMetadata, + mappingsProperties, + unallowedValues, + }); + }); + + test('it does NOT invoke `onError`', () => { + expect(onError).not.toBeCalled(); + }); + + test('it invokes the lifecycle hooks in the expected order', () => { + expect(orderOfCalls).toEqual([ + 'onStart', + 'onLoadMappingsStart', + 'onLoadMappingsSuccess', + 'onLoadUnallowedValuesStart', + 'onLoadUnallowedValuesSuccess', + 'onSuccess', + ]); + }); + + describe('when load mappings error occurs', () => { + const error = 'simulated fetch mappings error'; + const onCheckCompleted = jest.fn(); + + beforeEach(async () => { + orderOfCalls.length = 0; + jest.clearAllMocks(); + + mockFetchMappings.mockRejectedValueOnce(new Error(error)); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + onError, + onLoadMappingsStart, + onLoadMappingsSuccess, + onLoadUnallowedValuesStart, + onLoadUnallowedValuesSuccess, + onStart, + onSuccess, + }); + }); + + test('it invokes `onError` with mappings error', () => { + expect(onError).toBeCalledWith(new Error(error)); + }); + + test('it does NOT invoke `onSuccess`', () => { + expect(onSuccess).not.toBeCalled(); + }); + + test('it invokes the lifecycle hooks in the expected order', () => { + expect(orderOfCalls).toEqual(['onStart', 'onLoadMappingsStart', 'onError']); + }); + }); + + describe('when load unallowed values error occurs', () => { + const error = 'simulated fetch unallowed values error'; + const onCheckCompleted = jest.fn(); + + beforeEach(async () => { + orderOfCalls.length = 0; + jest.clearAllMocks(); + + mockFetchUnallowedValues.mockRejectedValueOnce(new Error(error)); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + onError, + onLoadMappingsStart, + onLoadMappingsSuccess, + onLoadUnallowedValuesStart, + onLoadUnallowedValuesSuccess, + onStart, + onSuccess, + }); + }); + + test('it invokes `onError` with unallowed values error', () => { + expect(onError).toBeCalledWith(new Error(error)); + }); + + test('it does NOT invoke `onSuccess`', () => { + expect(onSuccess).not.toBeCalled(); + }); + + test('it invokes the lifecycle hooks in the expected order', () => { + expect(orderOfCalls).toEqual([ + 'onStart', + 'onLoadMappingsStart', + 'onLoadMappingsSuccess', + 'onLoadUnallowedValuesStart', + 'onError', + ]); + }); + }); + }); + + describe('happy path, when the signal is aborted', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it does NOT invoke onCheckCompleted', async () => { + const onCheckCompleted = jest.fn(); + + const abortController = new AbortController(); + abortController.abort(); + + await checkIndex({ + abortController, + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + }); + + expect(onCheckCompleted).not.toBeCalled(); + }); + }); + + describe('when an error occurs', () => { + const onCheckCompleted = jest.fn(); + const error = 'simulated fetch mappings error'; + + beforeEach(async () => { + jest.clearAllMocks(); + + mockFetchMappings = jest.fn( + (_: { abortController: AbortController; patternOrIndexName: string }) => + Promise.reject(new Error(error)) + ); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + }); + }); + + test('it invokes onCheckCompleted with the expected `error`', () => { + expect(onCheckCompleted.mock.calls[0][0].error).toEqual(error); + }); + + test('it invokes onCheckCompleted with the expected `indexName`', () => { + expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); + }); + + test('it invokes onCheckCompleted with null `partitionedFieldMetadata`', () => { + expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).toBeNull(); + }); + + test('it invokes onCheckCompleted with the expected `pattern`', () => { + expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); + }); + }); + + describe('when an error occurs, but the error does not have a toString', () => { + const onCheckCompleted = jest.fn(); + + beforeEach(async () => { + jest.clearAllMocks(); + + mockFetchMappings = jest.fn( + (_: { abortController: AbortController; patternOrIndexName: string }) => + // eslint-disable-next-line prefer-promise-reject-errors + Promise.reject(undefined) + ); + + await checkIndex({ + abortController: new AbortController(), + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + }); + }); + + test('it invokes onCheckCompleted with the fallback `error`', () => { + expect(onCheckCompleted.mock.calls[0][0].error).toEqual( + `An error occurred checking index ${indexName}` + ); + }); + + test('it invokes onCheckCompleted with the expected `indexName`', () => { + expect(onCheckCompleted.mock.calls[0][0].indexName).toEqual(indexName); + }); + + test('it invokes onCheckCompleted with null `partitionedFieldMetadata`', () => { + expect(onCheckCompleted.mock.calls[0][0].partitionedFieldMetadata).toBeNull(); + }); + + test('it invokes onCheckCompleted with the expected `pattern`', () => { + expect(onCheckCompleted.mock.calls[0][0].pattern).toEqual(pattern); + }); + }); + + describe('when an error occurs, and the signal is aborted', () => { + const onCheckCompleted = jest.fn(); + const abortController = new AbortController(); + abortController.abort(); + + const error = 'simulated fetch mappings error'; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it does NOT invoke onCheckCompleted', async () => { + mockFetchMappings = jest.fn( + (_: { abortController: AbortController; patternOrIndexName: string }) => + Promise.reject(new Error(error)) + ); + + await checkIndex({ + abortController, + batchId: 'batch-id', + checkAllStartTime: Date.now(), + formatBytes, + formatNumber, + httpFetch, + indexName, + isLastCheck: false, + onCheckCompleted, + pattern, + }); + + expect(onCheckCompleted).not.toBeCalled(); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts new file mode 100644 index 0000000000000..a577ca15d0ad8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts @@ -0,0 +1,170 @@ +/* + * 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 { HttpHandler } from '@kbn/core-http-browser'; +import { + IndicesGetMappingIndexMappingRecord, + MappingProperty, +} from '@elastic/elasticsearch/lib/api/types'; +import { v4 as uuidv4 } from 'uuid'; + +import { getUnallowedValueRequestItems } from './get_unallowed_value_request_items'; +import * as i18n from '../translations'; +import type { + OnCheckCompleted, + PartitionedFieldMetadata, + UnallowedValueCount, + UnallowedValueSearchResult, +} from '../types'; +import { fetchMappings } from './fetch_mappings'; +import { fetchUnallowedValues, getUnallowedValues } from './fetch_unallowed_values'; +import { EcsFlatTyped } from '../constants'; +import { getMappingsProperties, getSortedPartitionedFieldMetadata } from './metadata'; + +export const EMPTY_PARTITIONED_FIELD_METADATA: PartitionedFieldMetadata = { + all: [], + custom: [], + ecsCompliant: [], + incompatible: [], + sameFamily: [], +}; + +export interface CheckIndexProps { + abortController: AbortController; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + httpFetch: HttpHandler; + indexName: string; + onCheckCompleted: OnCheckCompleted; + pattern: string; + onLoadMappingsSuccess?: (indexes: Record) => void; + onLoadMappingsStart?: () => void; + onLoadUnallowedValuesSuccess?: (searchResults: UnallowedValueSearchResult[]) => void; + onLoadUnallowedValuesStart?: () => void; + onStart?: () => void; + onSuccess?: ({ + partitionedFieldMetadata, + mappingsProperties, + unallowedValues, + }: { + partitionedFieldMetadata: PartitionedFieldMetadata; + mappingsProperties: Record | null; + unallowedValues: Record; + }) => void; + onError?: (error: unknown) => void; + batchId?: string; + checkAllStartTime?: number; + isCheckAll?: boolean; + isLastCheck?: boolean; +} + +export async function checkIndex({ + abortController, + formatBytes, + formatNumber, + httpFetch, + indexName, + onCheckCompleted, + pattern, + onLoadMappingsSuccess, + onLoadMappingsStart, + onLoadUnallowedValuesSuccess, + onLoadUnallowedValuesStart, + onStart, + onSuccess, + onError, + isLastCheck = false, + batchId = uuidv4(), + checkAllStartTime = Date.now(), + isCheckAll = false, +}: CheckIndexProps) { + try { + const startTime = Date.now(); + + onStart?.(); + onLoadMappingsStart?.(); + const indexes = await fetchMappings({ + abortController, + httpFetch, + patternOrIndexName: indexName, + }); + + onLoadMappingsSuccess?.(indexes); + + const requestItems = getUnallowedValueRequestItems({ + ecsMetadata: EcsFlatTyped, + indexName, + }); + + onLoadUnallowedValuesStart?.(); + const searchResults = await fetchUnallowedValues({ + abortController, + httpFetch, + indexName, + requestItems, + }); + + onLoadUnallowedValuesSuccess?.(searchResults); + + const unallowedValues = getUnallowedValues({ + requestItems, + searchResults, + }); + + const mappingsProperties = getMappingsProperties({ + indexes, + indexName, + }); + + const partitionedFieldMetadata = + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties, + unallowedValues, + }) ?? EMPTY_PARTITIONED_FIELD_METADATA; + + onSuccess?.({ + partitionedFieldMetadata, + mappingsProperties, + unallowedValues, + }); + if (!abortController.signal.aborted) { + onCheckCompleted({ + checkAllStartTime, + batchId, + error: null, + formatBytes, + isCheckAll, + formatNumber, + indexName, + partitionedFieldMetadata, + pattern, + requestTime: Date.now() - startTime, + isLastCheck, + }); + } + } catch (error: unknown) { + onError?.(error); + + if (!abortController.signal.aborted) { + onCheckCompleted({ + checkAllStartTime, + batchId, + error: + error instanceof Error ? error.message : i18n.AN_ERROR_OCCURRED_CHECKING_INDEX(indexName), + formatBytes, + formatNumber, + isCheckAll, + indexName, + partitionedFieldMetadata: null, + pattern, + isLastCheck, + }); + } + } +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts new file mode 100644 index 0000000000000..b24241b95a510 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.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 { fetchMappings } from './fetch_mappings'; +import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; + +describe('helpers', () => { + describe('fetchMappings', () => { + test('it returns the expected mappings', async () => { + const mockFetch = jest.fn().mockResolvedValue(mockMappingsResponse); + + const result = await fetchMappings({ + abortController: new AbortController(), + httpFetch: mockFetch, + patternOrIndexName: 'auditbeat-custom-index-1', + }); + + expect(result).toEqual({ + 'auditbeat-custom-index-1': { + mappings: { + properties: { + '@timestamp': { type: 'date' }, + event: { properties: { category: { ignore_above: 1024, type: 'keyword' } } }, + host: { + properties: { + name: { + fields: { keyword: { ignore_above: 256, type: 'keyword' } }, + type: 'text', + }, + }, + }, + some: { + properties: { + field: { + fields: { keyword: { ignore_above: 256, type: 'keyword' } }, + type: 'text', + }, + }, + }, + source: { + properties: { + ip: { fields: { keyword: { ignore_above: 256, type: 'keyword' } }, type: 'text' }, + port: { type: 'long' }, + }, + }, + }, + }, + }, + }); + }); + + test('it throws the expected error when fetch fails', async () => { + const error = 'simulated error'; + const mockFetch = jest.fn().mockImplementation(() => { + throw new Error(error); + }); + + await expect( + fetchMappings({ + abortController: new AbortController(), + httpFetch: mockFetch, + patternOrIndexName: 'auditbeat-custom-index-1', + }) + ).rejects.toThrowError( + 'Error loading mappings for auditbeat-custom-index-1: simulated error' + ); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts new file mode 100644 index 0000000000000..090f7e375e5bc --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { HttpHandler } from '@kbn/core-http-browser'; +import type { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; + +import * as i18n from '../translations'; +import { INTERNAL_API_VERSION } from '../constants'; + +export const MAPPINGS_API_ROUTE = '/internal/ecs_data_quality_dashboard/mappings'; + +export async function fetchMappings({ + abortController, + httpFetch, + patternOrIndexName, +}: { + abortController: AbortController; + httpFetch: HttpHandler; + patternOrIndexName: string; +}): Promise> { + const encodedIndexName = encodeURIComponent(`${patternOrIndexName}`); + + try { + return await httpFetch>( + `${MAPPINGS_API_ROUTE}/${encodedIndexName}`, + { + method: 'GET', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + } + ); + } catch (e) { + throw new MappingsError(patternOrIndexName, e.message); + } +} + +export class MappingsError extends Error { + constructor(patternOrIndexName: string, details: string) { + const message = i18n.ERROR_LOADING_MAPPINGS({ details, patternOrIndexName }); + super(message); + + this.name = 'MappingsError'; + this.message = message; + } +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts new file mode 100644 index 0000000000000..00dc04dedf27a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts @@ -0,0 +1,498 @@ +/* + * 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 { omit } from 'lodash/fp'; + +import { + fetchUnallowedValues, + getUnallowedValueCount, + getUnallowedValues, + isBucket, +} from './fetch_unallowed_values'; +import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; +import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types'; +import { INTERNAL_API_VERSION } from '../constants'; + +describe('helpers', () => { + let originalFetch: (typeof global)['fetch']; + + beforeAll(() => { + originalFetch = global.fetch; + }); + + afterAll(() => { + global.fetch = originalFetch; + }); + + describe('isBucket', () => { + test('it returns true when the bucket is valid', () => { + expect( + isBucket({ + key: 'stop', + doc_count: 2, + }) + ).toBe(true); + }); + + test('it returns false when just `key` is missing', () => { + expect( + isBucket({ + doc_count: 2, + }) + ).toBe(false); + }); + + test('it returns false when just `key` has an incorrect type', () => { + expect( + isBucket({ + key: 1234, // <-- should be a string + doc_count: 2, + }) + ).toBe(false); + }); + + test('it returns false when just `doc_count` is missing', () => { + expect( + isBucket({ + key: 'stop', + }) + ).toBe(false); + }); + + test('it returns false when just `doc_count` has an incorrect type', () => { + expect( + isBucket({ + key: 'stop', + doc_count: 'foo', // <-- should be a number + }) + ).toBe(false); + }); + + test('it returns false when both `key` and `doc_count` are missing', () => { + expect(isBucket({})).toBe(false); + }); + + test('it returns false when both `key` and `doc_count` have incorrect types', () => { + expect( + isBucket({ + key: 1234, // <-- should be a string + doc_count: 'foo', // <-- should be a number + }) + ).toBe(false); + }); + + test('it returns false when `maybeBucket` is undefined', () => { + expect(isBucket(undefined)).toBe(false); + }); + }); + + describe('getUnallowedValueCount', () => { + test('it returns the expected count', () => { + expect( + getUnallowedValueCount({ + key: 'stop', + doc_count: 2, + }) + ).toEqual({ count: 2, fieldName: 'stop' }); + }); + }); + + describe('getUnallowedValues', () => { + const requestItems: UnallowedValueRequestItem[] = [ + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.category', + allowedValues: [ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.kind', + allowedValues: [ + 'alert', + 'enrichment', + 'event', + 'metric', + 'state', + 'pipeline_error', + 'signal', + ], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.outcome', + allowedValues: ['failure', 'success', 'unknown'], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.type', + allowedValues: [ + 'access', + 'admin', + 'allowed', + 'change', + 'connection', + 'creation', + 'deletion', + 'denied', + 'end', + 'error', + 'group', + 'indicator', + 'info', + 'installation', + 'protocol', + 'start', + 'user', + ], + }, + ]; + + const searchResults: UnallowedValueSearchResult[] = [ + { + aggregations: { + 'event.category': { + buckets: [ + { + key: 'an_invalid_category', + doc_count: 2, + }, + { + key: 'theory', + doc_count: 1, + }, + ], + }, + }, + }, + { + aggregations: { + 'event.kind': { + buckets: [], + }, + }, + }, + { + aggregations: { + 'event.outcome': { + buckets: [], + }, + }, + }, + { + aggregations: { + 'event.type': { + buckets: [], + }, + }, + }, + ]; + + test('it returns the expected unallowed values', () => { + expect( + getUnallowedValues({ + requestItems, + searchResults, + }) + ).toEqual({ + 'event.category': [ + { count: 2, fieldName: 'an_invalid_category' }, + { count: 1, fieldName: 'theory' }, + ], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }); + }); + + test('it returns an empty index when `searchResults` is null', () => { + expect( + getUnallowedValues({ + requestItems, + searchResults: null, + }) + ).toEqual({}); + }); + + test('it returns an empty index when `searchResults` is not an array', () => { + expect( + getUnallowedValues({ + requestItems, + // @ts-expect-error + searchResults: 1234, + }) + ).toEqual({}); + }); + + test('it returns the expected results when `searchResults` does NOT have `aggregations`', () => { + const noAggregations: UnallowedValueSearchResult[] = searchResults.map((x) => + omit('aggregations', x) + ); + + expect( + getUnallowedValues({ + requestItems, + searchResults: noAggregations, + }) + ).toEqual({ + 'event.category': [], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }); + }); + + test('it returns the expected unallowed values when SOME buckets are invalid', () => { + const someInvalid: UnallowedValueSearchResult[] = [ + { + aggregations: { + 'event.category': { + buckets: [ + { + key: 'foo', + // @ts-expect-error + doc_count: 'this-is-an-invalid-bucket', // <-- invalid type, should be number + }, + { + key: 'bar', + doc_count: 1, + }, + ], + }, + }, + }, + { + aggregations: { + 'event.kind': { + buckets: [], + }, + }, + }, + { + aggregations: { + 'event.outcome': { + buckets: [], + }, + }, + }, + { + aggregations: { + 'event.type': { + buckets: [], + }, + }, + }, + ]; + + expect( + getUnallowedValues({ + requestItems, + searchResults: someInvalid, + }) + ).toEqual({ + 'event.category': [{ count: 1, fieldName: 'bar' }], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }); + }); + }); + + describe('fetchUnallowedValues', () => { + const requestItems: UnallowedValueRequestItem[] = [ + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.category', + allowedValues: [ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.kind', + allowedValues: [ + 'alert', + 'enrichment', + 'event', + 'metric', + 'state', + 'pipeline_error', + 'signal', + ], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.outcome', + allowedValues: ['failure', 'success', 'unknown'], + }, + { + indexName: 'auditbeat-custom-index-1', + indexFieldName: 'event.type', + allowedValues: [ + 'access', + 'admin', + 'allowed', + 'change', + 'connection', + 'creation', + 'deletion', + 'denied', + 'end', + 'error', + 'group', + 'indicator', + 'info', + 'installation', + 'protocol', + 'start', + 'user', + ], + }, + ]; + + test('it includes the expected content in the `fetch` request', async () => { + const mockFetch = jest.fn().mockResolvedValue(mockUnallowedValuesResponse); + const abortController = new AbortController(); + + await fetchUnallowedValues({ + abortController, + httpFetch: mockFetch, + indexName: 'auditbeat-custom-index-1', + requestItems, + }); + + expect(mockFetch).toBeCalledWith( + '/internal/ecs_data_quality_dashboard/unallowed_field_values', + { + body: JSON.stringify(requestItems), + headers: { 'Content-Type': 'application/json' }, + method: 'POST', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + } + ); + }); + + test('it returns the expected unallowed values', async () => { + const mockFetch = jest.fn().mockResolvedValue(mockUnallowedValuesResponse); + + const result = await fetchUnallowedValues({ + abortController: new AbortController(), + httpFetch: mockFetch, + indexName: 'auditbeat-custom-index-1', + requestItems, + }); + + expect(result).toEqual([ + { + _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, + aggregations: { + 'event.category': { + buckets: [ + { doc_count: 2, key: 'an_invalid_category' }, + { doc_count: 1, key: 'theory' }, + ], + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + }, + }, + hits: { hits: [], max_score: null, total: { relation: 'eq', value: 3 } }, + status: 200, + timed_out: false, + took: 1, + }, + { + _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, + aggregations: { + 'event.kind': { buckets: [], doc_count_error_upper_bound: 0, sum_other_doc_count: 0 }, + }, + hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, + status: 200, + timed_out: false, + took: 0, + }, + { + _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, + aggregations: { + 'event.outcome': { + buckets: [], + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + }, + }, + hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, + status: 200, + timed_out: false, + took: 0, + }, + { + _shards: { failed: 0, skipped: 0, successful: 1, total: 1 }, + aggregations: { + 'event.type': { buckets: [], doc_count_error_upper_bound: 0, sum_other_doc_count: 0 }, + }, + hits: { hits: [], max_score: null, total: { relation: 'eq', value: 4 } }, + status: 200, + timed_out: false, + took: 0, + }, + ]); + }); + + test('it throws the expected error when fetch fails', async () => { + const error = 'simulated error'; + const mockFetch = jest.fn().mockImplementation(() => { + throw new Error(error); + }); + + await expect( + fetchUnallowedValues({ + abortController: new AbortController(), + httpFetch: mockFetch, + indexName: 'auditbeat-custom-index-1', + requestItems, + }) + ).rejects.toThrowError( + 'Error loading unallowed values for index auditbeat-custom-index-1: simulated error' + ); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts new file mode 100644 index 0000000000000..b19481546a285 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts @@ -0,0 +1,100 @@ +/* + * 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 { HttpHandler } from '@kbn/core-http-browser'; + +import { INTERNAL_API_VERSION } from '../constants'; +import * as i18n from '../translations'; +import type { + Bucket, + UnallowedValueCount, + UnallowedValueRequestItem, + UnallowedValueSearchResult, +} from '../types'; + +export const isBucket = (maybeBucket: unknown): maybeBucket is Bucket => + maybeBucket != null && + typeof (maybeBucket as Bucket).key === 'string' && + typeof (maybeBucket as Bucket).doc_count === 'number'; + +// eslint-disable-next-line @typescript-eslint/naming-convention +export const getUnallowedValueCount = ({ doc_count, key }: Bucket): UnallowedValueCount => ({ + count: doc_count, + fieldName: key, +}); + +export const getUnallowedValues = ({ + requestItems, + searchResults, +}: { + requestItems: UnallowedValueRequestItem[]; + searchResults: UnallowedValueSearchResult[] | null; +}): Record => { + if (searchResults == null || !Array.isArray(searchResults)) { + return {}; + } + + return requestItems.reduce((acc, { indexFieldName }) => { + const searchResult = searchResults.find( + (x) => + typeof x.aggregations === 'object' && Array.isArray(x.aggregations[indexFieldName]?.buckets) + ); + + if ( + searchResult != null && + searchResult.aggregations != null && + searchResult.aggregations[indexFieldName] != null + ) { + const buckets = searchResult.aggregations[indexFieldName]?.buckets; + + return { + ...acc, + [indexFieldName]: buckets?.flatMap((x) => (isBucket(x) ? getUnallowedValueCount(x) : [])), + }; + } else { + return { + ...acc, + [indexFieldName]: [], + }; + } + }, {}); +}; + +const UNALLOWED_VALUES_API_ROUTE = '/internal/ecs_data_quality_dashboard/unallowed_field_values'; +export async function fetchUnallowedValues({ + abortController, + httpFetch, + indexName, + requestItems, +}: { + abortController: AbortController; + httpFetch: HttpHandler; + indexName: string; + requestItems: UnallowedValueRequestItem[]; +}): Promise { + try { + return await httpFetch(UNALLOWED_VALUES_API_ROUTE, { + body: JSON.stringify(requestItems), + headers: { 'Content-Type': 'application/json' }, + method: 'POST', + signal: abortController.signal, + version: INTERNAL_API_VERSION, + }); + } catch (e) { + throw new UnallowedValuesError(indexName, e.message); + } +} + +export class UnallowedValuesError extends Error { + constructor(indexName: string, details: string) { + const message = i18n.ERROR_LOADING_UNALLOWED_VALUES({ details, indexName }); + super(message); + + this.name = 'UnallowedValuesError'; + this.message = message; + } +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts new file mode 100644 index 0000000000000..dd92e3700c18a --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts @@ -0,0 +1,88 @@ +/* + * 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 { + IlmExplainLifecycleLifecycleExplainManaged, + IlmExplainLifecycleLifecycleExplainUnmanaged, +} from '@elastic/elasticsearch/lib/api/types'; + +import { getIlmPhase } from './get_ilm_phase'; + +const hot: IlmExplainLifecycleLifecycleExplainManaged = { + index: '.ds-packetbeat-8.6.1-2023.02.04-000001', + managed: true, + policy: 'packetbeat', + index_creation_date_millis: 1675536751379, + time_since_index_creation: '3.98d', + lifecycle_date_millis: 1675536751379, + age: '3.98d', + phase: 'hot', + phase_time_millis: 1675536751809, + action: 'rollover', + action_time_millis: 1675536751809, + step: 'check-rollover-ready', + step_time_millis: 1675536751809, + phase_execution: { + policy: 'packetbeat', + version: 1, + modified_date_in_millis: 1675536751205, + }, +}; + +const warm = { + ...hot, + phase: 'warm', +}; +const cold = { + ...hot, + phase: 'cold', +}; +const frozen = { + ...hot, + phase: 'frozen', +}; +const other = { + ...hot, + phase: 'other', // not a valid phase +}; + +const managed: Record = { + hot, + warm, + cold, + frozen, +}; + +const unmanaged: IlmExplainLifecycleLifecycleExplainUnmanaged = { + index: 'michael', + managed: false, +}; + +describe('getIlmPhase', () => { + const isILMAvailable = true; + test('it returns undefined when the `ilmExplainRecord` is undefined', () => { + expect(getIlmPhase(undefined, isILMAvailable)).toBeUndefined(); + }); + + describe('when the `ilmExplainRecord` is a `IlmExplainLifecycleLifecycleExplainManaged` record', () => { + Object.keys(managed).forEach((phase) => + test(`it returns the expected phase when 'phase' is '${phase}'`, () => { + expect(getIlmPhase(managed[phase], isILMAvailable)).toEqual(phase); + }) + ); + + test(`it returns undefined when the 'phase' is unknown`, () => { + expect(getIlmPhase(other, isILMAvailable)).toBeUndefined(); + }); + }); + + describe('when the `ilmExplainRecord` is a `IlmExplainLifecycleLifecycleExplainUnmanaged` record', () => { + test('it returns `unmanaged`', () => { + expect(getIlmPhase(unmanaged, isILMAvailable)).toEqual('unmanaged'); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts new file mode 100644 index 0000000000000..78e9bfb98f2d6 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; +import { IlmPhase } from '../types'; + +export const getIlmPhase = ( + ilmExplainRecord: IlmExplainLifecycleLifecycleExplain | undefined, + isILMAvailable: boolean +): IlmPhase | undefined => { + if (ilmExplainRecord == null || !isILMAvailable) { + return undefined; + } + + if ('phase' in ilmExplainRecord) { + const phase = ilmExplainRecord.phase; + + switch (phase) { + case 'hot': + return 'hot'; + case 'warm': + return 'warm'; + case 'cold': + return 'cold'; + case 'frozen': + return 'frozen'; + default: + return undefined; + } + } else { + return 'unmanaged'; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.ts new file mode 100644 index 0000000000000..b2ff66941b395 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.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 { getIlmPhaseDescription } from './get_ilm_phase_description'; +import { + COLD_DESCRIPTION, + FROZEN_DESCRIPTION, + HOT_DESCRIPTION, + UNMANAGED_DESCRIPTION, + WARM_DESCRIPTION, +} from '../translations'; + +describe('helpers', () => { + describe('getIlmPhaseDescription', () => { + const phases: Array<{ + phase: string; + expected: string; + }> = [ + { + phase: 'hot', + expected: HOT_DESCRIPTION, + }, + { + phase: 'warm', + expected: WARM_DESCRIPTION, + }, + { + phase: 'cold', + expected: COLD_DESCRIPTION, + }, + { + phase: 'frozen', + expected: FROZEN_DESCRIPTION, + }, + { + phase: 'unmanaged', + expected: UNMANAGED_DESCRIPTION, + }, + { + phase: 'something-else', + expected: ' ', + }, + ]; + + phases.forEach(({ phase, expected }) => { + test(`it returns ${expected} when phase is ${phase}`, () => { + expect(getIlmPhaseDescription(phase)).toBe(expected); + }); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts new file mode 100644 index 0000000000000..27f20cd28e1a4 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as i18n from '../translations'; + +/** + * Returns an i18n description of an an ILM phase + */ +export const getIlmPhaseDescription = (phase: string): string => { + switch (phase) { + case 'hot': + return i18n.HOT_DESCRIPTION; + case 'warm': + return i18n.WARM_DESCRIPTION; + case 'cold': + return i18n.COLD_DESCRIPTION; + case 'frozen': + return i18n.FROZEN_DESCRIPTION; + case 'unmanaged': + return i18n.UNMANAGED_DESCRIPTION; + default: + return ' '; + } +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.ts new file mode 100644 index 0000000000000..44283436f7477 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getIncompatibleStatBadgeColor } from './get_incompatible_stat_badge_color'; + +describe('getIncompatibleStatBadgeColor', () => { + describe('when incompatible is greater than 0', () => { + it('returns danger', () => { + expect(getIncompatibleStatBadgeColor(1)).toBe('danger'); + }); + }); + + describe('when incompatible is 0', () => { + it('returns hollow', () => { + expect(getIncompatibleStatBadgeColor(0)).toBe('hollow'); + }); + }); + + describe('when incompatible is undefined', () => { + it('returns hollow', () => { + expect(getIncompatibleStatBadgeColor(undefined)).toBe('hollow'); + }); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.ts new file mode 100644 index 0000000000000..fcaa660bba934 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const getIncompatibleStatBadgeColor = (incompatible: number | undefined): string => + incompatible != null && incompatible > 0 ? 'danger' : 'hollow'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts new file mode 100644 index 0000000000000..7bfde1d8d7844 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts @@ -0,0 +1,230 @@ +/* + * 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 { defaultSort } from '../constants'; +import { mockIlmExplain } from '../mock/ilm_explain/mock_ilm_explain'; +import { mockStats } from '../mock/stats/mock_stats'; +import { DataQualityCheckResult } from '../types'; +import { getSummaryTableItems } from './get_summary_table_items'; + +describe('getSummaryTableItems', () => { + const indexNames = [ + '.ds-packetbeat-8.6.1-2023.02.04-000001', + '.ds-packetbeat-8.5.3-2023.02.04-000001', + 'auditbeat-custom-index-1', + ]; + const pattern = 'auditbeat-*'; + const patternDocsCount = 4; + const results: Record = { + 'auditbeat-custom-index-1': { + docsCount: 4, + error: null, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + markdownComments: [ + '### auditbeat-custom-index-1\n', + '| Result | Index | Docs | Incompatible fields | ILM Phase |\n|--------|-------|------|---------------------|-----------|\n| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` |\n\n', + '### **Incompatible fields** `3` **Custom fields** `4` **ECS compliant fields** `2` **All fields** `9`\n', + "#### 3 incompatible fields, 0 fields with mappings in the same family\n\nFields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.1.\n\nIncompatible fields with mappings in the same family have exactly the same search behavior but may have different space usage or performance characteristics.\n\nWhen an incompatible field is not in the same family:\n❌ Detection engine rules referencing these fields may not match them correctly\n❌ Pages may not display some events or fields due to unexpected field mappings or values\n❌ Mappings or field values that don't comply with ECS are not supported\n", + '\n#### Incompatible field mappings - auditbeat-custom-index-1\n\n\n| Field | ECS mapping type (expected) | Index mapping type (actual) | \n|-------|-----------------------------|-----------------------------|\n| host.name | `keyword` | `text` |\n| source.ip | `ip` | `text` |\n\n#### Incompatible field values - auditbeat-custom-index-1\n\n\n| Field | ECS values (expected) | Document values (actual) | \n|-------|-----------------------|--------------------------|\n| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `an_invalid_category` (2),\n`theory` (1) |\n\n', + ], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: 1706526408000, + }, + }; + const isILMAvailable = true; + + test('it returns the expected summary table items', () => { + expect( + getSummaryTableItems({ + ilmExplain: mockIlmExplain, + indexNames, + isILMAvailable, + pattern, + patternDocsCount, + results, + sortByColumn: defaultSort.sort.field, + sortByDirection: defaultSort.sort.direction, + stats: mockStats, + }) + ).toEqual([ + { + docsCount: 1630289, + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 733175040, + checkedAt: undefined, + }, + { + docsCount: 1628343, + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 731583142, + checkedAt: undefined, + }, + { + docsCount: 4, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 28413, + checkedAt: 1706526408000, + }, + ]); + }); + + test('it returns the expected summary table items when isILMAvailable is false', () => { + expect( + getSummaryTableItems({ + ilmExplain: mockIlmExplain, + indexNames, + isILMAvailable: false, + pattern, + patternDocsCount, + results, + sortByColumn: defaultSort.sort.field, + sortByDirection: defaultSort.sort.direction, + stats: mockStats, + }) + ).toEqual([ + { + docsCount: 1630289, + ilmPhase: undefined, + incompatible: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 733175040, + checkedAt: undefined, + }, + { + docsCount: 1628343, + ilmPhase: undefined, + incompatible: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 731583142, + checkedAt: undefined, + }, + { + docsCount: 4, + ilmPhase: undefined, + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 28413, + checkedAt: 1706526408000, + }, + ]); + }); + + test('it returns the expected summary table items when `sortByDirection` is ascending', () => { + expect( + getSummaryTableItems({ + ilmExplain: mockIlmExplain, + indexNames, + isILMAvailable, + pattern, + patternDocsCount, + results, + sortByColumn: defaultSort.sort.field, + sortByDirection: 'asc', // <-- ascending + stats: mockStats, + }) + ).toEqual([ + { + docsCount: 4, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 28413, + checkedAt: 1706526408000, + }, + { + docsCount: 1628343, + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 731583142, + checkedAt: undefined, + }, + { + docsCount: 1630289, + ilmPhase: 'hot', + incompatible: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: 733175040, + checkedAt: undefined, + }, + ]); + }); + + test('it returns the expected summary table items when data is unavailable', () => { + expect( + getSummaryTableItems({ + ilmExplain: null, // <-- no data + indexNames, + isILMAvailable, + pattern, + patternDocsCount, + results: undefined, // <-- no data + sortByColumn: defaultSort.sort.field, + sortByDirection: defaultSort.sort.direction, + stats: null, // <-- no data + }) + ).toEqual([ + { + docsCount: 0, + ilmPhase: undefined, + incompatible: undefined, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: undefined, + checkedAt: undefined, + }, + { + docsCount: 0, + ilmPhase: undefined, + incompatible: undefined, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: undefined, + checkedAt: undefined, + }, + { + docsCount: 0, + ilmPhase: undefined, + incompatible: undefined, + indexName: 'auditbeat-custom-index-1', + pattern: 'auditbeat-*', + patternDocsCount: 4, + sizeInBytes: undefined, + checkedAt: undefined, + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.ts new file mode 100644 index 0000000000000..7e518a739b251 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.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 { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; +import { orderBy } from 'lodash/fp'; + +import { DataQualityCheckResult, IndexSummaryTableItem, MeteringStatsIndex } from '../types'; +import { getIlmPhase } from './get_ilm_phase'; +import { getDocsCount, getIndexIncompatible, getSizeInBytes } from './stats'; + +export const getSummaryTableItems = ({ + ilmExplain, + indexNames, + isILMAvailable, + pattern, + patternDocsCount, + results, + sortByColumn, + sortByDirection, + stats, +}: { + ilmExplain: Record | null; + indexNames: string[]; + isILMAvailable: boolean; + pattern: string; + patternDocsCount: number; + results: Record | undefined; + sortByColumn: string; + sortByDirection: 'desc' | 'asc'; + stats: Record | null; +}): IndexSummaryTableItem[] => { + const summaryTableItems = indexNames.map((indexName) => ({ + docsCount: getDocsCount({ stats, indexName }), + incompatible: getIndexIncompatible({ indexName, results }), + indexName, + ilmPhase: + isILMAvailable && ilmExplain != null + ? getIlmPhase(ilmExplain[indexName], isILMAvailable) + : undefined, + pattern, + patternDocsCount, + sizeInBytes: getSizeInBytes({ stats, indexName }), + checkedAt: results?.[indexName]?.checkedAt, + })); + + return orderBy([sortByColumn], [sortByDirection], summaryTableItems); +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx new file mode 100644 index 0000000000000..8ce15c11b7000 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx @@ -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 { EcsFlatTyped } from '../constants'; +import type { EcsFieldMetadata, UnallowedValueRequestItem } from '../types'; + +export const hasAllowedValues = ({ + ecsMetadata, + fieldName, +}: { + ecsMetadata: EcsFlatTyped; + fieldName: string; +}): boolean => (ecsMetadata[fieldName]?.allowed_values?.length ?? 0) > 0; + +export const getValidValues = (field?: EcsFieldMetadata): string[] => + field?.allowed_values?.flatMap(({ name }) => name) ?? []; + +export const getUnallowedValueRequestItems = ({ + ecsMetadata, + indexName, +}: { + ecsMetadata: EcsFlatTyped; + indexName: string; +}): UnallowedValueRequestItem[] => + Object.keys(ecsMetadata).reduce( + (acc, fieldName) => + hasAllowedValues({ ecsMetadata, fieldName }) + ? [ + ...acc, + { + indexName, + indexFieldName: fieldName, + allowedValues: getValidValues(ecsMetadata[fieldName]), + }, + ] + : acc, + [] + ); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx new file mode 100644 index 0000000000000..c2a35bc989625 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx @@ -0,0 +1,154 @@ +/* + * 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 { EcsFlatTyped } from '../constants'; +import { + getUnallowedValueRequestItems, + getValidValues, + hasAllowedValues, +} from './get_unallowed_value_request_items'; + +describe('hasAllowedValues', () => { + test('it returns true for a field that has `allowed_values`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'event.category', + }) + ).toBe(true); + }); + + test('it returns false for a field that does NOT have `allowed_values`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'host.name', + }) + ).toBe(false); + }); + + test('it returns false for a field that does NOT exist in `ecsMetadata`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'does.NOT.exist', + }) + ).toBe(false); + }); +}); + +describe('getValidValues', () => { + test('it returns the expected valid values', () => { + expect(getValidValues(EcsFlatTyped['event.category'])).toEqual( + expect.arrayContaining([ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ]) + ); + }); + + test('it returns an empty array when the `field` does NOT have `allowed_values`', () => { + expect(getValidValues(EcsFlatTyped['host.name'])).toEqual([]); + }); + + test('it returns an empty array when `field` is undefined', () => { + expect(getValidValues(undefined)).toEqual([]); + }); +}); + +describe('getUnallowedValueRequestItems', () => { + test('it returns the expected request items', () => { + expect( + getUnallowedValueRequestItems({ + ecsMetadata: EcsFlatTyped, + indexName: 'auditbeat-*', + }) + ).toEqual([ + { + indexName: 'auditbeat-*', + indexFieldName: 'event.category', + allowedValues: expect.arrayContaining([ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ]), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.kind', + allowedValues: expect.arrayContaining([ + 'alert', + 'enrichment', + 'event', + 'metric', + 'state', + 'pipeline_error', + 'signal', + ]), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.outcome', + allowedValues: expect.arrayContaining(['failure', 'success', 'unknown']), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.type', + allowedValues: expect.arrayContaining([ + 'access', + 'admin', + 'allowed', + 'change', + 'connection', + 'creation', + 'deletion', + 'denied', + 'end', + 'error', + 'group', + 'indicator', + 'info', + 'installation', + 'protocol', + 'start', + 'user', + ]), + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts new file mode 100644 index 0000000000000..a8bbbc0cd5c60 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts @@ -0,0 +1,208 @@ +/* + * 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 numeral from '@elastic/numeral'; + +import { EMPTY_STAT } from '../constants'; +import { + getCodeFormattedValue, + getHeaderSeparator, + getMarkdownTableHeader, + getResultEmoji, + getStatsRollupMarkdownComment, + getSummaryTableMarkdownHeader, + getSummaryTableMarkdownRow, +} from './markdown'; + +const defaultBytesFormat = '0,0.[0]b'; +const formatBytes = (value: number | undefined) => + value != null ? numeral(value).format(defaultBytesFormat) : EMPTY_STAT; + +const defaultNumberFormat = '0,0.[000]'; +const formatNumber = (value: number | undefined) => + value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; + +describe('getHeaderSeparator', () => { + test('it returns a sequence of dashes equal to the length of the header, plus two additional dashes to pad each end of the cntent', () => { + const content = '0123456789'; // content.length === 10 + const expected = '------------'; // expected.length === 12 + + expect(getHeaderSeparator(content)).toEqual(expected); + }); +}); + +describe('getCodeFormattedValue', () => { + test('it returns the expected placeholder when `value` is undefined', () => { + expect(getCodeFormattedValue(undefined)).toEqual('`--`'); + }); + + test('it returns the content formatted as markdown code', () => { + const value = 'foozle'; + + expect(getCodeFormattedValue(value)).toEqual('`foozle`'); + }); + + test('it escapes content such that `value` may be included in a markdown table cell', () => { + const value = + '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n'; + + expect(getCodeFormattedValue(value)).toEqual( + '`\\| there were newlines and column separators in the beginning, middle, \\|and end\\| `' + ); + }); +}); + +describe('getStatsRollupMarkdownComment', () => { + test('it returns the expected comment', () => { + expect( + getStatsRollupMarkdownComment({ + docsCount: 57410, + formatBytes, + formatNumber, + incompatible: 3, + indices: 25, + indicesChecked: 1, + sizeInBytes: 28413, + }) + ).toEqual( + '| Incompatible fields | Indices checked | Indices | Size | Docs |\n|---------------------|-----------------|---------|------|------|\n| 3 | 1 | 25 | 27.7KB | 57,410 |\n' + ); + }); + + test('it returns the expected comment when optional values are undefined', () => { + expect( + getStatsRollupMarkdownComment({ + docsCount: 0, + formatBytes, + formatNumber, + incompatible: undefined, + indices: undefined, + indicesChecked: undefined, + sizeInBytes: undefined, + }) + ).toEqual( + '| Incompatible fields | Indices checked | Indices | Docs |\n|---------------------|-----------------|---------|------|\n| -- | -- | -- | 0 |\n' + ); + }); +}); + +describe('getSummaryTableMarkdownHeader', () => { + test('it returns the expected header', () => { + const isILMAvailable = true; + expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( + '| Result | Index | Docs | Incompatible fields | ILM Phase | Size |\n|--------|-------|------|---------------------|-----------|------|' + ); + }); + + test('it returns the expected header when isILMAvailable is false', () => { + const isILMAvailable = false; + expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|' + ); + }); + + test('it returns the expected header when displayDocSize is false', () => { + const isILMAvailable = false; + expect(getSummaryTableMarkdownHeader(isILMAvailable)).toEqual( + '| Result | Index | Docs | Incompatible fields |\n|--------|-------|------|---------------------|' + ); + }); +}); + +describe('getSummaryTableMarkdownRow', () => { + test('it returns the expected row when all values are provided', () => { + expect( + getSummaryTableMarkdownRow({ + docsCount: 4, + formatBytes, + formatNumber, + incompatible: 3, + ilmPhase: 'unmanaged', + isILMAvailable: true, + indexName: 'auditbeat-custom-index-1', + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual('| ❌ | auditbeat-custom-index-1 | 4 (0.0%) | 3 | `unmanaged` | 27.7KB |\n'); + }); + + test('it returns the expected row when optional values are NOT provided', () => { + expect( + getSummaryTableMarkdownRow({ + docsCount: 4, + formatBytes, + formatNumber, + incompatible: undefined, // <-- + ilmPhase: undefined, // <-- + indexName: 'auditbeat-custom-index-1', + isILMAvailable: true, + patternDocsCount: 57410, + sizeInBytes: 28413, + }) + ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- | -- | 27.7KB |\n'); + }); + + test('it returns the expected row when isILMAvailable is false', () => { + expect( + getSummaryTableMarkdownRow({ + docsCount: 4, + formatBytes, + formatNumber, + incompatible: undefined, // <-- + ilmPhase: undefined, // <-- + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- |\n'); + }); + + test('it returns the expected row when sizeInBytes is undefined', () => { + expect( + getSummaryTableMarkdownRow({ + docsCount: 4, + formatBytes, + formatNumber, + incompatible: undefined, // <-- + ilmPhase: undefined, // <-- + indexName: 'auditbeat-custom-index-1', + isILMAvailable: false, + patternDocsCount: 57410, + sizeInBytes: undefined, + }) + ).toEqual('| -- | auditbeat-custom-index-1 | 4 (0.0%) | -- |\n'); + }); +}); + +describe('getResultEmoji', () => { + test('it returns the expected placeholder when `incompatible` is undefined', () => { + expect(getResultEmoji(undefined)).toEqual('--'); + }); + + test('it returns a ✅ when the incompatible count is zero', () => { + expect(getResultEmoji(0)).toEqual('✅'); + }); + + test('it returns a ❌ when the incompatible count is NOT zero', () => { + expect(getResultEmoji(1)).toEqual('❌'); + }); +}); + +describe('getMarkdownTableHeader', () => { + const headerNames = [ + '|\nthere were newlines and column separators in the beginning, middle,\n|and end|\n', + 'A second column', + 'A third column', + ]; + + test('it returns the expected table header', () => { + expect(getMarkdownTableHeader(headerNames)).toEqual( + '\n| \\| there were newlines and column separators in the beginning, middle, \\|and end\\| | A second column | A third column | \n|----------------------------------------------------------------------------------|-----------------|----------------|' + ); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts new file mode 100644 index 0000000000000..e8118df379c82 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts @@ -0,0 +1,128 @@ +/* + * 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 { EMPTY_PLACEHOLDER, EMPTY_STAT } from '../constants'; +import { + DOCS, + ILM_PHASE, + ILM_PHASE_CAPITALIZED, + INCOMPATIBLE_FIELDS, + INDEX, + INDICES, + INDICES_CHECKED, + RESULT, + SIZE, +} from '../translations'; +import { IlmPhase } from '../types'; +import { getDocsCountPercent } from './stats'; + +export const escapeNewlines = (content: string | undefined): string | undefined => + content != null ? content.replaceAll('\n', ' ').replaceAll('|', '\\|') : content; + +export const getCodeFormattedValue = (value: string | undefined) => + `\`${escapeNewlines(value ?? EMPTY_PLACEHOLDER)}\``; + +export const getHeaderSeparator = (headerText: string): string => '-'.repeat(headerText.length + 2); // 2 extra, for the spaces on both sides of the column name + +export const getStatsRollupMarkdownComment = ({ + docsCount, + formatBytes, + formatNumber, + incompatible, + indices, + indicesChecked, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + incompatible: number | undefined; + indices: number | undefined; + indicesChecked: number | undefined; + sizeInBytes: number | undefined; +}): string => + Number.isInteger(sizeInBytes) + ? `| ${INCOMPATIBLE_FIELDS} | ${INDICES_CHECKED} | ${INDICES} | ${SIZE} | ${DOCS} | +|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( + INDICES_CHECKED + )}|${getHeaderSeparator(INDICES)}|${getHeaderSeparator(SIZE)}|${getHeaderSeparator(DOCS)}| +| ${incompatible ?? EMPTY_STAT} | ${indicesChecked ?? EMPTY_STAT} | ${ + indices ?? EMPTY_STAT + } | ${formatBytes(sizeInBytes)} | ${formatNumber(docsCount)} | +` + : `| ${INCOMPATIBLE_FIELDS} | ${INDICES_CHECKED} | ${INDICES} | ${DOCS} | +|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( + INDICES_CHECKED + )}|${getHeaderSeparator(INDICES)}|${getHeaderSeparator(DOCS)}| +| ${incompatible ?? EMPTY_STAT} | ${indicesChecked ?? EMPTY_STAT} | ${ + indices ?? EMPTY_STAT + } | ${formatNumber(docsCount)} | +`; + +export const getSummaryTableMarkdownHeader = (includeDocSize: boolean): string => + includeDocSize + ? `| ${RESULT} | ${INDEX} | ${DOCS} | ${INCOMPATIBLE_FIELDS} | ${ILM_PHASE_CAPITALIZED} | ${SIZE} | +|${getHeaderSeparator(RESULT)}|${getHeaderSeparator(INDEX)}|${getHeaderSeparator( + DOCS + )}|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|${getHeaderSeparator( + ILM_PHASE + )}|${getHeaderSeparator(SIZE)}|` + : `| ${RESULT} | ${INDEX} | ${DOCS} | ${INCOMPATIBLE_FIELDS} | +|${getHeaderSeparator(RESULT)}|${getHeaderSeparator(INDEX)}|${getHeaderSeparator( + DOCS + )}|${getHeaderSeparator(INCOMPATIBLE_FIELDS)}|`; + +export const getResultEmoji = (incompatible: number | undefined): string => { + if (incompatible == null) { + return EMPTY_PLACEHOLDER; + } else { + return incompatible === 0 ? '✅' : '❌'; + } +}; + +export const getSummaryTableMarkdownRow = ({ + docsCount, + formatBytes, + formatNumber, + ilmPhase, + incompatible, + indexName, + isILMAvailable, + patternDocsCount, + sizeInBytes, +}: { + docsCount: number; + formatBytes: (value: number | undefined) => string; + formatNumber: (value: number | undefined) => string; + ilmPhase: IlmPhase | undefined; + incompatible: number | undefined; + indexName: string; + isILMAvailable: boolean; + patternDocsCount: number; + sizeInBytes: number | undefined; +}): string => + isILMAvailable && Number.isInteger(sizeInBytes) + ? `| ${getResultEmoji(incompatible)} | ${escapeNewlines(indexName)} | ${formatNumber( + docsCount + )} (${getDocsCountPercent({ + docsCount, + patternDocsCount, + })}) | ${incompatible ?? EMPTY_PLACEHOLDER} | ${ + ilmPhase != null ? getCodeFormattedValue(ilmPhase) : EMPTY_PLACEHOLDER + } | ${formatBytes(sizeInBytes)} | +` + : `| ${getResultEmoji(incompatible)} | ${escapeNewlines(indexName)} | ${formatNumber( + docsCount + )} (${getDocsCountPercent({ + docsCount, + patternDocsCount, + })}) | ${incompatible ?? EMPTY_PLACEHOLDER} | +`; + +export const getMarkdownTableHeader = (headerNames: string[]) => ` +| ${headerNames.map((name) => `${escapeNewlines(name)} | `).join('')} +|${headerNames.map((name) => `${getHeaderSeparator(name)}|`).join('')}`; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts new file mode 100644 index 0000000000000..b85f4a7516dbb --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts @@ -0,0 +1,637 @@ +/* + * 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 { omit } from 'lodash/fp'; + +import { EnrichedFieldMetadata, PartitionedFieldMetadata, UnallowedValueCount } from '../types'; +import { mockMappingsProperties } from '../mock/mappings_properties/mock_mappings_properties'; +import { + FieldType, + getEnrichedFieldMetadata, + getFieldTypes, + getMappingsProperties, + getMissingTimestampFieldMetadata, + getPartitionedFieldMetadata, + getSortedPartitionedFieldMetadata, + isMappingCompatible, +} from './metadata'; +import { EcsFlatTyped } from '../constants'; +import { + hostNameWithTextMapping, + hostNameKeyword, + someField, + someFieldKeyword, + sourceIpWithTextMapping, + sourceIpKeyword, + sourcePort, + timestamp, + eventCategoryWithUnallowedValues, +} from '../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockIndicesGetMappingIndexMappingRecords } from '../mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record'; + +describe('getFieldTypes', () => { + const expected = [ + { + field: '@timestamp', + type: 'date', + }, + { + field: 'event.category', + type: 'keyword', + }, + { + field: 'host.name', + type: 'text', + }, + { + field: 'host.name.keyword', + type: 'keyword', + }, + { + field: 'some.field', + type: 'text', + }, + { + field: 'some.field.keyword', + type: 'keyword', + }, + { + field: 'source.ip', + type: 'text', + }, + { + field: 'source.ip.keyword', + type: 'keyword', + }, + { + field: 'source.port', + type: 'long', + }, + ]; + + test('it flattens the field names and types in the mapping properties', () => { + expect(getFieldTypes(mockMappingsProperties)).toEqual(expected); + }); + + test('it throws a type error when mappingsProperties is not flatten-able', () => { + // @ts-expect-error + const invalidType: Record = []; // <-- this is an array, NOT a valid Record + + expect(() => getFieldTypes(invalidType)).toThrowError('Root value is not flatten-able'); + }); +}); + +describe('isMappingCompatible', () => { + test('it returns true for an exact match', () => { + expect(isMappingCompatible({ ecsExpectedType: 'keyword', type: 'keyword' })).toBe(true); + }); + + test("it returns false when both types don't exactly match", () => { + expect(isMappingCompatible({ ecsExpectedType: 'wildcard', type: 'keyword' })).toBe(false); + }); +}); + +describe('getEnrichedFieldMetadata', () => { + /** + * The ECS schema + * https://raw.githubusercontent.com/elastic/ecs/main/generated/ecs/ecs_flat.yml + * defines a handful of fields that have `allowed_values`. For these + * fields, the documents in an index should only have specific values. + * + * This instance of the type `Record` + * represents an index that doesn't have any unallowed values, for the + * specified keys in the map, i.e. `event.category`, `event.kind`, etc. + * + * This will be used to test the happy path. Variants of this + * value will be used to test unhappy paths. + */ + const noUnallowedValues: Record = { + 'event.category': [], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }; + + /** + * Represents an index that has unallowed values, for the + * `event.category` field. The other fields in the collection, + * i.e. `event.kind`, don't have any unallowed values. + * + * This instance will be used to test paths where a field is + * NOT ECS complaint, because the index has unallowed values. + */ + const unallowedValues: Record = { + 'event.category': [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }; + + /** + * This instance of a `FieldType` has the correct mapping for the + * `event.category` field. + * + * This instance will be used to test paths where the index has + * a valid mapping for the `event.category` field. + */ + const fieldMetadataCorrectMappingType: FieldType = { + field: 'event.category', + type: 'keyword', // <-- this index has the correct mapping type + }; + + /** + * This `EnrichedFieldMetadata` for the `event.category` field, + * represents a happy path result, where the index being checked: + * + * 1) The `type` of the field in the index, `keyword`, matches the expected + * `type` of the `event.category` field, as defined by the `EcsMetadata` + * 2) The index doesn't have any unallowed values for the `event.category` field + * + * Since this is a happy path result, it has the following values: + * `indexInvalidValues` is an empty array, because the index does not contain any invalid values + * `isEcsCompliant` is true, because the index has the expected mapping type, and no unallowed values + */ + const happyPathResultSample: EnrichedFieldMetadata = { + dashed_name: 'event-category', + description: + 'This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy.\n`event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory.\nThis field is an array. This will allow proper categorization of some events that fall in multiple categories.', + example: 'authentication', + flat_name: 'event.category', + ignore_above: 1024, + level: 'core', + name: 'category', + normalize: ['array'], + short: 'Event category. The second categorization field in the hierarchy.', + type: 'keyword', + indexFieldName: 'event.category', + indexFieldType: 'keyword', // a valid mapping, because the `type` property from the `ecsMetadata` is also `keyword` + indexInvalidValues: [], // empty array, because the index does not contain any invalid values + hasEcsMetadata: true, + isEcsCompliant: true, // because the index has the expected mapping type, and no unallowed values + isInSameFamily: false, + }; + + /** + * Creates expected result matcher based on the happy path result sample. Please, add similar `expect` based assertions to it if anything breaks + * with an ECS upgrade, instead of hardcoding the values. + */ + const expectedResult = (extraFields: Record = {}) => + expect.objectContaining({ + ...happyPathResultSample, + ...extraFields, + allowed_values: expect.arrayContaining([ + expect.objectContaining({ + description: expect.any(String), + name: expect.any(String), + expected_event_types: expect.any(Array), + }), + ]), + }); + + test('it returns the happy path result when the index has no mapping conflicts, and no unallowed values', () => { + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index + unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index + }) + ).toEqual(expectedResult()); + }); + + test('it returns the happy path result when the index has no mapping conflicts, and the unallowedValues map does not contain an entry for the field', () => { + // create an `unallowedValues` that doesn't have an entry for `event.category`: + const noEntryForEventCategory: Record = omit( + 'event.category', + unallowedValues + ); + + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index + unallowedValues: noEntryForEventCategory, // a lookup in this map for the `event.category` field will return undefined + }) + ).toEqual(expectedResult()); + }); + + test('it returns a result with the expected `indexInvalidValues` and `isEcsCompliant` when the index has no mapping conflict, but it has unallowed values', () => { + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: fieldMetadataCorrectMappingType, // no mapping conflicts for `event.category` in this index + unallowedValues, // this index has unallowed values for the event.category field + }) + ).toEqual( + expectedResult({ + indexInvalidValues: [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ], + isEcsCompliant: false, // because there are unallowed values + }) + ); + }); + + test('it returns a result with the expected `isEcsCompliant` and `isInSameFamily` when the index type does not match ECS, but NO unallowed values', () => { + const indexFieldType = 'text'; + + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: { + field: 'event.category', // `event.category` is a `keyword`, per the ECS spec + type: indexFieldType, // this index has a mapping of `text` instead + }, + unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index + }) + ).toEqual( + expectedResult({ + indexFieldType, + isEcsCompliant: false, // `keyword` !== `text` + isInSameFamily: false, // `keyword` and `text` are not in the same family + }) + ); + }); + + test('it returns a result with the expected `isEcsCompliant` and `isInSameFamily` when the mapping is is in the same family', () => { + const indexFieldType = 'wildcard'; + + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: { + field: 'event.category', // `event.category` is a `keyword` per the ECS spec + type: indexFieldType, // this index has a mapping of `wildcard` instead + }, + unallowedValues: noUnallowedValues, // no unallowed values for `event.category` in this index + }) + ).toEqual( + expectedResult({ + indexFieldType, + isEcsCompliant: false, // `wildcard` !== `keyword` + isInSameFamily: true, // `wildcard` and `keyword` are in the same family + }) + ); + }); + + test('it returns a result with the expected `indexInvalidValues`,`isEcsCompliant`, and `isInSameFamily` when the index has BOTH mapping conflicts, and unallowed values', () => { + const indexFieldType = 'text'; + + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: { + field: 'event.category', // `event.category` is a `keyword` per the ECS spec + type: indexFieldType, // this index has a mapping of `text` instead + }, + unallowedValues, // this index also has unallowed values for the event.category field + }) + ).toEqual( + expectedResult({ + indexFieldType, + indexInvalidValues: [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ], + isEcsCompliant: false, // because there are BOTH mapping conflicts and unallowed values + isInSameFamily: false, // `text` and `keyword` are not in the same family + }) + ); + }); + + test('it returns the expected result for a custom field, i.e. a field that does NOT have an entry in `ecsMetadata`', () => { + const field = 'a_custom_field'; // not defined by ECS + const indexFieldType = 'keyword'; + + expect( + getEnrichedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + fieldMetadata: { + field, + type: indexFieldType, // no mapping conflict, because ECS doesn't define this field + }, + unallowedValues: noUnallowedValues, // no unallowed values for `a_custom_field` in this index + }) + ).toEqual({ + indexFieldName: field, + indexFieldType, + indexInvalidValues: [], + hasEcsMetadata: false, + isEcsCompliant: false, + isInSameFamily: false, // custom fields are never in the same family + }); + }); +}); + +describe('getMissingTimestampFieldMetadata', () => { + test('it returns the expected `EnrichedFieldMetadata`', () => { + expect(getMissingTimestampFieldMetadata()).toEqual({ + ...EcsFlatTyped['@timestamp'], + hasEcsMetadata: true, + indexFieldName: '@timestamp', + indexFieldType: '-', // the index did NOT define a mapping for @timestamp + indexInvalidValues: [], + isEcsCompliant: false, // an index must define the @timestamp mapping + isInSameFamily: false, // `date` is not a member of any families + }); + }); +}); + +describe('getPartitionedFieldMetadata', () => { + test('it places all the `EnrichedFieldMetadata` in the expected categories', () => { + const enrichedFieldMetadata: EnrichedFieldMetadata[] = [ + timestamp, + eventCategoryWithUnallowedValues, + hostNameWithTextMapping, + hostNameKeyword, + someField, + someFieldKeyword, + sourceIpWithTextMapping, + sourceIpKeyword, + sourcePort, + ]; + const expected: PartitionedFieldMetadata = { + all: [ + timestamp, + eventCategoryWithUnallowedValues, + hostNameWithTextMapping, + hostNameKeyword, + someField, + someFieldKeyword, + sourceIpWithTextMapping, + sourceIpKeyword, + sourcePort, + ], + ecsCompliant: [timestamp, sourcePort], + custom: [hostNameKeyword, someField, someFieldKeyword, sourceIpKeyword], + incompatible: [ + eventCategoryWithUnallowedValues, + hostNameWithTextMapping, + sourceIpWithTextMapping, + ], + sameFamily: [], + }; + + expect(getPartitionedFieldMetadata(enrichedFieldMetadata)).toEqual(expected); + }); +}); + +describe('getSortedPartitionedFieldMetadata', () => { + test('it returns null when mappings are loading', () => { + expect( + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: true, // <-- + mappingsProperties: mockMappingsProperties, + unallowedValues: {}, + }) + ).toBeNull(); + }); + + test('it returns null when `unallowedValues` is null', () => { + expect( + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties: mockMappingsProperties, + unallowedValues: null, // <-- + }) + ).toBeNull(); + }); + + describe('when `mappingsProperties` is unknown', () => { + const incompatibleFieldMetadata = { + ...EcsFlatTyped['@timestamp'], + hasEcsMetadata: true, + indexFieldName: '@timestamp', + indexFieldType: '-', + indexInvalidValues: [], + isEcsCompliant: false, + isInSameFamily: false, + }; + const expected = { + all: [incompatibleFieldMetadata], + custom: [], + ecsCompliant: [], + incompatible: [incompatibleFieldMetadata], + sameFamily: [], + }; + + test('it returns a `PartitionedFieldMetadata` with an `incompatible` `@timestamp` when `mappingsProperties` is undefined', () => { + expect( + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties: undefined, // <-- + unallowedValues: {}, + }) + ).toEqual(expected); + }); + + test('it returns a `PartitionedFieldMetadata` with an `incompatible` `@timestamp` when `mappingsProperties` is null', () => { + expect( + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties: null, // <-- + unallowedValues: {}, + }) + ).toEqual(expected); + }); + }); + + test('it returns the expected sorted field metadata', () => { + const unallowedValues = { + 'event.category': [ + { + count: 2, + fieldName: 'an_invalid_category', + }, + { + count: 1, + fieldName: 'theory', + }, + ], + 'event.kind': [], + 'event.outcome': [], + 'event.type': [], + }; + + expect( + getSortedPartitionedFieldMetadata({ + ecsMetadata: EcsFlatTyped, + loadingMappings: false, + mappingsProperties: mockMappingsProperties, + unallowedValues, + }) + ).toMatchObject({ + all: expect.arrayContaining([ + expect.objectContaining({ + name: expect.any(String), + flat_name: expect.any(String), + dashed_name: expect.any(String), + description: expect.any(String), + hasEcsMetadata: true, + isEcsCompliant: expect.any(Boolean), + isInSameFamily: expect.any(Boolean), + }), + ]), + ecsCompliant: expect.arrayContaining([ + expect.objectContaining({ + name: expect.any(String), + flat_name: expect.any(String), + dashed_name: expect.any(String), + description: expect.any(String), + hasEcsMetadata: true, + isEcsCompliant: true, + isInSameFamily: false, + }), + ]), + custom: expect.arrayContaining([ + expect.objectContaining({ + indexFieldName: expect.any(String), + indexFieldType: expect.any(String), + indexInvalidValues: expect.any(Array), + hasEcsMetadata: expect.any(Boolean), + isEcsCompliant: expect.any(Boolean), + isInSameFamily: expect.any(Boolean), + }), + ]), + incompatible: expect.arrayContaining([ + expect.objectContaining({ + name: expect.any(String), + flat_name: expect.any(String), + dashed_name: expect.any(String), + description: expect.any(String), + hasEcsMetadata: expect.any(Boolean), + isEcsCompliant: false, + isInSameFamily: false, + }), + ]), + sameFamily: [], + }); + }); +}); + +describe('getMappingsProperties', () => { + test('it returns the expected mapping properties', () => { + expect( + getMappingsProperties({ + indexes: mockIndicesGetMappingIndexMappingRecords, + indexName: 'auditbeat-custom-index-1', + }) + ).toEqual({ + '@timestamp': { + type: 'date', + }, + event: { + properties: { + category: { + ignore_above: 1024, + type: 'keyword', + }, + }, + }, + host: { + properties: { + name: { + fields: { + keyword: { + ignore_above: 256, + type: 'keyword', + }, + }, + type: 'text', + }, + }, + }, + some: { + properties: { + field: { + fields: { + keyword: { + ignore_above: 256, + type: 'keyword', + }, + }, + type: 'text', + }, + }, + }, + source: { + properties: { + ip: { + fields: { + keyword: { + ignore_above: 256, + type: 'keyword', + }, + }, + type: 'text', + }, + port: { + type: 'long', + }, + }, + }, + }); + }); + + test('it returns null when `indexes` is null', () => { + expect( + getMappingsProperties({ + indexes: null, // <-- + indexName: 'auditbeat-custom-index-1', + }) + ).toBeNull(); + }); + + test('it returns null when `indexName` does not exist in `indexes`', () => { + expect( + getMappingsProperties({ + indexes: mockIndicesGetMappingIndexMappingRecords, + indexName: 'does-not-exist', // <-- + }) + ).toBeNull(); + }); + + test('it returns null when `properties` does not exist in the mappings', () => { + const missingProperties = { + ...mockIndicesGetMappingIndexMappingRecords, + foozle: { + mappings: {}, // <-- does not have a `properties` + }, + }; + + expect( + getMappingsProperties({ + indexes: missingProperties, + indexName: 'foozle', + }) + ).toBeNull(); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts new file mode 100644 index 0000000000000..c2fb750e4f0a8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts @@ -0,0 +1,228 @@ +/* + * 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 { + IndicesGetMappingIndexMappingRecord, + MappingProperty, +} from '@elastic/elasticsearch/lib/api/types'; +import { has, sortBy } from 'lodash/fp'; + +import { EMPTY_METADATA, EcsFlatTyped } from '../constants'; +import { + EcsBasedFieldMetadata, + EnrichedFieldMetadata, + PartitionedFieldMetadata, + UnallowedValueCount, +} from '../types'; +import { getIsInSameFamily } from '../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/utils/get_is_in_same_family'; + +export const getPartitionedFieldMetadata = ( + enrichedFieldMetadata: EnrichedFieldMetadata[] +): PartitionedFieldMetadata => + enrichedFieldMetadata.reduce( + (acc, x) => ({ + all: [...acc.all, x], + ecsCompliant: x.isEcsCompliant ? [...acc.ecsCompliant, x] : acc.ecsCompliant, + custom: !x.hasEcsMetadata ? [...acc.custom, x] : acc.custom, + incompatible: + x.hasEcsMetadata && !x.isEcsCompliant && !x.isInSameFamily + ? [...acc.incompatible, x] + : acc.incompatible, + sameFamily: x.isInSameFamily ? [...acc.sameFamily, x] : acc.sameFamily, + }), + { + all: [], + ecsCompliant: [], + custom: [], + incompatible: [], + sameFamily: [], + } + ); + +export interface FieldType { + field: string; + type: string; +} + +function shouldReadKeys(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} + +const getNextPathWithoutProperties = ({ + key, + pathWithoutProperties, + value, +}: { + key: string; + pathWithoutProperties: string; + value: unknown; +}): string => { + if (!pathWithoutProperties) { + return key; + } + + if (shouldReadKeys(value) && (key === 'properties' || key === 'fields')) { + return `${pathWithoutProperties}`; + } else { + return `${pathWithoutProperties}.${key}`; + } +}; + +export function getFieldTypes(mappingsProperties: Record): FieldType[] { + if (!shouldReadKeys(mappingsProperties)) { + throw new TypeError(`Root value is not flatten-able, received ${mappingsProperties}`); + } + + const result: FieldType[] = []; + (function flatten(prefix, object, pathWithoutProperties) { + for (const [key, value] of Object.entries(object)) { + const path = prefix ? `${prefix}.${key}` : key; + + const nextPathWithoutProperties = getNextPathWithoutProperties({ + key, + pathWithoutProperties, + value, + }); + + if (shouldReadKeys(value)) { + flatten(path, value, nextPathWithoutProperties); + } else { + if (nextPathWithoutProperties.endsWith('.type')) { + const pathWithoutType = nextPathWithoutProperties.slice( + 0, + nextPathWithoutProperties.lastIndexOf('.type') + ); + + result.push({ + field: pathWithoutType, + type: `${value}`, + }); + } + } + } + })('', mappingsProperties, ''); + + return result; +} + +export const isMappingCompatible = ({ + ecsExpectedType, + type, +}: { + ecsExpectedType: string | undefined; + type: string; +}): boolean => type === ecsExpectedType; + +export const getEnrichedFieldMetadata = ({ + ecsMetadata, + fieldMetadata, + unallowedValues, +}: { + ecsMetadata: EcsFlatTyped; + fieldMetadata: FieldType; + unallowedValues: Record; +}): EnrichedFieldMetadata => { + const { field, type } = fieldMetadata; + const indexInvalidValues = unallowedValues[field] ?? []; + + if (has(fieldMetadata.field, ecsMetadata)) { + const ecsExpectedType = ecsMetadata[field].type; + const isEcsCompliant = + isMappingCompatible({ ecsExpectedType, type }) && indexInvalidValues.length === 0; + + const isInSameFamily = + !isMappingCompatible({ ecsExpectedType, type }) && + indexInvalidValues.length === 0 && + getIsInSameFamily({ ecsExpectedType, type }); + + return { + ...ecsMetadata[field], + indexFieldName: field, + indexFieldType: type, + indexInvalidValues, + hasEcsMetadata: true, + isEcsCompliant, + isInSameFamily, + }; + } else { + return { + indexFieldName: field, + indexFieldType: type, + indexInvalidValues: [], + hasEcsMetadata: false, + isEcsCompliant: false, + isInSameFamily: false, // custom fields are never in the same family + }; + } +}; + +export const getSortedPartitionedFieldMetadata = ({ + ecsMetadata, + loadingMappings, + mappingsProperties, + unallowedValues, +}: { + ecsMetadata: EcsFlatTyped; + loadingMappings: boolean; + mappingsProperties: Record | null | undefined; + unallowedValues: Record | null; +}): PartitionedFieldMetadata | null => { + if (loadingMappings || unallowedValues == null) { + return null; + } + + // this covers scenario when we try to check an empty index + // or index without required @timestamp field in the mapping + // + // we create an artifical incompatible timestamp field metadata + // so that we can signal to user that the incompatibility is due to missing timestamp + if (mappingsProperties == null) { + const missingTimestampFieldMetadata = getMissingTimestampFieldMetadata(); + return { + ...EMPTY_METADATA, + all: [missingTimestampFieldMetadata], + incompatible: [missingTimestampFieldMetadata], + }; + } + + const fieldTypes = getFieldTypes(mappingsProperties); + + const enrichedFieldMetadata = sortBy( + 'indexFieldName', + fieldTypes.map((fieldMetadata) => + getEnrichedFieldMetadata({ ecsMetadata, fieldMetadata, unallowedValues }) + ) + ); + + const partitionedFieldMetadata = getPartitionedFieldMetadata(enrichedFieldMetadata); + + return partitionedFieldMetadata; +}; + +export const getMissingTimestampFieldMetadata = (): EcsBasedFieldMetadata => ({ + ...EcsFlatTyped['@timestamp'], + hasEcsMetadata: true, + indexFieldName: '@timestamp', + indexFieldType: '-', + indexInvalidValues: [], + isEcsCompliant: false, + isInSameFamily: false, // `date` is not a member of any families +}); + +export const getMappingsProperties = ({ + indexes, + indexName, +}: { + indexes: Record | null; + indexName: string; +}): Record | null => { + if (indexes != null && indexes[indexName] != null) { + return indexes[indexName].mappings.properties ?? null; + } + + return null; +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts new file mode 100644 index 0000000000000..fd48ba39073fe --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts @@ -0,0 +1,284 @@ +/* + * 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 { + auditbeatNoResults, + auditbeatWithAllResults, +} from '../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatWithSomeErrors } from '../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { mockStatsPacketbeatIndex } from '../mock/stats/mock_stats_auditbeat_index'; +import { mockStatsAuditbeatIndex } from '../mock/stats/mock_stats_packetbeat_index'; +import { DataQualityCheckResult } from '../types'; +import { + getDocsCount, + getDocsCountPercent, + getSizeInBytes, + getTotalPatternIncompatible, + getTotalPatternIndicesChecked, +} from './stats'; + +describe('getTotalPatternIndicesChecked', () => { + test('it returns zero when `patternRollup` is undefined', () => { + expect(getTotalPatternIndicesChecked(undefined)).toEqual(0); + }); + + test('it returns zero when `patternRollup` does NOT have any results', () => { + expect(getTotalPatternIndicesChecked(auditbeatNoResults)).toEqual(0); + }); + + test('it returns the expected total when all indices in `patternRollup` have results', () => { + expect(getTotalPatternIndicesChecked(auditbeatWithAllResults)).toEqual(3); + }); + + test('it returns the expected total when some indices in `patternRollup` have errors', () => { + expect(getTotalPatternIndicesChecked(packetbeatWithSomeErrors)).toEqual(1); + }); +}); + +describe('getDocsCount', () => { + test('it returns the expected docs count when `stats` contains the `indexName`', () => { + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + const expectedCount = mockStatsPacketbeatIndex[indexName].num_docs; + + expect( + getDocsCount({ + indexName, + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(expectedCount); + }); + + test('it returns zero when `stats` does NOT contain the `indexName`', () => { + const indexName = 'not-gonna-find-it'; + + expect( + getDocsCount({ + indexName, + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(0); + }); + + test('it returns zero when `stats` is null', () => { + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + + expect( + getDocsCount({ + indexName, + stats: null, + }) + ).toEqual(0); + }); + + test('it returns the expected total for a green index, where `primaries.docs.count` and `total.docs.count` have different values', () => { + const indexName = 'auditbeat-custom-index-1'; + + expect( + getDocsCount({ + indexName, + stats: mockStatsAuditbeatIndex, + }) + ).toEqual(mockStatsAuditbeatIndex[indexName].num_docs); + }); +}); + +describe('getSizeInBytes', () => { + test('it returns the expected size when `stats` contains the `indexName`', () => { + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + const expectedCount = mockStatsPacketbeatIndex[indexName].size_in_bytes; + + expect( + getSizeInBytes({ + indexName, + stats: mockStatsPacketbeatIndex, + }) + ).toEqual(expectedCount); + }); + + test('it returns undefined when `stats` does NOT contain the `indexName`', () => { + const indexName = 'not-gonna-find-it'; + + expect( + getSizeInBytes({ + indexName, + stats: mockStatsPacketbeatIndex, + }) + ).toBeUndefined(); + }); + + test('it returns undefined when `stats` is null', () => { + const indexName = '.ds-packetbeat-8.6.1-2023.02.04-000001'; + + expect( + getSizeInBytes({ + indexName, + stats: null, + }) + ).toBeUndefined(); + }); + + test('it returns the expected size for a green index, where `primaries.store.size_in_bytes` and `total.store.size_in_bytes` have different values', () => { + const indexName = 'auditbeat-custom-index-1'; + + expect( + getSizeInBytes({ + indexName, + stats: mockStatsAuditbeatIndex, + }) + ).toEqual(mockStatsAuditbeatIndex[indexName].size_in_bytes); + }); +}); + +describe('getTotalPatternIncompatible', () => { + test('it returns zero when multiple indices in the results results have a count of zero', () => { + const results: Record = { + '.ds-packetbeat-8.5.3-2023.02.04-000001': { + docsCount: 1630289, + error: null, + ilmPhase: 'hot', + incompatible: 0, + indexName: '.ds-packetbeat-8.5.3-2023.02.04-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + '.ds-packetbeat-8.6.1-2023.02.04-000001': { + docsCount: 1628343, + error: null, + ilmPhase: 'hot', + incompatible: 0, + indexName: '.ds-packetbeat-8.6.1-2023.02.04-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'packetbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + }; + + expect(getTotalPatternIncompatible(results)).toEqual(0); + }); + + test("it returns the expected total when some indices have incompatible fields, but others don't", () => { + const results: Record = { + '.ds-auditbeat-8.6.1-2023.02.07-000001': { + docsCount: 18086, + error: null, + ilmPhase: 'hot', + incompatible: 0, + indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + 'auditbeat-custom-index-1': { + docsCount: 4, + error: null, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + 'auditbeat-custom-empty-index-1': { + docsCount: 0, + error: null, + ilmPhase: 'unmanaged', + incompatible: 1, + indexName: 'auditbeat-custom-empty-index-1', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + }; + + expect(getTotalPatternIncompatible(results)).toEqual(4); + }); + + test('it returns the expected total when some indices have undefined incompatible counts', () => { + const results: Record = { + '.ds-auditbeat-8.6.1-2023.02.07-000001': { + docsCount: 18086, + error: null, + ilmPhase: 'hot', + incompatible: undefined, // <-- this index has an undefined `incompatible` + indexName: '.ds-auditbeat-8.6.1-2023.02.07-000001', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + 'auditbeat-custom-index-1': { + docsCount: 4, + error: null, + ilmPhase: 'unmanaged', + incompatible: 3, + indexName: 'auditbeat-custom-index-1', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + 'auditbeat-custom-empty-index-1': { + docsCount: 0, + error: null, + ilmPhase: 'unmanaged', + incompatible: 1, + indexName: 'auditbeat-custom-empty-index-1', + markdownComments: ['foo', 'bar', 'baz'], + pattern: 'auditbeat-*', + sameFamily: 0, + checkedAt: Date.now(), + }, + }; + + expect(getTotalPatternIncompatible(results)).toEqual(4); + }); + + test('it returns zero when `results` is empty', () => { + expect(getTotalPatternIncompatible({})).toEqual(0); + }); + + test('it returns undefined when `results` is undefined', () => { + expect(getTotalPatternIncompatible(undefined)).toBeUndefined(); + }); +}); + +describe('getDocsCountPercent', () => { + test('it returns an empty string when `patternDocsCount` is zero', () => { + expect( + getDocsCountPercent({ + docsCount: 0, + patternDocsCount: 0, + }) + ).toEqual(''); + }); + + test('it returns the expected format when when `patternDocsCount` is non-zero, and `locales` is undefined', () => { + expect( + getDocsCountPercent({ + docsCount: 2904, + locales: undefined, + patternDocsCount: 57410, + }) + ).toEqual('5.1%'); + }); + + test('it returns the expected format when when `patternDocsCount` is non-zero, and `locales` is provided', () => { + expect( + getDocsCountPercent({ + docsCount: 2904, + locales: 'en-US', + patternDocsCount: 57410, + }) + ).toEqual('5.1%'); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts new file mode 100644 index 0000000000000..a59a43faa18db --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts @@ -0,0 +1,78 @@ +/* + * 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 { DataQualityCheckResult, MeteringStatsIndex, PatternRollup } from '../types'; + +export const getIndexIncompatible = ({ + indexName, + results, +}: { + indexName: string; + results: Record | undefined; +}): number | undefined => { + if (results == null || results[indexName] == null) { + return undefined; + } + + return results[indexName].incompatible; +}; + +export const getSizeInBytes = ({ + indexName, + stats, +}: { + indexName: string; + stats: Record | null; +}): number | undefined => (stats && stats[indexName]?.size_in_bytes) ?? undefined; + +export const getDocsCount = ({ + indexName, + stats, +}: { + indexName: string; + stats: Record | null; +}): number => (stats && stats[indexName]?.num_docs) ?? 0; + +export const getTotalPatternIndicesChecked = (patternRollup: PatternRollup | undefined): number => { + if (patternRollup != null && patternRollup.results != null) { + const allResults = Object.values(patternRollup.results); + const nonErrorResults = allResults.filter(({ error }) => error == null); + + return nonErrorResults.length; + } else { + return 0; + } +}; + +export const getTotalPatternIncompatible = ( + results: Record | undefined +): number | undefined => { + if (results == null) { + return undefined; + } + + const allResults = Object.values(results); + + return allResults.reduce((acc, { incompatible }) => acc + (incompatible ?? 0), 0); +}; + +export const getDocsCountPercent = ({ + docsCount, + locales, + patternDocsCount, +}: { + docsCount: number; + locales?: string | string[]; + patternDocsCount: number; +}): string => + patternDocsCount !== 0 + ? Number(docsCount / patternDocsCount).toLocaleString(locales, { + style: 'percent', + maximumFractionDigits: 1, + minimumFractionDigits: 1, + }) + : ''; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts index 87c32ba78d5e6..245fdbf7a75d4 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -export { DataQualityPanel } from './impl/data_quality'; +export { DataQualityPanel } from './impl/data_quality_panel'; -export { getIlmPhaseDescription } from './impl/data_quality/helpers'; +export { getIlmPhaseDescription } from './impl/data_quality_panel/utils/get_ilm_phase_description'; export { DATA_QUALITY_PROMPT_CONTEXT_PILL, @@ -17,6 +17,11 @@ export { ILM_PHASE, INDEX_LIFECYCLE_MANAGEMENT_PHASES, SELECT_ONE_OR_MORE_ILM_PHASES, -} from './impl/data_quality/translations'; + DATA_QUALITY_DASHBOARD_CONVERSATION_ID, +} from './impl/data_quality_panel/translations'; -export { ECS_REFERENCE_URL } from './impl/data_quality/data_quality_panel/index_properties/markdown/helpers'; +export { + ECS_REFERENCE_URL, + ECS_FIELD_REFERENCE_URL, + MAPPING_URL, +} from './impl/data_quality_panel/constants'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/jest.config.js b/x-pack/packages/security-solution/ecs_data_quality_dashboard/jest.config.js index e017b0ceaf369..5f6f7ab9bce1f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/jest.config.js +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/jest.config.js @@ -11,11 +11,11 @@ module.exports = { coverageReporters: ['text', 'html'], collectCoverageFrom: [ '/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.{ts,tsx}', - '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/*mock*.{ts,tsx}', - '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/*.test.{ts,tsx}', - '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/*.d.ts', - '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/*.config.ts', + '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/{__test__,__snapshots__,__examples__,*mock*,stub,tests,test_helpers,integration_tests,types}/**/*', + '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*mock*.{ts,tsx}', + '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.test.{ts,tsx}', + '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.d.ts', + '!/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.config.ts', ], preset: '@kbn/test', rootDir: '../../../..', diff --git a/x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts b/x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts index 24c8d0a57e772..fe0354b34a558 100644 --- a/x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts +++ b/x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts @@ -673,11 +673,13 @@ export const getSecuritySubFeaturesMap = ({ [SecuritySubFeatureId.processOperations, processOperationsSubFeature], [SecuritySubFeatureId.fileOperations, fileOperationsSubFeature], [SecuritySubFeatureId.executeAction, executeActionSubFeature], + [SecuritySubFeatureId.scanAction, scanActionSubFeature], ]; - if (experimentalFeatures.responseActionScanEnabled) { - securitySubFeaturesList.push([SecuritySubFeatureId.scanAction, scanActionSubFeature]); - } + // Use the following code to add feature based on feature flag + // if (experimentalFeatures.featureFlagName) { + // securitySubFeaturesList.push([SecuritySubFeatureId.featureId, featureSubFeature]); + // } const securitySubFeaturesMap = new Map( securitySubFeaturesList diff --git a/x-pack/packages/security/authorization_core/README.md b/x-pack/packages/security/authorization_core/README.md new file mode 100644 index 0000000000000..ce2c2dd277198 --- /dev/null +++ b/x-pack/packages/security/authorization_core/README.md @@ -0,0 +1,3 @@ +# @kbn/security-authorization-core + +Contains core authorization logic diff --git a/x-pack/packages/security/authorization_core/index.ts b/x-pack/packages/security/authorization_core/index.ts new file mode 100644 index 0000000000000..ccb68eb3bbcec --- /dev/null +++ b/x-pack/packages/security/authorization_core/index.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. + */ + +export { Actions } from './src/actions'; +export { privilegesFactory } from './src/privileges'; +export type { + CasesSupportedOperations, + PrivilegesService, + RawKibanaPrivileges, + RawKibanaFeaturePrivileges, +} from './src/privileges'; diff --git a/x-pack/packages/security/authorization_core/jest.config.js b/x-pack/packages/security/authorization_core/jest.config.js new file mode 100644 index 0000000000000..db3272ac46d92 --- /dev/null +++ b/x-pack/packages/security/authorization_core/jest.config.js @@ -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. + */ + +module.exports = { + coverageDirectory: '/x-pack/packages/security/authorization_core', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/packages/security/authorization_core/**/*.{ts,tsx}'], + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/security/authorization_core'], +}; diff --git a/x-pack/packages/security/authorization_core/kibana.jsonc b/x-pack/packages/security/authorization_core/kibana.jsonc new file mode 100644 index 0000000000000..f2e33db5c8a81 --- /dev/null +++ b/x-pack/packages/security/authorization_core/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-server", + "id": "@kbn/security-authorization-core", + "owner": "@elastic/kibana-security" +} diff --git a/x-pack/packages/security/authorization_core/package.json b/x-pack/packages/security/authorization_core/package.json new file mode 100644 index 0000000000000..4b270288d4763 --- /dev/null +++ b/x-pack/packages/security/authorization_core/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/security-authorization-core", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/packages/security/authorization_core/src/__fixtures__/licensing.mock.ts b/x-pack/packages/security/authorization_core/src/__fixtures__/licensing.mock.ts new file mode 100644 index 0000000000000..6ee9910b768bd --- /dev/null +++ b/x-pack/packages/security/authorization_core/src/__fixtures__/licensing.mock.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 { Observable, of } from 'rxjs'; + +import type { LicenseType } from '@kbn/licensing-plugin/common/types'; +import { LICENSE_TYPE } from '@kbn/licensing-plugin/common/types'; +import type { SecurityLicense, SecurityLicenseFeatures } from '@kbn/security-plugin-types-common'; + +export const licenseMock = { + create: ( + features: Partial | Observable> = {}, + licenseType: LicenseType = 'basic', // default to basic if this is not specified, + isAvailable: Observable = of(true) + ): jest.Mocked => ({ + isLicenseAvailable: jest.fn().mockImplementation(() => { + let result = true; + + isAvailable.subscribe((next) => { + result = next; + }); + + return result; + }), + getLicenseType: jest.fn().mockReturnValue(licenseType), + getUnavailableReason: jest.fn(), + isEnabled: jest.fn().mockReturnValue(true), + getFeatures: + features instanceof Observable + ? jest.fn().mockImplementation(() => { + let subbedFeatures: Partial = {}; + + features.subscribe((next) => { + subbedFeatures = next; + }); + + return subbedFeatures; + }) + : jest.fn().mockReturnValue(features), + hasAtLeast: jest + .fn() + .mockImplementation( + (licenseTypeToCheck: LicenseType) => + LICENSE_TYPE[licenseTypeToCheck] <= LICENSE_TYPE[licenseType] + ), + features$: + features instanceof Observable + ? (features as Observable) + : of((features ?? {}) as SecurityLicenseFeatures), + }), +}; diff --git a/x-pack/plugins/security/server/authorization/actions/__snapshots__/alerting.test.ts.snap b/x-pack/packages/security/authorization_core/src/actions/__snapshots__/alerting.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/__snapshots__/alerting.test.ts.snap rename to x-pack/packages/security/authorization_core/src/actions/__snapshots__/alerting.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/actions/__snapshots__/api.test.ts.snap b/x-pack/packages/security/authorization_core/src/actions/__snapshots__/api.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/__snapshots__/api.test.ts.snap rename to x-pack/packages/security/authorization_core/src/actions/__snapshots__/api.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/actions/__snapshots__/app.test.ts.snap b/x-pack/packages/security/authorization_core/src/actions/__snapshots__/app.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/__snapshots__/app.test.ts.snap rename to x-pack/packages/security/authorization_core/src/actions/__snapshots__/app.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/actions/__snapshots__/cases.test.ts.snap b/x-pack/packages/security/authorization_core/src/actions/__snapshots__/cases.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/__snapshots__/cases.test.ts.snap rename to x-pack/packages/security/authorization_core/src/actions/__snapshots__/cases.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/actions/__snapshots__/ui.test.ts.snap b/x-pack/packages/security/authorization_core/src/actions/__snapshots__/ui.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/__snapshots__/ui.test.ts.snap rename to x-pack/packages/security/authorization_core/src/actions/__snapshots__/ui.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/actions/actions.mock.ts b/x-pack/packages/security/authorization_core/src/actions/actions.mock.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/actions.mock.ts rename to x-pack/packages/security/authorization_core/src/actions/actions.mock.ts diff --git a/x-pack/plugins/security/server/authorization/actions/actions.test.ts b/x-pack/packages/security/authorization_core/src/actions/actions.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/actions.test.ts rename to x-pack/packages/security/authorization_core/src/actions/actions.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/actions.ts b/x-pack/packages/security/authorization_core/src/actions/actions.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/actions.ts rename to x-pack/packages/security/authorization_core/src/actions/actions.ts diff --git a/x-pack/plugins/security/server/authorization/actions/alerting.test.ts b/x-pack/packages/security/authorization_core/src/actions/alerting.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/alerting.test.ts rename to x-pack/packages/security/authorization_core/src/actions/alerting.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/alerting.ts b/x-pack/packages/security/authorization_core/src/actions/alerting.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/alerting.ts rename to x-pack/packages/security/authorization_core/src/actions/alerting.ts diff --git a/x-pack/plugins/security/server/authorization/actions/api.test.ts b/x-pack/packages/security/authorization_core/src/actions/api.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/api.test.ts rename to x-pack/packages/security/authorization_core/src/actions/api.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/api.ts b/x-pack/packages/security/authorization_core/src/actions/api.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/api.ts rename to x-pack/packages/security/authorization_core/src/actions/api.ts diff --git a/x-pack/plugins/security/server/authorization/actions/app.test.ts b/x-pack/packages/security/authorization_core/src/actions/app.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/app.test.ts rename to x-pack/packages/security/authorization_core/src/actions/app.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/app.ts b/x-pack/packages/security/authorization_core/src/actions/app.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/app.ts rename to x-pack/packages/security/authorization_core/src/actions/app.ts diff --git a/x-pack/plugins/security/server/authorization/actions/cases.test.ts b/x-pack/packages/security/authorization_core/src/actions/cases.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/cases.test.ts rename to x-pack/packages/security/authorization_core/src/actions/cases.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/cases.ts b/x-pack/packages/security/authorization_core/src/actions/cases.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/cases.ts rename to x-pack/packages/security/authorization_core/src/actions/cases.ts diff --git a/x-pack/plugins/security/server/authorization/actions/index.ts b/x-pack/packages/security/authorization_core/src/actions/index.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/index.ts rename to x-pack/packages/security/authorization_core/src/actions/index.ts diff --git a/x-pack/plugins/security/server/authorization/actions/saved_object.test.ts b/x-pack/packages/security/authorization_core/src/actions/saved_object.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/saved_object.test.ts rename to x-pack/packages/security/authorization_core/src/actions/saved_object.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/saved_object.ts b/x-pack/packages/security/authorization_core/src/actions/saved_object.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/saved_object.ts rename to x-pack/packages/security/authorization_core/src/actions/saved_object.ts diff --git a/x-pack/plugins/security/server/authorization/actions/space.test.ts b/x-pack/packages/security/authorization_core/src/actions/space.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/space.test.ts rename to x-pack/packages/security/authorization_core/src/actions/space.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/space.ts b/x-pack/packages/security/authorization_core/src/actions/space.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/space.ts rename to x-pack/packages/security/authorization_core/src/actions/space.ts diff --git a/x-pack/plugins/security/server/authorization/actions/ui.test.ts b/x-pack/packages/security/authorization_core/src/actions/ui.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/ui.test.ts rename to x-pack/packages/security/authorization_core/src/actions/ui.test.ts diff --git a/x-pack/plugins/security/server/authorization/actions/ui.ts b/x-pack/packages/security/authorization_core/src/actions/ui.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/actions/ui.ts rename to x-pack/packages/security/authorization_core/src/actions/ui.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/__snapshots__/cases.test.ts.snap b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/__snapshots__/cases.test.ts.snap similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/__snapshots__/cases.test.ts.snap rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/__snapshots__/cases.test.ts.snap diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/alerting.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.test.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/alerting.test.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/alerting.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/alerting.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/alerting.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/api.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/api.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/api.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/api.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/app.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/app.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/app.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/app.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.test.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.test.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.test.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.test.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/cases.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/catalogue.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/catalogue.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/catalogue.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/catalogue.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/feature_privilege_builder.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/feature_privilege_builder.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/feature_privilege_builder.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/feature_privilege_builder.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/index.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/index.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/index.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/index.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/management.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/management.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/management.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/management.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/navlink.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/navlink.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/saved_object.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/saved_object.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/saved_object.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/saved_object.ts diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/ui.ts b/x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/ui.ts similarity index 100% rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/ui.ts rename to x-pack/packages/security/authorization_core/src/privileges/feature_privilege_builder/ui.ts diff --git a/x-pack/packages/security/authorization_core/src/privileges/index.ts b/x-pack/packages/security/authorization_core/src/privileges/index.ts new file mode 100644 index 0000000000000..7113b1b348bec --- /dev/null +++ b/x-pack/packages/security/authorization_core/src/privileges/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type { PrivilegesService } from './privileges'; +export type { CasesSupportedOperations } from './feature_privilege_builder'; +export { privilegesFactory } from './privileges'; +export type { RawKibanaPrivileges, RawKibanaFeaturePrivileges } from './raw_kibana_privileges'; diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts b/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts similarity index 99% rename from x-pack/plugins/security/server/authorization/privileges/privileges.test.ts rename to x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts index 93efd86f52f54..118d63503db22 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts +++ b/x-pack/packages/security/authorization_core/src/privileges/privileges.test.ts @@ -9,7 +9,7 @@ import { KibanaFeature } from '@kbn/features-plugin/server'; import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; import { privilegesFactory } from './privileges'; -import { licenseMock } from '../../../common/licensing/index.mock'; +import { licenseMock } from '../__fixtures__/licensing.mock'; import { Actions } from '../actions'; const actions = new Actions(); diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.ts b/x-pack/packages/security/authorization_core/src/privileges/privileges.ts similarity index 98% rename from x-pack/plugins/security/server/authorization/privileges/privileges.ts rename to x-pack/packages/security/authorization_core/src/privileges/privileges.ts index 4295ae7c89bb4..9fb8dd9f083e2 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.ts +++ b/x-pack/packages/security/authorization_core/src/privileges/privileges.ts @@ -13,9 +13,9 @@ import type { } from '@kbn/features-plugin/common'; import type { FeaturesPluginSetup, KibanaFeature } from '@kbn/features-plugin/server'; +import type { SecurityLicense } from '@kbn/security-plugin-types-common'; import { featurePrivilegeBuilderFactory } from './feature_privilege_builder'; -import type { SecurityLicense } from '../../../common'; -import type { RawKibanaPrivileges } from '../../../common/model'; +import type { RawKibanaPrivileges } from './raw_kibana_privileges'; import type { Actions } from '../actions'; export interface PrivilegesService { diff --git a/x-pack/plugins/security/common/model/raw_kibana_privileges.ts b/x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts similarity index 100% rename from x-pack/plugins/security/common/model/raw_kibana_privileges.ts rename to x-pack/packages/security/authorization_core/src/privileges/raw_kibana_privileges.ts diff --git a/x-pack/packages/security/authorization_core/tsconfig.json b/x-pack/packages/security/authorization_core/tsconfig.json new file mode 100644 index 0000000000000..03870180c12c5 --- /dev/null +++ b/x-pack/packages/security/authorization_core/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node", "react"] + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/features-plugin", + "@kbn/security-plugin-types-common", + "@kbn/security-plugin-types-server", + "@kbn/licensing-plugin", + ] +} diff --git a/x-pack/packages/security/plugin_types_public/index.ts b/x-pack/packages/security/plugin_types_public/index.ts index 0b326ce2ee664..a2a6f4ea6a3ee 100644 --- a/x-pack/packages/security/plugin_types_public/index.ts +++ b/x-pack/packages/security/plugin_types_public/index.ts @@ -17,3 +17,5 @@ export type { UserProfileAPIClient, } from './src/user_profile'; export type { RolePutPayload, RolesAPIClient } from './src/roles'; +export { PrivilegesAPIClientPublicContract } from './src/privileges'; +export type { PrivilegesAPIClientGetAllArgs } from './src/privileges'; diff --git a/x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts b/x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts index 5ad462f8c2aa1..f04acf8020b24 100644 --- a/x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts +++ b/x-pack/packages/security/plugin_types_public/src/authorization/authorization_service.ts @@ -6,6 +6,7 @@ */ import type { RolesAPIClient } from '../roles'; +import type { PrivilegesAPIClientPublicContract } from '../privileges'; export interface AuthorizationServiceSetup { /** @@ -17,6 +18,11 @@ export interface AuthorizationServiceSetup { * A set of methods to work with Kibana user roles. */ roles: RolesAPIClient; + + /** + * A set of methods to work with Kibana role privileges + */ + privileges: PrivilegesAPIClientPublicContract; } /** diff --git a/x-pack/packages/security/plugin_types_public/src/privileges/index.ts b/x-pack/packages/security/plugin_types_public/src/privileges/index.ts new file mode 100644 index 0000000000000..b8d111a0c79fe --- /dev/null +++ b/x-pack/packages/security/plugin_types_public/src/privileges/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { PrivilegesAPIClientPublicContract } from './privileges_api_client'; +export type { PrivilegesAPIClientGetAllArgs } from './privileges_api_client'; diff --git a/x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts b/x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.ts new file mode 100644 index 0000000000000..e3a97398db7a3 --- /dev/null +++ b/x-pack/packages/security/plugin_types_public/src/privileges/privileges_api_client.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 type { RawKibanaPrivileges } from '@kbn/security-authorization-core'; + +export interface PrivilegesAPIClientGetAllArgs { + includeActions: boolean; + /* + * respectLicenseLevel is an internal optional parameter solely for getting all sub-feature + * privileges to use in the UI. It is not meant for any other use. + */ + respectLicenseLevel: boolean; +} +// TODO: Eyo include the proper return types for contract +export abstract class PrivilegesAPIClientPublicContract { + abstract getAll(args: PrivilegesAPIClientGetAllArgs): Promise; +} diff --git a/x-pack/packages/security/plugin_types_public/tsconfig.json b/x-pack/packages/security/plugin_types_public/tsconfig.json index 6779851e86367..5c97e25656ecf 100644 --- a/x-pack/packages/security/plugin_types_public/tsconfig.json +++ b/x-pack/packages/security/plugin_types_public/tsconfig.json @@ -14,5 +14,6 @@ "@kbn/core-user-profile-common", "@kbn/security-plugin-types-common", "@kbn/core-security-common", + "@kbn/security-authorization-core" ] } diff --git a/x-pack/packages/security/role_management_model/README.md b/x-pack/packages/security/role_management_model/README.md new file mode 100644 index 0000000000000..f87e15a76e453 --- /dev/null +++ b/x-pack/packages/security/role_management_model/README.md @@ -0,0 +1,3 @@ +# @kbn/security-role-management + +Contains business logic for RBAC administration within Kibana. diff --git a/x-pack/packages/security/role_management_model/index.ts b/x-pack/packages/security/role_management_model/index.ts new file mode 100644 index 0000000000000..fa69415d3f8cc --- /dev/null +++ b/x-pack/packages/security/role_management_model/index.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. + */ + +export { SecuredFeature } from './src/secured_feature'; +export { SecuredSubFeature } from './src/secured_sub_feature'; +export { SubFeaturePrivilegeGroup } from './src/sub_feature_privilege_group'; +export { SubFeaturePrivilege } from './src/sub_feature_privilege'; +export { PrimaryFeaturePrivilege } from './src/primary_feature_privilege'; +export { KibanaPrivileges, isGlobalPrivilegeDefinition } from './src/kibana_privileges'; +export { KibanaPrivilege } from './src/kibana_privilege'; +export { PrivilegeCollection } from './src/privilege_collection'; diff --git a/x-pack/packages/security/role_management_model/jest.config.js b/x-pack/packages/security/role_management_model/jest.config.js new file mode 100644 index 0000000000000..4223e717dec5e --- /dev/null +++ b/x-pack/packages/security/role_management_model/jest.config.js @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/packages/security/role_management_model', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/packages/security/role_management_model/**/*.{ts,tsx}'], + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/security/role_management_model'], +}; diff --git a/x-pack/packages/security/role_management_model/kibana.jsonc b/x-pack/packages/security/role_management_model/kibana.jsonc new file mode 100644 index 0000000000000..9ba7936494167 --- /dev/null +++ b/x-pack/packages/security/role_management_model/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/security-role-management-model", + "owner": "@elastic/kibana-security" +} diff --git a/x-pack/packages/security/role_management_model/package.json b/x-pack/packages/security/role_management_model/package.json new file mode 100644 index 0000000000000..d231b70912484 --- /dev/null +++ b/x-pack/packages/security/role_management_model/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/security-role-management-model", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/packages/security/role_management_model/src/__fixtures__/index.ts b/x-pack/packages/security/role_management_model/src/__fixtures__/index.ts new file mode 100644 index 0000000000000..32f8d17be94b2 --- /dev/null +++ b/x-pack/packages/security/role_management_model/src/__fixtures__/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { createFeature, kibanaFeatures } from './kibana_features'; +export { createKibanaPrivileges, createRawKibanaPrivileges } from './kibana_privileges'; diff --git a/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts b/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_features.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts rename to x-pack/packages/security/role_management_model/src/__fixtures__/kibana_features.ts diff --git a/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts b/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.ts new file mode 100644 index 0000000000000..2dc5078038033 --- /dev/null +++ b/x-pack/packages/security/role_management_model/src/__fixtures__/kibana_privileges.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 type { KibanaFeature } from '@kbn/features-plugin/public'; +import { type FeaturesPluginSetup } from '@kbn/features-plugin/server'; +import { + featurePrivilegeIterator, + subFeaturePrivilegeIterator, +} from '@kbn/features-plugin/server/feature_privilege_iterator'; +import type { LicenseType } from '@kbn/licensing-plugin/server'; +import type { SecurityLicenseFeatures } from '@kbn/security-plugin-types-common'; +import { Actions, privilegesFactory } from '@kbn/security-authorization-core'; +import { KibanaPrivileges } from '../kibana_privileges'; + +const featuresPluginService = (): jest.Mocked => { + return { + getKibanaFeatures: jest.fn(), + getElasticsearchFeatures: jest.fn(), + registerKibanaFeature: jest.fn(), + registerElasticsearchFeature: jest.fn(), + enableReportingUiCapabilities: jest.fn(), + featurePrivilegeIterator: jest.fn().mockImplementation(featurePrivilegeIterator), + subFeaturePrivilegeIterator: jest.fn().mockImplementation(subFeaturePrivilegeIterator), + }; +}; + +export const createRawKibanaPrivileges = ( + features: KibanaFeature[], + { allowSubFeaturePrivileges = true } = {} +) => { + const featuresService = featuresPluginService(); + featuresService.getKibanaFeatures.mockReturnValue(features); + + const licensingService = { + getFeatures: () => ({ allowSubFeaturePrivileges } as SecurityLicenseFeatures), + getType: () => 'basic' as const, + hasAtLeast: (licenseType: LicenseType) => licenseType === 'basic', + }; + + return privilegesFactory(new Actions(), featuresService, licensingService).get(); +}; + +export const createKibanaPrivileges = ( + features: KibanaFeature[], + { allowSubFeaturePrivileges = true } = {} +) => { + return new KibanaPrivileges( + createRawKibanaPrivileges(features, { allowSubFeaturePrivileges }), + features + ); +}; diff --git a/x-pack/plugins/security/public/management/roles/model/kibana_privilege.ts b/x-pack/packages/security/role_management_model/src/kibana_privilege.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/kibana_privilege.ts rename to x-pack/packages/security/role_management_model/src/kibana_privilege.ts diff --git a/x-pack/packages/security/role_management_model/src/kibana_privileges.test.ts b/x-pack/packages/security/role_management_model/src/kibana_privileges.test.ts new file mode 100644 index 0000000000000..6102c853db51b --- /dev/null +++ b/x-pack/packages/security/role_management_model/src/kibana_privileges.test.ts @@ -0,0 +1,187 @@ +/* + * 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 { KibanaPrivilege } from './kibana_privilege'; +import { KibanaPrivileges, isGlobalPrivilegeDefinition } from './kibana_privileges'; +import type { RoleKibanaPrivilege } from '@kbn/security-plugin-types-common'; +import { createRawKibanaPrivileges, kibanaFeatures } from './__fixtures__'; + +describe('kibana_privilege', () => { + describe('isGlobalPrivilegeDefinition', () => { + it('returns true if no spaces are defined', () => { + expect( + // @ts-ignore + isGlobalPrivilegeDefinition({ + base: [], + feature: {}, + }) + ).toEqual(true); + }); + + it('returns true if spaces is an empty array', () => { + expect( + isGlobalPrivilegeDefinition({ + spaces: [], + base: [], + feature: {}, + }) + ).toEqual(true); + }); + + it('returns true if spaces contains "*"', () => { + expect( + isGlobalPrivilegeDefinition({ + spaces: ['*'], + base: [], + feature: {}, + }) + ).toEqual(true); + }); + + it('returns false if spaces does not contain "*"', () => { + expect( + isGlobalPrivilegeDefinition({ + spaces: ['foo', 'bar'], + base: [], + feature: {}, + }) + ).toEqual(false); + }); + }); + + describe('KibanaPrivileges', () => { + describe('#getBasePrivileges', () => { + it('returns the space base privileges for a non-global entry', () => { + const rawPrivileges = createRawKibanaPrivileges(kibanaFeatures); + const kibanaPrivileges = new KibanaPrivileges(rawPrivileges, kibanaFeatures); + + const entry: RoleKibanaPrivilege = { + base: [], + feature: {}, + spaces: ['foo'], + }; + + const basePrivileges = kibanaPrivileges.getBasePrivileges(entry); + + const expectedPrivileges = rawPrivileges.space; + + expect(basePrivileges).toHaveLength(2); + expect(basePrivileges[0]).toMatchObject({ + id: 'all', + actions: expectedPrivileges.all, + }); + expect(basePrivileges[1]).toMatchObject({ + id: 'read', + actions: expectedPrivileges.read, + }); + }); + + it('returns the global base privileges for a global entry', () => { + const rawPrivileges = createRawKibanaPrivileges(kibanaFeatures); + const kibanaPrivileges = new KibanaPrivileges(rawPrivileges, kibanaFeatures); + + const entry: RoleKibanaPrivilege = { + base: [], + feature: {}, + spaces: ['*'], + }; + + const basePrivileges = kibanaPrivileges.getBasePrivileges(entry); + + const expectedPrivileges = rawPrivileges.global; + + expect(basePrivileges).toHaveLength(2); + expect(basePrivileges[0]).toMatchObject({ + id: 'all', + actions: expectedPrivileges.all, + }); + expect(basePrivileges[1]).toMatchObject({ + id: 'read', + actions: expectedPrivileges.read, + }); + }); + }); + + describe('#createCollectionFromRoleKibanaPrivileges', () => { + it('creates a collection from a role with no privileges assigned', () => { + const rawPrivileges = createRawKibanaPrivileges(kibanaFeatures); + const kibanaPrivileges = new KibanaPrivileges(rawPrivileges, kibanaFeatures); + + const assignedPrivileges: RoleKibanaPrivilege[] = []; + kibanaPrivileges.createCollectionFromRoleKibanaPrivileges(assignedPrivileges); + }); + + it('creates a collection ignoring unknown privileges', () => { + const rawPrivileges = createRawKibanaPrivileges(kibanaFeatures); + const kibanaPrivileges = new KibanaPrivileges(rawPrivileges, kibanaFeatures); + + const assignedPrivileges: RoleKibanaPrivilege[] = [ + { + base: ['read', 'some-unknown-base-privilege'], + feature: {}, + spaces: ['*'], + }, + { + base: [], + feature: { + with_sub_features: ['read', 'cool_all', 'some-unknown-feature-privilege'], + some_unknown_feature: ['all'], + }, + spaces: ['foo'], + }, + ]; + kibanaPrivileges.createCollectionFromRoleKibanaPrivileges(assignedPrivileges); + }); + + it('creates a collection using all assigned privileges, and only the assigned privileges', () => { + const rawPrivileges = createRawKibanaPrivileges(kibanaFeatures); + const kibanaPrivileges = new KibanaPrivileges(rawPrivileges, kibanaFeatures); + + const assignedPrivileges: RoleKibanaPrivilege[] = [ + { + base: ['read'], + feature: {}, + spaces: ['*'], + }, + { + base: [], + feature: { + with_sub_features: ['read', 'cool_all'], + }, + spaces: ['foo'], + }, + ]; + const collection = + kibanaPrivileges.createCollectionFromRoleKibanaPrivileges(assignedPrivileges); + + expect( + collection.grantsPrivilege( + new KibanaPrivilege('test', [...rawPrivileges.features.with_excluded_sub_features.read]) + ) + ).toEqual(true); + + expect( + collection.grantsPrivilege( + new KibanaPrivilege('test', [...rawPrivileges.features.with_excluded_sub_features.all]) + ) + ).toEqual(false); + + expect( + collection.grantsPrivilege( + new KibanaPrivilege('test', [...rawPrivileges.features.with_sub_features.cool_all]) + ) + ).toEqual(true); + + expect( + collection.grantsPrivilege( + new KibanaPrivilege('test', [...rawPrivileges.features.with_sub_features.cool_toggle_1]) + ) + ).toEqual(false); + }); + }); + }); +}); diff --git a/x-pack/packages/security/role_management_model/src/kibana_privileges.ts b/x-pack/packages/security/role_management_model/src/kibana_privileges.ts new file mode 100644 index 0000000000000..e78ee9b105bbf --- /dev/null +++ b/x-pack/packages/security/role_management_model/src/kibana_privileges.ts @@ -0,0 +1,99 @@ +/* + * 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 { KibanaFeature } from '@kbn/features-plugin/common'; + +import type { RoleKibanaPrivilege } from '@kbn/security-plugin-types-common'; +import type { RawKibanaPrivileges } from '@kbn/security-authorization-core'; +import { KibanaPrivilege } from './kibana_privilege'; +import { PrivilegeCollection } from './privilege_collection'; +import { SecuredFeature } from './secured_feature'; + +function toBasePrivilege(entry: [string, string[]]): [string, KibanaPrivilege] { + const [privilegeId, actions] = entry; + return [privilegeId, new KibanaPrivilege(privilegeId, actions)]; +} + +function recordsToBasePrivilegeMap( + record: Record +): ReadonlyMap { + return new Map(Object.entries(record).map((entry) => toBasePrivilege(entry))); +} + +/** + * Determines if the passed privilege spec defines global privileges. + * @param privilegeSpec + */ +export function isGlobalPrivilegeDefinition(privilegeSpec: RoleKibanaPrivilege): boolean { + if (!privilegeSpec.spaces || privilegeSpec.spaces.length === 0) { + return true; + } + return privilegeSpec.spaces.includes('*'); +} + +export class KibanaPrivileges { + private global: ReadonlyMap; + + private spaces: ReadonlyMap; + + private feature: ReadonlyMap; + + constructor(rawKibanaPrivileges: RawKibanaPrivileges, features: KibanaFeature[]) { + this.global = recordsToBasePrivilegeMap(rawKibanaPrivileges.global); + this.spaces = recordsToBasePrivilegeMap(rawKibanaPrivileges.space); + this.feature = new Map( + features.map((feature) => { + const rawPrivs = rawKibanaPrivileges.features[feature.id]; + return [feature.id, new SecuredFeature(feature.toRaw(), rawPrivs)]; + }) + ); + } + + public getBasePrivileges(entry: RoleKibanaPrivilege) { + if (isGlobalPrivilegeDefinition(entry)) { + return Array.from(this.global.values()); + } + return Array.from(this.spaces.values()); + } + + public getSecuredFeature(featureId: string) { + return this.feature.get(featureId)!; + } + + public getSecuredFeatures() { + return Array.from(this.feature.values()); + } + + public createCollectionFromRoleKibanaPrivileges(roleKibanaPrivileges: RoleKibanaPrivilege[]) { + const filterAssigned = (assignedPrivileges: string[]) => (privilege: KibanaPrivilege) => + Array.isArray(assignedPrivileges) && assignedPrivileges.includes(privilege.id); + + const privileges: KibanaPrivilege[] = roleKibanaPrivileges + .map((entry) => { + const assignedBasePrivileges = this.getBasePrivileges(entry).filter( + filterAssigned(entry.base) + ); + + const assignedFeaturePrivileges: KibanaPrivilege[][] = Object.entries(entry.feature).map( + ([featureId, assignedFeaturePrivs]) => { + return this.getFeaturePrivileges(featureId).filter( + filterAssigned(assignedFeaturePrivs) + ); + } + ); + + return [assignedBasePrivileges, assignedFeaturePrivileges].flat(2); + }) + .flat(); + + return new PrivilegeCollection(privileges); + } + + private getFeaturePrivileges(featureId: string) { + return this.getSecuredFeature(featureId)?.getAllPrivileges() ?? []; + } +} diff --git a/x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts b/x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/primary_feature_privilege.ts rename to x-pack/packages/security/role_management_model/src/primary_feature_privilege.ts diff --git a/x-pack/plugins/security/public/management/roles/model/privilege_collection.test.ts b/x-pack/packages/security/role_management_model/src/privilege_collection.test.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/privilege_collection.test.ts rename to x-pack/packages/security/role_management_model/src/privilege_collection.test.ts diff --git a/x-pack/plugins/security/public/management/roles/model/privilege_collection.ts b/x-pack/packages/security/role_management_model/src/privilege_collection.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/privilege_collection.ts rename to x-pack/packages/security/role_management_model/src/privilege_collection.ts diff --git a/x-pack/plugins/security/public/management/roles/model/secured_feature.ts b/x-pack/packages/security/role_management_model/src/secured_feature.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/secured_feature.ts rename to x-pack/packages/security/role_management_model/src/secured_feature.ts diff --git a/x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts b/x-pack/packages/security/role_management_model/src/secured_sub_feature.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/secured_sub_feature.ts rename to x-pack/packages/security/role_management_model/src/secured_sub_feature.ts diff --git a/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts b/x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/sub_feature_privilege.ts rename to x-pack/packages/security/role_management_model/src/sub_feature_privilege.ts diff --git a/x-pack/plugins/security/public/management/roles/model/sub_feature_privilege_group.ts b/x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/model/sub_feature_privilege_group.ts rename to x-pack/packages/security/role_management_model/src/sub_feature_privilege_group.ts diff --git a/x-pack/packages/security/role_management_model/tsconfig.json b/x-pack/packages/security/role_management_model/tsconfig.json new file mode 100644 index 0000000000000..f18ed64fae713 --- /dev/null +++ b/x-pack/packages/security/role_management_model/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node", "react"] + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/features-plugin", + "@kbn/security-plugin-types-common", + "@kbn/security-authorization-core", + "@kbn/licensing-plugin", + ] +} diff --git a/x-pack/packages/security/ui_components/README.md b/x-pack/packages/security/ui_components/README.md new file mode 100644 index 0000000000000..dd5ee7d160285 --- /dev/null +++ b/x-pack/packages/security/ui_components/README.md @@ -0,0 +1,3 @@ +# @kbn/security-ui-components + +Contains stateless components for RBAC administration within Kibana. diff --git a/x-pack/packages/security/ui_components/index.ts b/x-pack/packages/security/ui_components/index.ts new file mode 100644 index 0000000000000..3730109d9c0f8 --- /dev/null +++ b/x-pack/packages/security/ui_components/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { + FeatureTable as KibanaPrivilegeTable, + FeatureTableCell, +} from './src/kibana_privilege_table'; +export { PrivilegeFormCalculator } from './src/privilege_form_calculator'; +export * as constants from './src/constants'; diff --git a/x-pack/packages/security/ui_components/jest.config.js b/x-pack/packages/security/ui_components/jest.config.js new file mode 100644 index 0000000000000..12c8dfc44691b --- /dev/null +++ b/x-pack/packages/security/ui_components/jest.config.js @@ -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. + */ + +module.exports = { + coverageDirectory: '/target/kibana-coverage/jest/x-pack/packages/security/ui_components', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/packages/security/ui_components/**/*.{ts,tsx}'], + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/x-pack/packages/security/ui_components'], +}; diff --git a/x-pack/packages/security/ui_components/kibana.jsonc b/x-pack/packages/security/ui_components/kibana.jsonc new file mode 100644 index 0000000000000..1aad2d80ed7f7 --- /dev/null +++ b/x-pack/packages/security/ui_components/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/security-ui-components", + "owner": "@elastic/kibana-security" +} diff --git a/x-pack/packages/security/ui_components/package.json b/x-pack/packages/security/ui_components/package.json new file mode 100644 index 0000000000000..59bf7383b958e --- /dev/null +++ b/x-pack/packages/security/ui_components/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/security-ui-components", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/constants.ts b/x-pack/packages/security/ui_components/src/constants.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/constants.ts rename to x-pack/packages/security/ui_components/src/constants.ts diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts b/x-pack/packages/security/ui_components/src/kibana_privilege_table/__fixtures__/index.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/__fixtures__/index.ts diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.scss b/x-pack/packages/security/ui_components/src/kibana_privilege_table/change_all_privileges.scss similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.scss rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/change_all_privileges.scss diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/change_all_privileges.tsx similarity index 97% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/change_all_privileges.tsx index 00494c48b9efb..4793f86a7a2a5 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/change_all_privileges.tsx @@ -19,8 +19,8 @@ import _ from 'lodash'; import React, { Component } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { KibanaPrivilege } from '@kbn/security-role-management-model'; -import type { KibanaPrivilege } from '../../../../model'; import { NO_PRIVILEGE_VALUE } from '../constants'; interface Props { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.scss b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.scss similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.scss rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.scss diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.test.tsx similarity index 90% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.test.tsx index 372b24048fe5b..0c1eac9a70d4e 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.test.tsx @@ -8,11 +8,11 @@ import { EuiIconTip } from '@elastic/eui'; import React from 'react'; +import { SecuredFeature } from '@kbn/security-role-management-model'; +import { createFeature } from '@kbn/security-role-management-model/src/__fixtures__'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { FeatureTableCell } from './feature_table_cell'; -import { createFeature } from '../../../../__fixtures__/kibana_features'; -import { SecuredFeature } from '../../../../model'; describe('FeatureTableCell', () => { it('renders the feature name', () => { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.tsx similarity index 95% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.tsx index 062597ce46ad2..177b6fb95a413 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/feature_table_cell.tsx @@ -10,7 +10,7 @@ import './feature_table_cell.scss'; import { EuiFlexGroup, EuiFlexItem, EuiIconTip, EuiText } from '@elastic/eui'; import React from 'react'; -import type { SecuredFeature } from '../../../../model'; +import type { SecuredFeature } from '@kbn/security-role-management-model'; interface Props { feature: SecuredFeature; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/index.ts b/x-pack/packages/security/ui_components/src/kibana_privilege_table/components/index.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/index.ts rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/components/index.ts diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.scss b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.scss similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.scss rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.scss diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx similarity index 99% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx index 8b40b6d16d403..83a0da2e26815 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx @@ -9,13 +9,16 @@ import { EuiAccordion, EuiIconTip } from '@elastic/eui'; import React from 'react'; import type { KibanaFeature, SubFeatureConfig } from '@kbn/features-plugin/public'; +import { + createFeature, + createKibanaPrivileges, + kibanaFeatures, +} from '@kbn/security-role-management-model/src/__fixtures__'; import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { getDisplayedFeaturePrivileges } from './__fixtures__'; import { FeatureTable } from './feature_table'; -import type { Role } from '../../../../../../../common'; -import { createFeature, kibanaFeatures } from '../../../../__fixtures__/kibana_features'; -import { createKibanaPrivileges } from '../../../../__fixtures__/kibana_privileges'; +import type { Role } from '@kbn/security-plugin-types-common'; import { PrivilegeFormCalculator } from '../privilege_form_calculator'; const createRole = (kibana: Role['kibana'] = []): Role => { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx similarity index 98% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx index 7734d415bf385..4b0d520dee661 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx @@ -29,13 +29,13 @@ import React, { Component } from 'react'; import type { AppCategory } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { Role } from '@kbn/security-plugin-types-common'; +import type { KibanaPrivileges, SecuredFeature } from '@kbn/security-role-management-model'; import { ChangeAllPrivilegesControl } from './change_all_privileges'; import { FeatureTableExpandedRow } from './feature_table_expanded_row'; -import type { Role } from '../../../../../../../common'; -import type { KibanaPrivileges, SecuredFeature } from '../../../../model'; import { NO_PRIVILEGE_VALUE } from '../constants'; -import { FeatureTableCell } from '../feature_table_cell'; +import { FeatureTableCell } from './components/feature_table_cell'; import type { PrivilegeFormCalculator } from '../privilege_form_calculator'; interface Props { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.test.tsx similarity index 98% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.test.tsx index b3856bb59f1f3..3b787f01cdf92 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.test.tsx @@ -8,12 +8,14 @@ import { act } from '@testing-library/react'; import React from 'react'; +import { + createKibanaPrivileges, + kibanaFeatures, +} from '@kbn/security-role-management-model/src/__fixtures__'; import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { FeatureTableExpandedRow } from './feature_table_expanded_row'; -import type { Role } from '../../../../../../../common'; -import { kibanaFeatures } from '../../../../__fixtures__/kibana_features'; -import { createKibanaPrivileges } from '../../../../__fixtures__/kibana_privileges'; +import type { Role } from '@kbn/security-plugin-types-common'; import { PrivilegeFormCalculator } from '../privilege_form_calculator'; const createRole = (kibana: Role['kibana'] = []): Role => { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.tsx similarity index 98% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.tsx index 42090f8c6c044..8e00327fd334b 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table_expanded_row.tsx @@ -11,9 +11,9 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import type { SecuredFeature } from '@kbn/security-role-management-model'; import { SubFeatureForm } from './sub_feature_form'; -import type { SecuredFeature } from '../../../../model'; import type { PrivilegeFormCalculator } from '../privilege_form_calculator'; interface Props { diff --git a/x-pack/packages/security/ui_components/src/kibana_privilege_table/index.ts b/x-pack/packages/security/ui_components/src/kibana_privilege_table/index.ts new file mode 100644 index 0000000000000..ad439d6aad3fa --- /dev/null +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { FeatureTable } from './feature_table'; +export { FeatureTableCell } from './components'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.test.tsx similarity index 96% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.test.tsx index 53e44aefbf1c8..8f741f1d48f9d 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.test.tsx @@ -10,13 +10,15 @@ import { act } from '@testing-library/react'; import React from 'react'; import { KibanaFeature } from '@kbn/features-plugin/public'; +import type { Role } from '@kbn/security-plugin-types-common'; +import { SecuredSubFeature } from '@kbn/security-role-management-model'; +import { + createKibanaPrivileges, + kibanaFeatures, +} from '@kbn/security-role-management-model/src/__fixtures__'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { SubFeatureForm } from './sub_feature_form'; -import type { Role } from '../../../../../../../common'; -import { kibanaFeatures } from '../../../../__fixtures__/kibana_features'; -import { createKibanaPrivileges } from '../../../../__fixtures__/kibana_privileges'; -import { SecuredSubFeature } from '../../../../model'; import { PrivilegeFormCalculator } from '../privilege_form_calculator'; // Note: these tests are not concerned with the proper display of privileges, diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.tsx similarity index 99% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx rename to x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.tsx index 4f3c1eb103a75..9155d8ae52835 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx +++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/sub_feature_form.tsx @@ -16,12 +16,12 @@ import { import React from 'react'; import { i18n } from '@kbn/i18n'; - import type { SecuredSubFeature, SubFeaturePrivilege, SubFeaturePrivilegeGroup, -} from '../../../../model'; +} from '@kbn/security-role-management-model'; + import { NO_PRIVILEGE_VALUE } from '../constants'; import type { PrivilegeFormCalculator } from '../privilege_form_calculator'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/index.ts b/x-pack/packages/security/ui_components/src/privilege_form_calculator/index.ts similarity index 100% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/index.ts rename to x-pack/packages/security/ui_components/src/privilege_form_calculator/index.ts diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.test.ts b/x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.test.ts similarity index 99% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.test.ts rename to x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.test.ts index 20c54fd2ea529..0281605f00f34 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.test.ts +++ b/x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.test.ts @@ -5,10 +5,13 @@ * 2.0. */ +import { + createKibanaPrivileges, + kibanaFeatures, +} from '@kbn/security-role-management-model/src/__fixtures__'; + import { PrivilegeFormCalculator } from './privilege_form_calculator'; -import type { Role } from '../../../../../../../common'; -import { kibanaFeatures } from '../../../../__fixtures__/kibana_features'; -import { createKibanaPrivileges } from '../../../../__fixtures__/kibana_privileges'; +import type { Role } from '@kbn/security-plugin-types-common'; const createRole = (kibana: Role['kibana'] = []): Role => { return { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.ts b/x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts similarity index 98% rename from x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.ts rename to x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts index 227c2be381546..75cdcac34031e 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_form_calculator/privilege_form_calculator.ts +++ b/x-pack/packages/security/ui_components/src/privilege_form_calculator/privilege_form_calculator.ts @@ -5,9 +5,12 @@ * 2.0. */ -import type { Role } from '../../../../../../../common'; -import type { KibanaPrivileges, SubFeaturePrivilegeGroup } from '../../../../model'; -import { isGlobalPrivilegeDefinition } from '../../../privilege_utils'; +import type { Role } from '@kbn/security-plugin-types-common'; +import { + isGlobalPrivilegeDefinition, + type KibanaPrivileges, + type SubFeaturePrivilegeGroup, +} from '@kbn/security-role-management-model'; /** * Calculator responsible for determining the displayed and effective privilege values for the following interfaces: diff --git a/x-pack/packages/security/ui_components/tsconfig.json b/x-pack/packages/security/ui_components/tsconfig.json new file mode 100644 index 0000000000000..736612a488852 --- /dev/null +++ b/x-pack/packages/security/ui_components/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node", "react"] + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/security-plugin-types-common", + "@kbn/test-jest-helpers", + "@kbn/security-role-management-model", + "@kbn/features-plugin", + ] +} diff --git a/x-pack/plugins/actions/server/action_type_registry.test.ts b/x-pack/plugins/actions/server/action_type_registry.test.ts index 76f9ae838de45..88ae6c3678552 100644 --- a/x-pack/plugins/actions/server/action_type_registry.test.ts +++ b/x-pack/plugins/actions/server/action_type_registry.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { TaskCost } from '@kbn/task-manager-plugin/server'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { schema } from '@kbn/config-schema'; import { ActionTypeRegistry, ActionTypeRegistryOpts } from './action_type_registry'; @@ -88,6 +89,7 @@ describe('actionTypeRegistry', () => { 'actions:my-action-type': { createTaskRunner: expect.any(Function), maxAttempts: 3, + cost: TaskCost.Tiny, title: 'My action type', }, }, diff --git a/x-pack/plugins/actions/server/action_type_registry.ts b/x-pack/plugins/actions/server/action_type_registry.ts index 615b0b43e9d6c..a5626450d9346 100644 --- a/x-pack/plugins/actions/server/action_type_registry.ts +++ b/x-pack/plugins/actions/server/action_type_registry.ts @@ -7,7 +7,7 @@ import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; -import { RunContext, TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; +import { RunContext, TaskManagerSetupContract, TaskCost } from '@kbn/task-manager-plugin/server'; import { LicensingPluginSetup } from '@kbn/licensing-plugin/server'; import { ActionType as CommonActionType, areValidFeatures } from '../common'; import { ActionsConfigurationUtilities } from './actions_config'; @@ -194,6 +194,7 @@ export class ActionTypeRegistry { [`actions:${actionType.id}`]: { title: actionType.name, maxAttempts, + cost: TaskCost.Tiny, createTaskRunner: (context: RunContext) => this.taskRunnerFactory.create(context), }, }); diff --git a/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap b/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap index d534170f74d0f..ae1289b2a9e2e 100644 --- a/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap +++ b/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap @@ -4318,6 +4318,27 @@ Object { ], "type": "array", }, + "systemInstruction": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, "temperature": Object { "flags": Object { "default": [Function], @@ -4344,6 +4365,95 @@ Object { ], "type": "number", }, + "toolConfig": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "keys": Object { + "allowedFunctionNames": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "items": Array [ + Object { + "flags": Object { + "error": [Function], + "presence": "optional", + }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + ], + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "array", + }, + "mode": Object { + "flags": Object { + "error": [Function], + }, + "matches": Array [ + Object { + "schema": Object { + "allow": Array [ + "AUTO", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "ANY", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "NONE", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "object", + }, "tools": Object { "flags": Object { "default": [Function], @@ -4464,6 +4574,27 @@ Object { ], "type": "array", }, + "systemInstruction": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, "temperature": Object { "flags": Object { "default": [Function], @@ -4610,6 +4741,27 @@ Object { ], "type": "array", }, + "systemInstruction": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, "temperature": Object { "flags": Object { "default": [Function], @@ -4636,6 +4788,95 @@ Object { ], "type": "number", }, + "toolConfig": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "keys": Object { + "allowedFunctionNames": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "items": Array [ + Object { + "flags": Object { + "error": [Function], + "presence": "optional", + }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + ], + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "array", + }, + "mode": Object { + "flags": Object { + "error": [Function], + }, + "matches": Array [ + Object { + "schema": Object { + "allow": Array [ + "AUTO", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "ANY", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "NONE", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "object", + }, "tools": Object { "flags": Object { "default": [Function], diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index b2e6badae3c59..560d5dc3ecea5 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { KibanaRequest } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { ActionExecutor } from './action_executor'; @@ -18,7 +17,7 @@ import { } from '@kbn/core/server/mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/mocks'; import { spacesServiceMock } from '@kbn/spaces-plugin/server/spaces_service/spaces_service.mock'; -import { ActionType as ConnectorType } from '../types'; +import { ActionType as ConnectorType, ConnectorUsageCollector } from '../types'; import { actionsAuthorizationMock, actionsMock } from '../mocks'; import { asBackgroundTaskExecutionSource, @@ -150,6 +149,10 @@ const connectorSavedObject = { references: [], }; +interface ActionUsage { + request_body_bytes: number; +} + const getBaseExecuteStartEventLogDoc = (unsecured: boolean) => { return { event: { @@ -163,6 +166,7 @@ const getBaseExecuteStartEventLogDoc = (unsecured: boolean) => { }, id: CONNECTOR_ID, name: '1', + type_id: 'test', }, ...(unsecured ? {} @@ -190,10 +194,23 @@ const getBaseExecuteStartEventLogDoc = (unsecured: boolean) => { }; }; -const getBaseExecuteEventLogDoc = (unsecured: boolean) => { +const getBaseExecuteEventLogDoc = ( + unsecured: boolean, + actionUsage: ActionUsage = { request_body_bytes: 0 } +) => { const base = getBaseExecuteStartEventLogDoc(unsecured); return { ...base, + kibana: { + ...base.kibana, + action: { + ...base.kibana.action, + execution: { + ...base.kibana.action.execution, + usage: actionUsage, + }, + }, + }, event: { ...base.event, action: 'execute', @@ -211,9 +228,12 @@ const getBaseExecuteEventLogDoc = (unsecured: boolean) => { }; }; +const mockGetRequestBodyByte = jest.spyOn(ConnectorUsageCollector.prototype, 'getRequestBodyByte'); + beforeEach(() => { jest.resetAllMocks(); jest.clearAllMocks(); + mockGetRequestBodyByte.mockReturnValue(0); spacesMock.getSpaceId.mockReturnValue('some-namespace'); loggerMock.get.mockImplementation(() => loggerMock); const mockRealm = { name: 'default_native', type: 'native' }; @@ -237,6 +257,7 @@ describe('Action Executor', () => { const label = executeUnsecure ? 'executes unsecured' : 'executes'; test(`successfully ${label}`, async () => { + mockGetRequestBodyByte.mockReturnValue(300); encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce( connectorSavedObject ); @@ -280,13 +301,15 @@ describe('Action Executor', () => { }, params: { foo: true }, logger: loggerMock, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); expect(loggerMock.debug).toBeCalledWith('executing action test:1: 1'); expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); - const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + const execDoc = getBaseExecuteEventLogDoc(executeUnsecure, { request_body_bytes: 300 }); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, execStartDoc); expect(eventLogger.logEvent).toHaveBeenNthCalledWith(2, execDoc); }); @@ -353,6 +376,7 @@ describe('Action Executor', () => { params: { foo: true }, logger: loggerMock, source: executionSource.source, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); expect(loggerMock.debug).toBeCalledWith('executing action test:1: 1'); @@ -360,6 +384,7 @@ describe('Action Executor', () => { const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { ...execStartDoc, kibana: { @@ -431,6 +456,7 @@ describe('Action Executor', () => { }, params: { foo: true }, logger: loggerMock, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); expect(loggerMock.debug).toBeCalledWith('executing action test:preconfigured: Preconfigured'); @@ -438,6 +464,7 @@ describe('Action Executor', () => { const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { ...execStartDoc, kibana: { @@ -513,6 +540,7 @@ describe('Action Executor', () => { params: { foo: true }, logger: loggerMock, request: {}, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); } @@ -532,6 +560,7 @@ describe('Action Executor', () => { const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { ...execStartDoc, kibana: { @@ -540,6 +569,7 @@ describe('Action Executor', () => { ...execStartDoc.kibana.action, id: 'system-connector-.cases', name: 'System action: .cases', + type_id: '.cases', }, saved_objects: [ { @@ -569,6 +599,7 @@ describe('Action Executor', () => { ...execDoc.kibana.action, id: 'system-connector-.cases', name: 'System action: .cases', + type_id: '.cases', }, saved_objects: [ { @@ -890,6 +921,7 @@ describe('Action Executor', () => { }, params: { foo: true }, logger: loggerMock, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); }); @@ -921,6 +953,7 @@ describe('Action Executor', () => { params: { foo: true }, logger: loggerMock, request: {}, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); }); @@ -989,6 +1022,7 @@ describe('Action Executor', () => { }, params: { foo: true }, logger: loggerMock, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); expect(loggerMock.debug).toBeCalledWith('executing action test:preconfigured: Preconfigured'); @@ -996,6 +1030,7 @@ describe('Action Executor', () => { const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { ...execStartDoc, kibana: { @@ -1026,6 +1061,12 @@ describe('Action Executor', () => { ...execDoc.kibana.action, id: 'preconfigured', name: 'Preconfigured', + execution: { + ...execStartDoc.kibana.action.execution, + usage: { + request_body_bytes: 0, + }, + }, }, saved_objects: [ { @@ -1074,6 +1115,7 @@ describe('Action Executor', () => { params: { foo: true }, logger: loggerMock, request: {}, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); expect(loggerMock.debug).toBeCalledWith( @@ -1083,6 +1125,7 @@ describe('Action Executor', () => { const execStartDoc = getBaseExecuteStartEventLogDoc(executeUnsecure); const execDoc = getBaseExecuteEventLogDoc(executeUnsecure); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { ...execStartDoc, kibana: { @@ -1091,6 +1134,7 @@ describe('Action Executor', () => { ...execStartDoc.kibana.action, id: 'system-connector-.cases', name: 'System action: .cases', + type_id: '.cases', }, saved_objects: [ { @@ -1120,6 +1164,7 @@ describe('Action Executor', () => { ...execDoc.kibana.action, id: 'system-connector-.cases', name: 'System action: .cases', + type_id: '.cases', }, saved_objects: [ { @@ -1290,6 +1335,7 @@ describe('Action Executor', () => { }, params: { foo: true }, logger: loggerMock, + connectorUsageCollector: expect.any(ConnectorUsageCollector), }); } }); @@ -1385,6 +1431,7 @@ describe('Event log', () => { }, name: undefined, id: 'action1', + type_id: 'test', }, alert: { rule: { @@ -1430,6 +1477,7 @@ describe('Event log', () => { }, name: 'action-1', id: '1', + type_id: 'test', }, alert: { rule: { @@ -1483,6 +1531,7 @@ describe('Event log', () => { }, name: 'action-1', id: '1', + type_id: 'test', }, alert: { rule: { @@ -1559,9 +1608,13 @@ describe('Event log', () => { gen_ai: { usage: mockGenAi.usage, }, + usage: { + request_body_bytes: 0, + }, }, name: 'action-1', id: '1', + type_id: '.gen-ai', }, alert: { rule: { @@ -1655,9 +1708,13 @@ describe('Event log', () => { total_tokens: 35, }, }, + usage: { + request_body_bytes: 0, + }, }, name: 'action-1', id: '1', + type_id: '.gen-ai', }, alert: { rule: { diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index 685e18c585ae0..c302b0da3e886 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -23,6 +23,7 @@ import { IEventLogger, SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/se import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server'; import { getErrorSource } from '@kbn/task-manager-plugin/server/task_running'; import { GEN_AI_TOKEN_COUNT_EVENT } from './event_based_telemetry'; +import { ConnectorUsageCollector } from '../usage/connector_usage_collector'; import { getGenAiTokenTracking, shouldTrackGenAiToken } from './gen_ai_token_tracking'; import { validateConfig, @@ -293,6 +294,7 @@ export class ActionExecutor { actionExecutionId, isInMemory: this.actionInfo.isInMemory, ...(source ? { source } : {}), + actionTypeId: this.actionInfo.actionTypeId, }); eventLogger.logEvent(event); @@ -394,6 +396,14 @@ export class ActionExecutor { const { actionTypeId, name, config, secrets } = actionInfo; + const loggerId = actionTypeId.startsWith('.') ? actionTypeId.substring(1) : actionTypeId; + const logger = this.actionExecutorContext!.logger.get(loggerId); + + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: actionId, + }); + if (!this.actionInfo || this.actionInfo.actionId !== actionId) { this.actionInfo = actionInfo; } @@ -434,9 +444,6 @@ export class ActionExecutor { return err.result; } - const loggerId = actionTypeId.startsWith('.') ? actionTypeId.substring(1) : actionTypeId; - const logger = this.actionExecutorContext!.logger.get(loggerId); - if (span) { span.name = `${executeLabel} ${actionTypeId}`; span.addLabels({ @@ -477,6 +484,7 @@ export class ActionExecutor { actionExecutionId, isInMemory: this.actionInfo.isInMemory, ...(source ? { source } : {}), + actionTypeId, }); eventLogger.startTiming(event); @@ -510,6 +518,7 @@ export class ActionExecutor { logger, source, ...(actionType.isSystemActionType ? { request } : {}), + connectorUsageCollector, }); if (rawResult && rawResult.status === 'error') { @@ -548,6 +557,11 @@ export class ActionExecutor { event.user = event.user || {}; event.user.name = currentUser?.username; event.user.id = currentUser?.profile_uid; + set( + event, + 'kibana.action.execution.usage.request_body_bytes', + connectorUsageCollector.getRequestBodyByte() + ); if (result.status === 'ok') { span?.setOutcome('success'); diff --git a/x-pack/plugins/actions/server/lib/axios_utils.test.ts b/x-pack/plugins/actions/server/lib/axios_utils.test.ts index c5e23f6cd3db3..bee09a90ed27b 100644 --- a/x-pack/plugins/actions/server/lib/axios_utils.test.ts +++ b/x-pack/plugins/actions/server/lib/axios_utils.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import axios, { AxiosInstance } from 'axios'; +import axios, { AxiosError, AxiosInstance } from 'axios'; import { Agent as HttpsAgent } from 'https'; import HttpProxyAgent from 'http-proxy-agent'; import { HttpsProxyAgent } from 'https-proxy-agent'; @@ -21,6 +21,7 @@ import { import { loggingSystemMock } from '@kbn/core/server/mocks'; import { actionsConfigMock } from '../actions_config.mock'; import { getCustomAgents } from './get_custom_agents'; +import { ConnectorUsageCollector } from '../usage/connector_usage_collector'; const TestUrl = 'https://elastic.co/foo/bar/baz'; @@ -79,6 +80,80 @@ describe('request', () => { }); }); + test('adds request body bytes from request header on a successful request when connectorUsageCollector is provided', async () => { + const contentLength = 12; + axiosMock.mockImplementation(() => ({ + status: 200, + headers: { 'content-type': 'application/json' }, + data: { incidentId: '123' }, + request: { + headers: { 'Content-Length': contentLength }, + getHeader: () => contentLength, + }, + })); + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + await request({ + axios, + url: '/test', + logger, + data: { test: 12345 }, + configurationUtilities, + connectorUsageCollector, + }); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength); + }); + + test('adds request body bytes from request header on a failed', async () => { + const contentLength = 12; + axiosMock.mockImplementation( + () => + new AxiosError('failed', '500', undefined, { + headers: { 'Content-Length': contentLength }, + }) + ); + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + + try { + await request({ + axios, + url: '/test', + logger, + configurationUtilities, + connectorUsageCollector, + }); + } catch (e) { + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength); + } + }); + + test('adds request body bytes from data when request header does not exist', async () => { + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + const data = { test: 12345 }; + + await request({ + axios, + url: '/test', + logger, + data, + configurationUtilities, + connectorUsageCollector, + }); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe( + Buffer.byteLength(JSON.stringify(data), 'utf8') + ); + }); + test('it have been called with proper proxy agent for a valid url', async () => { configurationUtilities.getProxySettings.mockReturnValue({ proxySSLSettings: { diff --git a/x-pack/plugins/actions/server/lib/axios_utils.ts b/x-pack/plugins/actions/server/lib/axios_utils.ts index 3852f2a33755b..254ad1a36f6e2 100644 --- a/x-pack/plugins/actions/server/lib/axios_utils.ts +++ b/x-pack/plugins/actions/server/lib/axios_utils.ts @@ -17,7 +17,7 @@ import { import { Logger } from '@kbn/core/server'; import { getCustomAgents } from './get_custom_agents'; import { ActionsConfigurationUtilities } from '../actions_config'; -import { SSLSettings } from '../types'; +import { ConnectorUsageCollector, SSLSettings } from '../types'; import { combineHeadersWithBasicAuthHeader } from './get_basic_auth_header'; export const request = async ({ @@ -30,6 +30,7 @@ export const request = async ({ headers, sslOverrides, timeout, + connectorUsageCollector, ...config }: { axios: AxiosInstance; @@ -41,6 +42,7 @@ export const request = async ({ headers?: Record; timeout?: number; sslOverrides?: SSLSettings; + connectorUsageCollector?: ConnectorUsageCollector; } & AxiosRequestConfig): Promise => { if (!isEmpty(axios?.defaults?.baseURL ?? '')) { throw new Error( @@ -64,18 +66,31 @@ export const request = async ({ headers, }); - return await axios(url, { - ...restConfig, - method, - headers: headersWithBasicAuth, - ...(data ? { data } : {}), - // use httpAgent and httpsAgent and set axios proxy: false, to be able to handle fail on invalid certs - httpAgent, - httpsAgent, - proxy: false, - maxContentLength, - timeout: Math.max(settingsTimeout, timeout ?? 0), - }); + try { + const result = await axios(url, { + ...restConfig, + method, + headers: headersWithBasicAuth, + ...(data ? { data } : {}), + // use httpAgent and httpsAgent and set axios proxy: false, to be able to handle fail on invalid certs + httpAgent, + httpsAgent, + proxy: false, + maxContentLength, + timeout: Math.max(settingsTimeout, timeout ?? 0), + }); + + if (connectorUsageCollector) { + connectorUsageCollector.addRequestBodyBytes(result, data); + } + + return result; + } catch (error) { + if (connectorUsageCollector) { + connectorUsageCollector.addRequestBodyBytes(error, data); + } + throw error; + } }; export const patch = async ({ @@ -84,12 +99,14 @@ export const patch = async ({ data, logger, configurationUtilities, + connectorUsageCollector, }: { axios: AxiosInstance; url: string; data: T; logger: Logger; configurationUtilities: ActionsConfigurationUtilities; + connectorUsageCollector?: ConnectorUsageCollector; }): Promise => { return request({ axios, @@ -98,6 +115,7 @@ export const patch = async ({ method: 'patch', data, configurationUtilities, + connectorUsageCollector, }); }; diff --git a/x-pack/plugins/actions/server/lib/connector_token_client.test.ts b/x-pack/plugins/actions/server/lib/connector_token_client.test.ts index baedd2ff07beb..b2b8c7487b475 100644 --- a/x-pack/plugins/actions/server/lib/connector_token_client.test.ts +++ b/x-pack/plugins/actions/server/lib/connector_token_client.test.ts @@ -37,6 +37,7 @@ beforeAll(() => { beforeEach(() => { clock.reset(); jest.resetAllMocks(); + jest.restoreAllMocks(); connectorTokenClient = new ConnectorTokenClient({ unsecuredSavedObjectsClient, encryptedSavedObjectsClient, diff --git a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts index cb6390a4b3335..46f13ae1182ac 100644 --- a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts +++ b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.test.ts @@ -33,6 +33,7 @@ describe('createActionEventLogRecordObject', () => { spaceId: 'default', name: 'test name', actionExecutionId: '123abc', + actionTypeId: '.slack', }) ).toStrictEqual({ '@timestamp': '1970-01-01T00:00:00.000Z', @@ -64,6 +65,7 @@ describe('createActionEventLogRecordObject', () => { }, action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', @@ -92,6 +94,7 @@ describe('createActionEventLogRecordObject', () => { }, ], actionExecutionId: '123abc', + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -118,6 +121,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', @@ -145,6 +149,7 @@ describe('createActionEventLogRecordObject', () => { }, ], actionExecutionId: '123abc', + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -163,6 +168,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', @@ -192,6 +198,7 @@ describe('createActionEventLogRecordObject', () => { ], name: 'test name', actionExecutionId: '123abc', + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -220,6 +227,7 @@ describe('createActionEventLogRecordObject', () => { }, action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', @@ -255,6 +263,7 @@ describe('createActionEventLogRecordObject', () => { }, ], actionExecutionId: '123abc', + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -289,6 +298,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', @@ -319,6 +329,7 @@ describe('createActionEventLogRecordObject', () => { ], actionExecutionId: '123abc', source: asHttpRequestExecutionSource(httpServerMock.createKibanaRequest()), + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -345,6 +356,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { source: 'http_request', @@ -376,6 +388,7 @@ describe('createActionEventLogRecordObject', () => { ], actionExecutionId: '123abc', source: asHttpRequestExecutionSource(httpServerMock.createKibanaRequest()), + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -402,6 +415,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { source: 'http_request', @@ -433,6 +447,7 @@ describe('createActionEventLogRecordObject', () => { ], actionExecutionId: '123abc', isInMemory: true, + actionTypeId: '.slack', }) ).toStrictEqual({ event: { @@ -460,6 +475,7 @@ describe('createActionEventLogRecordObject', () => { ], action: { name: 'test name', + type_id: '.slack', id: '1', execution: { uuid: '123abc', diff --git a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts index 4f8bf08966c59..c3b7a3b35f512 100644 --- a/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts +++ b/x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts @@ -37,6 +37,7 @@ interface CreateActionEventLogRecordParams { relatedSavedObjects?: RelatedSavedObjects; isInMemory?: boolean; source?: ActionExecutionSource; + actionTypeId: string; } export function createActionEventLogRecordObject(params: CreateActionEventLogRecordParams): Event { @@ -54,6 +55,7 @@ export function createActionEventLogRecordObject(params: CreateActionEventLogRec isInMemory, actionId, source, + actionTypeId, } = params; const kibanaAlertRule = { @@ -89,6 +91,7 @@ export function createActionEventLogRecordObject(params: CreateActionEventLogRec action: { ...(name ? { name } : {}), id: actionId, + type_id: actionTypeId, execution: { uuid: actionExecutionId, }, diff --git a/x-pack/plugins/actions/server/sub_action_framework/case.test.ts b/x-pack/plugins/actions/server/sub_action_framework/case.test.ts index 91e2df1972de8..aa32dd8853dba 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/case.test.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/case.test.ts @@ -12,12 +12,14 @@ import { actionsConfigMock } from '../actions_config.mock'; import { actionsMock } from '../mocks'; import { TestCaseConnector } from './mocks'; import { ActionsConfigurationUtilities } from '../actions_config'; +import { ConnectorUsageCollector } from '../usage'; describe('CaseConnector', () => { let logger: MockedLogger; let services: ReturnType; let mockedActionsConfig: jest.Mocked; let service: TestCaseConnector; + let connectorUsageCollector: ConnectorUsageCollector; const pushToServiceIncidentParamsSchema = { name: schema.string(), category: schema.nullable(schema.string()), @@ -57,6 +59,11 @@ describe('CaseConnector', () => { }, pushToServiceIncidentParamsSchema ); + + connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); }); describe('Sub actions', () => { @@ -191,7 +198,7 @@ describe('CaseConnector', () => { describe('pushToService', () => { it('should create an incident if externalId is null', async () => { - const res = await service.pushToService(pushToServiceParams); + const res = await service.pushToService(pushToServiceParams, connectorUsageCollector); expect(res).toEqual({ id: 'create-incident', title: 'Test incident', @@ -201,10 +208,13 @@ describe('CaseConnector', () => { }); it('should update an incident if externalId is not null', async () => { - const res = await service.pushToService({ - incident: { ...pushToServiceParams.incident, externalId: 'test-id' }, - comments: [], - }); + const res = await service.pushToService( + { + incident: { ...pushToServiceParams.incident, externalId: 'test-id' }, + comments: [], + }, + connectorUsageCollector + ); expect(res).toEqual({ id: 'update-incident', @@ -215,13 +225,16 @@ describe('CaseConnector', () => { }); it('should add comments', async () => { - const res = await service.pushToService({ - ...pushToServiceParams, - comments: [ - { comment: 'comment-1', commentId: 'comment-id-1' }, - { comment: 'comment-2', commentId: 'comment-id-2' }, - ], - }); + const res = await service.pushToService( + { + ...pushToServiceParams, + comments: [ + { comment: 'comment-1', commentId: 'comment-id-1' }, + { comment: 'comment-2', commentId: 'comment-id-2' }, + ], + }, + connectorUsageCollector + ); expect(res).toEqual({ id: 'create-incident', @@ -242,11 +255,14 @@ describe('CaseConnector', () => { }); it.each([[undefined], [null]])('should throw if externalId is %p', async (comments) => { - const res = await service.pushToService({ - ...pushToServiceParams, - // @ts-expect-error - comments, - }); + const res = await service.pushToService( + { + ...pushToServiceParams, + // @ts-expect-error + comments, + }, + connectorUsageCollector + ); expect(res).toEqual({ id: 'create-incident', @@ -257,10 +273,13 @@ describe('CaseConnector', () => { }); it('should not add comments if comments are an empty array', async () => { - const res = await service.pushToService({ - ...pushToServiceParams, - comments: [], - }); + const res = await service.pushToService( + { + ...pushToServiceParams, + comments: [], + }, + connectorUsageCollector + ); expect(res).toEqual({ id: 'create-incident', diff --git a/x-pack/plugins/actions/server/sub_action_framework/case.ts b/x-pack/plugins/actions/server/sub_action_framework/case.ts index 24a0512378912..1d942b210dbf9 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/case.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/case.ts @@ -9,22 +9,38 @@ import { schema, Type } from '@kbn/config-schema'; import { ExternalServiceIncidentResponse, PushToServiceResponse } from './types'; import { SubActionConnector } from './sub_action_connector'; import { ServiceParams } from './types'; +import { ConnectorUsageCollector } from '../usage'; export interface CaseConnectorInterface { - addComment: ({ incidentId, comment }: { incidentId: string; comment: string }) => Promise; - createIncident: (incident: Incident) => Promise; - updateIncident: ({ - incidentId, - incident, - }: { - incidentId: string; - incident: Incident; - }) => Promise; - getIncident: ({ id }: { id: string }) => Promise; - pushToService: (params: { - incident: { externalId: string | null } & Incident; - comments: Array<{ commentId: string; comment: string }>; - }) => Promise; + addComment: ( + { incidentId, comment }: { incidentId: string; comment: string }, + connectorUsageCollector: ConnectorUsageCollector + ) => Promise; + createIncident: ( + incident: Incident, + connectorUsageCollector: ConnectorUsageCollector + ) => Promise; + updateIncident: ( + { + incidentId, + incident, + }: { + incidentId: string; + incident: Incident; + }, + connectorUsageCollector: ConnectorUsageCollector + ) => Promise; + getIncident: ( + { id }: { id: string }, + connectorUsageCollector: ConnectorUsageCollector + ) => Promise; + pushToService: ( + params: { + incident: { externalId: string | null } & Incident; + comments: Array<{ commentId: string; comment: string }>; + }, + connectorUsageCollector: ConnectorUsageCollector + ) => Promise; } export abstract class CaseConnector @@ -56,50 +72,71 @@ export abstract class CaseConnector; + public abstract addComment( + { + incidentId, + comment, + }: { + incidentId: string; + comment: string; + }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise; - public abstract createIncident(incident: Incident): Promise; - public abstract updateIncident({ - incidentId, - incident, - }: { - incidentId: string; - incident: Incident; - }): Promise; - public abstract getIncident({ id }: { id: string }): Promise; + public abstract createIncident( + incident: Incident, + connectorUsageCollector: ConnectorUsageCollector + ): Promise; + public abstract updateIncident( + { + incidentId, + incident, + }: { + incidentId: string; + incident: Incident; + }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise; + public abstract getIncident( + { id }: { id: string }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise; - public async pushToService(params: { - incident: { externalId: string | null } & Incident; - comments: Array<{ commentId: string; comment: string }>; - }) { + public async pushToService( + params: { + incident: { externalId: string | null } & Incident; + comments: Array<{ commentId: string; comment: string }>; + }, + connectorUsageCollector: ConnectorUsageCollector + ) { const { incident, comments } = params; const { externalId, ...rest } = incident; let res: PushToServiceResponse; if (externalId != null) { - res = await this.updateIncident({ - incidentId: externalId, - incident: rest as Incident, - }); + res = await this.updateIncident( + { + incidentId: externalId, + incident: rest as Incident, + }, + connectorUsageCollector + ); } else { - res = await this.createIncident(rest as Incident); + res = await this.createIncident(rest as Incident, connectorUsageCollector); } if (comments && Array.isArray(comments) && comments.length > 0) { res.comments = []; for (const currentComment of comments) { - await this.addComment({ - incidentId: res.id, - comment: currentComment.comment, - }); + await this.addComment( + { + incidentId: res.id, + comment: currentComment.comment, + }, + connectorUsageCollector + ); res.comments = [ ...(res.comments ?? []), diff --git a/x-pack/plugins/actions/server/sub_action_framework/executor.test.ts b/x-pack/plugins/actions/server/sub_action_framework/executor.test.ts index 35b1fa43c6ce3..1b8bdf0adcaee 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/executor.test.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/executor.test.ts @@ -21,6 +21,7 @@ import { } from './mocks'; import { IService, ServiceParams } from './types'; import { getErrorSource, TaskErrorSource } from '@kbn/task-manager-plugin/server/task_running'; +import { ConnectorUsageCollector } from '../usage'; describe('Executor', () => { const actionId = 'test-action-id'; @@ -30,6 +31,7 @@ describe('Executor', () => { let logger: MockedLogger; let services: ReturnType; let mockedActionsConfig: jest.Mocked; + let connectorUsageCollector: ConnectorUsageCollector; const createExecutor = (Service: IService) => { const connector = { @@ -55,6 +57,10 @@ describe('Executor', () => { logger = loggingSystemMock.createLogger(); services = actionsMock.createServices(); mockedActionsConfig = actionsConfigMock.create(); + connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); }); it('should execute correctly', async () => { @@ -68,6 +74,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }); expect(res).toEqual({ @@ -90,6 +97,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }); expect(res).toEqual({ @@ -112,6 +120,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }); expect(res).toEqual({ @@ -132,6 +141,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }); expect(res).toEqual({ @@ -153,6 +163,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }) ).rejects.toThrowError('You should register at least one subAction for your connector type'); }); @@ -169,6 +180,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }) ).rejects.toThrowError( 'Sub action "not-exist" is not registered. Connector id: test-action-id. Connector name: Test. Connector type: .test' @@ -187,6 +199,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }); } catch (e) { expect(getErrorSource(e)).toBe(TaskErrorSource.USER); @@ -208,6 +221,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }) ).rejects.toThrowError( 'Method "not-exist" does not exists in service. Sub action: "testUrl". Connector id: test-action-id. Connector name: Test. Connector type: .test' @@ -226,6 +240,7 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }) ).rejects.toThrowError( 'Method "notAFunction" must be a function. Connector id: test-action-id. Connector name: Test. Connector type: .test' @@ -244,9 +259,50 @@ describe('Executor', () => { services, configurationUtilities: mockedActionsConfig, logger, + connectorUsageCollector, }) ).rejects.toThrowError( 'Request validation failed (Error: [id]: expected value of type [string] but got [undefined])' ); }); + + it('Passes connectorUsageCollector to the subAction method as a second param', async () => { + let echoSpy; + + const subActionParams = { id: 'test-id' }; + const connector = { + id: '.test', + name: 'Test', + minimumLicenseRequired: 'basic' as const, + supportedFeatureIds: ['alerting'], + schema: { + config: TestConfigSchema, + secrets: TestSecretsSchema, + }, + getService: (serviceParams: ServiceParams) => { + const service = new TestExecutor(serviceParams); + echoSpy = jest.spyOn(service, 'echo').mockResolvedValue(subActionParams); + return service; + }, + }; + + const executor = buildExecutor({ + configurationUtilities: mockedActionsConfig, + logger, + connector, + }); + + await executor({ + actionId, + params: { subAction: 'echo', subActionParams }, + config, + secrets, + services, + configurationUtilities: mockedActionsConfig, + logger, + connectorUsageCollector, + }); + + expect(echoSpy).toHaveBeenCalledWith(subActionParams, connectorUsageCollector); + }); }); diff --git a/x-pack/plugins/actions/server/sub_action_framework/executor.ts b/x-pack/plugins/actions/server/sub_action_framework/executor.ts index d9f2f693c175d..a8fbcb6e05984 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/executor.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/executor.ts @@ -30,7 +30,15 @@ export const buildExecutor = < logger: Logger; configurationUtilities: ActionsConfigurationUtilities; }): ExecutorType => { - return async ({ actionId, params, config, secrets, services, request }) => { + return async ({ + actionId, + params, + config, + secrets, + services, + request, + connectorUsageCollector, + }) => { const subAction = params.subAction; const subActionParams = params.subActionParams; @@ -88,7 +96,7 @@ export const buildExecutor = < } } - const data = await func.call(service, subActionParams); + const data = await func.call(service, subActionParams, connectorUsageCollector); return { status: 'ok', data: data ?? {}, actionId }; }; }; diff --git a/x-pack/plugins/actions/server/sub_action_framework/mocks.ts b/x-pack/plugins/actions/server/sub_action_framework/mocks.ts index f6c8e86dd5af3..28e4a2abc224e 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/mocks.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/mocks.ts @@ -8,6 +8,7 @@ import { schema, Type, TypeOf } from '@kbn/config-schema'; import { AxiosError } from 'axios'; +import { ConnectorUsageCollector } from '../usage'; import { SubActionConnector } from './sub_action_connector'; import { CaseConnector } from './case'; import { ExternalServiceIncidentResponse, ServiceParams } from './types'; @@ -57,36 +58,54 @@ export class TestSubActionConnector extends SubActionConnector | null }) { - const res = await this.request({ - url, - data, - headers: { 'X-Test-Header': 'test' }, - responseSchema: schema.object({ status: schema.string() }), - }); + public async testUrl( + { url, data = {} }: { url: string; data?: Record | null }, + connectorUsageCollector: ConnectorUsageCollector + ) { + const res = await this.request( + { + url, + data, + headers: { 'X-Test-Header': 'test' }, + responseSchema: schema.object({ status: schema.string() }), + }, + connectorUsageCollector + ); return res; } - public async testData({ data }: { data: Record }) { - const res = await this.request({ - url: 'https://example.com', - data: this.removeNullOrUndefinedFields(data), - headers: { 'X-Test-Header': 'test' }, - responseSchema: schema.object({ status: schema.string() }), - }); + public async testData( + { data }: { data: Record }, + connectorUsageCollector: ConnectorUsageCollector + ) { + const res = await this.request( + { + url: 'https://example.com', + data: this.removeNullOrUndefinedFields(data), + headers: { 'X-Test-Header': 'test' }, + responseSchema: schema.object({ status: schema.string() }), + }, + connectorUsageCollector + ); return res; } - public async testAuth({ headers }: { headers?: Record } = {}) { - const res = await this.request({ - url: 'https://example.com', - data: {}, - auth: { username: 'username', password: 'password' }, - headers: { 'X-Test-Header': 'test', ...headers }, - responseSchema: schema.object({ status: schema.string() }), - }); + public async testAuth( + { headers }: { headers?: Record } = {}, + connectorUsageCollector: ConnectorUsageCollector + ) { + const res = await this.request( + { + url: 'https://example.com', + data: {}, + auth: { username: 'username', password: 'password' }, + headers: { 'X-Test-Header': 'test', ...headers }, + responseSchema: schema.object({ status: schema.string() }), + }, + connectorUsageCollector + ); return res; } diff --git a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.test.ts b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.test.ts index 1358684d86093..ed599c3f30f71 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.test.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.test.ts @@ -13,6 +13,7 @@ import { actionsMock } from '../mocks'; import { TestSubActionConnector } from './mocks'; import { ActionsConfigurationUtilities } from '../actions_config'; import * as utils from '../lib/axios_utils'; +import { ConnectorUsageCollector } from '../usage'; jest.mock('axios'); @@ -43,6 +44,7 @@ describe('SubActionConnector', () => { let services: ReturnType; let mockedActionsConfig: jest.Mocked; let service: TestSubActionConnector; + let connectorUsageCollector: ConnectorUsageCollector; beforeEach(() => { jest.resetAllMocks(); @@ -70,6 +72,11 @@ describe('SubActionConnector', () => { secrets: { username: 'elastic', password: 'changeme' }, services, }); + + connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); }); describe('Sub actions', () => { @@ -85,34 +92,37 @@ describe('SubActionConnector', () => { describe('URL validation', () => { it('removes double slashes correctly', async () => { - await service.testUrl({ url: 'https://example.com//api///test-endpoint' }); + await service.testUrl( + { url: 'https://example.com//api///test-endpoint' }, + connectorUsageCollector + ); expect(requestMock.mock.calls[0][0].url).toBe('https://example.com/api/test-endpoint'); }); it('removes the ending slash correctly', async () => { - await service.testUrl({ url: 'https://example.com/' }); + await service.testUrl({ url: 'https://example.com/' }, connectorUsageCollector); expect(requestMock.mock.calls[0][0].url).toBe('https://example.com'); }); it('throws an error if the url is invalid', async () => { expect.assertions(1); - await expect(async () => service.testUrl({ url: 'invalid-url' })).rejects.toThrow( - 'URL Error: Invalid URL: invalid-url' - ); + await expect(async () => + service.testUrl({ url: 'invalid-url' }, connectorUsageCollector) + ).rejects.toThrow('URL Error: Invalid URL: invalid-url'); }); it('throws an error if the url starts with backslashes', async () => { expect.assertions(1); - await expect(async () => service.testUrl({ url: '//example.com/foo' })).rejects.toThrow( - 'URL Error: Invalid URL: //example.com/foo' - ); + await expect(async () => + service.testUrl({ url: '//example.com/foo' }, connectorUsageCollector) + ).rejects.toThrow('URL Error: Invalid URL: //example.com/foo'); }); it('throws an error if the protocol is not supported', async () => { expect.assertions(1); - await expect(async () => service.testUrl({ url: 'ftp://example.com' })).rejects.toThrow( - 'URL Error: Invalid protocol' - ); + await expect(async () => + service.testUrl({ url: 'ftp://example.com' }, connectorUsageCollector) + ).rejects.toThrow('URL Error: Invalid protocol'); }); it('throws if the host is the URI is not allowed', async () => { @@ -122,15 +132,15 @@ describe('SubActionConnector', () => { throw new Error('URI is not allowed'); }); - await expect(async () => service.testUrl({ url: 'https://example.com' })).rejects.toThrow( - 'error configuring connector action: URI is not allowed' - ); + await expect(async () => + service.testUrl({ url: 'https://example.com' }, connectorUsageCollector) + ).rejects.toThrow('error configuring connector action: URI is not allowed'); }); }); describe('Data', () => { it('sets data to an empty object if the data are null', async () => { - await service.testUrl({ url: 'https://example.com', data: null }); + await service.testUrl({ url: 'https://example.com', data: null }, connectorUsageCollector); expect(requestMock).toHaveBeenCalledTimes(1); const { data } = requestMock.mock.calls[0][0]; @@ -138,7 +148,10 @@ describe('SubActionConnector', () => { }); it('pass data to axios correctly if not null', async () => { - await service.testUrl({ url: 'https://example.com', data: { foo: 'foo' } }); + await service.testUrl( + { url: 'https://example.com', data: { foo: 'foo' } }, + connectorUsageCollector + ); expect(requestMock).toHaveBeenCalledTimes(1); const { data } = requestMock.mock.calls[0][0]; @@ -146,7 +159,10 @@ describe('SubActionConnector', () => { }); it('removeNullOrUndefinedFields: removes null values and undefined values correctly', async () => { - await service.testData({ data: { foo: 'foo', bar: null, baz: undefined } }); + await service.testData( + { data: { foo: 'foo', bar: null, baz: undefined } }, + connectorUsageCollector + ); expect(requestMock).toHaveBeenCalledTimes(1); const { data } = requestMock.mock.calls[0][0]; @@ -167,7 +183,7 @@ describe('SubActionConnector', () => { describe('Fetching', () => { it('fetch correctly', async () => { - const res = await service.testUrl({ url: 'https://example.com' }); + const res = await service.testUrl({ url: 'https://example.com' }, connectorUsageCollector); expect(requestMock).toHaveBeenCalledTimes(1); expect(requestMock).toBeCalledWith({ @@ -181,6 +197,7 @@ describe('SubActionConnector', () => { 'X-Test-Header': 'test', }, url: 'https://example.com', + connectorUsageCollector, }); expect(logger.debug).toBeCalledWith( @@ -192,7 +209,9 @@ describe('SubActionConnector', () => { it('validates the response correctly', async () => { requestMock.mockReturnValue({ data: { invalidField: 'test' } }); - await expect(async () => service.testUrl({ url: 'https://example.com' })).rejects.toThrow( + await expect(async () => + service.testUrl({ url: 'https://example.com' }, connectorUsageCollector) + ).rejects.toThrow( 'Response validation failed (Error: [status]: expected value of type [string] but got [undefined])' ); }); @@ -202,9 +221,9 @@ describe('SubActionConnector', () => { throw createAxiosError(); }); - await expect(async () => service.testUrl({ url: 'https://example.com' })).rejects.toThrow( - 'Message: An error occurred. Code: 500' - ); + await expect(async () => + service.testUrl({ url: 'https://example.com' }, connectorUsageCollector) + ).rejects.toThrow('Message: An error occurred. Code: 500'); expect(logger.debug).toHaveBeenLastCalledWith( 'Request to external service failed. Connector Id: test-id. Connector type: .test. Method: get. URL: https://example.com' @@ -212,7 +231,7 @@ describe('SubActionConnector', () => { }); it('converts auth axios property to a basic auth header if provided', async () => { - await service.testAuth(); + await service.testAuth(undefined, connectorUsageCollector); expect(requestMock).toHaveBeenCalledTimes(1); expect(requestMock).toBeCalledWith({ @@ -227,11 +246,15 @@ describe('SubActionConnector', () => { Authorization: `Basic ${Buffer.from('username:password').toString('base64')}`, }, url: 'https://example.com', + connectorUsageCollector, }); }); it('does not override an authorization header if provided', async () => { - await service.testAuth({ headers: { Authorization: 'Bearer my_token' } }); + await service.testAuth( + { headers: { Authorization: 'Bearer my_token' } }, + connectorUsageCollector + ); expect(requestMock).toHaveBeenCalledTimes(1); expect(requestMock).toBeCalledWith({ @@ -246,6 +269,7 @@ describe('SubActionConnector', () => { Authorization: 'Bearer my_token', }, url: 'https://example.com', + connectorUsageCollector, }); }); }); diff --git a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts index d5ad5391628bc..fe59feab4376b 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts @@ -24,6 +24,7 @@ import { IncomingMessage } from 'http'; import { PassThrough } from 'stream'; import { KibanaRequest } from '@kbn/core-http-server'; import { inspect } from 'util'; +import { ConnectorUsageCollector } from '../usage'; import { assertURL } from './helpers/validators'; import { ActionsConfigurationUtilities } from '../actions_config'; import { SubAction, SubActionRequestParams } from './types'; @@ -130,15 +131,18 @@ export abstract class SubActionConnector { protected abstract getResponseErrorMessage(error: AxiosError): string; - protected async request({ - url, - data, - method = 'get', - responseSchema, - headers, - timeout, - ...config - }: SubActionRequestParams): Promise> { + protected async request( + { + url, + data, + method = 'get', + responseSchema, + headers, + timeout, + ...config + }: SubActionRequestParams, + connectorUsageCollector: ConnectorUsageCollector + ): Promise> { try { this.assertURL(url); this.ensureUriAllowed(url); @@ -160,6 +164,7 @@ export abstract class SubActionConnector { configurationUtilities: this.configurationUtilities, headers: this.getHeaders(auth, headers as AxiosHeaders), timeout, + connectorUsageCollector, }); this.validateResponse(responseSchema, res.data); diff --git a/x-pack/plugins/actions/server/types.ts b/x-pack/plugins/actions/server/types.ts index aa6c7b26cf0ae..487e7630d40f9 100644 --- a/x-pack/plugins/actions/server/types.ts +++ b/x-pack/plugins/actions/server/types.ts @@ -39,11 +39,11 @@ export type ActionTypeSecrets = Record; export type ActionTypeParams = Record; export type ConnectorTokenClientContract = PublicMethodsOf; -import type { ActionExecutionSource } from './lib'; import { Connector, ConnectorWithExtraFindData } from './application/connector/types'; -export type { ActionExecutionSource } from './lib'; - +import type { ActionExecutionSource } from './lib'; export { ActionExecutionSourceType } from './lib'; +import { ConnectorUsageCollector } from './usage'; +export { ConnectorUsageCollector } from './usage'; export interface Services { savedObjectsClient: SavedObjectsClientContract; @@ -88,6 +88,7 @@ export interface ActionTypeExecutorOptions< configurationUtilities: ActionsConfigurationUtilities; source?: ActionExecutionSource; request?: KibanaRequest; + connectorUsageCollector: ConnectorUsageCollector; } export type ActionResult = Connector; diff --git a/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts index 8331f6890486c..066c477947e2c 100644 --- a/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts +++ b/x-pack/plugins/actions/server/unsecured_actions_client/unsecured_actions_client.ts @@ -12,11 +12,8 @@ import { ExecuteOptions, ExecutionResponse, } from '../create_unsecured_execute_function'; -import { - ActionExecutorContract, - asNotificationExecutionSource, - type RelatedSavedObjects, -} from '../lib'; +import { ActionExecutorContract, asNotificationExecutionSource } from '../lib'; +import type { RelatedSavedObjects } from '../lib'; import { ActionTypeExecutorResult, InMemoryConnector } from '../types'; import { asBackgroundTaskExecutionSource } from '../lib/action_execution_source'; import { ConnectorWithExtraFindData } from '../application/connector/types'; diff --git a/x-pack/plugins/actions/server/usage/connector_usage_collector.test.ts b/x-pack/plugins/actions/server/usage/connector_usage_collector.test.ts new file mode 100644 index 0000000000000..dcf071685f24f --- /dev/null +++ b/x-pack/plugins/actions/server/usage/connector_usage_collector.test.ts @@ -0,0 +1,102 @@ +/* + * 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 { ConnectorUsageCollector } from '../types'; +import { AxiosHeaders, AxiosResponse } from 'axios'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; + +describe('ConnectorUsageCollector', () => { + const logger = loggingSystemMock.createLogger(); + + test('it collects requestBodyBytes from response.request.headers', async () => { + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + const data = { test: 'foo' }; + const contentLength = Buffer.byteLength(JSON.stringify(data), 'utf8'); + + const axiosResponse: AxiosResponse = { + data, + status: 200, + statusText: 'OK', + headers: {}, + config: { headers: new AxiosHeaders() }, + request: { + headers: { 'Content-Length': contentLength }, + getHeader: () => contentLength, + }, + }; + + connectorUsageCollector.addRequestBodyBytes(axiosResponse, data); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength); + + connectorUsageCollector.addRequestBodyBytes(axiosResponse, data); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength + contentLength); + }); + test('it collects requestBodyBytes from data when header is is missing', async () => { + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + const data = { test: 'foo' }; + const contentLength = Buffer.byteLength(JSON.stringify(data), 'utf8'); + + const axiosResponse: AxiosResponse = { + data, + status: 200, + statusText: 'OK', + headers: {}, + config: { headers: new AxiosHeaders() }, + request: { + getHeader: () => undefined, + }, + }; + + connectorUsageCollector.addRequestBodyBytes(axiosResponse, data); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength); + + connectorUsageCollector.addRequestBodyBytes(axiosResponse, data); + + expect(connectorUsageCollector.getRequestBodyByte()).toBe(contentLength + contentLength); + }); + + test('it logs an error when the body cannot be stringified ', async () => { + const connectorUsageCollector = new ConnectorUsageCollector({ + logger, + connectorId: 'test-connector-id', + }); + + const data = { + name: 'arun', + }; + + // @ts-ignore + data.foo = data; // this is to force JSON.stringify to throw + + const axiosResponse: AxiosResponse = { + data, + status: 200, + statusText: 'OK', + headers: {}, + config: { headers: new AxiosHeaders() }, + request: { + getHeader: () => undefined, + }, + }; + + connectorUsageCollector.addRequestBodyBytes(axiosResponse, data); + + expect(logger.error).toHaveBeenCalledTimes(1); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining("Request body bytes couldn't be calculated, Error: ") + ); + }); +}); diff --git a/x-pack/plugins/actions/server/usage/connector_usage_collector.ts b/x-pack/plugins/actions/server/usage/connector_usage_collector.ts new file mode 100644 index 0000000000000..542be0ebf7c70 --- /dev/null +++ b/x-pack/plugins/actions/server/usage/connector_usage_collector.ts @@ -0,0 +1,52 @@ +/* + * 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 { AxiosError, AxiosResponse } from 'axios'; +import { Logger } from '@kbn/core/server'; +import { isUndefined } from 'lodash'; + +interface ConnectorUsage { + requestBodyBytes: number; +} + +export class ConnectorUsageCollector { + private connectorId: string; + private usage: ConnectorUsage = { + requestBodyBytes: 0, + }; + + private logger: Logger; + + constructor({ logger, connectorId }: { logger: Logger; connectorId: string }) { + this.logger = logger; + this.connectorId = connectorId; + } + + public addRequestBodyBytes(result?: AxiosError | AxiosResponse, body: string | object = '') { + const contentLength = result?.request?.getHeader('content-length'); + let bytes = 0; + + if (!isUndefined(contentLength)) { + bytes = parseInt(contentLength, 10); + } else { + try { + const sBody = typeof body === 'string' ? body : JSON.stringify(body); + bytes = Buffer.byteLength(sBody, 'utf8'); + } catch (e) { + this.logger.error( + `Request body bytes couldn't be calculated, Error: ${e.message}, connectorId:${this.connectorId}` + ); + } + } + + this.usage.requestBodyBytes = this.usage.requestBodyBytes + bytes; + } + + public getRequestBodyByte() { + return this.usage.requestBodyBytes; + } +} diff --git a/x-pack/plugins/actions/server/usage/index.ts b/x-pack/plugins/actions/server/usage/index.ts index 722ad76014f07..d4faf364b7295 100644 --- a/x-pack/plugins/actions/server/usage/index.ts +++ b/x-pack/plugins/actions/server/usage/index.ts @@ -6,3 +6,4 @@ */ export { registerActionsUsageCollector } from './actions_usage_collector'; +export { ConnectorUsageCollector } from './connector_usage_collector'; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_table/category_table.tsx b/x-pack/plugins/aiops/public/components/log_categorization/category_table/category_table.tsx index 91e18ea7b4421..2a9591bb415a6 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/category_table/category_table.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_table/category_table.tsx @@ -6,7 +6,7 @@ */ import type { FC } from 'react'; -import React, { useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { EuiBasicTableColumn, EuiTableSelectionType } from '@elastic/eui'; import { @@ -16,12 +16,12 @@ import { EuiToolTip, EuiIcon, } from '@elastic/eui'; +import type { Action } from '@elastic/eui/src/components/basic_table/action_types'; import { i18n } from '@kbn/i18n'; import type { UseTableState } from '@kbn/ml-in-memory-table'; import { css } from '@emotion/react'; -import { QUERY_MODE } from '@kbn/aiops-log-pattern-analysis/get_category_query'; import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; import { useEuiTheme } from '../../../hooks/use_eui_theme'; @@ -32,34 +32,36 @@ import type { EventRate } from '../use_categorize_request'; import { ExpandedRow } from './expanded_row'; import { FormattedPatternExamples, FormattedTokens } from '../format_category'; -import type { OpenInDiscover } from './use_open_in_discover'; interface Props { categories: Category[]; eventRate: EventRate; - pinnedCategory: Category | null; - setPinnedCategory: (category: Category | null) => void; - highlightedCategory: Category | null; - setHighlightedCategory: (category: Category | null) => void; + mouseOver?: { + pinnedCategory: Category | null; + setPinnedCategory: (category: Category | null) => void; + highlightedCategory: Category | null; + setHighlightedCategory: (category: Category | null) => void; + }; setSelectedCategories: (category: Category[]) => void; - openInDiscover: OpenInDiscover; tableState: UseTableState; + actions: Array>; enableRowActions?: boolean; displayExamples?: boolean; + selectable?: boolean; + onRenderComplete?: () => void; } export const CategoryTable: FC = ({ categories, eventRate, - pinnedCategory, - setPinnedCategory, - highlightedCategory, - setHighlightedCategory, + mouseOver, setSelectedCategories, - openInDiscover, tableState, + actions, enableRowActions = true, displayExamples = true, + selectable = true, + onRenderComplete, }) => { const euiTheme = useEuiTheme(); const primaryBackgroundColor = useEuiBackgroundColor('primary'); @@ -73,8 +75,6 @@ export const CategoryTable: FC = ({ return categories.some((category) => category.sparkline !== undefined); }, [categories]); - const { labels: openInDiscoverLabels, openFunction: openInDiscoverFunction } = openInDiscover; - const toggleDetails = useCallback( (category: Category) => { const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap }; @@ -134,24 +134,7 @@ export const CategoryTable: FC = ({ }), sortable: false, width: '65px', - actions: [ - { - name: openInDiscoverLabels.singleSelect.in, - description: openInDiscoverLabels.singleSelect.in, - icon: 'plusInCircle', - type: 'icon', - 'data-test-subj': 'aiopsLogPatternsActionFilterInButton', - onClick: (category) => openInDiscoverFunction(QUERY_MODE.INCLUDE, category), - }, - { - name: openInDiscoverLabels.singleSelect.out, - description: openInDiscoverLabels.singleSelect.out, - icon: 'minusInCircle', - type: 'icon', - 'data-test-subj': 'aiopsLogPatternsActionFilterOutButton', - onClick: (category) => openInDiscoverFunction(QUERY_MODE.EXCLUDE, category), - }, - ], + actions, }, ] as Array>; @@ -214,23 +197,29 @@ export const CategoryTable: FC = ({ }); } - const selectionValue: EuiTableSelectionType | undefined = { - selectable: () => true, - onSelectionChange: (selectedItems) => setSelectedCategories(selectedItems), - }; + const selectionValue: EuiTableSelectionType | undefined = selectable + ? { + selectable: () => true, + onSelectionChange: (selectedItems) => setSelectedCategories(selectedItems), + } + : undefined; const getRowStyle = (category: Category) => { + if (mouseOver === undefined) { + return {}; + } + if ( - pinnedCategory && - pinnedCategory.key === category.key && - pinnedCategory.key === category.key + mouseOver.pinnedCategory && + mouseOver.pinnedCategory.key === category.key && + mouseOver.pinnedCategory.key === category.key ) { return { backgroundColor: primaryBackgroundColor, }; } - if (highlightedCategory && highlightedCategory.key === category.key) { + if (mouseOver.highlightedCategory && mouseOver.highlightedCategory.key === category.key) { return { backgroundColor: euiTheme.euiColorLightestShade, }; @@ -251,39 +240,66 @@ export const CategoryTable: FC = ({ }, }); + const chartWrapperRef = useRef(null); + + const renderCompleteListener = useCallback( + (event: Event) => { + if (event.target !== chartWrapperRef.current) { + return; + } + if (typeof onRenderComplete === 'function') { + onRenderComplete(); + } + }, + [onRenderComplete] + ); + + useEffect(() => { + if (!chartWrapperRef.current) { + throw new Error('Reference to the chart wrapper is not set'); + } + const chartWrapper = chartWrapperRef.current; + chartWrapper.addEventListener('renderComplete', renderCompleteListener); + return () => { + chartWrapper.removeEventListener('renderComplete', renderCompleteListener); + }; + }, [renderCompleteListener]); + return ( - - compressed - items={categories} - columns={columns} - selection={selectionValue} - itemId="key" - onTableChange={onTableChange} - pagination={pagination} - sorting={sorting} - data-test-subj="aiopsLogPatternsTable" - itemIdToExpandedRowMap={itemIdToExpandedRowMap} - css={tableStyle} - rowProps={(category) => { - return enableRowActions - ? { - onClick: () => { - if (category.key === pinnedCategory?.key) { - setPinnedCategory(null); - } else { - setPinnedCategory(category); - } - }, - onMouseEnter: () => { - setHighlightedCategory(category); - }, - onMouseLeave: () => { - setHighlightedCategory(null); - }, - style: getRowStyle(category), - } - : undefined; - }} - /> +
+ + compressed + items={categories} + columns={columns} + selection={selectionValue} + itemId="key" + onTableChange={onTableChange} + pagination={pagination} + sorting={sorting} + data-test-subj="aiopsLogPatternsTable" + itemIdToExpandedRowMap={itemIdToExpandedRowMap} + css={tableStyle} + rowProps={(category) => { + return mouseOver + ? { + onClick: () => { + if (category.key === mouseOver.pinnedCategory?.key) { + mouseOver.setPinnedCategory(null); + } else { + mouseOver.setPinnedCategory(category); + } + }, + onMouseEnter: () => { + mouseOver.setHighlightedCategory(category); + }, + onMouseLeave: () => { + mouseOver.setHighlightedCategory(null); + }, + style: getRowStyle(category), + } + : undefined; + }} + /> +
); }; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_table/labels.ts b/x-pack/plugins/aiops/public/components/log_categorization/category_table/labels.ts index 674f7b8da0b60..bc94a5ec6918b 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/category_table/labels.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_table/labels.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; -export function getLabels(isFlyout: boolean) { +export function getLabels(inDiscover: boolean) { const flyoutFilterIn = (single: boolean) => i18n.translate('xpack.aiops.logCategorization.flyout.filterIn', { defaultMessage: 'Filter for {values, plural, one {pattern} other {patterns}}', @@ -38,25 +38,25 @@ export function getLabels(isFlyout: boolean) { }, }); - return isFlyout + return inDiscover ? { multiSelect: { - in: flyoutFilterIn(false), - out: flyoutFilterOut(false), + in: aiopsFilterIn(false), + out: aiopsFilterOut(false), }, singleSelect: { - in: flyoutFilterIn(true), - out: flyoutFilterOut(true), + in: aiopsFilterIn(true), + out: aiopsFilterOut(true), }, } : { multiSelect: { - in: aiopsFilterIn(false), - out: aiopsFilterOut(false), + in: flyoutFilterIn(false), + out: flyoutFilterOut(false), }, singleSelect: { - in: aiopsFilterIn(true), - out: aiopsFilterOut(true), + in: flyoutFilterIn(true), + out: flyoutFilterOut(true), }, }; } diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_table/table_header.tsx b/x-pack/plugins/aiops/public/components/log_categorization/category_table/table_header.tsx index d733c050fc3b8..9157b4994adb4 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/category_table/table_header.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_table/table_header.tsx @@ -58,7 +58,8 @@ export const OpenInDiscoverButtons: FC<{ openInDiscover: OpenInDiscover; showTex openInDiscover, showText = true, }) => { - const { labels, openFunction } = openInDiscover; + const { getLabels, openFunction } = openInDiscover; + const labels = getLabels(false); return ( @@ -67,7 +68,7 @@ export const OpenInDiscoverButtons: FC<{ openInDiscover: OpenInDiscover; showTex openFunction(QUERY_MODE.INCLUDE)} + onClick={() => openFunction(QUERY_MODE.INCLUDE, true)} iconType="plusInCircle" iconSide="left" > @@ -80,7 +81,7 @@ export const OpenInDiscoverButtons: FC<{ openInDiscover: OpenInDiscover; showTex openFunction(QUERY_MODE.EXCLUDE)} + onClick={() => openFunction(QUERY_MODE.EXCLUDE, true)} iconType="minusInCircle" iconSide="left" > diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_actions.tsx b/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_actions.tsx new file mode 100644 index 0000000000000..cb7567743d9ed --- /dev/null +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_actions.tsx @@ -0,0 +1,78 @@ +/* + * 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 } from 'react'; + +import type { Action } from '@elastic/eui/src/components/basic_table/action_types'; + +import { QUERY_MODE } from '@kbn/aiops-log-pattern-analysis/get_category_query'; +import type { Filter } from '@kbn/es-query'; +import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; +import type { DataViewField } from '@kbn/data-views-plugin/common'; +import type { TimefilterContract } from '@kbn/data-plugin/public'; +import type { CategorizationAdditionalFilter } from '@kbn/aiops-log-pattern-analysis/create_category_request'; +import type { LogCategorizationAppState } from '../../../application/url_state/log_pattern_analysis'; +import type { OpenInDiscover } from './use_open_in_discover'; +import { useOpenInDiscover } from './use_open_in_discover'; + +export interface UseActions { + getActions: (navigateToDiscover: boolean) => Array>; + openInDiscover: OpenInDiscover; +} + +export function useActions( + dataViewId: string, + selectedField: DataViewField | string | undefined, + selectedCategories: Category[], + aiopsListState: LogCategorizationAppState, + timefilter: TimefilterContract, + onAddFilter?: (values: Filter, alias?: string) => void, + additionalFilter?: CategorizationAdditionalFilter, + onClose: () => void = () => {} +): UseActions { + const openInDiscover = useOpenInDiscover( + dataViewId, + selectedField ?? undefined, + selectedCategories, + aiopsListState, + timefilter, + onAddFilter, + additionalFilter + ); + + const { getLabels: getOpenInDiscoverLabels, openFunction: openInDiscoverFunction } = + openInDiscover; + + const getActions = useCallback( + (navigateToDiscover: boolean): Array> => { + const openInDiscoverLabels = getOpenInDiscoverLabels(navigateToDiscover); + return [ + { + name: openInDiscoverLabels.singleSelect.in, + description: openInDiscoverLabels.singleSelect.in, + icon: 'plusInCircle', + type: 'icon', + 'data-test-subj': 'aiopsLogPatternsActionFilterInButton', + onClick: (category) => + openInDiscoverFunction(QUERY_MODE.INCLUDE, navigateToDiscover, category), + }, + { + name: openInDiscoverLabels.singleSelect.out, + description: openInDiscoverLabels.singleSelect.out, + icon: 'minusInCircle', + type: 'icon', + 'data-test-subj': 'aiopsLogPatternsActionFilterOutButton', + onClick: (category) => + openInDiscoverFunction(QUERY_MODE.EXCLUDE, navigateToDiscover, category), + }, + ]; + }, + [getOpenInDiscoverLabels, openInDiscoverFunction] + ); + + return { getActions, openInDiscover }; +} diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_open_in_discover.ts b/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_open_in_discover.ts index 963fd6b3a13e8..6a0908fbde725 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_open_in_discover.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_table/use_open_in_discover.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useCallback, useMemo } from 'react'; +import { useCallback } from 'react'; import moment from 'moment'; @@ -20,8 +20,8 @@ import type { LogCategorizationAppState } from '../../../application/url_state/l import { getLabels } from './labels'; export interface OpenInDiscover { - openFunction: (mode: QueryMode, category?: Category) => void; - labels: ReturnType; + openFunction: (mode: QueryMode, navigateToDiscover: boolean, category?: Category) => void; + getLabels: (navigateToDiscover: boolean) => ReturnType; count: number; } @@ -31,7 +31,6 @@ export function useOpenInDiscover( selectedCategories: Category[], aiopsListState: LogCategorizationAppState, timefilter: TimefilterContract, - navigateToDiscover?: boolean, onAddFilter?: (values: Filter, alias?: string) => void, additionalFilter?: CategorizationAdditionalFilter, onClose: () => void = () => {} @@ -39,7 +38,7 @@ export function useOpenInDiscover( const { openInDiscoverWithFilter } = useDiscoverLinks(); const openFunction = useCallback( - (mode: QueryMode, category?: Category) => { + (mode: QueryMode, navigateToDiscover: boolean, category?: Category) => { if ( onAddFilter !== undefined && selectedField !== undefined && @@ -80,7 +79,6 @@ export function useOpenInDiscover( [ onAddFilter, selectedField, - navigateToDiscover, additionalFilter, timefilter, openInDiscoverWithFilter, @@ -91,10 +89,5 @@ export function useOpenInDiscover( ] ); - const labels = useMemo(() => { - const isFlyout = onAddFilter !== undefined && onClose !== undefined; - return getLabels(isFlyout && navigateToDiscover === false); - }, [navigateToDiscover, onAddFilter, onClose]); - - return { openFunction, labels, count: selectedCategories.length }; + return { openFunction, getLabels, count: selectedCategories.length }; } diff --git a/x-pack/plugins/aiops/public/components/log_categorization/category_validation_callout.tsx b/x-pack/plugins/aiops/public/components/log_categorization/category_validation_callout.tsx index 966be3b100e74..b201ef982d6a7 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/category_validation_callout.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/category_validation_callout.tsx @@ -29,6 +29,8 @@ export const FieldValidationCallout: FC = ({ validationResults }) => { return ( = ({ {renderViewModeToggle(data?.categories.length)} - <> - - - {selectedCategories.length > 0 ? ( - - - - ) : null} + + {selectedCategories.length > 0 ? ( - + - -
+ ) : null} + + + + +
+
+ loadCategories()} + minimumTimeRangeOption={minimumTimeRangeOption} + setMinimumTimeRangeOption={setMinimumTimeRangeOption} + categoryCount={data?.totalCategories} + /> +
+ {selectedField !== null && earliest !== undefined && latest !== undefined ? (
- loadCategories()} - minimumTimeRangeOption={minimumTimeRangeOption} - setMinimumTimeRangeOption={setMinimumTimeRangeOption} - categoryCount={data?.totalCategories} +
- {selectedField !== null && earliest !== undefined && latest !== undefined ? ( -
- -
- ) : null} -
-
- - + ) : null} +
+
+
diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx index af40e305f558b..55b63c18081b8 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx @@ -36,9 +36,9 @@ interface Props { reload: () => void; } -const minimumTimeRangeOptions = Object.keys(MINIMUM_TIME_RANGE).map((value) => ({ - inputDisplay: value, - value: value as MinimumTimeRangeOption, +const minimumTimeRangeOptions = Object.entries(MINIMUM_TIME_RANGE).map(([key, { label }]) => ({ + inputDisplay: label, + value: key as MinimumTimeRangeOption, })); export const EmbeddableMenu: FC = ({ @@ -62,7 +62,7 @@ export const EmbeddableMenu: FC = ({ size="s" iconType="controlsHorizontal" onClick={() => togglePopover()} - // @ts-ignore - subdued does work + // @ts-expect-error - subdued does work color="subdued" aria-label={i18n.translate('xpack.aiops.logCategorization.embeddableMenu.aria', { defaultMessage: 'Pattern analysis options', @@ -91,54 +91,11 @@ export const EmbeddableMenu: FC = ({ - - - {i18n.translate( - 'xpack.aiops.logCategorization.embeddableMenu.minimumTimeRangeOptionsRowLabel', - { - defaultMessage: 'Minimum time range', - } - )} - - - - - - - - } - helpText={ - <> - {categoryCount !== undefined && minimumTimeRangeOption !== 'No minimum' ? ( - <> - - - ) : null} - - } - > - - + @@ -147,3 +104,83 @@ export const EmbeddableMenu: FC = ({ ); }; + +interface PatternAnalysisSettingsProps { + minimumTimeRangeOption: MinimumTimeRangeOption; + setMinimumTimeRangeOption: (w: MinimumTimeRangeOption) => void; + categoryCount: number | undefined; + compressed?: boolean; +} + +export const PatternAnalysisSettings: FC = ({ + minimumTimeRangeOption, + setMinimumTimeRangeOption, + categoryCount, + compressed = false, +}) => { + return ( + <> + + + {i18n.translate( + 'xpack.aiops.logCategorization.embeddableMenu.minimumTimeRangeOptionsRowLabel', + { + defaultMessage: 'Minimum time range', + } + )} + + + + + + + + } + helpText={ + <> + {categoryCount !== undefined && minimumTimeRangeOption !== 'No minimum' ? ( + <> + + + ) : ( + + )} + + } + > + + + + ); +}; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/field_selector.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/field_selector.tsx index 1941e2d8148d0..126eb9c53695b 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/field_selector.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/field_selector.tsx @@ -25,17 +25,13 @@ interface Props { fields: DataViewField[]; selectedField: DataViewField | null; setSelectedField: (field: DataViewField) => void; + WarningComponent?: FC; } export const SelectedField: FC = ({ fields, selectedField, setSelectedField }) => { const [showPopover, setShowPopover] = useState(false); const togglePopover = () => setShowPopover(!showPopover); - const fieldOptions = useMemo( - () => fields.map((field) => ({ inputDisplay: field.name, value: field })), - [fields] - ); - const button = ( = ({ fields, selectedField, setSelectedFie button={button} className="unifiedDataTableToolbarControlButton" > - + + + ); +}; + +export const FieldSelector: FC = ({ + fields, + selectedField, + setSelectedField, + WarningComponent, +}) => { + const fieldOptions = useMemo( + () => fields.map((field) => ({ inputDisplay: field.name, value: field })), + [fields] + ); + + const label = i18n.translate( + 'xpack.aiops.logCategorization.embeddableMenu.selectedFieldRowLabel', + { + defaultMessage: 'Selected field', + } + ); + + return ( + <> + {WarningComponent !== undefined ? : null} + + - + ); }; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/index.ts b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/index.ts index 8cc8fcbad313a..cfeafd6bac0ee 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/index.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/index.ts @@ -5,5 +5,5 @@ * 2.0. */ -export { LogCategorizationEmbeddable } from './log_categorization_for_embeddable'; -export { LogCategorizationWrapper } from './log_categorization_wrapper'; +export { LogCategorizationDiscover } from './log_categorization_for_discover'; +export { LogCategorizationDiscoverWrapper } from './log_categorization_for_discover_wrapper'; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover.tsx new file mode 100644 index 0000000000000..27d680fc1769c --- /dev/null +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover.tsx @@ -0,0 +1,470 @@ +/* + * 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 { FC } from 'react'; +import React, { useState, useEffect, useCallback, useMemo } from 'react'; + +import { EuiFlexGroup, EuiFlexItem, EuiSpacer, useEuiPaddingSize } from '@elastic/eui'; + +import type { DataViewField } from '@kbn/data-views-plugin/public'; +import { i18n } from '@kbn/i18n'; +import type { Filter } from '@kbn/es-query'; +import { buildEmptyFilter } from '@kbn/es-query'; +import { usePageUrlState } from '@kbn/ml-url-state'; +import type { FieldValidationResults } from '@kbn/ml-category-validator'; + +import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; + +import type { CategorizationAdditionalFilter } from '@kbn/aiops-log-pattern-analysis/create_category_request'; +import { AIOPS_TELEMETRY_ID } from '@kbn/aiops-common/constants'; +import type { EmbeddablePatternAnalysisInput } from '@kbn/aiops-log-pattern-analysis/embeddable'; +import { css } from '@emotion/react'; +import { useTableState } from '@kbn/ml-in-memory-table/hooks/use_table_state'; +import useMountedState from 'react-use/lib/useMountedState'; +import { + type LogCategorizationPageUrlState, + getDefaultLogCategorizationAppState, +} from '../../../application/url_state/log_pattern_analysis'; +import { createMergedEsQuery } from '../../../application/utils/search_utils'; +import { useData } from '../../../hooks/use_data'; +import { useSearch } from '../../../hooks/use_search'; +import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context'; + +import { useCategorizeRequest } from '../use_categorize_request'; +import type { EventRate } from '../use_categorize_request'; +import { CategoryTable } from '../category_table'; +import { InformationText } from '../information_text'; +import { LoadingCategorization } from '../loading_categorization'; +import { useValidateFieldRequest } from '../use_validate_category_field'; +import { FieldValidationCallout } from '../category_validation_callout'; +import { useMinimumTimeRange } from './use_minimum_time_range'; + +import { createAdditionalConfigHash, createDocumentStatsHash, getMessageField } from '../utils'; +import { DiscoverTabs } from './discover_tabs'; +import { useRandomSamplerStorage } from '../sampling_menu'; +import { useActions } from '../category_table/use_actions'; + +export interface LogCategorizationEmbeddableProps { + input: Readonly; + renderViewModeToggle: (patternCount?: number) => React.ReactElement; +} + +const BAR_TARGET = 20; + +export const LogCategorizationDiscover: FC = ({ + input, + renderViewModeToggle, +}) => { + const { + notifications: { toasts }, + data: { + query: { getState, filterManager }, + }, + uiSettings, + embeddingOrigin, + } = useAiopsAppContext(); + const tablePadding = useEuiPaddingSize('xs'); + + const { dataView, savedSearch } = input; + + const { runValidateFieldRequest, cancelRequest: cancelValidationRequest } = + useValidateFieldRequest(); + const { + getMinimumTimeRange, + cancelRequest: cancelWiderTimeRangeRequest, + minimumTimeRangeOption, + setMinimumTimeRangeOption, + } = useMinimumTimeRange(); + const { filters, query } = useMemo(() => getState(), [getState]); + + const isMounted = useMountedState(); + const randomSamplerStorage = useRandomSamplerStorage(); + const { + runCategorizeRequest, + cancelRequest: cancelCategorizationRequest, + randomSampler, + } = useCategorizeRequest(randomSamplerStorage); + const [stateFromUrl] = usePageUrlState( + 'logCategorization', + getDefaultLogCategorizationAppState({ + searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), + }) + ); + const [selectedCategories, setSelectedCategories] = useState([]); + const [selectedField, setSelectedField] = useState(null); + const [fields, setFields] = useState([]); + const [currentDocumentStatsHash, setCurrentDocumentStatsHash] = useState(null); + const [previousDocumentStatsHash, setPreviousDocumentStatsHash] = useState(0); + const [currentAdditionalConfigsHash, setCurrentAdditionalConfigsHash] = useState( + null + ); + const [previousAdditionalConfigsHash, setPreviousAdditionalConfigsHash] = useState( + null + ); + const [loading, setLoading] = useState(null); + const [eventRate, setEventRate] = useState([]); + const [data, setData] = useState<{ + categories: Category[]; + displayExamples: boolean; + totalCategories: number; + } | null>(null); + const [fieldValidationResult, setFieldValidationResult] = useState( + null + ); + const tableState = useTableState([], 'key'); + + useEffect( + function initFields() { + setCurrentDocumentStatsHash(null); + setSelectedField(null); + setLoading(null); + const { dataViewFields, messageField } = getMessageField(dataView); + setFields(dataViewFields); + setSelectedField(messageField); + }, + [dataView] + ); + + const cancelRequest = useCallback(() => { + cancelWiderTimeRangeRequest(); + cancelValidationRequest(); + cancelCategorizationRequest(); + }, [cancelCategorizationRequest, cancelValidationRequest, cancelWiderTimeRangeRequest]); + + useEffect( + function cancelRequestOnLeave() { + return () => { + cancelRequest(); + }; + }, + [cancelRequest] + ); + + const { searchQuery } = useSearch( + { dataView, savedSearch: savedSearch ?? null }, + stateFromUrl, + true + ); + + const { documentStats, timefilter, earliest, latest, intervalMs, forceRefresh } = useData( + dataView, + 'log_categorization', + searchQuery, + () => {}, + undefined, + undefined, + BAR_TARGET, + false + ); + + const onAddFilter = useCallback( + (values: Filter, alias?: string) => { + const filter = buildEmptyFilter(false, dataView.id); + if (alias) { + filter.meta.alias = alias; + } + filter.query = values.query; + if (typeof input.switchToDocumentView === 'function') { + input.switchToDocumentView().finally(() => { + filterManager.addFilters([filter]); + }); + } + }, + [dataView.id, filterManager, input] + ); + + const { getActions, openInDiscover } = useActions( + dataView.id!, + selectedField ?? undefined, + selectedCategories, + stateFromUrl, + timefilter, + onAddFilter, + undefined + ); + + useEffect( + function createDocumentStatHash() { + if (documentStats.documentCountStats === undefined) { + return; + } + + const hash = createDocumentStatsHash(documentStats); + if (hash !== previousDocumentStatsHash) { + setCurrentDocumentStatsHash(hash); + setData(null); + setFieldValidationResult(null); + } + }, + [documentStats, previousDocumentStatsHash] + ); + + useEffect( + function createAdditionalConfigHash2() { + if (!selectedField?.name) { + return; + } + + const hash = createAdditionalConfigHash([selectedField.name, minimumTimeRangeOption]); + if (hash !== previousAdditionalConfigsHash) { + setCurrentAdditionalConfigsHash(hash); + setData(null); + setFieldValidationResult(null); + } + }, + [minimumTimeRangeOption, previousAdditionalConfigsHash, selectedField] + ); + + const loadCategories = useCallback(async () => { + const { getIndexPattern, timeFieldName: timeField } = dataView; + const index = getIndexPattern(); + + if ( + loading === true || + selectedField === null || + timeField === undefined || + earliest === undefined || + latest === undefined || + minimumTimeRangeOption === undefined || + isMounted() !== true + ) { + return; + } + + cancelRequest(); + + setLoading(true); + setData(null); + setFieldValidationResult(null); + + const additionalFilter: CategorizationAdditionalFilter = { + from: earliest, + to: latest, + }; + + const runtimeMappings = dataView.getRuntimeMappings(); + + try { + const timeRange = await getMinimumTimeRange( + index, + timeField, + additionalFilter, + minimumTimeRangeOption, + searchQuery, + runtimeMappings + ); + + if (isMounted() === false) { + return; + } + + const [validationResult, categorizationResult] = await Promise.all([ + runValidateFieldRequest( + index, + selectedField.name, + timeField, + timeRange, + searchQuery, + runtimeMappings, + { + [AIOPS_TELEMETRY_ID.AIOPS_ANALYSIS_RUN_ORIGIN]: embeddingOrigin, + } + ), + runCategorizeRequest( + index, + selectedField.name, + timeField, + { to: timeRange.to, from: timeRange.from }, + searchQuery, + runtimeMappings, + intervalMs, + timeRange.useSubAgg ? additionalFilter : undefined + ), + ]); + + if (isMounted() === false) { + return; + } + + setFieldValidationResult(validationResult); + const { categories, hasExamples } = categorizationResult; + + if (timeRange.useSubAgg) { + const categoriesInBucket = categorizationResult.categories + .map((category) => ({ + ...category, + count: category.subFieldCount ?? category.subTimeRangeCount!, + examples: category.subFieldExamples!, + sparkline: category.subFieldSparkline, + })) + .filter((category) => category.count > 0) + .sort((a, b) => b.count - a.count); + setData({ + categories: categoriesInBucket, + displayExamples: hasExamples, + totalCategories: categories.length, + }); + } else { + setData({ + categories, + displayExamples: hasExamples, + totalCategories: categories.length, + }); + } + } catch (error) { + if (error.name !== 'AbortError') { + toasts.addError(error, { + title: i18n.translate('xpack.aiops.logCategorization.errorLoadingCategories', { + defaultMessage: 'Error loading categories', + }), + }); + } + } + + if (isMounted() === true) { + setLoading(false); + } + }, [ + dataView, + loading, + selectedField, + earliest, + latest, + minimumTimeRangeOption, + isMounted, + cancelRequest, + getMinimumTimeRange, + searchQuery, + runValidateFieldRequest, + embeddingOrigin, + runCategorizeRequest, + intervalMs, + toasts, + ]); + + useEffect( + function triggerAnalysis() { + const buckets = documentStats.documentCountStats?.buckets; + if (buckets === undefined || currentDocumentStatsHash === null) { + return; + } + + if ( + currentDocumentStatsHash !== previousDocumentStatsHash || + (currentAdditionalConfigsHash !== previousAdditionalConfigsHash && + currentDocumentStatsHash !== null) + ) { + randomSampler.setDocCount(documentStats.totalCount); + setEventRate( + Object.entries(buckets).map(([key, docCount]) => ({ + key: +key, + docCount, + })) + ); + loadCategories(); + setPreviousDocumentStatsHash(currentDocumentStatsHash); + setPreviousAdditionalConfigsHash(currentAdditionalConfigsHash); + } + }, + [ + loadCategories, + randomSampler, + previousDocumentStatsHash, + fieldValidationResult, + currentDocumentStatsHash, + currentAdditionalConfigsHash, + documentStats.documentCountStats?.buckets, + documentStats.totalCount, + previousAdditionalConfigsHash, + ] + ); + + useEffect( + function refreshTriggeredFromButton() { + if (input.lastReloadRequestTime !== undefined) { + setPreviousDocumentStatsHash(0); + setPreviousAdditionalConfigsHash(null); + forceRefresh(); + } + }, + // stop infinite loop from forceRefresh dependency + // eslint-disable-next-line react-hooks/exhaustive-deps + [input.lastReloadRequestTime] + ); + const style = css({ + overflowY: 'auto', + '.kbnDocTableWrapper': { + overflowX: 'hidden', + }, + }); + + const actions = getActions(false); + + return ( + <> + + + + + + + + <> + + {(loading ?? true) === true ? ( + + ) : null} + + {loading === false && + data !== null && + data.categories.length > 0 && + selectedField !== null ? ( + + ) : null} + + + + + + ); +}; + +// eslint-disable-next-line import/no-default-export +export default LogCategorizationDiscover; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx new file mode 100644 index 0000000000000..1af4f03a06bb3 --- /dev/null +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx @@ -0,0 +1,87 @@ +/* + * 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 { FC } from 'react'; +import React, { Suspense } from 'react'; +import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { CoreStart } from '@kbn/core/public'; +import type { LensPublicStart } from '@kbn/lens-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { StorageContextProvider } from '@kbn/ml-local-storage'; + +import { pick } from 'lodash'; +import { UI_SETTINGS } from '@kbn/data-plugin/public'; +import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { AIOPS_STORAGE_KEYS } from '../../../types/storage'; +import type { AiopsAppDependencies } from '../../../hooks/use_aiops_app_context'; +import { AiopsAppContext } from '../../../hooks/use_aiops_app_context'; +import type { LogCategorizationEmbeddableProps } from './log_categorization_for_discover'; +import { LogCategorizationDiscover } from './log_categorization_for_discover'; + +export interface EmbeddableLogCategorizationDeps { + theme: ThemeServiceStart; + data: DataPublicPluginStart; + uiSettings: IUiSettingsClient; + http: CoreStart['http']; + notifications: CoreStart['notifications']; + i18n: CoreStart['i18n']; + lens: LensPublicStart; + fieldFormats: FieldFormatsStart; + application: CoreStart['application']; + charts: ChartsPluginStart; + uiActions: UiActionsStart; +} + +export interface LogCategorizationEmbeddableWrapperProps { + deps: EmbeddableLogCategorizationDeps; + props: LogCategorizationEmbeddableProps; + embeddingOrigin?: string; +} + +const localStorage = new Storage(window.localStorage); + +export const LogCategorizationDiscoverWrapper: FC = ({ + deps, + props, + embeddingOrigin, +}) => { + const I18nContext = deps.i18n.Context; + const aiopsAppContextValue = { + embeddingOrigin, + ...deps, + } as unknown as AiopsAppDependencies; + + const datePickerDeps = { + ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + uiSettingsKeys: UI_SETTINGS, + }; + + return ( + + + + + + + + + + + + ); +}; + +// eslint-disable-next-line import/no-default-export +export default LogCategorizationDiscoverWrapper; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_embeddable.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_embeddable.tsx index 48da76a40f12a..0d4cf093019cd 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_embeddable.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_embeddable.tsx @@ -5,106 +5,96 @@ * 2.0. */ import type { FC } from 'react'; -import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react'; +import { useMemo } from 'react'; +import React, { useState, useEffect, useCallback } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiSpacer, useEuiPaddingSize } from '@elastic/eui'; - -import type { DataViewField } from '@kbn/data-views-plugin/public'; import { i18n } from '@kbn/i18n'; import type { Filter } from '@kbn/es-query'; import { buildEmptyFilter } from '@kbn/es-query'; -import { usePageUrlState } from '@kbn/ml-url-state'; import type { FieldValidationResults } from '@kbn/ml-category-validator'; import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; import type { CategorizationAdditionalFilter } from '@kbn/aiops-log-pattern-analysis/create_category_request'; -import { AIOPS_TELEMETRY_ID } from '@kbn/aiops-common/constants'; import type { EmbeddablePatternAnalysisInput } from '@kbn/aiops-log-pattern-analysis/embeddable'; -import { css } from '@emotion/react'; import { useTableState } from '@kbn/ml-in-memory-table/hooks/use_table_state'; -import { - type LogCategorizationPageUrlState, - getDefaultLogCategorizationAppState, -} from '../../../application/url_state/log_pattern_analysis'; +import { AIOPS_TELEMETRY_ID } from '@kbn/aiops-common/constants'; +import datemath from '@elastic/datemath'; +import useMountedState from 'react-use/lib/useMountedState'; +import { useFilterQueryUpdates } from '../../../hooks/use_filters_query'; +import type { PatternAnalysisProps } from '../../../shared_components/pattern_analysis'; +import { useSearch } from '../../../hooks/use_search'; +import { getDefaultLogCategorizationAppState } from '../../../application/url_state/log_pattern_analysis'; import { createMergedEsQuery } from '../../../application/utils/search_utils'; import { useData } from '../../../hooks/use_data'; -import { useSearch } from '../../../hooks/use_search'; import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context'; import { useCategorizeRequest } from '../use_categorize_request'; import type { EventRate } from '../use_categorize_request'; import { CategoryTable } from '../category_table'; -import { InformationText } from '../information_text'; import { LoadingCategorization } from '../loading_categorization'; import { useValidateFieldRequest } from '../use_validate_category_field'; -import { FieldValidationCallout } from '../category_validation_callout'; import { useMinimumTimeRange } from './use_minimum_time_range'; -import { createAdditionalConfigHash, createDocumentStatsHash, getMessageField } from '../utils'; -import { useOpenInDiscover } from '../category_table/use_open_in_discover'; -import { DiscoverTabs } from './discover_tabs'; +import { FieldValidationCallout } from '../category_validation_callout'; +import { useActions } from '../category_table/use_actions'; +import { InformationText } from '../information_text'; -export interface LogCategorizationEmbeddableProps { - input: Readonly; - renderViewModeToggle: (patternCount?: number) => React.ReactElement; -} +export type LogCategorizationEmbeddableProps = Readonly< + EmbeddablePatternAnalysisInput & PatternAnalysisProps +>; const BAR_TARGET = 20; export const LogCategorizationEmbeddable: FC = ({ - input, - renderViewModeToggle, + dataView, + savedSearch, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, + onChange, + onRenderComplete, + timeRange, + lastReloadRequestTime, }) => { const { notifications: { toasts }, data: { - query: { getState, filterManager }, + query: { filterManager }, }, uiSettings, embeddingOrigin, } = useAiopsAppContext(); - const tablePadding = useEuiPaddingSize('xs'); - const { dataView, savedSearch } = input; + const { filters, query } = useFilterQueryUpdates(); const { runValidateFieldRequest, cancelRequest: cancelValidationRequest } = useValidateFieldRequest(); - const { - getMinimumTimeRange, - cancelRequest: cancelWiderTimeRangeRequest, - minimumTimeRangeOption, - setMinimumTimeRangeOption, - } = useMinimumTimeRange(); - const { filters, query } = useMemo(() => getState(), [getState]); + const { getMinimumTimeRange, cancelRequest: cancelWiderTimeRangeRequest } = useMinimumTimeRange(); - const mounted = useRef(false); + const isMounted = useMountedState(); const { runCategorizeRequest, cancelRequest: cancelCategorizationRequest, randomSampler, - } = useCategorizeRequest(); - const [stateFromUrl] = usePageUrlState( - 'logCategorization', - getDefaultLogCategorizationAppState({ - searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), - }) - ); - const [highlightedCategory, setHighlightedCategory] = useState(null); + } = useCategorizeRequest({ + randomSamplerMode, + setRandomSamplerMode: () => {}, + randomSamplerProbability, + setRandomSamplerProbability: () => {}, + }); + + const appState = getDefaultLogCategorizationAppState({ + searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), + filters, + }); + const { searchQuery } = useSearch({ dataView, savedSearch: savedSearch ?? null }, appState, true); + const [selectedCategories, setSelectedCategories] = useState([]); - const [selectedField, setSelectedField] = useState(null); - const [fields, setFields] = useState([]); - const [currentDocumentStatsHash, setCurrentDocumentStatsHash] = useState(null); - const [previousDocumentStatsHash, setPreviousDocumentStatsHash] = useState(0); - const [currentAdditionalConfigsHash, setCurrentAdditionalConfigsHash] = useState( - null - ); - const [previousAdditionalConfigsHash, setPreviousAdditionalConfigsHash] = useState( - null - ); + const [loading, setLoading] = useState(null); const [eventRate, setEventRate] = useState([]); - const [pinnedCategory, setPinnedCategory] = useState(null); const [data, setData] = useState<{ categories: Category[]; displayExamples: boolean; @@ -117,12 +107,7 @@ export const LogCategorizationEmbeddable: FC = useEffect( function initFields() { - setCurrentDocumentStatsHash(null); - setSelectedField(null); setLoading(null); - const { dataViewFields, messageField } = getMessageField(dataView); - setFields(dataViewFields); - setSelectedField(messageField); }, [dataView] ); @@ -131,24 +116,27 @@ export const LogCategorizationEmbeddable: FC = cancelWiderTimeRangeRequest(); cancelValidationRequest(); cancelCategorizationRequest(); + setLoading(false); }, [cancelCategorizationRequest, cancelValidationRequest, cancelWiderTimeRangeRequest]); useEffect( function cancelRequestOnLeave() { - mounted.current = true; return () => { - mounted.current = false; cancelRequest(); }; }, - [cancelRequest, mounted] + [cancelRequest] ); - const { searchQuery } = useSearch( - { dataView, savedSearch: savedSearch ?? null }, - stateFromUrl, - true - ); + const timeRangeParsed = useMemo(() => { + if (timeRange) { + const min = datemath.parse(timeRange.from); + const max = datemath.parse(timeRange.to); + if (min && max) { + return { min, max }; + } + } + }, [timeRange]); const { documentStats, timefilter, earliest, latest, intervalMs, forceRefresh } = useData( dataView, @@ -158,81 +146,45 @@ export const LogCategorizationEmbeddable: FC = undefined, undefined, BAR_TARGET, - false + false, + timeRangeParsed ); const onAddFilter = useCallback( (values: Filter, alias?: string) => { - if (input.switchToDocumentView === undefined) { - return; - } - const filter = buildEmptyFilter(false, dataView.id); if (alias) { filter.meta.alias = alias; } filter.query = values.query; - input.switchToDocumentView(); filterManager.addFilters([filter]); }, - [dataView.id, filterManager, input] + [dataView.id, filterManager] ); - const openInDiscover = useOpenInDiscover( + const { getActions } = useActions( dataView.id!, - selectedField ?? undefined, + dataView.fields.find((field) => field.name === fieldName), selectedCategories, - stateFromUrl, + appState, timefilter, - false, onAddFilter, undefined ); - useEffect( - function createDocumentStatHash() { - if (documentStats.documentCountStats === undefined) { - return; - } - - const hash = createDocumentStatsHash(documentStats); - if (hash !== previousDocumentStatsHash) { - setCurrentDocumentStatsHash(hash); - setData(null); - setFieldValidationResult(null); - } - }, - [documentStats, previousDocumentStatsHash] - ); - - useEffect( - function createAdditionalConfigHash2() { - if (!selectedField?.name) { - return; - } - - const hash = createAdditionalConfigHash([selectedField.name, minimumTimeRangeOption]); - if (hash !== previousAdditionalConfigsHash) { - setCurrentAdditionalConfigsHash(hash); - setData(null); - setFieldValidationResult(null); - } - }, - [minimumTimeRangeOption, previousAdditionalConfigsHash, selectedField] - ); - const loadCategories = useCallback(async () => { const { getIndexPattern, timeFieldName: timeField } = dataView; const index = getIndexPattern(); if ( loading === true || - selectedField === null || + fieldName === null || + fieldName === undefined || timeField === undefined || earliest === undefined || latest === undefined || minimumTimeRangeOption === undefined || - mounted.current !== true + isMounted() !== true ) { return; } @@ -250,7 +202,7 @@ export const LogCategorizationEmbeddable: FC = const runtimeMappings = dataView.getRuntimeMappings(); try { - const timeRange = await getMinimumTimeRange( + const minTimeRange = await getMinimumTimeRange( index, timeField, additionalFilter, @@ -259,16 +211,16 @@ export const LogCategorizationEmbeddable: FC = runtimeMappings ); - if (mounted.current !== true) { + if (isMounted() !== true) { return; } const [validationResult, categorizationResult] = await Promise.all([ runValidateFieldRequest( index, - selectedField.name, + fieldName, timeField, - timeRange, + minTimeRange, searchQuery, runtimeMappings, { @@ -277,24 +229,24 @@ export const LogCategorizationEmbeddable: FC = ), runCategorizeRequest( index, - selectedField.name, + fieldName, timeField, - { to: timeRange.to, from: timeRange.from }, + { to: minTimeRange.to, from: minTimeRange.from }, searchQuery, runtimeMappings, intervalMs, - timeRange.useSubAgg ? additionalFilter : undefined + minTimeRange.useSubAgg ? additionalFilter : undefined ), ]); - if (mounted.current !== true) { + if (isMounted() !== true) { return; } setFieldValidationResult(validationResult); const { categories, hasExamples } = categorizationResult; - if (timeRange.useSubAgg) { + if (minTimeRange.useSubAgg) { const categoriesInBucket = categorizationResult.categories .map((category) => ({ ...category, @@ -317,9 +269,7 @@ export const LogCategorizationEmbeddable: FC = }); } } catch (error) { - if (error.name === 'AbortError') { - // ignore error - } else { + if (error.name !== 'AbortError') { toasts.addError(error, { title: i18n.translate('xpack.aiops.logCategorization.errorLoadingCategories', { defaultMessage: 'Error loading categories', @@ -328,144 +278,103 @@ export const LogCategorizationEmbeddable: FC = } } - if (mounted.current === true) { + if (isMounted() === true) { setLoading(false); } }, [ + cancelRequest, dataView, - loading, - selectedField, earliest, + embeddingOrigin, + fieldName, + getMinimumTimeRange, + intervalMs, + isMounted, latest, + loading, minimumTimeRangeOption, - cancelRequest, - getMinimumTimeRange, - searchQuery, - runValidateFieldRequest, - embeddingOrigin, runCategorizeRequest, - intervalMs, + runValidateFieldRequest, + searchQuery, toasts, ]); + useEffect( + function setOnChange() { + if (typeof onChange === 'function') { + onChange(data?.categories ?? []); + } + }, + [data, onChange] + ); + useEffect( function triggerAnalysis() { const buckets = documentStats.documentCountStats?.buckets; - if (buckets === undefined || currentDocumentStatsHash === null) { + if (buckets === undefined) { return; } - if ( - currentDocumentStatsHash !== previousDocumentStatsHash || - (currentAdditionalConfigsHash !== previousAdditionalConfigsHash && - currentDocumentStatsHash !== null) - ) { - randomSampler.setDocCount(documentStats.totalCount); - setEventRate( - Object.entries(buckets).map(([key, docCount]) => ({ - key: +key, - docCount, - })) - ); - loadCategories(); - setPreviousDocumentStatsHash(currentDocumentStatsHash); - setPreviousAdditionalConfigsHash(currentAdditionalConfigsHash); - } + randomSampler.setDocCount(documentStats.totalCount); + setEventRate( + Object.entries(buckets).map(([key, docCount]) => ({ + key: +key, + docCount, + })) + ); + + loadCategories(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [ - loadCategories, randomSampler, - previousDocumentStatsHash, - fieldValidationResult, - currentDocumentStatsHash, - currentAdditionalConfigsHash, documentStats.documentCountStats?.buckets, documentStats.totalCount, - previousAdditionalConfigsHash, + dataView.name, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, ] ); useEffect( function refreshTriggeredFromButton() { - if (input.lastReloadRequestTime !== undefined) { - setPreviousDocumentStatsHash(0); - setPreviousAdditionalConfigsHash(null); + if (lastReloadRequestTime !== undefined) { + cancelRequest(); forceRefresh(); } }, // eslint-disable-next-line react-hooks/exhaustive-deps - [input.lastReloadRequestTime] + [lastReloadRequestTime] ); - const style = css({ - overflowY: 'auto', - '.kbnDocTableWrapper': { - overflowX: 'hidden', - }, - }); + + const actions = [...getActions(false), ...getActions(true)]; return ( <> - + {(loading ?? true) === true ? : null} + + - - - - - - <> - - {(loading ?? true) === true ? ( - - ) : null} - - {loading === false && - data !== null && - data.categories.length > 0 && - selectedField !== null ? ( - - ) : null} - - - - + {loading === false && data !== null && data.categories.length > 0 && fieldName !== null ? ( + + ) : null} ); }; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_wrapper.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_wrapper.tsx deleted file mode 100644 index 49a8219bc880a..0000000000000 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_wrapper.tsx +++ /dev/null @@ -1,87 +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 type { FC } from 'react'; -import React, { Suspense } from 'react'; -import type { ThemeServiceStart } from '@kbn/core-theme-browser'; -import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { CoreStart } from '@kbn/core/public'; -import type { LensPublicStart } from '@kbn/lens-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { DatePickerContextProvider } from '@kbn/ml-date-picker'; -import { StorageContextProvider } from '@kbn/ml-local-storage'; - -import { pick } from 'lodash'; -import { UI_SETTINGS } from '@kbn/data-plugin/public'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { AIOPS_STORAGE_KEYS } from '../../../types/storage'; -import type { AiopsAppDependencies } from '../../../hooks/use_aiops_app_context'; -import { AiopsAppContext } from '../../../hooks/use_aiops_app_context'; -import type { LogCategorizationEmbeddableProps } from './log_categorization_for_embeddable'; -import { LogCategorizationEmbeddable } from './log_categorization_for_embeddable'; - -export interface EmbeddableLogCategorizationDeps { - theme: ThemeServiceStart; - data: DataPublicPluginStart; - uiSettings: IUiSettingsClient; - http: CoreStart['http']; - notifications: CoreStart['notifications']; - i18n: CoreStart['i18n']; - lens: LensPublicStart; - fieldFormats: FieldFormatsStart; - application: CoreStart['application']; - charts: ChartsPluginStart; - uiActions: UiActionsStart; -} - -export interface LogCategorizationEmbeddableWrapperProps { - deps: EmbeddableLogCategorizationDeps; - props: LogCategorizationEmbeddableProps; - embeddingOrigin?: string; -} - -const localStorage = new Storage(window.localStorage); - -export const LogCategorizationWrapper: FC = ({ - deps, - props, - embeddingOrigin, -}) => { - const I18nContext = deps.i18n.Context; - const aiopsAppContextValue = { - embeddingOrigin, - ...deps, - } as unknown as AiopsAppDependencies; - - const datePickerDeps = { - ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), - uiSettingsKeys: UI_SETTINGS, - }; - - return ( - - - - - - - - - - - - ); -}; - -// eslint-disable-next-line import/no-default-export -export default LogCategorizationWrapper; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts index 07b5485be7bbd..3380d5e31e833 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts @@ -4,16 +4,52 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { i18n } from '@kbn/i18n'; import type { unitOfTime } from 'moment'; +export const DEFAULT_MINIMUM_TIME_RANGE_OPTION: MinimumTimeRangeOption = 'No minimum'; + export type MinimumTimeRangeOption = 'No minimum' | '1 week' | '1 month' | '3 months' | '6 months'; -type MinimumTimeRange = Record; +type MinimumTimeRange = Record< + MinimumTimeRangeOption, + { label: string; factor: number; unit: unitOfTime.Base } +>; export const MINIMUM_TIME_RANGE: MinimumTimeRange = { - 'No minimum': { factor: 0, unit: 'w' }, - '1 week': { factor: 1, unit: 'w' }, - '1 month': { factor: 1, unit: 'M' }, - '3 months': { factor: 3, unit: 'M' }, - '6 months': { factor: 6, unit: 'M' }, + 'No minimum': { + label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.noMin', { + defaultMessage: 'Use range specified in time selector', + }), + factor: 0, + unit: 'w', + }, + '1 week': { + label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.1week', { + defaultMessage: '1 week', + }), + factor: 1, + unit: 'w', + }, + '1 month': { + label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.1month', { + defaultMessage: '1 month', + }), + factor: 1, + unit: 'M', + }, + '3 months': { + label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.3months', { + defaultMessage: '3 months', + }), + factor: 3, + unit: 'M', + }, + '6 months': { + label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.6months', { + defaultMessage: '6 months', + }), + factor: 6, + unit: 'M', + }, }; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/selected_patterns.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/selected_patterns.tsx index 44c9014c1aee1..ebbe9ed7fb169 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/selected_patterns.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/selected_patterns.tsx @@ -19,7 +19,8 @@ import { QUERY_MODE } from '@kbn/aiops-log-pattern-analysis/get_category_query'; import type { OpenInDiscover } from '../category_table/use_open_in_discover'; export const SelectedPatterns: FC<{ openInDiscover: OpenInDiscover }> = ({ openInDiscover }) => { - const { labels, openFunction } = openInDiscover; + const { getLabels, openFunction } = openInDiscover; + const labels = getLabels(false); const [showMenu, setShowMenu] = useState(false); const togglePopover = () => setShowMenu(!showMenu); @@ -51,14 +52,14 @@ export const SelectedPatterns: FC<{ openInDiscover: OpenInDiscover }> = ({ openI openFunction(QUERY_MODE.INCLUDE)} + onClick={() => openFunction(QUERY_MODE.INCLUDE, false)} > {labels.multiSelect.in} , openFunction(QUERY_MODE.EXCLUDE)} + onClick={() => openFunction(QUERY_MODE.EXCLUDE, false)} > {labels.multiSelect.out} , diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts index 6d32e0902f1c8..50328a2ef345c 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts @@ -15,7 +15,7 @@ import { useStorage } from '@kbn/ml-local-storage'; import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context'; import type { MinimumTimeRangeOption } from './minimum_time_range'; -import { MINIMUM_TIME_RANGE } from './minimum_time_range'; +import { DEFAULT_MINIMUM_TIME_RANGE_OPTION, MINIMUM_TIME_RANGE } from './minimum_time_range'; import type { AiOpsKey, AiOpsStorageMapped } from '../../../types/storage'; import { AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE } from '../../../types/storage'; @@ -54,6 +54,11 @@ export function useMinimumTimeRange() { signal: abortController.current.signal, }); + if (resp.end.epoch === null || resp.start.epoch === null) { + // epoch can be null if no data can be found. + return { ...timeRange, useSubAgg: false }; + } + // the index isn't big enough to get a wider time range const indexTimeRangeMs = resp.end.epoch - resp.start.epoch; if (indexTimeRangeMs < minimumTimeRangeMs) { @@ -80,7 +85,7 @@ export function useMinimumTimeRange() { const [minimumTimeRangeOption, setMinimumTimeRangeOption] = useStorage< AiOpsKey, AiOpsStorageMapped - >(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, '1 week'); + >(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, DEFAULT_MINIMUM_TIME_RANGE_OPTION); const cancelRequest = useCallback(() => { abortController.current.abort(); diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx index 99ce9f88c8d2c..ec61dca179da2 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx @@ -46,13 +46,13 @@ import { useCategorizeRequest } from './use_categorize_request'; import type { EventRate } from './use_categorize_request'; import { CategoryTable } from './category_table'; import { InformationText } from './information_text'; -import { SamplingMenu } from './sampling_menu'; +import { SamplingMenu, useRandomSamplerStorage } from './sampling_menu'; import { LoadingCategorization } from './loading_categorization'; import { useValidateFieldRequest } from './use_validate_category_field'; import { FieldValidationCallout } from './category_validation_callout'; import { CreateCategorizationJobButton } from './create_categorization_job'; import { TableHeader } from './category_table/table_header'; -import { useOpenInDiscover } from './category_table/use_open_in_discover'; +import { useActions } from './category_table/use_actions'; enum SELECTED_TAB { BUCKET, @@ -93,23 +93,21 @@ export const LogCategorizationFlyout: FC = ({ const { filters, query } = useMemo(() => getState(), [getState]); const mounted = useRef(false); + const randomSamplerStorage = useRandomSamplerStorage(); const { runCategorizeRequest, cancelRequest: cancelCategorizationRequest, randomSampler, - } = useCategorizeRequest(); + } = useCategorizeRequest(randomSamplerStorage); const [stateFromUrl] = usePageUrlState( 'logCategorization', getDefaultLogCategorizationAppState({ searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), }) ); - const [highlightedCategory, setHighlightedCategory] = useState(null); const [selectedCategories, setSelectedCategories] = useState([]); - const [selectedSavedSearch /* , setSelectedSavedSearch*/] = useState(savedSearch); const [loading, setLoading] = useState(true); const [eventRate, setEventRate] = useState([]); - const [pinnedCategory, setPinnedCategory] = useState(null); const [data, setData] = useState<{ categories: Category[]; categoriesInBucket: Category[] | null; @@ -139,7 +137,7 @@ export const LogCategorizationFlyout: FC = ({ ); const { searchQueryLanguage, searchString, searchQuery } = useSearch( - { dataView, savedSearch: selectedSavedSearch }, + { dataView, savedSearch }, stateFromUrl, true ); @@ -154,13 +152,12 @@ export const LogCategorizationFlyout: FC = ({ BAR_TARGET ); - const openInDiscover = useOpenInDiscover( + const { getActions, openInDiscover } = useActions( dataView.id!, selectedField, selectedCategories, stateFromUrl, timefilter, - true, undefined, undefined ); @@ -292,6 +289,7 @@ export const LogCategorizationFlyout: FC = ({ randomSampler, ]); + const actions = getActions(true); const infoIconCss = { marginTop: euiTheme.size.m, marginLeft: euiTheme.size.xxs }; return ( @@ -417,15 +415,11 @@ export const LogCategorizationFlyout: FC = ({ : data.categories } eventRate={eventRate} - pinnedCategory={pinnedCategory} - setPinnedCategory={setPinnedCategory} - highlightedCategory={highlightedCategory} - setHighlightedCategory={setHighlightedCategory} enableRowActions={false} displayExamples={data.displayExamples} setSelectedCategories={setSelectedCategories} - openInDiscover={openInDiscover} tableState={tableState} + actions={actions} /> ) : null} 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 5709833d925d9..567201fff0dd2 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 @@ -49,12 +49,12 @@ import { useCategorizeRequest } from './use_categorize_request'; import { CategoryTable } from './category_table'; import { DocumentCountChart } from './document_count_chart'; import { InformationText } from './information_text'; -import { SamplingMenu } from './sampling_menu'; +import { SamplingMenu, useRandomSamplerStorage } from './sampling_menu'; import { useValidateFieldRequest } from './use_validate_category_field'; import { FieldValidationCallout } from './category_validation_callout'; import { createDocumentStatsHash } from './utils'; import { TableHeader } from './category_table/table_header'; -import { useOpenInDiscover } from './category_table/use_open_in_discover'; +import { useActions } from './category_table/use_actions'; const BAR_TARGET = 20; const DEFAULT_SELECTED_FIELD = 'message'; @@ -70,11 +70,12 @@ export const LogCategorizationPage: FC = ({ embeddin } = useAiopsAppContext(); const { dataView, savedSearch } = useDataSource(); + const randomSamplerStorage = useRandomSamplerStorage(); const { runCategorizeRequest, cancelRequest: cancelCategorizationRequest, randomSampler, - } = useCategorizeRequest(); + } = useCategorizeRequest(randomSamplerStorage); const { runValidateFieldRequest, cancelRequest: cancelValidationRequest } = useValidateFieldRequest(); const [stateFromUrl, setUrlState] = usePageUrlState( @@ -159,13 +160,12 @@ export const LogCategorizationPage: FC = ({ embeddin BAR_TARGET ); - const openInDiscover = useOpenInDiscover( + const { getActions, openInDiscover } = useActions( dataView.id!, selectedField, selectedCategories, stateFromUrl, timefilter, - true, undefined, undefined ); @@ -336,6 +336,8 @@ export const LogCategorizationPage: FC = ({ embeddin setUrlState({ field }); }; + const actions = getActions(true); + return ( @@ -435,14 +437,16 @@ export const LogCategorizationPage: FC = ({ embeddin ) : null} diff --git a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/index.ts b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/index.ts index 9959fd531cb9c..ab0b3f54aa40b 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/index.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/index.ts @@ -7,3 +7,4 @@ export { SamplingMenu } from './sampling_menu'; export { RandomSampler } from './random_sampler'; +export { useRandomSamplerStorage, type RandomSamplerStorage } from './use_random_sampler_storage'; diff --git a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler.ts b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler.ts index 72ebd2c95b777..48fc5f3b5f28e 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler.ts @@ -8,6 +8,7 @@ import { BehaviorSubject } from 'rxjs'; import { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils'; import { i18n } from '@kbn/i18n'; +import type { RandomSamplerStorage } from './use_random_sampler_storage'; export const RANDOM_SAMPLER_PROBABILITIES = [ 0.00001, 0.00005, 0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, @@ -68,12 +69,12 @@ export class RandomSampler { private setRandomSamplerModeInStorage: (mode: RandomSamplerOption) => void; private setRandomSamplerProbabilityInStorage: (prob: RandomSamplerProbability) => void; - constructor( - randomSamplerMode: RandomSamplerOption, - setRandomSamplerMode: (mode: RandomSamplerOption) => void, - randomSamplerProbability: RandomSamplerProbability, - setRandomSamplerProbability: (prob: RandomSamplerProbability) => void - ) { + constructor({ + randomSamplerMode, + randomSamplerProbability, + setRandomSamplerMode, + setRandomSamplerProbability, + }: RandomSamplerStorage) { this.mode$.next(randomSamplerMode); this.setRandomSamplerModeInStorage = setRandomSamplerMode; this.probability$.next(randomSamplerProbability); diff --git a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_panel.tsx b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_panel.tsx index 1944039a85e7f..3dab7d6d919da 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_panel.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_panel.tsx @@ -19,11 +19,19 @@ import { RANDOM_SAMPLER_OPTION, RANDOM_SAMPLER_SELECT_OPTIONS } from './random_s interface Props { randomSampler: RandomSampler; + displayProbability?: boolean; calloutPosition?: 'top' | 'bottom'; + compressed?: boolean; reload: () => void; } -export const SamplingPanel: FC = ({ randomSampler, reload, calloutPosition = 'top' }) => { +export const SamplingPanel: FC = ({ + randomSampler, + reload, + displayProbability = true, + calloutPosition = 'top', + compressed = false, +}) => { const samplingProbability = useObservable( randomSampler.getProbability$(), randomSampler.getProbability() @@ -60,6 +68,7 @@ export const SamplingPanel: FC = ({ randomSampler, reload, calloutPositio ) : null} = ({ randomSampler, reload, calloutPositio } )} helpText={ - randomSamplerPreference === RANDOM_SAMPLER_OPTION.ON_AUTOMATIC ? ( + displayProbability && randomSamplerPreference === RANDOM_SAMPLER_OPTION.ON_AUTOMATIC ? ( ) : null } > ; + +export function useRandomSamplerStorage() { + const [randomSamplerMode, setRandomSamplerMode] = useStorage< + AiOpsKey, + AiOpsStorageMapped + >(AIOPS_RANDOM_SAMPLING_MODE_PREFERENCE, RANDOM_SAMPLER_OPTION.ON_AUTOMATIC); + + const [randomSamplerProbability, setRandomSamplerProbability] = useStorage< + AiOpsKey, + AiOpsStorageMapped + >(AIOPS_RANDOM_SAMPLING_PROBABILITY_PREFERENCE, DEFAULT_PROBABILITY); + + return { + randomSamplerMode, + setRandomSamplerMode, + randomSamplerProbability, + setRandomSamplerProbability, + }; +} diff --git a/x-pack/plugins/aiops/public/components/log_categorization/use_categorize_request.ts b/x-pack/plugins/aiops/public/components/log_categorization/use_categorize_request.ts index 6e21ef246329b..1c792c4f484a6 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/use_categorize_request.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/use_categorize_request.ts @@ -10,7 +10,6 @@ import { useRef, useCallback, useMemo } from 'react'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { isRunningResponse } from '@kbn/data-plugin/public'; -import { useStorage } from '@kbn/ml-local-storage'; import { type CategorizationAdditionalFilter, @@ -21,44 +20,22 @@ import type { CatResponse } from '@kbn/aiops-log-pattern-analysis/types'; import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { - type AiOpsKey, - type AiOpsStorageMapped, - AIOPS_RANDOM_SAMPLING_MODE_PREFERENCE, - AIOPS_RANDOM_SAMPLING_PROBABILITY_PREFERENCE, -} from '../../types/storage'; +import type { RandomSamplerStorage } from './sampling_menu'; import { RandomSampler } from './sampling_menu'; -import { RANDOM_SAMPLER_OPTION, DEFAULT_PROBABILITY } from './sampling_menu/random_sampler'; export type EventRate = Array<{ key: number; docCount: number; }>; -export function useCategorizeRequest() { - const [randomSamplerMode, setRandomSamplerMode] = useStorage< - AiOpsKey, - AiOpsStorageMapped - >(AIOPS_RANDOM_SAMPLING_MODE_PREFERENCE, RANDOM_SAMPLER_OPTION.ON_AUTOMATIC); - - const [randomSamplerProbability, setRandomSamplerProbability] = useStorage< - AiOpsKey, - AiOpsStorageMapped - >(AIOPS_RANDOM_SAMPLING_PROBABILITY_PREFERENCE, DEFAULT_PROBABILITY); - +export function useCategorizeRequest(randomSamplerStorage: RandomSamplerStorage) { const { data } = useAiopsAppContext(); const abortController = useRef(new AbortController()); const randomSampler = useMemo( - () => - new RandomSampler( - randomSamplerMode, - setRandomSamplerMode, - randomSamplerProbability, - setRandomSamplerProbability - ), + () => new RandomSampler(randomSamplerStorage), // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx index 38cf611b4bdd1..f6f3ea0f4d9db 100644 --- a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx +++ b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx @@ -104,7 +104,7 @@ export const LogRateAnalysisResultsTable: FC = groupFilter !== undefined ); - const onChange = useCallback((tableSettings) => { + const onChange = useCallback((tableSettings: any) => { if (tableSettings.page) { const { index, size } = tableSettings.page; setPageIndex(index); diff --git a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx index 905ac53b149ca..d69a0fec7200f 100644 --- a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx +++ b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx @@ -247,7 +247,7 @@ export const LogRateAnalysisResultsGroupsTable: FC { + const onChange = useCallback((tableSettings: any) => { if (tableSettings.page) { const { index, size } = tableSettings.page; setPageIndex(index); diff --git a/x-pack/plugins/aiops/public/embeddables/index.ts b/x-pack/plugins/aiops/public/embeddables/index.ts index 2affeffea7799..b7d9ad25951fb 100644 --- a/x-pack/plugins/aiops/public/embeddables/index.ts +++ b/x-pack/plugins/aiops/public/embeddables/index.ts @@ -8,6 +8,7 @@ import type { CoreSetup } from '@kbn/core-lifecycle-browser'; import type { EmbeddableSetup } from '@kbn/embeddable-plugin/public'; import { EMBEDDABLE_CHANGE_POINT_CHART_TYPE } from '@kbn/aiops-change-point-detection/constants'; +import { EMBEDDABLE_PATTERN_ANALYSIS_TYPE } from '@kbn/aiops-log-pattern-analysis/constants'; import type { AiopsPluginStart, AiopsPluginStartDeps } from '../types'; export const registerEmbeddables = ( @@ -18,4 +19,8 @@ export const registerEmbeddables = ( const { getChangePointChartEmbeddableFactory } = await import('./change_point_chart'); return getChangePointChartEmbeddableFactory(core.getStartServices); }); + embeddable.registerReactEmbeddableFactory(EMBEDDABLE_PATTERN_ANALYSIS_TYPE, async () => { + const { getPatternAnalysisEmbeddableFactory } = await import('./pattern_analysis'); + return getPatternAnalysisEmbeddableFactory(core.getStartServices); + }); }; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/embeddable_pattern_analysis_factory.tsx b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/embeddable_pattern_analysis_factory.tsx new file mode 100644 index 0000000000000..e1af6b45ac3f9 --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/embeddable_pattern_analysis_factory.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 { + EMBEDDABLE_PATTERN_ANALYSIS_TYPE, + PATTERN_ANALYSIS_DATA_VIEW_REF_NAME, +} from '@kbn/aiops-log-pattern-analysis/constants'; +import type { Reference } from '@kbn/content-management-utils'; +import type { StartServicesAccessor } from '@kbn/core-lifecycle-browser'; +import { type DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import { DATA_VIEW_SAVED_OBJECT_TYPE } from '@kbn/data-views-plugin/common'; +import type { ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public'; +import { i18n } from '@kbn/i18n'; +import { + apiHasExecutionContext, + fetch$, + initializeTimeRange, + initializeTitles, + useBatchedPublishingSubjects, +} from '@kbn/presentation-publishing'; +import fastIsEqual from 'fast-deep-equal'; +import { cloneDeep } from 'lodash'; +import React, { useMemo } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import { BehaviorSubject, distinctUntilChanged, map, skipWhile } from 'rxjs'; +import { getPatternAnalysisComponent } from '../../shared_components'; +import type { AiopsPluginStart, AiopsPluginStartDeps } from '../../types'; +import { initializePatternAnalysisControls } from './initialize_pattern_analysis_controls'; +import type { + PatternAnalysisEmbeddableApi, + PatternAnalysisEmbeddableRuntimeState, + PatternAnalysisEmbeddableState, +} from './types'; + +export interface EmbeddablePatternAnalysisStartServices { + data: DataPublicPluginStart; +} + +export type EmbeddablePatternAnalysisType = typeof EMBEDDABLE_PATTERN_ANALYSIS_TYPE; + +export const getDependencies = async ( + getStartServices: StartServicesAccessor +) => { + const [ + { http, uiSettings, notifications, ...startServices }, + { lens, data, usageCollection, fieldFormats }, + ] = await getStartServices(); + + return { + http, + uiSettings, + data, + notifications, + lens, + usageCollection, + fieldFormats, + ...startServices, + }; +}; + +export const getPatternAnalysisEmbeddableFactory = ( + getStartServices: StartServicesAccessor +) => { + const factory: ReactEmbeddableFactory< + PatternAnalysisEmbeddableState, + PatternAnalysisEmbeddableRuntimeState, + PatternAnalysisEmbeddableApi + > = { + type: EMBEDDABLE_PATTERN_ANALYSIS_TYPE, + deserializeState: (state) => { + const serializedState = cloneDeep(state.rawState); + // inject the reference + const dataViewIdRef = state.references?.find( + (ref) => ref.name === PATTERN_ANALYSIS_DATA_VIEW_REF_NAME + ); + // if the serializedState already contains a dataViewId, we don't want to overwrite it. (Unsaved state can cause this) + if (dataViewIdRef && serializedState && !serializedState.dataViewId) { + serializedState.dataViewId = dataViewIdRef?.id; + } + return serializedState; + }, + buildEmbeddable: async (state, buildApi, uuid, parentApi) => { + const [coreStart, pluginStart] = await getStartServices(); + + const { http, uiSettings, notifications, ...startServices } = coreStart; + const { lens, data, usageCollection, fieldFormats } = pluginStart; + + const deps = { + http, + uiSettings, + data, + notifications, + lens, + usageCollection, + fieldFormats, + ...startServices, + }; + + const { + api: timeRangeApi, + comparators: timeRangeComparators, + serialize: serializeTimeRange, + } = initializeTimeRange(state); + + const { titlesApi, titleComparators, serializeTitles } = initializeTitles(state); + + const { + patternAnalysisControlsApi, + serializePatternAnalysisChartState, + patternAnalysisControlsComparators, + } = initializePatternAnalysisControls(state); + + const dataLoading = new BehaviorSubject(true); + const blockingError = new BehaviorSubject(undefined); + + const dataViews$ = new BehaviorSubject([ + await deps.data.dataViews.get( + state.dataViewId ?? (await deps.data.dataViews.getDefaultId()) + ), + ]); + + const api = buildApi( + { + ...timeRangeApi, + ...titlesApi, + ...patternAnalysisControlsApi, + getTypeDisplayName: () => + i18n.translate('xpack.aiops.patternAnalysis.typeDisplayName', { + defaultMessage: 'pattern analysis', + }), + isEditingEnabled: () => true, + onEdit: async () => { + try { + const { resolveEmbeddablePatternAnalysisUserInput } = await import( + './resolve_pattern_analysis_config_input' + ); + + const result = await resolveEmbeddablePatternAnalysisUserInput( + coreStart, + pluginStart, + parentApi, + uuid, + false, + patternAnalysisControlsApi, + undefined, + serializePatternAnalysisChartState() + ); + + patternAnalysisControlsApi.updateUserInput(result); + } catch (e) { + return Promise.reject(); + } + }, + dataLoading, + blockingError, + dataViews: dataViews$, + serializeState: () => { + const dataViewId = patternAnalysisControlsApi.dataViewId.getValue(); + const references: Reference[] = dataViewId + ? [ + { + type: DATA_VIEW_SAVED_OBJECT_TYPE, + name: PATTERN_ANALYSIS_DATA_VIEW_REF_NAME, + id: dataViewId, + }, + ] + : []; + return { + rawState: { + timeRange: undefined, + ...serializeTitles(), + ...serializeTimeRange(), + ...serializePatternAnalysisChartState(), + }, + references, + }; + }, + }, + { + ...timeRangeComparators, + ...titleComparators, + ...patternAnalysisControlsComparators, + } + ); + + const PatternAnalysisComponent = getPatternAnalysisComponent(coreStart, pluginStart); + + const onLoading = (v: boolean) => dataLoading.next(v); + const onRenderComplete = () => dataLoading.next(false); + const onError = (error: Error) => blockingError.next(error); + + return { + api, + Component: () => { + if (!apiHasExecutionContext(parentApi)) { + throw new Error('Parent API does not have execution context'); + } + + const [ + dataViewId, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, + ] = useBatchedPublishingSubjects( + api.dataViewId, + api.fieldName, + api.minimumTimeRangeOption, + api.randomSamplerMode, + api.randomSamplerProbability + ); + + const reload$ = useMemo( + () => + fetch$(api).pipe( + skipWhile((fetchContext) => !fetchContext.isReload), + map((fetchContext) => Date.now()) + ), + [] + ); + + const timeRange$ = useMemo( + () => + fetch$(api).pipe( + map((fetchContext) => fetchContext.timeRange), + distinctUntilChanged(fastIsEqual) + ), + [] + ); + + const lastReloadRequestTime = useObservable(reload$, Date.now()); + const timeRange = useObservable(timeRange$, undefined); + + let embeddingOrigin; + if (apiHasExecutionContext(parentApi)) { + embeddingOrigin = parentApi.executionContext.type; + } + + return ( + + ); + }, + }; + }, + }; + + return factory; +}; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/index.ts b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/index.ts new file mode 100644 index 0000000000000..419fcf091f5fd --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/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 { getPatternAnalysisEmbeddableFactory } from './embeddable_pattern_analysis_factory'; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/initialize_pattern_analysis_controls.ts b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/initialize_pattern_analysis_controls.ts new file mode 100644 index 0000000000000..31de22365df7f --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/initialize_pattern_analysis_controls.ts @@ -0,0 +1,66 @@ +/* + * 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 { StateComparators } from '@kbn/presentation-publishing'; +import { BehaviorSubject } from 'rxjs'; +import type { PatternAnalysisComponentApi, PatternAnalysisEmbeddableState } from './types'; + +type PatternAnalysisEmbeddableCustomState = Omit< + PatternAnalysisEmbeddableState, + 'timeRange' | 'title' | 'description' | 'hidePanelTitles' +>; + +export const initializePatternAnalysisControls = (rawState: PatternAnalysisEmbeddableState) => { + const dataViewId = new BehaviorSubject(rawState.dataViewId); + const fieldName = new BehaviorSubject(rawState.fieldName); + const minimumTimeRangeOption = new BehaviorSubject(rawState.minimumTimeRangeOption); + const randomSamplerMode = new BehaviorSubject(rawState.randomSamplerMode); + const randomSamplerProbability = new BehaviorSubject(rawState.randomSamplerProbability); + + const updateUserInput = (update: PatternAnalysisEmbeddableCustomState) => { + dataViewId.next(update.dataViewId); + fieldName.next(update.fieldName); + minimumTimeRangeOption.next(update.minimumTimeRangeOption); + randomSamplerMode.next(update.randomSamplerMode); + randomSamplerProbability.next(update.randomSamplerProbability); + }; + + const serializePatternAnalysisChartState = (): PatternAnalysisEmbeddableCustomState => { + return { + dataViewId: dataViewId.getValue(), + fieldName: fieldName.getValue(), + minimumTimeRangeOption: minimumTimeRangeOption.getValue(), + randomSamplerMode: randomSamplerMode.getValue(), + randomSamplerProbability: randomSamplerProbability.getValue(), + }; + }; + + const patternAnalysisControlsComparators: StateComparators = + { + dataViewId: [dataViewId, (arg) => dataViewId.next(arg)], + fieldName: [fieldName, (arg) => fieldName.next(arg)], + minimumTimeRangeOption: [minimumTimeRangeOption, (arg) => minimumTimeRangeOption.next(arg)], + randomSamplerMode: [randomSamplerMode, (arg) => randomSamplerMode.next(arg)], + randomSamplerProbability: [ + randomSamplerProbability, + (arg) => randomSamplerProbability.next(arg), + ], + }; + + return { + patternAnalysisControlsApi: { + dataViewId, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, + updateUserInput, + } as unknown as PatternAnalysisComponentApi, + serializePatternAnalysisChartState, + patternAnalysisControlsComparators, + }; +}; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx new file mode 100644 index 0000000000000..f44fff343fb50 --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx @@ -0,0 +1,423 @@ +/* + * 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 { + EuiFlyoutHeader, + EuiTitle, + EuiFlyoutBody, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiButton, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiFlyoutFooter, + EuiCallOut, +} from '@elastic/eui'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { i18n } from '@kbn/i18n'; +import type { FC } from 'react'; +import React, { useEffect, useMemo, useState, useCallback } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { pick } from 'lodash'; +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import useObservable from 'react-use/lib/useObservable'; +import type { DataViewField } from '@kbn/data-views-plugin/public'; +import useMountedState from 'react-use/lib/useMountedState'; +import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; +import { DataSourceContextProvider } from '../../hooks/use_data_source'; +import type { PatternAnalysisEmbeddableRuntimeState } from './types'; +import { PatternAnalysisSettings } from '../../components/log_categorization/log_categorization_for_embeddable/embeddable_menu'; +import { RandomSampler } from '../../components/log_categorization/sampling_menu'; +import { + DEFAULT_PROBABILITY, + RANDOM_SAMPLER_OPTION, +} from '../../components/log_categorization/sampling_menu/random_sampler'; +import { + DEFAULT_MINIMUM_TIME_RANGE_OPTION, + type MinimumTimeRangeOption, +} from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range'; +import { getMessageField } from '../../components/log_categorization/utils'; +import { FieldSelector } from '../../components/log_categorization/log_categorization_for_embeddable/field_selector'; +import { SamplingPanel } from '../../components/log_categorization/sampling_menu/sampling_panel'; + +export interface PatternAnalysisInitializerProps { + initialInput?: Partial; + onCreate: (props: PatternAnalysisEmbeddableRuntimeState) => void; + onCancel: () => void; + onPreview: (update: PatternAnalysisEmbeddableRuntimeState) => Promise; + isNewPanel: boolean; +} + +export const PatternAnalysisEmbeddableInitializer: FC = ({ + initialInput, + onCreate, + onCancel, + onPreview, + isNewPanel, +}) => { + const { + unifiedSearch: { + ui: { IndexPatternSelect }, + }, + } = useAiopsAppContext(); + + const [formInput, setFormInput] = useState( + pick( + initialInput ?? { + minimumTimeRangeOption: DEFAULT_MINIMUM_TIME_RANGE_OPTION, + randomSamplerMode: RANDOM_SAMPLER_OPTION.ON_AUTOMATIC, + randomSamplerProbability: DEFAULT_PROBABILITY, + }, + [ + 'dataViewId', + 'fieldName', + 'minimumTimeRangeOption', + 'randomSamplerMode', + 'randomSamplerProbability', + ] + ) as PatternAnalysisEmbeddableRuntimeState + ); + const [isFormValid, setIsFormValid] = useState(true); + + const updatedProps = useMemo(() => { + return { + ...formInput, + title: isPopulatedObject(formInput) + ? i18n.translate('xpack.aiops.embeddablePatternAnalysis.attachmentTitle', { + defaultMessage: 'Pattern analysis: {fieldName}', + values: { + fieldName: formInput.fieldName, + }, + }) + : '', + }; + }, [formInput]); + + useEffect( + function previewChanges() { + if (isFormValid && updatedProps.fieldName !== undefined) { + onPreview(updatedProps); + } + }, + [isFormValid, onPreview, updatedProps] + ); + + const setDataViewId = useCallback( + (dataViewId: string | undefined) => { + setFormInput({ + ...formInput, + dataViewId: dataViewId ?? '', + fieldName: undefined, + }); + setIsFormValid(false); + }, + [formInput] + ); + + return ( + <> + + +

+ {isNewPanel + ? i18n.translate('xpack.aiops.embeddablePatternAnalysis.config.title.new', { + defaultMessage: 'Create pattern analysis', + }) + : i18n.translate('xpack.aiops.embeddablePatternAnalysis.config.title.edit', { + defaultMessage: 'Edit pattern analysis', + })} +

+
+
+ + + + + { + setDataViewId(newId ?? ''); + }} + /> + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export const FormControls: FC<{ + formInput: PatternAnalysisEmbeddableRuntimeState; + onChange: (update: PatternAnalysisEmbeddableRuntimeState) => void; + onValidationChange: (isValid: boolean) => void; +}> = ({ formInput, onChange, onValidationChange }) => { + const dataViewId = formInput.dataViewId; + const { + data: { dataViews }, + } = useAiopsAppContext(); + const [fields, setFields] = useState([]); + const [selectedField, setSelectedField] = useState(null); + const [isDataViewTimeBased, setIsDataViewTimeBased] = useState(true); + + const randomSampler = useMemo(() => { + return new RandomSampler({ + randomSamplerMode: formInput.randomSamplerMode ?? RANDOM_SAMPLER_OPTION.ON_AUTOMATIC, + setRandomSamplerMode: () => {}, + randomSamplerProbability: formInput.randomSamplerProbability ?? DEFAULT_PROBABILITY, + setRandomSamplerProbability: () => {}, + }); + }, [formInput.randomSamplerMode, formInput.randomSamplerProbability]); + const randomSamplerMode = useObservable(randomSampler.getMode$(), randomSampler.getMode()); + const randomSamplerProbability = useObservable( + randomSampler.getProbability$(), + randomSampler.getProbability() + ); + + const isMounted = useMountedState(); + + useEffect( + function initFields() { + if (!dataViewId) { + setFields([]); + setSelectedField(null); + return; + } + + dataViews + .get(dataViewId) + .then((dataView) => { + if (!isMounted()) { + return; + } + const isTimeBased = dataView.isTimeBased(); + setIsDataViewTimeBased(isTimeBased); + if (isTimeBased === false) { + setFields([]); + setSelectedField(null); + return; + } + const { dataViewFields, messageField } = getMessageField(dataView); + setFields(dataViewFields); + const field = dataViewFields.find((f) => f.name === formInput.fieldName); + if (formInput.fieldName === undefined) { + // form input does not contain a field name, select the found message field + setSelectedField(messageField ?? null); + return; + } + // otherwise, select the field from the form input + setSelectedField(field ?? messageField ?? null); + }) + .catch(() => { + setFields([]); + setSelectedField(null); + }); + }, + [dataViewId, dataViews, formInput, isMounted, onChange] + ); + + useEffect( + function validateForm() { + onValidationChange(selectedField !== null && formInput.dataViewId !== undefined); + }, + [selectedField, formInput, onValidationChange] + ); + + useEffect( + function samplerChange() { + onChange({ + ...formInput, + randomSamplerMode, + randomSamplerProbability, + }); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [onChange, randomSamplerMode, randomSamplerProbability] + ); + + useEffect( + function samplerChange() { + if (selectedField === null) { + return; + } + + onChange({ + ...formInput, + fieldName: selectedField.name, + }); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [onChange, selectedField] + ); + + const setMinimumTimeRangeOption = (option: MinimumTimeRangeOption) => { + onChange({ + ...formInput, + minimumTimeRangeOption: option, + }); + }; + + return ( + <> + + + + + + + + + {}} + calloutPosition="bottom" + displayProbability={false} + compressed={true} + /> + + ); +}; + +const TextFieldWarning = () => { + return ( + <> + +

+ {i18n.translate( + 'xpack.aiops.logCategorization.embeddableMenu.textFieldWarning.title.description', + { + defaultMessage: 'Pattern analysis can only be run on data views with a text field.', + } + )} +

+
+ + + ); +}; + +const TimeFieldWarning = () => { + return ( + <> + +

+ {i18n.translate( + 'xpack.aiops.logCategorization.embeddableMenu.timeFieldWarning.title.description', + { + defaultMessage: 'Pattern analysis can only be run on data views with a time field.', + } + )} +

+
+ + + ); +}; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysys_component_wrapper.tsx b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysys_component_wrapper.tsx new file mode 100644 index 0000000000000..ebdac78e00c5c --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysys_component_wrapper.tsx @@ -0,0 +1,75 @@ +/* + * 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 { FC } from 'react'; +import React from 'react'; +import { useDataSource } from '../../hooks/use_data_source'; +import type { PatternAnalysisProps } from '../../shared_components/pattern_analysis'; +import LogCategorizationEmbeddable from '../../components/log_categorization/log_categorization_for_embeddable/log_categorization_for_embeddable'; + +/** + * Grid component wrapper for embeddable. + * + * @param fieldName + * @param minimumTimeRangeOption + * @param randomSamplerMode + * @param randomSamplerProbability + * @param lastReloadRequestTime + * @param onError + * @param onLoading + * @param onRenderComplete + * @param onChange + * @param emptyState + * @param timeRange + * @constructor + */ +export const PatternAnalysisEmbeddableWrapper: FC = ({ + dataViewId, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, + lastReloadRequestTime, + onError, + onLoading, + onRenderComplete, + onChange, + emptyState, + timeRange, +}) => { + const { dataView } = useDataSource(); + + if (dataView.id !== dataViewId) { + return null; + } + + return ( +
+ +
+ ); +}; diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/resolve_pattern_analysis_config_input.tsx b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/resolve_pattern_analysis_config_input.tsx new file mode 100644 index 0000000000000..e1345526bf25d --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/resolve_pattern_analysis_config_input.tsx @@ -0,0 +1,103 @@ +/* + * 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 { CoreStart } from '@kbn/core/public'; +import { tracksOverlays } from '@kbn/presentation-containers'; +import { toMountPoint } from '@kbn/react-kibana-mount'; +import React from 'react'; +import type { AiopsAppDependencies } from '../..'; +import { AiopsAppContext } from '../../hooks/use_aiops_app_context'; +import type { AiopsPluginStartDeps } from '../../types'; +import { PatternAnalysisEmbeddableInitializer } from './pattern_analysis_initializer'; +import type { PatternAnalysisComponentApi, PatternAnalysisEmbeddableState } from './types'; + +export async function resolveEmbeddablePatternAnalysisUserInput( + coreStart: CoreStart, + pluginStart: AiopsPluginStartDeps, + parentApi: unknown, + focusedPanelId: string, + isNewPanel: boolean, + patternAnalysisControlsApi: PatternAnalysisComponentApi, + deletePanel?: () => void, + initialState?: PatternAnalysisEmbeddableState +): Promise { + const { overlays } = coreStart; + + const overlayTracker = tracksOverlays(parentApi) ? parentApi : undefined; + + let hasChanged = false; + return new Promise(async (resolve, reject) => { + try { + const cancelChanges = () => { + if (isNewPanel && deletePanel) { + deletePanel(); + } else if (hasChanged && patternAnalysisControlsApi && initialState) { + // Reset to initialState in case user has changed the preview state + patternAnalysisControlsApi.updateUserInput(initialState); + } + + flyoutSession.close(); + overlayTracker?.clearOverlays(); + }; + + const update = async (nextUpdate: PatternAnalysisEmbeddableState) => { + resolve(nextUpdate); + flyoutSession.close(); + overlayTracker?.clearOverlays(); + }; + + const preview = async (nextUpdate: PatternAnalysisEmbeddableState) => { + if (patternAnalysisControlsApi) { + patternAnalysisControlsApi.updateUserInput(nextUpdate); + hasChanged = true; + } + }; + + const flyoutSession = overlays.openFlyout( + toMountPoint( + + + , + coreStart + ), + { + ownFocus: true, + size: 's', + type: 'push', + paddingSize: 'm', + hideCloseButton: true, + 'data-test-subj': 'aiopsPatternAnalysisEmbeddableInitializer', + 'aria-labelledby': 'patternAnalysisConfig', + onClose: () => { + reject(); + flyoutSession.close(); + overlayTracker?.clearOverlays(); + }, + } + ); + + if (tracksOverlays(parentApi)) { + parentApi.openOverlay(flyoutSession, { focusedPanelId }); + } + } catch (error) { + reject(error); + } + }); +} diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/types.ts b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/types.ts new file mode 100644 index 0000000000000..f78934b9075f1 --- /dev/null +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/types.ts @@ -0,0 +1,62 @@ +/* + * 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 { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public'; +import type { + HasEditCapabilities, + PublishesDataViews, + PublishesTimeRange, + PublishingSubject, + SerializedTimeRange, + SerializedTitles, +} from '@kbn/presentation-publishing'; +import type { FC } from 'react'; +import type { MinimumTimeRangeOption } from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range'; +import type { + RandomSamplerOption, + RandomSamplerProbability, +} from '../../components/log_categorization/sampling_menu/random_sampler'; + +export type ViewComponent = FC<{ + interval: string; + onRenderComplete?: () => void; +}>; + +export interface PatternAnalysisComponentApi { + dataViewId: PublishingSubject; + fieldName: PublishingSubject; + minimumTimeRangeOption: PublishingSubject< + PatternAnalysisEmbeddableState['minimumTimeRangeOption'] + >; + randomSamplerMode: PublishingSubject; + randomSamplerProbability: PublishingSubject< + PatternAnalysisEmbeddableState['randomSamplerProbability'] + >; + updateUserInput: (update: PatternAnalysisEmbeddableState) => void; +} + +export type PatternAnalysisEmbeddableApi = DefaultEmbeddableApi & + HasEditCapabilities & + PublishesDataViews & + PublishesTimeRange & + PatternAnalysisComponentApi; + +export interface PatternAnalysisEmbeddableState extends SerializedTitles, SerializedTimeRange { + dataViewId: string; + fieldName: string | undefined; + minimumTimeRangeOption: MinimumTimeRangeOption; + randomSamplerMode: RandomSamplerOption; + randomSamplerProbability: RandomSamplerProbability; +} + +export interface PatternAnalysisEmbeddableInitialState + extends SerializedTitles, + SerializedTimeRange { + dataViewId?: string; +} + +export type PatternAnalysisEmbeddableRuntimeState = PatternAnalysisEmbeddableState; diff --git a/x-pack/plugins/aiops/public/hooks/use_filters_query.test.tsx b/x-pack/plugins/aiops/public/hooks/use_filters_query.test.tsx index 2f45f627495b8..bfea21f9e8bbc 100644 --- a/x-pack/plugins/aiops/public/hooks/use_filters_query.test.tsx +++ b/x-pack/plugins/aiops/public/hooks/use_filters_query.test.tsx @@ -8,6 +8,7 @@ import { FilterQueryContextProvider, useFilterQueryUpdates } from './use_filters_query'; import { act, renderHook } from '@testing-library/react-hooks'; import { dataPluginMock as mockDataPlugin } from '@kbn/data-plugin/public/mocks'; +import type { TimefilterConfig } from '@kbn/data-plugin/public/query'; import { Timefilter } from '@kbn/data-plugin/public/query'; import { useAiopsAppContext } from './use_aiops_app_context'; import { useReload } from './use_reload'; @@ -43,9 +44,10 @@ describe('useFilterQueryUpdates', () => { test('provides correct search bounds for relative time range on each reload', async () => { const mockDataContract = mockDataPlugin.createStartContract(); - const mockTimefilterConfig = { + const mockTimefilterConfig: TimefilterConfig = { timeDefaults: { from: 'now-15m', to: 'now' }, refreshIntervalDefaults: { pause: false, value: 0 }, + minRefreshIntervalDefault: 1000, }; useAiopsAppContext().data.query.timefilter.timefilter = new Timefilter( diff --git a/x-pack/plugins/aiops/public/plugin.tsx b/x-pack/plugins/aiops/public/plugin.tsx index 7d55c3098cfaf..ceb378b0f29bf 100755 --- a/x-pack/plugins/aiops/public/plugin.tsx +++ b/x-pack/plugins/aiops/public/plugin.tsx @@ -72,7 +72,7 @@ export class AiopsPlugin PatternAnalysisComponent: dynamic( async () => import( - './components/log_categorization/log_categorization_for_embeddable/log_categorization_wrapper' + './components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper' ) ), }; diff --git a/x-pack/plugins/aiops/public/shared_components/index.tsx b/x-pack/plugins/aiops/public/shared_components/index.tsx index 3e19cfda3b844..1c5b85c4b79b6 100644 --- a/x-pack/plugins/aiops/public/shared_components/index.tsx +++ b/x-pack/plugins/aiops/public/shared_components/index.tsx @@ -10,6 +10,7 @@ import { dynamic } from '@kbn/shared-ux-utility'; import type { CoreStart } from '@kbn/core-lifecycle-browser'; import type { AiopsPluginStartDeps } from '../types'; import type { ChangePointDetectionSharedComponent } from './change_point_detection'; +import type { PatternAnalysisSharedComponent } from './pattern_analysis'; const ChangePointDetectionLazy = dynamic(async () => import('./change_point_detection')); @@ -23,3 +24,16 @@ export const getChangePointDetectionComponent = ( }; export type { ChangePointDetectionSharedComponent } from './change_point_detection'; + +const PatternAnalysisLazy = dynamic(async () => import('./pattern_analysis')); + +export const getPatternAnalysisComponent = ( + coreStart: CoreStart, + pluginStart: AiopsPluginStartDeps +): PatternAnalysisSharedComponent => { + return React.memo((props) => { + return ; + }); +}; + +export type { PatternAnalysisSharedComponent } from './pattern_analysis'; diff --git a/x-pack/plugins/aiops/public/shared_components/pattern_analysis.tsx b/x-pack/plugins/aiops/public/shared_components/pattern_analysis.tsx new file mode 100644 index 0000000000000..af474f4f5ef3e --- /dev/null +++ b/x-pack/plugins/aiops/public/shared_components/pattern_analysis.tsx @@ -0,0 +1,172 @@ +/* + * 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 { EMBEDDABLE_ORIGIN } from '@kbn/aiops-common/constants'; +import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; +import type { CoreStart } from '@kbn/core-lifecycle-browser'; +import { UI_SETTINGS } from '@kbn/data-service'; +import type { TimeRange } from '@kbn/es-query'; +import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; +import { pick } from 'lodash'; +import React, { useEffect, useMemo, useState, type FC } from 'react'; +import type { Observable } from 'rxjs'; +import { BehaviorSubject, combineLatest, distinctUntilChanged, map } from 'rxjs'; +import type { MinimumTimeRangeOption } from '../components/log_categorization/log_categorization_for_embeddable/minimum_time_range'; +import type { + RandomSamplerOption, + RandomSamplerProbability, +} from '../components/log_categorization/sampling_menu/random_sampler'; +import { PatternAnalysisEmbeddableWrapper } from '../embeddables/pattern_analysis/pattern_analysys_component_wrapper'; +import { AiopsAppContext, type AiopsAppDependencies } from '../hooks/use_aiops_app_context'; +import { DataSourceContextProvider } from '../hooks/use_data_source'; +import { FilterQueryContextProvider } from '../hooks/use_filters_query'; +import { ReloadContextProvider } from '../hooks/use_reload'; +import type { AiopsPluginStartDeps } from '../types'; + +/** + * Only used to initialize internally + */ +export type PatternAnalysisPropsWithDeps = PatternAnalysisProps & { + coreStart: CoreStart; + pluginStart: AiopsPluginStartDeps; +}; + +export type PatternAnalysisSharedComponent = FC; + +export interface PatternAnalysisProps { + dataViewId: string; + timeRange: TimeRange; + fieldName: string | undefined; + minimumTimeRangeOption: MinimumTimeRangeOption; + randomSamplerMode: RandomSamplerOption; + randomSamplerProbability: RandomSamplerProbability; + /** + * Component to render if there are no patterns found + */ + emptyState?: React.ReactElement; + /** + * Outputs the most recent patterns data + */ + onChange?: (patterns: Category[]) => void; + /** + * Last reload request time, can be used for manual reload + */ + lastReloadRequestTime?: number; + /** Origin of the embeddable instance */ + embeddingOrigin?: string; + onLoading: (isLoading: boolean) => void; + onRenderComplete: () => void; + onError: (error: Error) => void; +} + +const PatternAnalysisWrapper: FC = ({ + // Component dependencies + coreStart, + pluginStart, + // Component props + dataViewId, + timeRange, + fieldName, + minimumTimeRangeOption, + randomSamplerMode, + randomSamplerProbability, + onLoading, + onError, + onRenderComplete, + embeddingOrigin, + lastReloadRequestTime, + onChange, +}) => { + const deps = useMemo(() => { + const { http, uiSettings, notifications, ...startServices } = coreStart; + const { lens, data, usageCollection, fieldFormats, charts } = pluginStart; + + return { + http, + uiSettings, + data, + notifications, + lens, + usageCollection, + fieldFormats, + charts, + ...startServices, + }; + }, [coreStart, pluginStart]); + + const datePickerDeps = { + ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + uiSettingsKeys: UI_SETTINGS, + }; + + const aiopsAppContextValue = useMemo(() => { + return { + embeddingOrigin: embeddingOrigin ?? EMBEDDABLE_ORIGIN, + ...deps, + } as unknown as AiopsAppDependencies; + }, [deps, embeddingOrigin]); + + const [manualReload$] = useState>( + new BehaviorSubject(lastReloadRequestTime ?? Date.now()) + ); + + useEffect( + function updateManualReloadSubject() { + if (!lastReloadRequestTime) return; + manualReload$.next(lastReloadRequestTime); + }, + [lastReloadRequestTime, manualReload$] + ); + + const resultObservable$ = useMemo>(() => { + return combineLatest([manualReload$]).pipe( + map(([manualReload]) => Math.max(manualReload)), + distinctUntilChanged() + ); + }, [manualReload$]); + + // TODO: Remove data-shared-item as part of https://github.com/elastic/kibana/issues/179376> + return ( +
+ + + + + + + + + + + + + +
+ ); +}; + +// eslint-disable-next-line import/no-default-export +export default PatternAnalysisWrapper; diff --git a/x-pack/plugins/aiops/public/types/index.ts b/x-pack/plugins/aiops/public/types/index.ts index 9150c9b983f84..561c91b178eac 100644 --- a/x-pack/plugins/aiops/public/types/index.ts +++ b/x-pack/plugins/aiops/public/types/index.ts @@ -22,7 +22,7 @@ import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { ChangePointDetectionSharedComponent } from '../shared_components'; -import type { LogCategorizationEmbeddableWrapperProps } from '../components/log_categorization/log_categorization_for_embeddable/log_categorization_wrapper'; +import type { LogCategorizationEmbeddableWrapperProps } from '../components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper'; export interface AiopsPluginSetupDeps { embeddable: EmbeddableSetup; diff --git a/x-pack/plugins/aiops/public/ui_actions/create_pattern_analysis_action.tsx b/x-pack/plugins/aiops/public/ui_actions/create_pattern_analysis_action.tsx new file mode 100644 index 0000000000000..81127559e4e3d --- /dev/null +++ b/x-pack/plugins/aiops/public/ui_actions/create_pattern_analysis_action.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import type { PresentationContainer } from '@kbn/presentation-containers'; +import type { EmbeddableApiContext } from '@kbn/presentation-publishing'; +import type { UiActionsActionDefinition } from '@kbn/ui-actions-plugin/public'; +import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; +import type { CoreStart } from '@kbn/core-lifecycle-browser'; +import { EMBEDDABLE_PATTERN_ANALYSIS_TYPE } from '@kbn/aiops-log-pattern-analysis/constants'; +import type { AiopsPluginStartDeps } from '../types'; +import type { PatternAnalysisActionContext } from './pattern_analysis_action_context'; +import type { + PatternAnalysisEmbeddableApi, + PatternAnalysisEmbeddableInitialState, +} from '../embeddables/pattern_analysis/types'; + +const parentApiIsCompatible = async ( + parentApi: unknown +): Promise => { + const { apiIsPresentationContainer } = await import('@kbn/presentation-containers'); + // we cannot have an async type check, so return the casted parentApi rather than a boolean + return apiIsPresentationContainer(parentApi) ? (parentApi as PresentationContainer) : undefined; +}; + +export function createAddPatternAnalysisEmbeddableAction( + coreStart: CoreStart, + pluginStart: AiopsPluginStartDeps +): UiActionsActionDefinition { + return { + id: 'create-pattern-analysis-embeddable', + grouping: [ + { + id: 'ml', + getDisplayName: () => + i18n.translate('xpack.aiops.navMenu.mlAppNameText', { + defaultMessage: 'Machine Learning and Analytics', + }), + getIconType: () => 'logPatternAnalysis', + }, + ], + getIconType: () => 'logPatternAnalysis', + getDisplayName: () => + i18n.translate('xpack.aiops.embeddablePatternAnalysisDisplayName', { + defaultMessage: 'Pattern analysis', + }), + async isCompatible(context: EmbeddableApiContext) { + return Boolean(await parentApiIsCompatible(context.embeddable)); + }, + async execute(context) { + const presentationContainerParent = await parentApiIsCompatible(context.embeddable); + if (!presentationContainerParent) throw new IncompatibleActionError(); + + try { + const { resolveEmbeddablePatternAnalysisUserInput } = await import( + '../embeddables/pattern_analysis/resolve_pattern_analysis_config_input' + ); + + const initialState: PatternAnalysisEmbeddableInitialState = { + dataViewId: undefined, + }; + + const embeddable = await presentationContainerParent.addNewPanel< + object, + PatternAnalysisEmbeddableApi + >({ + panelType: EMBEDDABLE_PATTERN_ANALYSIS_TYPE, + initialState, + }); + + if (!embeddable) { + return; + } + + const deletePanel = () => { + presentationContainerParent.removePanel(embeddable.uuid); + }; + + resolveEmbeddablePatternAnalysisUserInput( + coreStart, + pluginStart, + context.embeddable, + embeddable.uuid, + true, + embeddable, + deletePanel + ); + } catch (e) { + return Promise.reject(); + } + }, + }; +} diff --git a/x-pack/plugins/aiops/public/ui_actions/index.ts b/x-pack/plugins/aiops/public/ui_actions/index.ts index c8e4edb58792b..d14856fd28733 100644 --- a/x-pack/plugins/aiops/public/ui_actions/index.ts +++ b/x-pack/plugins/aiops/public/ui_actions/index.ts @@ -17,6 +17,7 @@ import { createAddChangePointChartAction } from './create_change_point_chart'; import { createOpenChangePointInMlAppAction } from './open_change_point_ml'; import type { AiopsPluginStartDeps } from '../types'; import { createCategorizeFieldAction } from '../components/log_categorization'; +import { createAddPatternAnalysisEmbeddableAction } from './create_pattern_analysis_action'; export function registerAiopsUiActions( uiActions: UiActionsSetup, @@ -25,7 +26,9 @@ export function registerAiopsUiActions( ) { const openChangePointInMlAppAction = createOpenChangePointInMlAppAction(coreStart, pluginStart); const addChangePointChartAction = createAddChangePointChartAction(coreStart, pluginStart); + const addPatternAnalysisAction = createAddPatternAnalysisEmbeddableAction(coreStart, pluginStart); + uiActions.addTriggerAction(ADD_PANEL_TRIGGER, addPatternAnalysisAction); uiActions.addTriggerAction(ADD_PANEL_TRIGGER, addChangePointChartAction); uiActions.registerTrigger(categorizeFieldTrigger); diff --git a/x-pack/plugins/aiops/public/ui_actions/pattern_analysis_action_context.ts b/x-pack/plugins/aiops/public/ui_actions/pattern_analysis_action_context.ts new file mode 100644 index 0000000000000..d2ed27ae7dfd2 --- /dev/null +++ b/x-pack/plugins/aiops/public/ui_actions/pattern_analysis_action_context.ts @@ -0,0 +1,24 @@ +/* + * 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 { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import { apiIsOfType, type EmbeddableApiContext } from '@kbn/presentation-publishing'; +import { EMBEDDABLE_PATTERN_ANALYSIS_TYPE } from '@kbn/aiops-log-pattern-analysis/constants'; +import type { ChangePointEmbeddableApi } from '../embeddables/change_point_chart/types'; + +export interface PatternAnalysisActionContext extends EmbeddableApiContext { + embeddable: ChangePointEmbeddableApi; +} + +export function isPatternAnalysisEmbeddableContext( + arg: unknown +): arg is PatternAnalysisActionContext { + return ( + isPopulatedObject(arg, ['embeddable']) && + apiIsOfType(arg.embeddable, EMBEDDABLE_PATTERN_ANALYSIS_TYPE) + ); +} diff --git a/x-pack/plugins/aiops/tsconfig.json b/x-pack/plugins/aiops/tsconfig.json index 1c89006ff5eff..1b0e742521ddc 100644 --- a/x-pack/plugins/aiops/tsconfig.json +++ b/x-pack/plugins/aiops/tsconfig.json @@ -78,6 +78,7 @@ "@kbn/usage-collection-plugin", "@kbn/utility-types", "@kbn/observability-ai-assistant-plugin", + "@kbn/ui-theme", "@kbn/apm-utils", ], "exclude": [ diff --git a/x-pack/plugins/alerting/common/routes/rule/common/constants/v1.ts b/x-pack/plugins/alerting/common/routes/rule/common/constants/v1.ts index 745b0937922cb..f0d41ebf72f3f 100644 --- a/x-pack/plugins/alerting/common/routes/rule/common/constants/v1.ts +++ b/x-pack/plugins/alerting/common/routes/rule/common/constants/v1.ts @@ -41,6 +41,7 @@ export const ruleExecutionStatusWarningReason = { MAX_EXECUTABLE_ACTIONS: 'maxExecutableActions', MAX_ALERTS: 'maxAlerts', MAX_QUEUED_ACTIONS: 'maxQueuedActions', + EXECUTION: 'ruleExecution', } as const; export type RuleNotifyWhen = (typeof ruleNotifyWhen)[keyof typeof ruleNotifyWhen]; diff --git a/x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts b/x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts index c513a0c53c693..e8c91d649b8c2 100644 --- a/x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts +++ b/x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts @@ -208,6 +208,7 @@ export const ruleExecutionStatusSchema = schema.object({ schema.literal(ruleExecutionStatusWarningReasonV1.MAX_EXECUTABLE_ACTIONS), schema.literal(ruleExecutionStatusWarningReasonV1.MAX_ALERTS), schema.literal(ruleExecutionStatusWarningReasonV1.MAX_QUEUED_ACTIONS), + schema.literal(ruleExecutionStatusWarningReasonV1.EXECUTION), ], { meta: { @@ -260,6 +261,7 @@ export const ruleLastRunSchema = schema.object({ schema.literal(ruleExecutionStatusWarningReasonV1.MAX_EXECUTABLE_ACTIONS), schema.literal(ruleExecutionStatusWarningReasonV1.MAX_ALERTS), schema.literal(ruleExecutionStatusWarningReasonV1.MAX_QUEUED_ACTIONS), + schema.literal(ruleExecutionStatusWarningReasonV1.EXECUTION), ], { meta: { diff --git a/x-pack/plugins/alerting/common/rules_settings.ts b/x-pack/plugins/alerting/common/rules_settings.ts index 953f29144a100..2267ce4b9cde9 100644 --- a/x-pack/plugins/alerting/common/rules_settings.ts +++ b/x-pack/plugins/alerting/common/rules_settings.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + export interface RulesSettingsModificationMetadata { createdBy: string | null; updatedBy: string | null; @@ -17,6 +18,11 @@ export interface RulesSettingsFlappingProperties { statusChangeThreshold: number; } +export interface RuleSpecificFlappingProperties { + lookBackWindow: number; + statusChangeThreshold: number; +} + export type RulesSettingsFlapping = RulesSettingsFlappingProperties & RulesSettingsModificationMetadata; @@ -37,10 +43,13 @@ export interface RulesSettings { queryDelay?: RulesSettingsQueryDelay; } -export const MIN_LOOK_BACK_WINDOW = 2; -export const MAX_LOOK_BACK_WINDOW = 20; -export const MIN_STATUS_CHANGE_THRESHOLD = 2; -export const MAX_STATUS_CHANGE_THRESHOLD = 20; +export { + MIN_LOOK_BACK_WINDOW, + MAX_LOOK_BACK_WINDOW, + MIN_STATUS_CHANGE_THRESHOLD, + MAX_STATUS_CHANGE_THRESHOLD, +} from '@kbn/alerting-types'; + export const MIN_QUERY_DELAY = 0; export const MAX_QUERY_DELAY = 60; diff --git a/x-pack/plugins/alerting/docs/openapi/bundled.json b/x-pack/plugins/alerting/docs/openapi/bundled.json index 1c7749d5e47c1..7d6d85c229202 100644 --- a/x-pack/plugins/alerting/docs/openapi/bundled.json +++ b/x-pack/plugins/alerting/docs/openapi/bundled.json @@ -17,76 +17,104 @@ "url": "/" } ], - "tags": [ - { - "name": "alerting", - "description": "Alerting APIs enable you to create and manage rules and alerts." - } - ], "paths": { - "/api/alerting/rule": { - "post": { - "summary": "Create a rule with a random identifier", - "operationId": "createRule", - "description": "To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs.\n", + "/api/alerting/_health": { + "get": { + "summary": "Get the alerting framework health", + "operationId": "getAlertingHealth", + "description": "You must have `read` privileges for the **Management > Stack Rules** feature or for at least one of the **Analytics > Discover**, **Analytics > Machine Learning**, **Observability**, or **Security** features.\n", "tags": [ "alerting" ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/create_rule_request" - }, - "examples": { - "createEsQueryEsqlRuleRequest": { - "$ref": "#/components/examples/create_es_query_esql_rule_request" - }, - "createEsQueryRuleRequest": { - "$ref": "#/components/examples/create_es_query_rule_request" - }, - "createEsQueryKqlRuleRequest": { - "$ref": "#/components/examples/create_es_query_kql_rule_request" - }, - "createIndexThresholdRuleRequest": { - "$ref": "#/components/examples/create_index_threshold_rule_request" - }, - "createTrackingContainmentRuleRequest": { - "$ref": "#/components/examples/create_tracking_containment_rule_request" - } - } - } - } - }, "responses": { "200": { "description": "Indicates a successful call.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/rule_response_properties" + "type": "object", + "properties": { + "alerting_framework_health": { + "type": "object", + "description": "Three substates identify the health of the alerting framework: `decryption_health`, `execution_health`, and `read_health`.\n", + "properties": { + "decryption_health": { + "type": "object", + "description": "The timestamp and status of the rule decryption.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + }, + "execution_health": { + "type": "object", + "description": "The timestamp and status of the rule run.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + }, + "read_health": { + "type": "object", + "description": "The timestamp and status of the rule reading events.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + } + } + }, + "has_permanent_encryption_key": { + "type": "boolean", + "description": "If `false`, the encrypted saved object plugin does not have a permanent encryption key.", + "example": true + }, + "is_sufficiently_secure": { + "type": "boolean", + "description": "If `false`, security is enabled but TLS is not.", + "example": true + } + } }, "examples": { - "createEsQueryEsqlRuleResponse": { - "$ref": "#/components/examples/create_es_query_esql_rule_response" - }, - "createEsQueryRuleResponse": { - "$ref": "#/components/examples/create_es_query_rule_response" - }, - "createEsQueryKqlRuleResponse": { - "$ref": "#/components/examples/create_es_query_kql_rule_response" - }, - "createIndexThresholdRuleResponse": { - "$ref": "#/components/examples/create_index_threshold_rule_response" - }, - "createTrackingContainmentRuleResponse": { - "$ref": "#/components/examples/create_tracking_containment_rule_response" + "getAlertingHealthResponse": { + "$ref": "#/components/examples/get_health_response" } } } @@ -101,654 +129,15 @@ } } } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } } } } }, - "/api/alerting/rule/{ruleId}": { + "/api/alerting/rule_types": { "get": { - "summary": "Get rule details", - "operationId": "getRule", - "description": "You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To get rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/rule_response_properties" - }, - "examples": { - "getRuleResponse": { - "$ref": "#/components/examples/get_rule_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } - } - } - }, - "delete": { - "summary": "Delete a rule", - "operationId": "deleteRule", - "description": "To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } - } - } - }, - "post": { - "summary": "Create a rule", - "operationId": "createRuleId", - "description": "This API creates a rule with a specific rule identifier. If you omit the identifer, it is automatically generated. To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "ruleId", - "description": "An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated.\n", - "required": true, - "schema": { - "type": "string", - "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/create_rule_request" - }, - "examples": { - "createEsQueryEsqlRuleIdRequest": { - "$ref": "#/components/examples/create_es_query_esql_rule_request" - }, - "createEsQueryRuleIdRequest": { - "$ref": "#/components/examples/create_es_query_rule_request" - }, - "createEsQueryKqlRuleIdRequest": { - "$ref": "#/components/examples/create_es_query_kql_rule_request" - }, - "createIndexThreholdRuleIdRequest": { - "$ref": "#/components/examples/create_index_threshold_rule_request" - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/rule_response_properties" - }, - "examples": { - "createEsQueryEsqlRuleIdResponse": { - "$ref": "#/components/examples/create_es_query_esql_rule_response" - }, - "createEsQueryRuleIdResponse": { - "$ref": "#/components/examples/create_es_query_rule_response" - }, - "createEsQueryKqlRuleIdResponse": { - "$ref": "#/components/examples/create_es_query_kql_rule_response" - }, - "createIndexThresholdRuleIdResponse": { - "$ref": "#/components/examples/create_index_threshold_rule_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } - } - } - }, - "put": { - "summary": "Update a rule", - "operationId": "updateRule", - "description": "To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/update_rule_request" - }, - "examples": { - "updateRuleRequest": { - "$ref": "#/components/examples/update_rule_request" - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/rule_response_properties" - }, - "examples": { - "updateRuleResponse": { - "$ref": "#/components/examples/update_rule_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/_disable": { - "post": { - "summary": "Disable a rule", - "operationId": "disableRule", - "description": "You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/404_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/_enable": { - "post": { - "summary": "Enable a rule", - "operationId": "enableRule", - "description": "To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - }, - "404": { - "description": "Object is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rules/_find": { - "get": { - "summary": "Find rule information", - "operationId": "findRules", - "description": "You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To find rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "name": "default_search_operator", - "in": "query", - "description": "The default operator to use for the simple_query_string.", - "schema": { - "type": "string", - "default": "OR" - }, - "example": "OR" - }, - { - "name": "fields", - "in": "query", - "description": "The fields to return in the `attributes` key of the response.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "filter", - "in": "query", - "description": "A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`.\n", - "schema": { - "type": "string" - } - }, - { - "name": "has_reference", - "in": "query", - "description": "Filters the rules that have a relation with the reference objects with a specific type and identifier.", - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - { - "name": "page", - "in": "query", - "description": "The page number to return.", - "schema": { - "type": "integer", - "default": 1 - }, - "example": 1 - }, - { - "name": "per_page", - "in": "query", - "description": "The number of rules to return per page.", - "schema": { - "type": "integer", - "default": 20 - }, - "example": 20 - }, - { - "name": "search", - "in": "query", - "description": "An Elasticsearch simple_query_string query that filters the objects in the response.", - "schema": { - "type": "string", - "example": "threshold +-test*" - } - }, - { - "name": "search_fields", - "in": "query", - "description": "The fields to perform the simple_query_string parsed query against.", - "schema": { - "oneOf": [ - { - "type": "string", - "example": "name" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - }, - { - "name": "sort_field", - "in": "query", - "description": "Determines which field is used to sort the results. The field must exist in the `attributes` key of the response.\n", - "schema": { - "type": "string" - } - }, - { - "name": "sort_order", - "in": "query", - "description": "Determines the sort order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "desc" - }, - "example": "asc" - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/rule_response_properties" - } - }, - "page": { - "type": "integer" - }, - "per_page": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "examples": { - "findRulesResponse": { - "$ref": "#/components/examples/find_rules_response" - }, - "findConditionalActionRulesResponse": { - "$ref": "#/components/examples/find_rules_response_conditional_action" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/_health": { - "get": { - "summary": "Get the alerting framework health", - "operationId": "getAlertingHealth", - "description": "You must have `read` privileges for the **Management > Stack Rules** feature or for at least one of the **Analytics > Discover**, **Analytics > Machine Learning**, **Observability**, or **Security** features.\n", - "tags": [ - "alerting" - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "alerting_framework_health": { - "type": "object", - "description": "Three substates identify the health of the alerting framework: `decryption_health`, `execution_health`, and `read_health`.\n", - "properties": { - "decryption_health": { - "type": "object", - "description": "The timestamp and status of the rule decryption.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - }, - "execution_health": { - "type": "object", - "description": "The timestamp and status of the rule run.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - }, - "read_health": { - "type": "object", - "description": "The timestamp and status of the rule reading events.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - } - } - }, - "has_permanent_encryption_key": { - "type": "boolean", - "description": "If `false`, the encrypted saved object plugin does not have a permanent encryption key.", - "example": true - }, - "is_sufficiently_secure": { - "type": "boolean", - "description": "If `false`, security is enabled but TLS is not.", - "example": true - } - } - }, - "examples": { - "getAlertingHealthResponse": { - "$ref": "#/components/examples/get_health_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rule_types": { - "get": { - "summary": "Get the rule types", - "operationId": "getRuleTypes", - "description": "If you have `read` privileges for one or more Kibana features, the API response contains information about the appropriate rule types. For example, there are rule types associated with the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, and **Security** features. To get rule types associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role.\n", + "summary": "Get the rule types", + "operationId": "getRuleTypes", + "description": "If you have `read` privileges for one or more Kibana features, the API response contains information about the appropriate rule types. For example, there are rule types associated with the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, and **Security** features. To get rule types associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role.\n", "tags": [ "alerting" ], @@ -983,6838 +372,1188 @@ "type": "boolean" } } - }, - "slo": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - }, - "read": { - "type": "boolean" - } - } - }, - "stackAlerts": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - }, - "read": { - "type": "boolean" - } - } - }, - "uptime": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - }, - "read": { - "type": "boolean" - } - } - } - } - }, - "category": { - "type": "string", - "description": "The rule category, which is used by features such as category-specific maintenance windows.", - "enum": [ - "management", - "observability", - "securitySolution" - ] - }, - "default_action_group_id": { - "description": "The default identifier for the rule type group.", - "type": "string" - }, - "does_set_recovery_context": { - "description": "Indicates whether the rule passes context variables to its recovery action.", - "type": "boolean" - }, - "enabled_in_license": { - "description": "Indicates whether the rule type is enabled or disabled based on the subscription.", - "type": "boolean" - }, - "has_alerts_mappings": { - "type": "boolean", - "description": "Indicates whether the rule type has custom mappings for the alert data." - }, - "has_fields_for_a_a_d": { - "type": "boolean" - }, - "id": { - "description": "The unique identifier for the rule type.", - "type": "string" - }, - "is_exportable": { - "description": "Indicates whether the rule type is exportable in **Stack Management > Saved Objects**.", - "type": "boolean" - }, - "minimum_license_required": { - "description": "The subscriptions required to use the rule type.", - "type": "string", - "example": "basic" - }, - "name": { - "description": "The descriptive name of the rule type.", - "type": "string" - }, - "producer": { - "description": "An identifier for the application that produces this rule type.", - "type": "string", - "example": "stackAlerts" - }, - "recovery_action_group": { - "description": "An action group to use when an alert goes from an active state to an inactive one.", - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "rule_task_timeout": { - "type": "string", - "example": "5m" - } - } - } - }, - "examples": { - "getRuleTypesResponse": { - "$ref": "#/components/examples/get_rule_types_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/_mute_all": { - "post": { - "summary": "Mute all alerts", - "operationId": "muteAllAlerts", - "description": "This API snoozes the notifications for the rule indefinitely. The rule checks continue to occur but alerts will not trigger any actions. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/_unmute_all": { - "post": { - "summary": "Unmute all alerts", - "operationId": "unmuteAllAlerts", - "description": "If the rule has its notifications snoozed indefinitely, this API cancels the snooze. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/_update_api_key": { - "post": { - "summary": "Update the API key for a rule", - "operationId": "updateRuleAPIKey", - "description": "The new API key has the credentials of the user that submits the request.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "200": { - "description": "Indicates a successful call." - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/400_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/alert/{alertId}/_mute": { - "post": { - "summary": "Mute an alert", - "operationId": "muteAlert", - "description": "You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/alert_id" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute": { - "post": { - "summary": "Unmute an alert", - "operationId": "unmuteAlert", - "description": "You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/alert_id" - }, - { - "$ref": "#/components/parameters/rule_id" - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}": { - "delete": { - "summary": "Delete an alert", - "operationId": "legaryDeleteAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After you delete an alert, you cannot recover it.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - }, - "get": { - "summary": "Get an alert by identifier", - "operationId": "legacyGetAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the get rule API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/alert_response_properties" - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - }, - "post": { - "summary": "Create an alert", - "operationId": "legacyCreateAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the create rule API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "An UUID v1 or v4 identifier for the alert. If this parameter is omitted, the identifier is randomly generated.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "title": "Legacy create alert request properties", - "type": "object", - "required": [ - "alertTypeId", - "consumer", - "name", - "notifyWhen", - "params", - "schedule" - ], - "properties": { - "actions": { - "type": "array", - "items": { - "type": "object", - "required": [ - "actionTypeId", - "group", - "id", - "params" - ], - "properties": { - "actionTypeId": { - "type": "string", - "description": "The identifier for the action type." - }, - "group": { - "type": "string", - "description": "Grouping actions is recommended for escalations for different types of alert instances. If you don't need this functionality, set it to `default`.\n" - }, - "id": { - "type": "string", - "description": "The ID of the action saved object." - }, - "params": { - "type": "object", - "description": "The map to the `params` that the action type will receive. `params` are handled as Mustache templates and passed a default set of context.\n" - } - } - } - }, - "alertTypeId": { - "type": "string", - "description": "The ID of the alert type that you want to call when the alert is scheduled to run." - }, - "consumer": { - "type": "string", - "description": "The name of the application that owns the alert. This name has to match the Kibana feature name, as that dictates the required role-based access control privileges." - }, - "enabled": { - "type": "boolean", - "description": "Indicates if you want to run the alert on an interval basis after it is created." - }, - "name": { - "type": "string", - "description": "A name to reference and search." - }, - "notifyWhen": { - "type": "string", - "description": "The condition for throttling the notification.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ] - }, - "params": { - "type": "object", - "description": "The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined." - }, - "schedule": { - "type": "object", - "description": "The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.\n", - "properties": { - "interval": { - "type": "string", - "description": "The interval format specifies the interval in seconds, minutes, hours or days at which the alert should run.", - "example": "10s" - } - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of keywords to reference and search." - }, - "throttle": { - "type": "string", - "description": "How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period.\n" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/alert_response_properties" - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - }, - "put": { - "summary": "Update an alert", - "operationId": "legacyUpdateAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the update rule API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "title": "Legacy update alert request properties", - "type": "object", - "required": [ - "name", - "notifyWhen", - "params", - "schedule" - ], - "properties": { - "actions": { - "type": "array", - "items": { - "type": "object", - "required": [ - "actionTypeId", - "group", - "id", - "params" - ], - "properties": { - "actionTypeId": { - "type": "string", - "description": "The identifier for the action type." - }, - "group": { - "type": "string", - "description": "Grouping actions is recommended for escalations for different types of alert instances. If you don't need this functionality, set it to `default`.\n" - }, - "id": { - "type": "string", - "description": "The ID of the action saved object." - }, - "params": { - "type": "object", - "description": "The map to the `params` that the action type will receive. `params` are handled as Mustache templates and passed a default set of context.\n" - } - } - } - }, - "name": { - "type": "string", - "description": "A name to reference and search." - }, - "notifyWhen": { - "type": "string", - "description": "The condition for throttling the notification.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ] - }, - "params": { - "type": "object", - "description": "The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined." - }, - "schedule": { - "type": "object", - "description": "The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.\n", - "properties": { - "interval": { - "type": "string", - "description": "The interval format specifies the interval in seconds, minutes, hours or days at which the alert should run.", - "example": "1d" - } - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of keywords to reference and search." - }, - "throttle": { - "type": "string", - "description": "How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period.\n" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/alert_response_properties" - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/_disable": { - "post": { - "summary": "Disable an alert", - "operationId": "legacyDisableAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the disable rule API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/_enable": { - "post": { - "summary": "Enable an alert", - "operationId": "legacyEnableAlert", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the enable rule API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/_mute_all": { - "post": { - "summary": "Mute all alert instances", - "operationId": "legacyMuteAllAlertInstances", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the mute all alerts API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/_unmute_all": { - "post": { - "summary": "Unmute all alert instances", - "operationId": "legacyUnmuteAllAlertInstances", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the unmute all alerts API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "The identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alerts/_find": { - "get": { - "summary": "Get a paginated set of alerts", - "operationId": "legacyFindAlerts", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the find rules API instead. NOTE: Alert `params` are stored as a flattened field type and analyzed as keywords. As alerts change in Kibana, the results on each page of the response also change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data.\n", - "tags": [ - "alerting" - ], - "parameters": [ - { - "name": "default_search_operator", - "in": "query", - "description": "The default operator to use for the `simple_query_string`.", - "schema": { - "type": "string", - "default": "OR" - }, - "example": "OR" - }, - { - "name": "fields", - "in": "query", - "description": "The fields to return in the `attributes` key of the response.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "filter", - "in": "query", - "description": "A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`.\n", - "schema": { - "type": "string" - } - }, - { - "name": "has_reference", - "in": "query", - "description": "Filters the rules that have a relation with the reference objects with a specific type and identifier.", - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - { - "name": "page", - "in": "query", - "description": "The page number to return.", - "schema": { - "type": "integer", - "default": 1 - }, - "example": 1 - }, - { - "name": "per_page", - "in": "query", - "description": "The number of alerts to return per page.", - "schema": { - "type": "integer", - "default": 20 - }, - "example": 20 - }, - { - "name": "search", - "in": "query", - "description": "An Elasticsearch `simple_query_string` query that filters the alerts in the response.", - "schema": { - "type": "string" - } - }, - { - "name": "search_fields", - "in": "query", - "description": "The fields to perform the `simple_query_string` parsed query against.", - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - }, - { - "name": "sort_field", - "in": "query", - "description": "Determines which field is used to sort the results. The field must exist in the `attributes` key of the response.\n", - "schema": { - "type": "string" - } - }, - { - "name": "sort_order", - "in": "query", - "description": "Determines the sort order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "desc" - }, - "example": "asc" - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/alert_response_properties" - } - }, - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alerts/_health": { - "get": { - "summary": "Get the alerting framework health", - "operationId": "legacyGetAlertingHealth", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the get alerting framework health API instead.", - "tags": [ - "alerting" - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "alertingFrameworkHealth": { - "type": "object", - "description": "Three substates identify the health of the alerting framework: `decryptionHealth`, `executionHealth`, and `readHealth`.\n", - "properties": { - "decryptionHealth": { - "type": "object", - "description": "The timestamp and status of the alert decryption.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - }, - "executionHealth": { - "type": "object", - "description": "The timestamp and status of the alert execution.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - }, - "readHealth": { - "type": "object", - "description": "The timestamp and status of the alert reading events.", - "properties": { - "status": { - "type": "string", - "example": "ok", - "enum": [ - "error", - "ok", - "warn" - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "example": "2023-01-13T01:28:00.280Z" - } - } - } - } - }, - "hasPermanentEncryptionKey": { - "type": "boolean", - "description": "If `false`, the encrypted saved object plugin does not have a permanent encryption key.", - "example": true - }, - "isSufficientlySecure": { - "type": "boolean", - "description": "If `false`, security is enabled but TLS is not.", - "example": true - } - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alerts/list_alert_types": { - "get": { - "summary": "Get the alert types", - "operationId": "legacyGetAlertTypes", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the get rule types API instead.", - "tags": [ - "alerting" - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "actionGroups": { - "description": "An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert actions validation uses this configuration to ensure that groups are valid.\n", - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - } - }, - "actionVariables": { - "description": "A list of action variables that the alert type makes available via context and state in action parameter templates, and a short human readable description. The Alert UI will use this information to prompt users for these variables in action parameter editors.\n", - "type": "object", - "properties": { - "context": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - }, - "params": { - "type": "array", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - } - }, - "state": { - "type": "array", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - } - } - } - }, - "authorizedConsumers": { - "description": "The list of the plugins IDs that have access to the alert type.", - "type": "object" - }, - "defaultActionGroupId": { - "description": "The default identifier for the alert type group.", - "type": "string" - }, - "enabledInLicense": { - "description": "Indicates whether the rule type is enabled based on the subscription.", - "type": "boolean" - }, - "id": { - "description": "The unique identifier for the alert type.", - "type": "string" - }, - "isExportable": { - "description": "Indicates whether the alert type is exportable in Saved Objects Management UI.", - "type": "boolean" - }, - "minimumLicenseRequired": { - "description": "The subscriptions required to use the alert type.", - "type": "string" - }, - "name": { - "description": "The descriptive name of the alert type.", - "type": "string" - }, - "producer": { - "description": "An identifier for the application that produces this alert type.", - "type": "string" - }, - "recoveryActionGroup": { - "description": "An action group to use when an alert instance goes from an active state to an inactive one. If it is not specified, the default recovered action group is used.\n", - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute": { - "post": { - "summary": "Mute an alert instance", - "operationId": "legacyMuteAlertInstance", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the mute alert API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "An identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - }, - { - "in": "path", - "name": "alertInstanceId", - "description": "An identifier for the alert instance.", - "required": true, - "schema": { - "type": "string", - "example": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - }, - "/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute": { - "post": { - "summary": "Unmute an alert instance", - "operationId": "legacyUnmuteAlertInstance", - "deprecated": true, - "description": "Deprecated in 7.13.0. Use the unmute alert API instead.", - "tags": [ - "alerting" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "in": "path", - "name": "alertId", - "description": "An identifier for the alert.", - "required": true, - "schema": { - "type": "string", - "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" - } - }, - { - "in": "path", - "name": "alertInstanceId", - "description": "An identifier for the alert instance.", - "required": true, - "schema": { - "type": "string", - "example": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" - } - } - ], - "responses": { - "204": { - "description": "Indicates a successful call." - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/401_response" - } - } - } - } - } - } - } - }, - "components": { - "parameters": { - "kbn_xsrf": { - "schema": { - "type": "string" - }, - "in": "header", - "name": "kbn-xsrf", - "description": "Cross-site request forgery protection", - "required": true - }, - "rule_id": { - "in": "path", - "name": "ruleId", - "description": "An identifier for the rule.", - "required": true, - "schema": { - "type": "string", - "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - } - }, - "alert_id": { - "in": "path", - "name": "alertId", - "description": "An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string.", - "required": true, - "schema": { - "type": "string", - "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - } - } - }, - "schemas": { - "create_anomaly_detection_alert_rule_request": { - "title": "Create anomaly detection rule request", - "description": "A rule that checks if the anomaly detection job results contain anomalies that match the rule conditions. \n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an anomaly detection rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.ml.anomaly_detection_alert" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_anomaly_detection_jobs_health_rule_request": { - "title": "Create anomaly detection jobs health rule request", - "description": "An rule that monitors job health and alerts if an operational issue occurred that may prevent the job from detecting anomalies.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an anomaly detection jobs health rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.ml.anomaly_detection_jobs_health" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_apm_anomaly_rule_request": { - "title": "Create APM anomaly rule rule request", - "description": "A rule that detects when either the latency, throughput, or failed transaction rate of a service is anomalous.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_apm_anomaly" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "apm.anomaly" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_apm_error_count_rule_request": { - "title": "Create APM error count rule request", - "description": "A rule that detects when the number of errors in a service exceeds a defined threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_apm_error_count" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "apm.error_rate" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_apm_transaction_duration_rule_request": { - "title": "Create latency threshold rule request", - "description": "A rule that detects when the latency of a specific transaction type in a service exceeds a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_apm_transaction_duration" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "apm.transaction_duration" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_apm_transaction_error_rate_rule_request": { - "title": "Create APM transaction error rate rule request", - "description": "A rule that sends notifications when the rate of transaction errors in a service exceeds a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_apm_transaction_error_rate" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "apm.transaction_error_rate" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_es_query_rule_request": { - "title": "Create Elasticsearch query rule request", - "description": "A rule that runs a user-configured query, compares the number of matches to a configured threshold, and schedules actions to run when the threshold condition is met. \n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_es_query_rule" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - ".es-query" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_geo_containment_rule_request": { - "title": "Create tracking containment rule request", - "description": "A rule that runs an Elasticsearch query over indices to determine whether any documents are currently contained within any boundaries from the specified boundary index. In the event that an entity is contained within a boundary, an alert may be generated. \n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an tracking containment rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - ".geo-containment" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_index_threshold_rule_request": { - "title": "Create index threshold rule request", - "description": "A rule that runs an Elasticsearch query, aggregates field values from documents, compares them to threshold values, and schedules actions to run when the thresholds are met.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_index_threshold_rule" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - ".index-threshold" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_infra_inventory_rule_request": { - "title": "Create infra inventory rule request", - "description": "A rule that sends notifications when a metric has reached or exceeded a value for a specific resource or a group of resources within your infrastructure.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_infra_inventory" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "metrics.alert.inventory.threshold" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_infra_metric_anomaly_rule_request": { - "title": "Create infrastructure anomaly rule request", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an infrastructure anomaly rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "metrics.alert.anomaly" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_infra_metric_threshold_rule_request": { - "title": "Create infra metric threshold rule request", - "description": "A rule that sends notifications when a metric has reached or exceeded a value for a specific time period.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_infra_metric_threshold" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "metrics.alert.threshold" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_jvm_memory_usage_rule_request": { - "title": "Create JVM memory usage rule request", - "description": "A rule that detects when a node reports high memory usage.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a JVM memory usage rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_jvm_memory_usage" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_log_threshold_rule_request": { - "title": "Create log threshold rule request", - "description": "A rule that detects when a log aggregation exceeds a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_log_threshold" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "logs.alert.document.count" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_ccr_exceptions_rule_request": { - "title": "Create CCR read exceptions rule request", - "description": "A rule that detects cross-cluster replication (CCR) read exceptions.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a CCR read exceptions rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_ccr_read_exceptions" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_cluster_health_rule_request": { - "title": "Create cluster health rule request", - "description": "A rule that detects when the health of the cluster changes.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a cluster health rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_cluster_health" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_cpu_usage_rule_request": { - "title": "Create CPU usage rule request", - "description": "A rule that detects when the CPU load for a node is consistently high.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a CPU usage rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_cpu_usage" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_disk_usage_rule_request": { - "title": "Create disk usage rule request", - "description": "A rule that detects when the disk usage for a node is consistently high.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a disk usage rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_disk_usage" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_elasticsearch_version_mismatch_rule_request": { - "title": "Create Elasticsearch version mismatch rule request", - "description": "A rule that detects when the cluster has multipe versions of Elasticsearch.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a Elasticsearch version mismatch rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_elasticsearch_version_mismatch" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_license_expiration_rule_request": { - "title": "Create license expiration rule request", - "description": "A rule that detects when the cluster license is about to expire.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a license expiration rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_license_expiration" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_kibana_version_mismatch_rule_request": { - "title": "Create Kibana version mismatch rule request", - "description": "A rule that detects when the cluster has multiple versions of Kibana.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a Kibana version mismatch rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_kibana_version_mismatch" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_logstash_version_mismatch_rule_request": { - "title": "Create Logstash version mismatch rule request", - "description": "A rule that detects when the cluster has multiple versions of Logstash.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a Logstash version mismatch rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_logstash_version_mismatch" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_missing_data_rule_request": { - "title": "Create missing monitoring data rule request", - "description": "A rule that detects when monitoring data is missing.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a missing monitoring data rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_missing_monitoring_data" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_nodes_changed_rule_request": { - "title": "Create nodes changed rule request", - "description": "A rule that detects when nodes are added, removed, or restarted.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a nodes changed rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_nodes_changed" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_shard_size_rule_request": { - "title": "Create shard size rule request", - "description": "A rule that detects when the average shard size is larger than a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a shard size rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_shard_size" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_thread_pool_search_rejections_rule_request": { - "title": "Create thread pool search rejections rule request", - "description": "A rule that detects when the number of rejections in the thread pool exceeds a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a thread pool search rejections rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_thread_pool_search_rejections" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_monitoring_thread_pool_write_rejections_rule_request": { - "title": "Create thread pool write rejections rule request", - "description": "A rule that detects when the number of rejections in the write thread pool exceeds a threshold.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a thread pool write rejections rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "monitoring_alert_thread_pool_write_rejections" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_eql_rule_request": { - "title": "Create event correlation rule request", - "description": "A rule that uses Event Query Language (EQL) to match events, generate sequences, and stack data.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an event correlation rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.eqlRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_indicator_rule_request": { - "title": "Create indicator match rule request", - "description": "A rule that uses indicators from intelligence sources to detect matching events and alerts.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for an indicator match rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.indicatorRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_ml_rule_request": { - "title": "Create machine learning rule request", - "description": "A rule that detects when a machine learning job discovers an anomaly above the defined threshold.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a machine learning rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.mlRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_new_terms_rule_request": { - "title": "Create new terms rule request", - "description": "A rule that finds documents with values that appear for the first time.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a new terms rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.newTermsRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_notifications_rule_request": { - "title": "Create security solution notification (legacy) rule request", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a notification rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.notifications" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_query_rule_request": { - "title": "Create custom query rule request", - "description": "A rule that uses KQL or Lucene to detect issues across indices.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a custom query rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.queryRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_saved_query_rule_request": { - "title": "Create saved query rule request", - "description": "A rule that searches the defined indices and creates an alert when a document matches the saved search.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a saved query rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.savedQueryRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_siem_threshold_rule_request": { - "title": "Create threshold rule request", - "description": "A rule that aggregates query results to detect when the number of matches exceeds a threshold.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a threshold rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "siem.thresholdRule" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_slo_burn_rate_rule_request": { - "title": "Create slo burn rate rule request", - "description": "A rule that detects when the burn rate is above a defined threshold for two different lookback periods. The two periods are a long period and a short period that is 1/12th of the long period. For each lookback period, the burn rate is computed as the error rate divided by the error budget. When the burn rates for both periods surpass the threshold, an alert occurs.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_slo_burn_rate" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "slo.rules.burnRate" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_synthetics_monitor_status_rule_request": { - "title": "Create synthetics monitor status rule request", - "description": "A rule that detects when a monitor is down or an availability threshold is breached.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for the synthetics monitor status rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.synthetics.alerts.monitorStatus" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_synthetics_uptime_duration_anomaly_rule_request": { - "title": "Create synthetics uptime duration anomaly rule request", - "description": "A rule that detects response durations for all of the geographic locations of each monitor. When a monitor runs for an unusual amount of time, at a particular time, an anomaly is recorded.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for the uptime duration anomaly rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.uptime.alerts.durationAnomaly" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_synthetics_uptime_tls_rule_request": { - "title": "Create synthetics uptime TLS rule request", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_synthetics_uptime_tls" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.uptime.alerts.tls" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_synthetics_uptime_tls_certificate_rule_request": { - "title": "Create TLS certificate rule request", - "description": "A rule that detects when a monitor has a TLS certificate expiring or when it exceeds an age limit.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a TLS certificate rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.uptime.alerts.tlsCertificate" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_transform_health_rule_request": { - "title": "Create transform health rule request", - "description": "A rule that monitors transforms health and alerts if an operational issue occurred.\n", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for a transform health rule.", - "additionalProperties": true - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "transform_health" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "create_uptime_monitor_status_rule_request": { - "title": "Create uptime monitor status rule request", - "description": "A rule that detects monitor errors and outages.", - "type": "object", - "required": [ - "consumer", - "name", - "params", - "rule_type_id", - "schedule" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "consumer": { - "$ref": "#/components/schemas/consumer" - }, - "enabled": { - "$ref": "#/components/schemas/enabled_rule" - }, - "name": { - "$ref": "#/components/schemas/name_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "$ref": "#/components/schemas/params_property_synthetics_monitor_status" - }, - "rule_type_id": { - "type": "string", - "description": "The ID of the rule type that you want to call when the rule is scheduled to run.", - "enum": [ - "xpack.uptime.alerts.monitorStatus" - ] - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - } - } - }, - "filter": { - "type": "object", - "description": "A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package.", - "properties": { - "meta": { - "type": "object", - "properties": { - "alias": { - "type": "string", - "nullable": true - }, - "controlledBy": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "string" - }, - "group": { - "type": "string" - }, - "index": { - "type": "string" - }, - "isMultiIndex": { - "type": "boolean" - }, - "key": { - "type": "string" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "object" - }, - "type": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "query": { - "type": "object" - }, - "$state": { - "type": "object" - } - } - }, - "notify_when_action": { - "type": "string", - "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.\n", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "example": "onActiveAlert" - }, - "throttle_action": { - "type": "string", - "nullable": true, - "description": "The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.\n", - "default": null, - "example": "10m" - }, - "actions": { - "type": "array", - "default": [], - "nullable": true, - "items": { - "type": "object", - "required": [ - "group", - "id", - "params" - ], - "description": "An action that runs under defined conditions.\n", - "properties": { - "alerts_filter": { - "type": "object", - "description": "Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs.\n", - "properties": { - "query": { - "type": "object", - "description": "Defines a query filter that determines whether the action runs.", - "properties": { - "kql": { - "type": "string", - "description": "A filter written in Kibana Query Language (KQL)." - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/filter" - } - } - } - }, - "timeframe": { - "type": "object", - "description": "Defines a period that limits whether the action runs.", - "properties": { - "days": { - "type": "array", - "description": "Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "hours": { - "type": "object", - "description": "Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day.\n", - "properties": { - "end": { - "type": "string", - "description": "The end of the time frame in 24-hour notation (`hh:mm`).", - "example": "17:00" - }, - "start": { - "type": "string", - "description": "The start of the time frame in 24-hour notation (`hh:mm`).", - "example": "08:00" - } - } - }, - "timezone": { - "type": "string", - "description": "The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.\n", - "example": "Europe/Madrid" - } - } - } - } - }, - "connector_type_id": { - "type": "string", - "description": "The type of connector. This property appears in responses but cannot be set in requests.", - "example": ".server-log", - "readOnly": true - }, - "frequency": { - "type": "object", - "description": "The properties that affect how often actions are generated. If the rule type supports setting `summary` to `true`, the action can be a summary of alerts at the specified notification interval. Otherwise, an action runs for each alert at the specified notification interval. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level.\n", - "required": [ - "notify_when", - "summary" - ], - "properties": { - "notify_when": { - "$ref": "#/components/schemas/notify_when_action" - }, - "summary": { - "type": "boolean", - "description": "Indicates whether the action is a summary." - }, - "throttle": { - "$ref": "#/components/schemas/throttle_action" - } - } - }, - "group": { - "type": "string", - "description": "The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`.\n", - "example": "default" - }, - "id": { - "type": "string", - "description": "The identifier for the connector saved object.", - "example": "9dca3e00-74f5-11ed-9801-35303b735aef" - }, - "params": { - "type": "object", - "description": "The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.", - "additionalProperties": true - }, - "uuid": { - "type": "string", - "description": "A universally unique identifier (UUID) for the action.", - "example": "1c7a1280-f28c-4e06-96b2-e4e5f05d1d61" - } - } - } - }, - "alert_delay": { - "type": "object", - "description": "Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.", - "required": [ - "active" - ], - "properties": { - "active": { - "type": "number", - "description": "The number of consecutive runs that must meet the rule conditions.", - "example": 3 - } - } - }, - "consumer": { - "type": "string", - "description": "The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.\n" - }, - "enabled_rule": { - "type": "boolean", - "description": "Indicates whether you want to run the rule on an interval basis after it is created." - }, - "name_rule": { - "type": "string", - "description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.\n" - }, - "notify_when": { - "type": "string", - "description": "Deprecated in 8.13.0. Use the `notify_when` property in the action `frequency` object instead. Indicates how often alerts generate actions. NOTE: You cannot specify `notify_when` at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.\n", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "deprecated": true, - "example": "onActiveAlert" - }, - "schedule": { - "type": "object", - "description": "The check interval, which specifies how frequently the rule conditions are checked. The interval is specified in seconds, minutes, hours, or days.", - "properties": { - "interval": { - "type": "string", - "example": "1m" - } - } - }, - "tags": { - "type": "array", - "description": "The tags for the rule.", - "items": { - "type": "string" - }, - "default": [] - }, - "throttle": { - "type": "string", - "description": "Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.\n", - "nullable": true, - "default": null, - "deprecated": true, - "example": "10m" - }, - "params_property_apm_anomaly": { - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "properties": { - "serviceName": { - "type": "string", - "description": "The service name from APM" - }, - "transactionType": { - "type": "string", - "description": "The transaction type from APM" - }, - "windowSize": { - "type": "number", - "example": 6, - "description": "The window size" - }, - "windowUnit": { - "type": "string", - "description": "The window size unit", - "enum": [ - "m", - "h", - "d" - ] - }, - "environment": { - "type": "string", - "description": "The environment from APM" - }, - "anomalySeverityType": { - "type": "string", - "description": "The anomaly threshold value", - "enum": [ - "critical", - "major", - "minor", - "warning" - ] - } - } - }, - "params_property_apm_error_count": { - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "properties": { - "serviceName": { - "type": "string", - "description": "The service name from APM" - }, - "windowSize": { - "type": "number", - "description": "The window size", - "example": 6 - }, - "windowUnit": { - "type": "string", - "description": "The window size unit", - "enum": [ - "m", - "h", - "d" - ] - }, - "environment": { - "type": "string", - "description": "The environment from APM" - }, - "threshold": { - "type": "number", - "description": "The error count threshold value" - }, - "groupBy": { - "type": "array", - "default": [ - "service.name", - "service.environment" - ], - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "service.name", - "service.environment", - "transaction.name", - "error.grouping_key" - ] - } - }, - "errorGroupingKey": { - "type": "string" - } - } - }, - "params_property_apm_transaction_duration": { - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment", - "aggregationType" - ], - "properties": { - "serviceName": { - "type": "string", - "description": "The service name from APM" - }, - "transactionType": { - "type": "string", - "description": "The transaction type from APM" - }, - "transactionName": { - "type": "string", - "description": "The transaction name from APM" - }, - "windowSize": { - "type": "number", - "description": "The window size", - "example": 6 - }, - "windowUnit": { - "type": "string", - "description": "ç", - "enum": [ - "m", - "h", - "d" - ] - }, - "environment": { - "type": "string" - }, - "threshold": { - "type": "number", - "description": "The latency threshold value" - }, - "groupBy": { - "type": "array", - "default": [ - "service.name", - "service.environment", - "transaction.type" - ], - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "service.name", - "service.environment", - "transaction.type", - "transaction.name" - ] - } - }, - "aggregationType": { - "type": "string", - "enum": [ - "avg", - "95th", - "99th" - ] - } - } - }, - "params_property_apm_transaction_error_rate": { - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "properties": { - "serviceName": { - "type": "string", - "description": "The service name from APM" - }, - "transactionType": { - "type": "string", - "description": "The transaction type from APM" - }, - "transactionName": { - "type": "string", - "description": "The transaction name from APM" - }, - "windowSize": { - "type": "number", - "description": "The window size", - "example": 6 - }, - "windowUnit": { - "type": "string", - "description": "The window size unit", - "enum": [ - "m", - "h", - "d" - ] - }, - "environment": { - "type": "string", - "description": "The environment from APM" - }, - "threshold": { - "type": "number", - "description": "The error rate threshold value" - }, - "groupBy": { - "type": "array", - "default": [ - "service.name", - "service.environment", - "transaction.type" - ], - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "service.name", - "service.environment", - "transaction.type", - "transaction.name" - ] - } - } - } - }, - "aggfield": { - "description": "The name of the numeric field that is used in the aggregation. This property is required when `aggType` is `avg`, `max`, `min` or `sum`.\n", - "type": "string" - }, - "aggtype": { - "description": "The type of aggregation to perform.", - "type": "string", - "enum": [ - "avg", - "count", - "max", - "min", - "sum" - ], - "default": "count" - }, - "excludehitsfrompreviousrun": { - "description": "Indicates whether to exclude matches from previous runs. If `true`, you can avoid alert duplication by excluding documents that have already been detected by the previous rule run. This option is not available when a grouping field is specified.\n", - "type": "boolean" - }, - "groupby": { - "description": "Indicates whether the aggregation is applied over all documents (`all`) or split into groups (`top`) using a grouping field (`termField`). If grouping is used, an alert will be created for each group when it exceeds the threshold; only the top groups (up to `termSize` number of groups) are checked.\n", - "type": "string", - "enum": [ - "all", - "top" - ], - "default": "all" - }, - "termsize": { - "description": "This property is required when `groupBy` is `top`. It specifies the number of groups to check against the threshold and therefore limits the number of alerts on high cardinality fields.\n", - "type": "integer" - }, - "timefield": { - "description": "The field that is used to calculate the time window.", - "type": "string" - }, - "timewindowsize": { - "description": "The size of the time window (in `timeWindowUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.\n", - "type": "integer", - "example": 5 - }, - "timewindowunit": { - "description": "The type of units for the time window: seconds, minutes, hours, or days.\n", - "type": "string", - "enum": [ - "s", - "m", - "h", - "d" - ], - "example": "m" - }, - "size": { - "description": "The number of documents to pass to the configured actions when the threshold condition is met.\n", - "type": "integer" - }, - "termfield": { - "description": "The names of up to four fields that are used for grouping the aggregation. This property is required when `groupBy` is `top`.\n", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 4 - } - ] - }, - "threshold": { - "description": "The threshold value that is used with the `thresholdComparator`. If the `thresholdComparator` is `between` or `notBetween`, you must specify the boundary values.\n", - "type": "array", - "items": { - "type": "integer", - "example": 4000 - } - }, - "thresholdcomparator": { - "description": "The comparison function for the threshold. For example, \"is above\", \"is above or equals\", \"is below\", \"is below or equals\", \"is between\", and \"is not between\".", - "type": "string", - "enum": [ - ">", - ">=", - "<", - "<=", - "between", - "notBetween" - ], - "example": ">" - }, - "params_es_query_rule": { - "oneOf": [ - { - "type": "object", - "x-technical-preview": true, - "description": "The parameters for an Elasticsearch query rule that uses ES|QL to define the query. This functionality is in technical pre view and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.\n", - "required": [ - "esqlQuery", - "searchType", - "size", - "threshold", - "thresholdComparator", - "timeWindowSize", - "timeWindowUnit" - ], - "properties": { - "aggField": { - "$ref": "#/components/schemas/aggfield" - }, - "aggType": { - "$ref": "#/components/schemas/aggtype" - }, - "esqlQuery": { - "type": "object", - "required": [ - "esql" - ], - "properties": { - "esql": { - "description": "The query definition, which uses Elasticsearch Query Language.", - "type": "string" - } - } - }, - "excludeHitsFromPreviousRun": { - "$ref": "#/components/schemas/excludehitsfrompreviousrun" - }, - "groupBy": { - "$ref": "#/components/schemas/groupby" - }, - "searchType": { - "description": "The type of query, in this case a query that uses Elasticsearch Query Language (ES|QL).", - "type": "string", - "enum": [ - "esqlQuery" - ], - "example": "esqlQuery" - }, - "size": { - "type": "integer", - "description": "When `searchType` is `esqlQuery`, this property is required but it does not affect the rule behavior.\n", - "example": 0 - }, - "termSize": { - "$ref": "#/components/schemas/termsize" - }, - "threshold": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 0 - }, - "description": "The threshold value that is used with the `thresholdComparator`. When `searchType` is `esqlQuery`, this property is required and must be set to zero.\n" - }, - "thresholdComparator": { - "type": "string", - "description": "The comparison function for the threshold. When `searchType` is `esqlQuery`, this property is required and must be set to \">\". Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results.\n", - "enum": [ - ">" - ], - "example": ">" - }, - "timeField": { - "$ref": "#/components/schemas/timefield" - }, - "timeWindowSize": { - "$ref": "#/components/schemas/timewindowsize" - }, - "timeWindowUnit": { - "$ref": "#/components/schemas/timewindowunit" - } - } - }, - { - "type": "object", - "description": "The parameters for an Elasticsearch query rule that uses KQL or Lucene to define the query.", - "required": [ - "searchType", - "size", - "threshold", - "thresholdComparator", - "timeWindowSize", - "timeWindowUnit" - ], - "properties": { - "aggField": { - "$ref": "#/components/schemas/aggfield" - }, - "aggType": { - "$ref": "#/components/schemas/aggtype" - }, - "excludeHitsFromPreviousRun": { - "$ref": "#/components/schemas/excludehitsfrompreviousrun" - }, - "groupBy": { - "$ref": "#/components/schemas/groupby" - }, - "searchConfiguration": { - "description": "The query definition, which uses KQL or Lucene to fetch the documents from Elasticsearch.", - "type": "object", - "properties": { - "filter": { - "type": "array", - "items": { - "$ref": "#/components/schemas/filter" - } - }, - "index": { - "description": "The indices to query.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "query": { - "type": "object", - "properties": { - "language": { - "type": "string", - "example": "kuery" - }, - "query": { - "type": "string" - } - } - } - } - }, - "searchType": { - "description": "The type of query, in this case a text-based query that uses KQL or Lucene.", - "type": "string", - "enum": [ - "searchSource" - ], - "example": "searchSource" - }, - "size": { - "$ref": "#/components/schemas/size" - }, - "termField": { - "$ref": "#/components/schemas/termfield" - }, - "termSize": { - "$ref": "#/components/schemas/termsize" - }, - "threshold": { - "$ref": "#/components/schemas/threshold" - }, - "thresholdComparator": { - "$ref": "#/components/schemas/thresholdcomparator" - }, - "timeField": { - "$ref": "#/components/schemas/timefield" - }, - "timeWindowSize": { - "$ref": "#/components/schemas/timewindowsize" - }, - "timeWindowUnit": { - "$ref": "#/components/schemas/timewindowunit" - } - } - }, - { - "type": "object", - "description": "The parameters for an Elasticsearch query rule that uses Elasticsearch Query DSL to define the query.", - "required": [ - "esQuery", - "index", - "threshold", - "thresholdComparator", - "timeField", - "timeWindowSize", - "timeWindowUnit" - ], - "properties": { - "aggField": { - "$ref": "#/components/schemas/aggfield" - }, - "aggType": { - "$ref": "#/components/schemas/aggtype" - }, - "esQuery": { - "description": "The query definition, which uses Elasticsearch Query DSL.", - "type": "string" - }, - "excludeHitsFromPreviousRun": { - "$ref": "#/components/schemas/excludehitsfrompreviousrun" - }, - "groupBy": { - "$ref": "#/components/schemas/groupby" - }, - "index": { - "description": "The indices to query.", - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "searchType": { - "description": "The type of query, in this case a query that uses Elasticsearch Query DSL.", - "type": "string", - "enum": [ - "esQuery" - ], - "default": "esQuery", - "example": "esQuery" - }, - "size": { - "$ref": "#/components/schemas/size" - }, - "termField": { - "$ref": "#/components/schemas/termfield" - }, - "termSize": { - "$ref": "#/components/schemas/termsize" - }, - "threshold": { - "$ref": "#/components/schemas/threshold" - }, - "thresholdComparator": { - "$ref": "#/components/schemas/thresholdcomparator" - }, - "timeField": { - "$ref": "#/components/schemas/timefield" - }, - "timeWindowSize": { - "$ref": "#/components/schemas/timewindowsize" - }, - "timeWindowUnit": { - "$ref": "#/components/schemas/timewindowunit" - } - } - } - ] - }, - "params_index_threshold_rule": { - "type": "object", - "description": "The parameters for an index threshold rule.", - "required": [ - "index", - "threshold", - "thresholdComparator", - "timeField", - "timeWindowSize", - "timeWindowUnit" - ], - "properties": { - "aggField": { - "$ref": "#/components/schemas/aggfield" - }, - "aggType": { - "$ref": "#/components/schemas/aggtype" - }, - "filterKuery": { - "description": "A KQL expression thats limits the scope of alerts.", - "type": "string" - }, - "groupBy": { - "$ref": "#/components/schemas/groupby" - }, - "index": { - "description": "The indices to query.", - "type": "array", - "items": { - "type": "string" - } - }, - "termField": { - "$ref": "#/components/schemas/termfield" - }, - "termSize": { - "$ref": "#/components/schemas/termsize" - }, - "threshold": { - "$ref": "#/components/schemas/threshold" - }, - "thresholdComparator": { - "$ref": "#/components/schemas/thresholdcomparator" - }, - "timeField": { - "$ref": "#/components/schemas/timefield" - }, - "timeWindowSize": { - "$ref": "#/components/schemas/timewindowsize" - }, - "timeWindowUnit": { - "$ref": "#/components/schemas/timewindowunit" - } - } - }, - "params_property_infra_inventory": { - "properties": { - "criteria": { - "type": "array", - "items": { - "type": "object", - "properties": { - "metric": { - "type": "string", - "enum": [ - "count", - "cpu", - "diskLatency", - "load", - "memory", - "memoryTotal", - "tx", - "rx", - "logRate", - "diskIOReadBytes", - "diskIOWriteBytes", - "s3TotalRequests", - "s3NumberOfObjects", - "s3BucketSize", - "s3DownloadBytes", - "s3UploadBytes", - "rdsConnections", - "rdsQueriesExecuted", - "rdsActiveTransactions", - "rdsLatency", - "sqsMessagesVisible", - "sqsMessagesDelayed", - "sqsMessagesSent", - "sqsMessagesEmpty", - "sqsOldestMessage", - "custom" - ] - }, - "timeSize": { - "type": "number" - }, - "timeUnit": { - "type": "string", - "enum": [ - "s", - "m", - "h", - "d" - ] - }, - "sourceId": { - "type": "string" - }, - "threshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "comparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "customMetric": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ] - }, - "field": { - "type": "string" - }, - "aggregation": { - "type": "string", - "enum": [ - "avg", - "max", - "min", - "rate" - ] - }, - "id": { - "type": "string" - }, - "label": { - "type": "string" - } - } - }, - "warningThreshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "warningComparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - } - } - } - }, - "filterQuery": { - "type": "string" - }, - "filterQueryText": { - "type": "string" - }, - "nodeType": { - "type": "string", - "enum": [ - "host", - "pod", - "container", - "awsEC2", - "awsS3", - "awsSQS", - "awsRDS" - ] - }, - "sourceId": { - "type": "string" - }, - "alertOnNoData": { - "type": "boolean" - } - } - }, - "params_property_infra_metric_threshold": { - "properties": { - "criteria": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "non count criterion", - "type": "object", - "properties": { - "threshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "comparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "timeUnit": { - "type": "string" - }, - "timeSize": { - "type": "number" - }, - "warningThreshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "warningComparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "metric": { - "type": "string" - }, - "aggType": { - "type": "string", - "enum": [ - "avg", - "max", - "min", - "cardinality", - "rate", - "count", - "sum", - "p95", - "p99", - "custom" - ] - } - } - }, - { - "title": "count criterion", - "type": "object", - "properties": { - "threshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "comparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "timeUnit": { - "type": "string" - }, - "timeSize": { - "type": "number" - }, - "warningThreshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "warningComparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "aggType": { - "type": "string", - "enum": [ - "count" - ] - } - } - }, - { - "title": "custom criterion", - "type": "object", - "properties": { - "threshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "comparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "timeUnit": { - "type": "string" - }, - "timeSize": { - "type": "number" - }, - "warningThreshold": { - "type": "array", - "items": { - "type": "number" - } - }, - "warningComparator": { - "type": "string", - "enum": [ - "<", - "<=", - ">", - ">=", - "between", - "outside" - ] - }, - "aggType": { - "type": "string", - "enum": [ - "custom" - ] - }, - "customMetric": { - "type": "array", - "items": { - "oneOf": [ - { + }, + "slo": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "aggType": { - "type": "string", - "enum": [ - "avg", - "sum", - "max", - "min", - "cardinality" - ] + "all": { + "type": "boolean" }, - "field": { - "type": "string" + "read": { + "type": "boolean" } } }, - { + "stackAlerts": { "type": "object", "properties": { - "name": { - "type": "string" + "all": { + "type": "boolean" }, - "aggType": { - "type": "string", - "enum": [ - "count" - ] + "read": { + "type": "boolean" + } + } + }, + "uptime": { + "type": "object", + "properties": { + "all": { + "type": "boolean" }, - "filter": { - "type": "string" + "read": { + "type": "boolean" } } } - ] - } - }, - "equation": { - "type": "string" - }, - "label": { - "type": "string" - } - } - } - ] - } - }, - "groupBy": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "filterQuery": { - "type": "string" - }, - "sourceId": { - "type": "string" - }, - "alertOnNoData": { - "type": "boolean" - }, - "alertOnGroupDisappear": { - "type": "boolean" - } - } - }, - "params_property_log_threshold": { - "oneOf": [ - { - "title": "Count", - "type": "object", - "required": [ - "count", - "timeSize", - "timeUnit", - "logView" - ], - "properties": { - "criteria": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string", - "example": "my.field" - }, - "comparator": { - "type": "string", - "enum": [ - "more than", - "more than or equals", - "less than", - "less than or equals", - "equals", - "does not equal", - "matches", - "does not match", - "matches phrase", - "does not match phrase" - ] - }, - "value": { - "oneOf": [ - { - "type": "number", - "example": 42 - }, - { - "type": "string", - "example": "value" } - ] - } - } - } - }, - "count": { - "type": "object", - "properties": { - "comparator": { - "type": "string", - "enum": [ - "more than", - "more than or equals", - "less than", - "less than or equals", - "equals", - "does not equal", - "matches", - "does not match", - "matches phrase", - "does not match phrase" - ] - }, - "value": { - "type": "number", - "example": 100 - } - } - }, - "timeSize": { - "type": "number", - "example": 6 - }, - "timeUnit": { - "type": "string", - "enum": [ - "s", - "m", - "h", - "d" - ] - }, - "logView": { - "type": "object", - "properties": { - "logViewId": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "log-view-reference" - ], - "example": "log-view-reference" - } - } - }, - "groupBy": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - { - "title": "Ratio", - "type": "object", - "required": [ - "count", - "timeSize", - "timeUnit", - "logView" - ], - "properties": { - "criteria": { - "type": "array", - "items": { - "minItems": 2, - "maxItems": 2, - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string", - "example": "my.field" }, - "comparator": { + "category": { "type": "string", + "description": "The rule category, which is used by features such as category-specific maintenance windows.", "enum": [ - "more than", - "more than or equals", - "less than", - "less than or equals", - "equals", - "does not equal", - "matches", - "does not match", - "matches phrase", - "does not match phrase" + "management", + "observability", + "securitySolution" ] }, - "value": { - "oneOf": [ - { - "type": "number", - "example": 42 + "default_action_group_id": { + "description": "The default identifier for the rule type group.", + "type": "string" + }, + "does_set_recovery_context": { + "description": "Indicates whether the rule passes context variables to its recovery action.", + "type": "boolean" + }, + "enabled_in_license": { + "description": "Indicates whether the rule type is enabled or disabled based on the subscription.", + "type": "boolean" + }, + "has_alerts_mappings": { + "type": "boolean", + "description": "Indicates whether the rule type has custom mappings for the alert data." + }, + "has_fields_for_a_a_d": { + "type": "boolean" + }, + "id": { + "description": "The unique identifier for the rule type.", + "type": "string" + }, + "is_exportable": { + "description": "Indicates whether the rule type is exportable in **Stack Management > Saved Objects**.", + "type": "boolean" + }, + "minimum_license_required": { + "description": "The subscriptions required to use the rule type.", + "type": "string", + "example": "basic" + }, + "name": { + "description": "The descriptive name of the rule type.", + "type": "string" + }, + "producer": { + "description": "An identifier for the application that produces this rule type.", + "type": "string", + "example": "stackAlerts" + }, + "recovery_action_group": { + "description": "An action group to use when an alert goes from an active state to an inactive one.", + "type": "object", + "properties": { + "id": { + "type": "string" }, - { - "type": "string", - "example": "value" + "name": { + "type": "string" } - ] - } - } - } - } - }, - "count": { - "type": "object", - "properties": { - "comparator": { - "type": "string", - "enum": [ - "more than", - "more than or equals", - "less than", - "less than or equals", - "equals", - "does not equal", - "matches", - "does not match", - "matches phrase", - "does not match phrase" - ] - }, - "value": { - "type": "number", - "example": 100 - } - } - }, - "timeSize": { - "type": "number", - "example": 6 - }, - "timeUnit": { - "type": "string", - "enum": [ - "s", - "m", - "h", - "d" - ] - }, - "logView": { - "type": "object", - "properties": { - "logViewId": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "log-view-reference" - ], - "example": "log-view-reference" - } - } - }, - "groupBy": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "params_property_slo_burn_rate": { - "properties": { - "sloId": { - "description": "The SLO identifier used by the rule", - "type": "string", - "example": "8853df00-ae2e-11ed-90af-09bb6422b258" - }, - "burnRateThreshold": { - "description": "The burn rate threshold used to trigger the alert", - "type": "number", - "example": 14.4 - }, - "maxBurnRateThreshold": { - "description": "The maximum burn rate threshold value defined by the SLO error budget", - "type": "number", - "example": 168 - }, - "longWindow": { - "description": "The duration of the long window used to compute the burn rate", - "type": "object", - "properties": { - "value": { - "description": "The duration value", - "type": "number", - "example": 6 - }, - "unit": { - "description": "The duration unit", - "type": "string", - "example": "h" - } - } - }, - "shortWindow": { - "description": "The duration of the short window used to compute the burn rate", - "type": "object", - "properties": { - "value": { - "description": "The duration value", - "type": "number", - "example": 30 - }, - "unit": { - "description": "The duration unit", - "type": "string", - "example": "m" - } - } - } - } - }, - "params_property_synthetics_uptime_tls": { - "properties": { - "search": { - "type": "string" - }, - "certExpirationThreshold": { - "type": "number" - }, - "certAgeThreshold": { - "type": "number" - } - } - }, - "params_property_synthetics_monitor_status": { - "required": [ - "numTimes", - "shouldCheckStatus", - "shouldCheckAvailability" - ], - "properties": { - "availability": { - "type": "object", - "properties": { - "range": { - "type": "number" - }, - "rangeUnit": { - "type": "string" - }, - "threshold": { - "type": "string" - } - } - }, - "filters": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "deprecated": true, - "properties": { - "monitor.type": { - "type": "array", - "items": { - "type": "string" - } - }, - "observer.geo.name": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "url.port": { - "type": "array", - "items": { - "type": "string" + } + }, + "rule_task_timeout": { + "type": "string", + "example": "5m" + } } } - } - } - ] - }, - "locations": { - "deprecated": true, - "type": "array", - "items": { - "type": "string" - } - }, - "numTimes": { - "type": "number" - }, - "search": { - "type": "string" - }, - "shouldCheckStatus": { - "type": "boolean" - }, - "shouldCheckAvailability": { - "type": "boolean" - }, - "timerangeCount": { - "type": "number" - }, - "timerangeUnit": { - "type": "string" - }, - "timerange": { - "deprecated": true, - "type": "object", - "properties": { - "from": { - "type": "string" - }, - "to": { - "type": "string" - } - } - }, - "version": { - "type": "number" - }, - "isAutoGenerated": { - "type": "boolean" - } - } - }, - "create_rule_request": { - "title": "Create rule request body properties", - "description": "The properties vary depending on the rule type.", - "oneOf": [ - { - "$ref": "#/components/schemas/create_anomaly_detection_alert_rule_request" - }, - { - "$ref": "#/components/schemas/create_anomaly_detection_jobs_health_rule_request" - }, - { - "$ref": "#/components/schemas/create_apm_anomaly_rule_request" - }, - { - "$ref": "#/components/schemas/create_apm_error_count_rule_request" - }, - { - "$ref": "#/components/schemas/create_apm_transaction_duration_rule_request" - }, - { - "$ref": "#/components/schemas/create_apm_transaction_error_rate_rule_request" - }, - { - "$ref": "#/components/schemas/create_es_query_rule_request" - }, - { - "$ref": "#/components/schemas/create_geo_containment_rule_request" - }, - { - "$ref": "#/components/schemas/create_index_threshold_rule_request" - }, - { - "$ref": "#/components/schemas/create_infra_inventory_rule_request" - }, - { - "$ref": "#/components/schemas/create_infra_metric_anomaly_rule_request" - }, - { - "$ref": "#/components/schemas/create_infra_metric_threshold_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_jvm_memory_usage_rule_request" - }, - { - "$ref": "#/components/schemas/create_log_threshold_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_ccr_exceptions_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_cluster_health_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_cpu_usage_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_disk_usage_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_license_expiration_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_kibana_version_mismatch_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_logstash_version_mismatch_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_missing_data_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_nodes_changed_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_shard_size_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request" - }, - { - "$ref": "#/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_eql_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_indicator_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_ml_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_new_terms_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_notifications_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_query_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_saved_query_rule_request" - }, - { - "$ref": "#/components/schemas/create_siem_threshold_rule_request" - }, - { - "$ref": "#/components/schemas/create_slo_burn_rate_rule_request" - }, - { - "$ref": "#/components/schemas/create_synthetics_monitor_status_rule_request" - }, - { - "$ref": "#/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request" - }, - { - "$ref": "#/components/schemas/create_synthetics_uptime_tls_rule_request" - }, - { - "$ref": "#/components/schemas/create_synthetics_uptime_tls_certificate_rule_request" - }, - { - "$ref": "#/components/schemas/create_transform_health_rule_request" - }, - { - "$ref": "#/components/schemas/create_uptime_monitor_status_rule_request" - } - ], - "discriminator": { - "propertyName": "rule_type_id", - "mapping": { - "xpack.ml.anomaly_detection_alert": "#/components/schemas/create_anomaly_detection_alert_rule_request", - "xpack.ml.anomaly_detection_jobs_health": "#/components/schemas/create_anomaly_detection_jobs_health_rule_request", - "apm.anomaly": "#/components/schemas/create_apm_anomaly_rule_request", - "apm.error_rate": "#/components/schemas/create_apm_error_count_rule_request", - "apm.transaction_duration": "#/components/schemas/create_apm_transaction_duration_rule_request", - "apm.transaction_error_rate": "#/components/schemas/create_apm_transaction_error_rate_rule_request", - ".es-query": "#/components/schemas/create_es_query_rule_request", - ".geo-containment": "#/components/schemas/create_geo_containment_rule_request", - ".index-threshold": "#/components/schemas/create_index_threshold_rule_request", - "metrics.alert.inventory.threshold": "#/components/schemas/create_infra_inventory_rule_request", - "metrics.alert.anomaly": "#/components/schemas/create_infra_metric_anomaly_rule_request", - "metrics.alert.threshold": "#/components/schemas/create_infra_metric_threshold_rule_request", - "monitoring_alert_jvm_memory_usage": "#/components/schemas/create_monitoring_jvm_memory_usage_rule_request", - "logs.alert.document.count": "#/components/schemas/create_log_threshold_rule_request", - "monitoring_ccr_read_exceptions": "#/components/schemas/create_monitoring_ccr_exceptions_rule_request", - "monitoring_alert_cluster_health": "#/components/schemas/create_monitoring_cluster_health_rule_request", - "monitoring_alert_cpu_usage": "#/components/schemas/create_monitoring_cpu_usage_rule_request", - "monitoring_alert_disk_usage": "#/components/schemas/create_monitoring_disk_usage_rule_request", - "monitoring_alert_elasticsearch_version_mismatch": "#/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request", - "monitoring_alert_license_expiration": "#/components/schemas/create_monitoring_license_expiration_rule_request", - "monitoring_alert_kibana_version_mismatch": "#/components/schemas/create_monitoring_kibana_version_mismatch_rule_request", - "monitoring_alert_logstash_version_mismatch": "#/components/schemas/create_monitoring_logstash_version_mismatch_rule_request", - "monitoring_alert_missing_monitoring_data": "#/components/schemas/create_monitoring_missing_data_rule_request", - "monitoring_alert_nodes_changed": "#/components/schemas/create_monitoring_nodes_changed_rule_request", - "monitoring_shard_size": "#/components/schemas/create_monitoring_shard_size_rule_request", - "monitoring_alert_thread_pool_search_rejections": "#/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request", - "monitoring_alert_thread_pool_write_rejections": "#/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request", - "siem.eqlRule": "#/components/schemas/create_siem_eql_rule_request", - "siem.indicatorRule": "#/components/schemas/create_siem_indicator_rule_request", - "siem.mlRule": "#/components/schemas/create_siem_ml_rule_request", - "siem.newTermsRule": "#/components/schemas/create_siem_new_terms_rule_request", - "siem.notifications": "#/components/schemas/create_siem_notifications_rule_request", - "siem.queryRule": "#/components/schemas/create_siem_query_rule_request", - "siem.savedQueryRule": "#/components/schemas/create_siem_saved_query_rule_request", - "siem.thresholdRule": "#/components/schemas/create_siem_threshold_rule_request", - "slo.rules.burnRate": "#/components/schemas/create_slo_burn_rate_rule_request", - "xpack.synthetics.alerts.monitorStatus": "#/components/schemas/create_synthetics_monitor_status_rule_request", - "xpack.uptime.alerts.durationAnomaly": "#/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request", - "xpack.uptime.alerts.tls": "#/components/schemas/create_synthetics_uptime_tls_rule_request", - "xpack.uptime.alerts.tlsCertificate": "#/components/schemas/create_synthetics_uptime_tls_certificate_rule_request", - "transform_health": "#/components/schemas/create_transform_health_rule_request", - "xpack.uptime.alerts.monitorStatus": "#/components/schemas/create_uptime_monitor_status_rule_request" - } - } - }, - "rule_response_properties": { - "title": "Rule response properties", - "type": "object", - "required": [ - "actions", - "api_key_owner", - "consumer", - "created_at", - "created_by", - "enabled", - "execution_status", - "id", - "mute_all", - "muted_alert_ids", - "name", - "params", - "rule_type_id", - "schedule", - "tags", - "throttle", - "updated_at", - "updated_by" - ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "api_key_created_by_user": { - "type": "boolean", - "description": "Indicates whether the API key that is associated with the rule was created by the user.", - "example": false - }, - "api_key_owner": { - "type": "string", - "description": "The owner of the API key that is associated with the rule and used to run background tasks.\n", - "nullable": true, - "example": "elastic" - }, - "consumer": { - "type": "string", - "description": "The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.", - "example": "alerts" - }, - "created_at": { - "type": "string", - "description": "The date and time that the rule was created.", - "format": "date-time", - "example": "2022-12-05T23:36:58.284Z" - }, - "created_by": { - "type": "string", - "description": "The identifier for the user that created the rule.", - "nullable": true, - "example": "elastic" - }, - "enabled": { - "type": "boolean", - "description": "Indicates whether the rule is currently enabled.", - "example": true - }, - "execution_status": { - "type": "object", - "properties": { - "last_duration": { - "type": "integer", - "example": 55 - }, - "last_execution_date": { - "type": "string", - "format": "date-time", - "example": "2022-12-06T00:13:43.890Z" - }, - "status": { - "type": "string", - "example": "ok" - } - } - }, - "id": { - "type": "string", - "description": "The identifier for the rule.", - "example": "b530fed0-74f5-11ed-9801-35303b735aef" - }, - "last_run": { - "type": "object", - "properties": { - "alerts_count": { - "type": "object", - "properties": { - "active": { - "type": "integer" - }, - "ignored": { - "type": "integer" - }, - "new": { - "type": "integer" - }, - "recovered": { - "type": "integer" + }, + "examples": { + "getRuleTypesResponse": { + "$ref": "#/components/examples/get_rule_types_response" } } - }, - "outcome": { - "type": "string", - "example": "succeeded" - }, - "outcome_msg": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "outcome_order": { - "type": "integer" - }, - "warning": { - "type": "string", - "nullable": true, - "example": null } } }, - "muted_alert_ids": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "mute_all": { - "type": "boolean", - "example": false - }, - "name": { - "type": "string", - "description": "The name of the rule.", - "example": "cluster_health_rule" - }, - "next_run": { - "type": "string", - "format": "date-time", - "nullable": true, - "example": "2022-12-06T00:14:43.818Z" - }, - "notify_when": { - "type": "string", - "description": "Indicates how often alerts generate actions.", - "nullable": true - }, - "params": { - "type": "object", - "description": "The parameters for the rule.", - "additionalProperties": true - }, - "revision": { - "type": "integer", - "description": "The rule revision number." - }, - "rule_type_id": { - "type": "string", - "description": "The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`.\n", - "example": "monitoring_alert_cluster_health" - }, - "running": { - "type": "boolean", - "description": "Indicates whether the rule is running." - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "scheduled_task_id": { - "type": "string", - "example": "b530fed0-74f5-11ed-9801-35303b735aef" - }, - "tags": { - "$ref": "#/components/schemas/tags" - }, - "throttle": { - "$ref": "#/components/schemas/throttle" - }, - "updated_at": { - "type": "string", - "description": "The date and time that the rule was updated most recently.", - "example": "2022-12-05T23:36:58.284Z" - }, - "updated_by": { - "type": "string", - "description": "The identifier for the user that updated this rule most recently.", - "nullable": true, - "example": "elastic" - } - } - }, - "401_response": { - "type": "object", - "title": "Unsuccessful rule API response", - "properties": { - "error": { - "type": "string", - "example": "Unauthorized", - "enum": [ - "Unauthorized" - ] - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "integer", - "example": 401, - "enum": [ - 401 - ] + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } } } - }, - "404_response": { - "type": "object", - "properties": { - "error": { - "type": "string", - "example": "Not Found", - "enum": [ - "Not Found" - ] + } + }, + "/api/alerts/alert/{alertId}": { + "delete": { + "summary": "Delete an alert", + "operationId": "legaryDeleteAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After you delete an alert, you cannot recover it.\n", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "message": { - "type": "string", - "example": "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found" + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." }, - "statusCode": { - "type": "integer", - "example": 404, - "enum": [ - 404 - ] + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } } } }, - "update_rule_request": { - "title": "Update rule request", - "description": "The update rule API request body varies depending on the type of rule and actions.\n", - "type": "object", - "required": [ - "name", - "params", - "schedule" + "get": { + "summary": "Get an alert by identifier", + "operationId": "legacyGetAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the get rule API instead.", + "tags": [ + "alerting" ], - "properties": { - "actions": { - "$ref": "#/components/schemas/actions" - }, - "alert_delay": { - "$ref": "#/components/schemas/alert_delay" - }, - "name": { - "type": "string", - "description": "The name of the rule.", - "example": "cluster_health_rule" - }, - "notify_when": { - "$ref": "#/components/schemas/notify_when" - }, - "params": { - "type": "object", - "description": "The parameters for the rule.", - "additionalProperties": true - }, - "schedule": { - "$ref": "#/components/schemas/schedule" - }, - "tags": { - "$ref": "#/components/schemas/tags" + "parameters": [ + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/alert_response_properties" + } + } + } }, - "throttle": { - "$ref": "#/components/schemas/throttle" + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } } } }, - "fieldmap_properties": { - "title": "Field map objects in the get rule types response", - "type": "object", - "properties": { - "array": { - "type": "boolean", - "description": "Indicates whether the field is an array." - }, - "dynamic": { - "type": "boolean", - "description": "Indicates whether it is a dynamic field mapping." - }, - "format": { - "type": "string", - "description": "Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`.\n" - }, - "ignore_above": { - "type": "integer", - "description": "Specifies the maximum length of a string field. Longer strings are not indexed or stored." - }, - "index": { - "type": "boolean", - "description": "Indicates whether field values are indexed." - }, - "path": { - "type": "string", - "description": "TBD" + "post": { + "summary": "Create an alert", + "operationId": "legacyCreateAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the create rule API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "properties": { - "type": "object", - "description": "Details about the object properties. This property is applicable when `type` is `object`.\n", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The data type for each object property." + { + "in": "path", + "name": "alertId", + "description": "An UUID v1 or v4 identifier for the alert. If this parameter is omitted, the identifier is randomly generated.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "title": "Legacy create alert request properties", + "type": "object", + "required": [ + "alertTypeId", + "consumer", + "name", + "notifyWhen", + "params", + "schedule" + ], + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "actionTypeId", + "group", + "id", + "params" + ], + "properties": { + "actionTypeId": { + "type": "string", + "description": "The identifier for the action type." + }, + "group": { + "type": "string", + "description": "Grouping actions is recommended for escalations for different types of alert instances. If you don't need this functionality, set it to `default`.\n" + }, + "id": { + "type": "string", + "description": "The ID of the action saved object." + }, + "params": { + "type": "object", + "description": "The map to the `params` that the action type will receive. `params` are handled as Mustache templates and passed a default set of context.\n" + } + } + } + }, + "alertTypeId": { + "type": "string", + "description": "The ID of the alert type that you want to call when the alert is scheduled to run." + }, + "consumer": { + "type": "string", + "description": "The name of the application that owns the alert. This name has to match the Kibana feature name, as that dictates the required role-based access control privileges." + }, + "enabled": { + "type": "boolean", + "description": "Indicates if you want to run the alert on an interval basis after it is created." + }, + "name": { + "type": "string", + "description": "A name to reference and search." + }, + "notifyWhen": { + "type": "string", + "description": "The condition for throttling the notification.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ] + }, + "params": { + "type": "object", + "description": "The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined." + }, + "schedule": { + "type": "object", + "description": "The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.\n", + "properties": { + "interval": { + "type": "string", + "description": "The interval format specifies the interval in seconds, minutes, hours or days at which the alert should run.", + "example": "10s" + } + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of keywords to reference and search." + }, + "throttle": { + "type": "string", + "description": "How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period.\n" + } } } } - }, - "required": { - "type": "boolean", - "description": "Indicates whether the field is required." - }, - "scaling_factor": { - "type": "integer", - "description": "The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. \n" - }, - "type": { - "type": "string", - "description": "Specifies the data type for the field.", - "example": "scaled_float" - } - } - }, - "400_response": { - "title": "Bad request", - "type": "object", - "required": [ - "error", - "message", - "statusCode" - ], - "properties": { - "error": { - "type": "string", - "enum": [ - "Bad Request" - ] - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "integer", - "enum": [ - 400 - ] } - } - }, - "alert_response_properties": { - "title": "Legacy alert response properties", - "type": "object", - "properties": { - "actions": { - "type": "array", - "items": { - "type": "object" + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/alert_response_properties" + } + } } }, - "alertTypeId": { - "type": "string", - "example": ".index-threshold" - }, - "apiKeyOwner": { - "type": "string", - "nullable": true, - "example": "elastic" - }, - "createdAt": { - "type": "string", - "description": "The date and time that the alert was created.", - "format": "date-time", - "example": "2022-12-05T23:36:58.284Z" - }, - "createdBy": { - "type": "string", - "description": "The identifier for the user that created the alert.", - "example": "elastic" - }, - "enabled": { - "type": "boolean", - "description": "Indicates whether the alert is currently enabled.", - "example": true - }, - "executionStatus": { - "type": "object", - "properties": { - "lastExecutionDate": { - "type": "string", - "format": "date-time", - "example": "2022-12-06T00:13:43.890Z" - }, - "status": { - "type": "string", - "example": "ok" + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } } } + } + } + }, + "put": { + "summary": "Update an alert", + "operationId": "legacyUpdateAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the update rule API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "id": { - "type": "string", + { + "in": "path", + "name": "alertId", "description": "The identifier for the alert.", - "example": "b530fed0-74f5-11ed-9801-35303b735aef" - }, - "muteAll": { - "type": "boolean", - "example": false - }, - "mutedInstanceIds": { - "type": "array", - "nullable": true, - "items": { - "type": "string" + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" } - }, - "name": { - "type": "string", - "description": "The name of the alert.", - "example": "my alert" - }, - "notifyWhen": { - "type": "string", - "example": "onActionGroupChange" - }, - "params": { - "type": "object", - "additionalProperties": true - }, - "schedule": { - "type": "object", - "properties": { - "interval": { - "type": "string" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "title": "Legacy update alert request properties", + "type": "object", + "required": [ + "name", + "notifyWhen", + "params", + "schedule" + ], + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "actionTypeId", + "group", + "id", + "params" + ], + "properties": { + "actionTypeId": { + "type": "string", + "description": "The identifier for the action type." + }, + "group": { + "type": "string", + "description": "Grouping actions is recommended for escalations for different types of alert instances. If you don't need this functionality, set it to `default`.\n" + }, + "id": { + "type": "string", + "description": "The ID of the action saved object." + }, + "params": { + "type": "object", + "description": "The map to the `params` that the action type will receive. `params` are handled as Mustache templates and passed a default set of context.\n" + } + } + } + }, + "name": { + "type": "string", + "description": "A name to reference and search." + }, + "notifyWhen": { + "type": "string", + "description": "The condition for throttling the notification.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ] + }, + "params": { + "type": "object", + "description": "The parameters to pass to the alert type executor `params` value. This will also validate against the alert type params validator, if defined." + }, + "schedule": { + "type": "object", + "description": "The schedule specifying when this alert should be run. A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.\n", + "properties": { + "interval": { + "type": "string", + "description": "The interval format specifies the interval in seconds, minutes, hours or days at which the alert should run.", + "example": "1d" + } + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of keywords to reference and search." + }, + "throttle": { + "type": "string", + "description": "How often this alert should fire the same actions. This will prevent the alert from sending out the same notification over and over. For example, if an alert with a schedule of 1 minute stays in a triggered state for 90 minutes, setting a throttle of `10m` or `1h` will prevent it from sending 90 notifications during this period.\n" + } + } } } - }, - "scheduledTaskId": { - "type": "string", - "example": "b530fed0-74f5-11ed-9801-35303b735aef" - }, - "tags": { - "type": "array", - "items": { - "type": "string" + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/alert_response_properties" + } + } } }, - "throttle": { - "type": "string", - "nullable": true - }, - "updatedAt": { - "type": "string", - "example": "2022-12-05T23:36:58.284Z" - }, - "updatedBy": { - "type": "string", - "description": "The identifier for the user that updated this alert most recently.", - "nullable": true, - "example": "elastic" + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } } } } }, - "examples": { - "create_es_query_esql_rule_request": { - "summary": "Create an Elasticsearch query rule that uses Elasticsearch Query Language (ES|QL).", - "value": { - "name": "my Elasticsearch query ESQL rule", - "params": { - "searchType": "esqlQuery", - "esqlQuery": { - "esql": "FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest | where geo.dest != \"GB\" | STATS sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | SORT sumbytes desc | LIMIT 10" - }, - "timeField": "@timestamp", - "timeWindowSize": 1, - "timeWindowUnit": "d", - "size": 0, - "thresholdComparator": ">", - "threshold": [ - 0 - ] - }, - "consumer": "stackAlerts", - "rule_type_id": ".es-query", - "schedule": { - "interval": "1d" + "/api/alerts/alert/{alertId}/_disable": { + "post": { + "summary": "Disable an alert", + "operationId": "legacyDisableAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the disable rule API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "actions": [ - { - "group": "query matched", - "id": "d0db1fe0-78d6-11ee-9177-f7d404c8c945", - "params": { - "level": "info", - "message": "Elasticsearch query rule '{{rule.name}}' is active:\n- Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}}" - }, - "frequency": { - "summary": false, - "notify_when": "onActiveAlert" - } + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" } - ] - } - }, - "create_es_query_rule_request": { - "summary": "Create an Elasticsearch query rule that uses Elasticsearch query domain specific language (DSL) to define its query and a server log connector to send notifications.", - "value": { - "actions": [ - { - "group": "query matched", - "params": { - "level": "info", - "message": "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts." - }, - "id": "fdbece50-406c-11ee-850e-c71febc4ca7f", - "frequency": { - "throttle": "1d", - "summary": true, - "notify_when": "onThrottleInterval" - } - }, - { - "group": "recovered", - "params": { - "level": "info", - "message": "Recovered" - }, - "id": "fdbece50-406c-11ee-850e-c71febc4ca7f", - "frequency": { - "summary": false, - "notify_when": "onActionGroupChange" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } } } - ], - "consumer": "alerts", - "name": "my Elasticsearch query rule", - "params": { - "esQuery": "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"", - "index": [ - "kibana_sample_data_logs" - ], - "size": 100, - "threshold": [ - 100 - ], - "thresholdComparator": ">", - "timeField": "@timestamp", - "timeWindowSize": 1, - "timeWindowUnit": "d" - }, - "rule_type_id": ".es-query", - "schedule": { - "interval": "1d" } } - }, - "create_es_query_kql_rule_request": { - "summary": "Create an Elasticsearch query rule that uses Kibana query language (KQL).", - "value": { - "consumer": "alerts", - "name": "my Elasticsearch query KQL rule", - "params": { - "aggType": "count", - "excludeHitsFromPreviousRun": true, - "groupBy": "all", - "searchConfiguration": { - "query": { - "query": "\"\"geo.src : \"US\" \"\"", - "language": "kuery" - }, - "index": "90943e30-9a47-11e8-b64d-95841ca0b247" - }, - "searchType": "searchSource", - "size": 100, - "threshold": [ - 1000 - ], - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m" + } + }, + "/api/alerts/alert/{alertId}/_enable": { + "post": { + "summary": "Enable an alert", + "operationId": "legacyEnableAlert", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the enable rule API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "rule_type_id": ".es-query", - "schedule": { - "interval": "1m" + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } } - } - }, - "create_index_threshold_rule_request": { - "summary": "Create an index threshold rule.", - "value": { - "actions": [ - { - "id": "48de3460-f401-11ed-9f8e-399c75a2deeb", - "frequency": { - "notify_when": "onActionGroupChange", - "summary": false - }, - "group": "threshold met", - "params": { - "level": "info", - "message": "Rule '{{rule.name}}' is active for group '{{context.group}}':\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" + ], + "responses": { + "204": { + "description": "Indicates a successful call." + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } } } - ], - "alert_delay": { - "active": 3 - }, - "consumer": "alerts", - "name": "my rule", - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [ - 1000 - ], - "index": [ - ".test-index" - ], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" - }, - "rule_type_id": ".index-threshold", - "schedule": { - "interval": "1m" - }, - "tags": [ - "cpu" - ] - } - }, - "create_tracking_containment_rule_request": { - "summary": "Create a tracking containment rule.", - "value": { - "consumer": "alerts", - "name": "my tracking rule", - "params": { - "index": "kibana_sample_data_logs", - "dateField\"": "@timestamp", - "geoField": "geo.coordinates", - "entity": "agent.keyword", - "boundaryType": "entireIndex", - "boundaryIndexTitle": "boundary*", - "boundaryGeoField": "location", - "boundaryNameField": "name", - "indexId": "90943e30-9a47-11e8-b64d-95841ca0b247", - "boundaryIndexId": "0cd90abf-abe7-44c7-909a-f621bbbcfefc" - }, - "rule_type_id": ".geo-containment", - "schedule": { - "interval": "1h" } } - }, - "create_es_query_esql_rule_response": { - "summary": "The create rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "e0d62360-78e8-11ee-9177-f7d404c8c945", - "enabled": true, - "name": "my Elasticsearch query ESQL rule", - "tags": [], - "rule_type_id": ".es-query", - "consumer": "stackAlerts", - "schedule": { - "interval": "1d" + } + }, + "/api/alerts/alert/{alertId}/_mute_all": { + "post": { + "summary": "Mute all alert instances", + "operationId": "legacyMuteAllAlertInstances", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the mute all alerts API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "actions": [ - { - "group": "query matched", - "id": "d0db1fe0-78d6-11ee-9177-f7d404c8c945", - "params": { - "level": "info", - "message": "Elasticsearch query rule '{{rule.name}}' is active:\n- Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}}" - }, - "connector_type_id": ".server-log", - "frequency": { - "summary": false, - "notify_when": "onActiveAlert", - "throttle": null - }, - "uuid": "bfe370a3-531b-4855-bbe6-ad739f578844" + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" } - ], - "params": { - "searchType": "esqlQuery", - "esqlQuery": { - "esql": "FROM kibana_sample_data_logs | keep bytes, clientip, host, geo.dest | WHERE geo.dest != \"GB\" | stats sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | sort sumbytes desc | limit 10" - }, - "timeField": "@timestamp", - "timeWindowSize": 1, - "timeWindowUnit": "d", - "size": 0, - "thresholdComparator": ">", - "threshold": [ - 0 - ], - "excludeHitsFromPreviousRun\"": "true,", - "aggType": "count", - "groupBy": "all" - }, - "scheduled_task_id": "e0d62360-78e8-11ee-9177-f7d404c8c945", - "created_by": "elastic", - "updated_by": "elastic\",", - "created_at": "2023-11-01T19:00:10.453Z", - "updated_at": "2023-11-01T19:00:10.453Z", - "api_key_owner": "elastic", - "api_key_created_by_user": false, - "throttle": null, - "mute_all": false, - "notify_when": null, - "muted_alert_ids": [], - "execution_status": { - "status": "pending", - "last_execution_date": "2023-11-01T19:00:10.453Z" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." }, - "revision": 0, - "running": false + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + } } - }, - "create_es_query_rule_response": { - "summary": "The create rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "58148c70-407f-11ee-850e-c71febc4ca7f", - "enabled": true, - "name": "my Elasticsearch query rule", - "tags": [], - "rule_type_id": ".es-query", - "consumer": "alerts", - "schedule": { - "interval": "1d" + } + }, + "/api/alerts/alert/{alertId}/_unmute_all": { + "post": { + "summary": "Unmute all alert instances", + "operationId": "legacyUnmuteAllAlertInstances", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the unmute all alerts API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, - "actions": [ - { - "group": "query matched", - "id": "fdbece50-406c-11ee-850e-c71febc4ca7f", - "params": { - "level": "info", - "message": "The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts." - }, - "connector_type_id": ".server-log", - "frequency": { - "summary": true, - "notify_when": "onThrottleInterval", - "throttle": "1d" - }, - "uuid": "53f3c2a3-e5d0-4cfa-af3b-6f0881385e78" - }, - { - "group": "recovered", - "id": "fdbece50-406c-11ee-850e-c71febc4ca7f", - "params": { - "level": "info", - "message": "Recovered" - }, - "connector_type_id": ".server-log", - "frequency": { - "summary": false, - "notify_when": "onActionGroupChange", - "throttle": null - }, - "uuid": "2324e45b-c0df-45c7-9d70-4993e30be758" + { + "in": "path", + "name": "alertId", + "description": "The identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" } - ], - "params": { - "thresholdComparator": ">", - "timeWindowSize": 1, - "timeWindowUnit": "d", - "threshold": [ - 100 - ], - "size": 100, - "timeField": "@timestamp", - "index": [ - "kibana_sample_data_logs" - ], - "esQuery": "\"\"\"{\"query\":{\"match_all\" : {}}}\"\"\"", - "excludeHitsFromPreviousRun": true, - "aggType": "count", - "groupBy": "all", - "searchType": "esQuery" - }, - "scheduled_task_id": "58148c70-407f-11ee-850e-c71febc4ca7f", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2023-08-22T00:03:38.263Z", - "updated_at": "2023-08-22T00:03:38.263Z", - "api_key_owner": "elastic", - "api_key_created_by_user": false, - "throttle": null, - "mute_all": false, - "notify_when": null, - "muted_alert_ids": [], - "execution_status": { - "status": "pending", - "last_execution_date": "2023-08-22T00:03:38.263Z" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." }, - "revision": 0, - "running": false + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + } } - }, - "create_es_query_kql_rule_response": { - "summary": "The create rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "7bd506d0-2284-11ee-8fad-6101956ced88", - "enabled": true, - "name": "my Elasticsearch query KQL rule\"", - "tags": [], - "rule_type_id": ".es-query", - "consumer": "alerts", - "schedule": { - "interval": "1m" - }, - "actions": [], - "params": { - "searchConfiguration": { - "query": { - "query": "\"\"geo.src : \"US\" \"\"", - "language": "kuery" - }, - "index": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + }, + "/api/alerts/alerts/_find": { + "get": { + "summary": "Get a paginated set of alerts", + "operationId": "legacyFindAlerts", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the find rules API instead. NOTE: Alert `params` are stored as a flattened field type and analyzed as keywords. As alerts change in Kibana, the results on each page of the response also change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data.\n", + "tags": [ + "alerting" + ], + "parameters": [ + { + "name": "default_search_operator", + "in": "query", + "description": "The default operator to use for the `simple_query_string`.", + "schema": { + "type": "string", + "default": "OR" }, - "searchType": "searchSource", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "threshold": [ - 1000 - ], - "thresholdComparator": ">", - "size": 100, - "aggType": "count", - "groupBy": "all", - "excludeHitsFromPreviousRun": true - }, - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2023-07-14T20:24:50.729Z", - "updated_at": "2023-07-14T20:24:50.729Z", - "api_key_owner": "elastic", - "api_key_created_by_user": false, - "throttle": null, - "notify_when": null, - "mute_all": false, - "muted_alert_ids": [], - "scheduled_task_id": "7bd506d0-2284-11ee-8fad-6101956ced88", - "execution_status": { - "status": "pending", - "last_execution_date": "2023-07-14T20:24:50.729Z" + "example": "OR" }, - "revision": 0, - "running": false - } - }, - "create_index_threshold_rule_response": { - "summary": "The create rule API returns a JSON object that contains details about the rule.", - "value": { - "actions": [ - { - "group": "threshold met", - "id": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2", - "uuid": "07aef2a0-9eed-4ef9-94ec-39ba58eb609d", - "connector_type_id": ".server-log", - "frequency": { - "notify_when": "onActionGroupChange", - "summary": false, - "throttle": null - }, - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group} :\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" + { + "name": "fields", + "in": "query", + "description": "The fields to return in the `attributes` key of the response.", + "schema": { + "type": "array", + "items": { + "type": "string" } } - ], - "alert_delay": { - "active": 3 - }, - "api_key_created_by_user": false, - "api_key_owner": "elastic", - "consumer": "alerts", - "created_at": "2022-06-08T17:20:31.632Z", - "created_by": "elastic", - "enabled": true, - "execution_status": { - "last_execution_date": "2022-06-08T17:20:31.632Z", - "status": "pending" - }, - "id": "41893910-6bca-11eb-9e0d-85d233e3ee35", - "muted_alert_ids": [], - "mute_all": false, - "name": "my rule", - "notify_when": null, - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [ - 1000 - ], - "index": [ - ".test-index" - ], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" - }, - "revision": 0, - "rule_type_id": ".index-threshold", - "running": false, - "schedule": { - "interval": "1m" }, - "scheduled_task_id": "425b0800-6bca-11eb-9e0d-85d233e3ee35", - "tags": [ - "cpu" - ], - "throttle": null, - "updated_at": "2022-06-08T17:20:31.632Z", - "updated_by": "elastic" - } - }, - "create_tracking_containment_rule_response": { - "summary": "The create rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "b6883f9d-5f70-4758-a66e-369d7c26012f", - "name": "my tracking rule", - "tags": [], - "enabled": true, - "consumer": "alerts", - "throttle": null, - "revision": 1, - "running": false, - "schedule": { - "interval": "1h" + { + "name": "filter", + "in": "query", + "description": "A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: \"myTitle\"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`.\n", + "schema": { + "type": "string" + } }, - "params": { - "index": "kibana_sample_data_logs", - "dateField": "@timestamp", - "geoField": "geo.coordinates", - "entity": "agent.keyword", - "boundaryType": "entireIndex", - "boundaryIndexTitle": "boundary*", - "boundaryGeoField": "location", - "boundaryNameField": "name", - "indexId": "90943e30-9a47-11e8-b64d-95841ca0b247", - "boundaryIndexId": "0cd90abf-abe7-44c7-909a-f621bbbcfefc" + { + "name": "has_reference", + "in": "query", + "description": "Filters the rules that have a relation with the reference objects with a specific type and identifier.", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } }, - "rule_type_id": ".geo-containment", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2024-02-14T19:52:55.920Z", - "updated_at": "2024-02-15T03:24:32.574Z", - "api_key_owner": "elastic", - "notify_when": null, - "mute_all": false, - "muted_alert_ids": [], - "scheduled_task_id": "b6883f9d-5f70-4758-a66e-369d7c26012f", - "execution_status": { - "status": "ok", - "last_execution_date": "2024-02-15T03:25:38.125Z", - "last_duration": 74 + { + "name": "page", + "in": "query", + "description": "The page number to return.", + "schema": { + "type": "integer", + "default": 1 + }, + "example": 1 }, - "actions": [], - "last_run": { - "alerts_count": { - "active": 0, - "new": 0, - "recovered": 0, - "ignored": 0 + { + "name": "per_page", + "in": "query", + "description": "The number of alerts to return per page.", + "schema": { + "type": "integer", + "default": 20 }, - "outcome_msg": null, - "outcome_order": 0, - "outcome": "succeeded", - "warning": null + "example": 20 }, - "next_run": "2024-02-15T03:26:38.033Z", - "api_key_created_by_user": false - } - }, - "get_rule_response": { - "summary": "The get rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "31697a40-7b36-11ed-aa79-f742c05329b2", - "consumer": "alerts", - "tags": [ - "cpu" - ], - "name": "my alert", - "enabled": true, - "throttle": null, - "schedule": { - "interval": "1m" + { + "name": "search", + "in": "query", + "description": "An Elasticsearch `simple_query_string` query that filters the alerts in the response.", + "schema": { + "type": "string" + } }, - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [ - 1000 - ], - "index": [ - "test-index" - ], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" + { + "name": "search_fields", + "in": "query", + "description": "The fields to perform the `simple_query_string` parsed query against.", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } }, - "revision": 1, - "rule_type_id": ".index-threshold", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2022-12-13T22:33:41.163Z", - "updated_at": "2022-12-13T22:33:41.163Z", - "api_key_owner": "elastic", - "notify_when": null, - "muted_alert_ids": [], - "mute_all": false, - "scheduled_task_id": "31697a40-7b36-11ed-aa79-f742c05329b2", - "execution_status": { - "status": "ok", - "last_execution_date": "2022-12-13T22:33:44.388Z", - "last_duration": 83 + { + "name": "sort_field", + "in": "query", + "description": "Determines which field is used to sort the results. The field must exist in the `attributes` key of the response.\n", + "schema": { + "type": "string" + } }, - "actions": [ - { - "group": "threshold met", - "id": "1007a0c0-7a6e-11ed-89d5-abec321c0def", - "uuid": "1c7a1280-f28c-4e06-96b2-e4e5f05d1d61", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}", - "connector_type_id": ".server-log" - }, - "connector_type_id": ".server-log", - "frequency": { - "throttle": null, - "summary": false, - "notify_when": "onActionGroupChange" + { + "name": "sort_order", + "in": "query", + "description": "Determines the sort order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "example": "asc" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/alert_response_properties" + } + }, + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + } } } - ], - "last_run": { - "alerts_count": { - "new": 0, - "ignored": 0, - "recovered": 0, - "active": 0 - }, - "outcome_msg": null, - "warning": null, - "outcome": "succeeded" }, - "next_run": "2022-12-13T22:34:44.314Z", - "api_key_created_by_user": false - } - }, - "update_rule_request": { - "summary": "Update an index threshold rule.", - "value": { - "actions": [ - { - "frequency": { - "summary": false, - "notify_when": "onActionGroupChange" - }, - "group": "threshold met", - "id": "96b668d0-a1b6-11ed-afdf-d39a49596974", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}" + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } } } - ], - "params": { - "aggField": "sheet.version", - "aggType": "avg", - "index": [ - ".updated-index" - ], - "groupBy": "top", - "termField": "name.keyword", - "termSize": 6, - "threshold": [ - 1000 - ], - "thresholdComparator": ">", - "timeField": "@timestamp", - "timeWindowSize": 5, - "timeWindowUnit": "m" - }, - "name": "new name", - "schedule": { - "interval": "1m" - }, - "tags": [] + } } - }, - "update_rule_response": { - "summary": "The update rule API returns a JSON object that contains details about the rule.", - "value": { - "id": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74", - "consumer": "alerts", - "tags": [], - "name": "new name", - "enabled": true, - "throttle": null, - "revision": 1, - "running": false, - "schedule": { - "interval": "1m" - }, - "params": { - "index": [ - ".updated-index" - ], - "timeField": "@timestamp", - "groupBy": "top", - "aggType": "avg", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "thresholdComparator": ">", - "threshold": [ - 1000 - ], - "aggField": "sheet.version", - "termField": "name.keyword", - "termSize": 6 - }, - "api_key_owner": "elastic", - "created_by": "elastic", - "updated_by": "elastic", - "rule_type_id": ".index-threshold", - "scheduled_task_id": "4c5eda00-e74f-11ec-b72f-5b18752ff9ea", - "created_at": "2024-03-26T23:13:20.985Z", - "updated_at": "2024-03-26T23:22:59.949Z", - "mute_all": false, - "muted_alert_ids": [], - "execution_status": { - "status": "ok", - "last_execution_date": "2024-03-26T23:22:51.390Z", - "last_duration": 52 - }, - "actions": [ - { - "group": "threshold met", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}" - }, - "id": "96b668d0-a1b6-11ed-afdf-d39a49596974", - "uuid": "07aef2a0-9eed-4ef9-94ec-39ba58eb609d", - "connector_type_id": ".server-log", - "frequency": { - "summary": false, - "throttle": null, - "notify_when": "onActionGroupChange" + } + }, + "/api/alerts/alerts/_health": { + "get": { + "summary": "Get the alerting framework health", + "operationId": "legacyGetAlertingHealth", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the get alerting framework health API instead.", + "tags": [ + "alerting" + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alertingFrameworkHealth": { + "type": "object", + "description": "Three substates identify the health of the alerting framework: `decryptionHealth`, `executionHealth`, and `readHealth`.\n", + "properties": { + "decryptionHealth": { + "type": "object", + "description": "The timestamp and status of the alert decryption.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + }, + "executionHealth": { + "type": "object", + "description": "The timestamp and status of the alert execution.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + }, + "readHealth": { + "type": "object", + "description": "The timestamp and status of the alert reading events.", + "properties": { + "status": { + "type": "string", + "example": "ok", + "enum": [ + "error", + "ok", + "warn" + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2023-01-13T01:28:00.280Z" + } + } + } + } + }, + "hasPermanentEncryptionKey": { + "type": "boolean", + "description": "If `false`, the encrypted saved object plugin does not have a permanent encryption key.", + "example": true + }, + "isSufficientlySecure": { + "type": "boolean", + "description": "If `false`, security is enabled but TLS is not.", + "example": true + } + } + } } } - ], - "last_run": { - "alerts_count": { - "new": 0, - "ignored": 0, - "recovered": 0, - "active": 0 - }, - "outcome_msg": null, - "warning": null, - "outcome": "succeeded" }, - "next_run": "2024-03-26T23:23:51.316Z", - "api_key_created_by_user": false - } - }, - "find_rules_response": { - "summary": "Retrieve information about a rule.", - "value": { - "page": 1, - "total": 1, - "per_page": 10, - "data": [ - { - "id": "3583a470-74f6-11ed-9801-35303b735aef", - "consumer": "alerts", - "tags": [ - "cpu" - ], - "name": "my alert", - "enabled": true, - "throttle": null, - "schedule": { - "interval": "1m" - }, - "params": { - "aggType": "avg", - "termSize": 6, - "thresholdComparator": ">", - "timeWindowSize": 5, - "timeWindowUnit": "m", - "groupBy": "top", - "threshold": [ - 1000 - ], - "index": [ - "test-index" - ], - "timeField": "@timestamp", - "aggField": "sheet.version", - "termField": "name.keyword" - }, - "revision": 1, - "rule_type_id": ".index-threshold", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2022-12-05T23:40:33.132Z", - "updated_at": "2022-12-05T23:40:33.132Z", - "api_key_owner": "elastic", - "mute_all": false, - "muted_alert_ids": [], - "scheduled_task_id": "3583a470-74f6-11ed-9801-35303b735aef", - "execution_status": { - "status": "ok", - "last_execution_date": "2022-12-06T01:44:23.983Z", - "last_duration": 48 - }, - "actions": [ - { - "id": "9dca3e00-74f5-11ed-9801-35303b735aef", - "group": "threshold met", - "uuid": "1c7a1280-f28c-4e06-96b2-e4e5f05d1d61", - "params": { - "level": "info", - "message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}}", - "connector_type_id": ".server-log" - }, - "frequency": { - "summary": false, - "notify_when": "onActionGroupChange", - "throttle": null - } + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" } - ], - "last_run": { - "alerts_count": { - "new": 0, - "ignored": 0, - "recovered": 0, - "active": 0 - }, - "outcome_msg": null, - "warning": null, - "outcome": "succeeded" - }, - "next_run": "2022-12-06T01:45:23.912Z", - "api_key_created_by_user": false + } } - ] + } } - }, - "find_rules_response_conditional_action": { - "summary": "Retrieve information about a rule that has conditional actions.", - "value": { - "page": 1, - "total": 1, - "per_page": 10, - "data": [ - { - "id": "6107a8f0-f401-11ed-9f8e-399c75a2deeb", - "name": "security_rule", - "consumer": "siem", - "enabled": true, - "tags": [], - "throttle": null, - "revision": 1, - "running": false, - "schedule": { - "interval": "1m" - }, - "params": { - "author": [], - "description": "A security threshold rule.", - "ruleId": "an_internal_rule_id", - "falsePositives": [], - "from": "now-3660s", - "immutable": false, - "license": "", - "outputIndex": "", - "meta": { - "from": "1h", - "kibana_siem_app_url": "https://localhost:5601/app/security" - }, - "maxSignals": 100, - "riskScore": 21, - "riskScoreMapping": [], - "severity": "low", - "severityMapping": [], - "threat": [], - "to": "now", - "references": [], - "version": 1, - "exceptionsList": [], - "type": "threshold", - "language": "kuery", - "index": [ - "kibana_sample_data_logs" - ], - "query": "*", - "filters": [], - "threshold": { - "field": [ - "bytes" - ], - "value": 1, - "cardinality": [] - } - }, - "rule_type_id": "siem.thresholdRule", - "created_by": "elastic", - "updated_by": "elastic", - "created_at": "2023-05-16T15:50:28.358Z", - "updated_at": "2023-05-16T20:25:42.559Z", - "api_key_owner": "elastic", - "notify_when": null, - "mute_all": false, - "muted_alert_ids": [], - "scheduled_task_id": "6107a8f0-f401-11ed-9f8e-399c75a2deeb", - "execution_status": { - "status": "ok", - "last_execution_date": "2023-05-16T20:26:49.590Z", - "last_duration": 166 - }, - "actions": [ - { - "group": "default", - "id": "49eae970-f401-11ed-9f8e-399c75a2deeb", - "params": { - "documents": [ - { - "rule_id": { - "[object Object]": null - }, - "rule_name": { - "[object Object]": null - }, - "alert_id": { - "[object Object]": null - }, - "context_message": { - "[object Object]": null + } + }, + "/api/alerts/alerts/list_alert_types": { + "get": { + "summary": "Get the alert types", + "operationId": "legacyGetAlertTypes", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the get rule types API instead.", + "tags": [ + "alerting" + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionGroups": { + "description": "An explicit list of groups for which the alert type can schedule actions, each with the action group's unique ID and human readable name. Alert actions validation uses this configuration to ensure that groups are valid.\n", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } } - } - ] - }, - "connector_type_id": ".index", - "frequency": { - "summary": true, - "notify_when": "onActiveAlert", - "throttle": null - }, - "uuid": "1c7a1280-f28c-4e06-96b2-e4e5f05d1d61", - "alerts_filter": { - "timeframe": { - "days": [ - 7 - ], - "timezone": "UTC", - "hours": { - "start": "08:00", - "end": "17:00" - } - }, - "query": { - "kql": "", - "filters": [ - { - "meta": { - "disabled": false, - "negate": false, - "alias": null, - "index": "c4bdca79-e69e-4d80-82a1-e5192c621bea", - "key": "client.geo.region_iso_code", - "field": "client.geo.region_iso_code", - "params": { - "query": "CA-QC", - "type": "phrase" + }, + "actionVariables": { + "description": "A list of action variables that the alert type makes available via context and state in action parameter templates, and a short human readable description. The Alert UI will use this information to prompt users for these variables in action parameter editors.\n", + "type": "object", + "properties": { + "context": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } } }, - "$state": { - "store": "appState" + "params": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } }, - "query": { - "match_phrase": { - "client.geo.region_iso_code": "CA-QC" + "state": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } } } } - ] + }, + "authorizedConsumers": { + "description": "The list of the plugins IDs that have access to the alert type.", + "type": "object" + }, + "defaultActionGroupId": { + "description": "The default identifier for the alert type group.", + "type": "string" + }, + "enabledInLicense": { + "description": "Indicates whether the rule type is enabled based on the subscription.", + "type": "boolean" + }, + "id": { + "description": "The unique identifier for the alert type.", + "type": "string" + }, + "isExportable": { + "description": "Indicates whether the alert type is exportable in Saved Objects Management UI.", + "type": "boolean" + }, + "minimumLicenseRequired": { + "description": "The subscriptions required to use the alert type.", + "type": "string" + }, + "name": { + "description": "The descriptive name of the alert type.", + "type": "string" + }, + "producer": { + "description": "An identifier for the application that produces this alert type.", + "type": "string" + }, + "recoveryActionGroup": { + "description": "An action group to use when an alert instance goes from an active state to an inactive one. If it is not specified, the default recovered action group is used.\n", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } } } } - ], - "last_run": { - "alerts_count": { - "new": 0, - "ignored": 0, - "recovered": 0, - "active": 0 - }, - "outcome_msg": [ - "Rule execution completed successfully" - ], - "outcome_order": 0, - "warning": null, - "outcome": "succeeded" - }, - "next_run": "2023-05-16T20:27:49.507Z", - "api_key_created_by_user": false + } + } + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + } + } + } + }, + "/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute": { + "post": { + "summary": "Mute an alert instance", + "operationId": "legacyMuteAlertInstance", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the mute alert API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "in": "path", + "name": "alertId", + "description": "An identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } + }, + { + "in": "path", + "name": "alertInstanceId", + "description": "An identifier for the alert instance.", + "required": true, + "schema": { + "type": "string", + "example": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + } + } + } + }, + "/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute": { + "post": { + "summary": "Unmute an alert instance", + "operationId": "legacyUnmuteAlertInstance", + "deprecated": true, + "description": "Deprecated in 7.13.0. Use the unmute alert API instead.", + "tags": [ + "alerting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "in": "path", + "name": "alertId", + "description": "An identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "41893910-6bca-11eb-9e0d-85d233e3ee35" + } + }, + { + "in": "path", + "name": "alertInstanceId", + "description": "An identifier for the alert instance.", + "required": true, + "schema": { + "type": "string", + "example": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } } - ] + } } - }, + } + } + }, + "components": { + "examples": { "get_health_response": { "summary": "Retrieve information about the health of the alerting framework.", "value": { @@ -8159,6 +1898,210 @@ } ] } + }, + "schemas": { + "401_response": { + "type": "object", + "title": "Unsuccessful rule API response", + "properties": { + "error": { + "type": "string", + "example": "Unauthorized", + "enum": [ + "Unauthorized" + ] + }, + "message": { + "type": "string" + }, + "statusCode": { + "type": "integer", + "example": 401, + "enum": [ + 401 + ] + } + } + }, + "fieldmap_properties": { + "title": "Field map objects in the get rule types response", + "type": "object", + "properties": { + "array": { + "type": "boolean", + "description": "Indicates whether the field is an array." + }, + "dynamic": { + "type": "boolean", + "description": "Indicates whether it is a dynamic field mapping." + }, + "format": { + "type": "string", + "description": "Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`.\n" + }, + "ignore_above": { + "type": "integer", + "description": "Specifies the maximum length of a string field. Longer strings are not indexed or stored." + }, + "index": { + "type": "boolean", + "description": "Indicates whether field values are indexed." + }, + "path": { + "type": "string", + "description": "TBD" + }, + "properties": { + "type": "object", + "description": "Details about the object properties. This property is applicable when `type` is `object`.\n", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The data type for each object property." + } + } + } + }, + "required": { + "type": "boolean", + "description": "Indicates whether the field is required." + }, + "scaling_factor": { + "type": "integer", + "description": "The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. \n" + }, + "type": { + "type": "string", + "description": "Specifies the data type for the field.", + "example": "scaled_float" + } + } + }, + "alert_response_properties": { + "title": "Legacy alert response properties", + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object" + } + }, + "alertTypeId": { + "type": "string", + "example": ".index-threshold" + }, + "apiKeyOwner": { + "type": "string", + "nullable": true, + "example": "elastic" + }, + "createdAt": { + "type": "string", + "description": "The date and time that the alert was created.", + "format": "date-time", + "example": "2022-12-05T23:36:58.284Z" + }, + "createdBy": { + "type": "string", + "description": "The identifier for the user that created the alert.", + "example": "elastic" + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the alert is currently enabled.", + "example": true + }, + "executionStatus": { + "type": "object", + "properties": { + "lastExecutionDate": { + "type": "string", + "format": "date-time", + "example": "2022-12-06T00:13:43.890Z" + }, + "status": { + "type": "string", + "example": "ok" + } + } + }, + "id": { + "type": "string", + "description": "The identifier for the alert.", + "example": "b530fed0-74f5-11ed-9801-35303b735aef" + }, + "muteAll": { + "type": "boolean", + "example": false + }, + "mutedInstanceIds": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the alert.", + "example": "my alert" + }, + "notifyWhen": { + "type": "string", + "example": "onActionGroupChange" + }, + "params": { + "type": "object", + "additionalProperties": true + }, + "schedule": { + "type": "object", + "properties": { + "interval": { + "type": "string" + } + } + }, + "scheduledTaskId": { + "type": "string", + "example": "b530fed0-74f5-11ed-9801-35303b735aef" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "throttle": { + "type": "string", + "nullable": true + }, + "updatedAt": { + "type": "string", + "example": "2022-12-05T23:36:58.284Z" + }, + "updatedBy": { + "type": "string", + "description": "The identifier for the user that updated this alert most recently.", + "nullable": true, + "example": "elastic" + } + } + } + }, + "parameters": { + "kbn_xsrf": { + "schema": { + "type": "string" + }, + "in": "header", + "name": "kbn-xsrf", + "description": "Cross-site request forgery protection", + "required": true + } } } } \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/bundled.yaml b/x-pack/plugins/alerting/docs/openapi/bundled.yaml index de4ded2b6abac..87601c463e50e 100644 --- a/x-pack/plugins/alerting/docs/openapi/bundled.yaml +++ b/x-pack/plugins/alerting/docs/openapi/bundled.yaml @@ -10,480 +10,96 @@ info: url: https://www.elastic.co/licensing/elastic-license servers: - url: / -tags: - - name: alerting - description: Alerting APIs enable you to create and manage rules and alerts. paths: - /api/alerting/rule: - post: - summary: Create a rule with a random identifier - operationId: createRule - description: | - To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/create_rule_request' - examples: - createEsQueryEsqlRuleRequest: - $ref: '#/components/examples/create_es_query_esql_rule_request' - createEsQueryRuleRequest: - $ref: '#/components/examples/create_es_query_rule_request' - createEsQueryKqlRuleRequest: - $ref: '#/components/examples/create_es_query_kql_rule_request' - createIndexThresholdRuleRequest: - $ref: '#/components/examples/create_index_threshold_rule_request' - createTrackingContainmentRuleRequest: - $ref: '#/components/examples/create_tracking_containment_rule_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/rule_response_properties' - examples: - createEsQueryEsqlRuleResponse: - $ref: '#/components/examples/create_es_query_esql_rule_response' - createEsQueryRuleResponse: - $ref: '#/components/examples/create_es_query_rule_response' - createEsQueryKqlRuleResponse: - $ref: '#/components/examples/create_es_query_kql_rule_response' - createIndexThresholdRuleResponse: - $ref: '#/components/examples/create_index_threshold_rule_response' - createTrackingContainmentRuleResponse: - $ref: '#/components/examples/create_tracking_containment_rule_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - /api/alerting/rule/{ruleId}: + /api/alerting/_health: get: - summary: Get rule details - operationId: getRule - description: | - You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To get rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/rule_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/rule_response_properties' - examples: - getRuleResponse: - $ref: '#/components/examples/get_rule_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - delete: - summary: Delete a rule - operationId: deleteRule - description: | - To delete a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're deleting. For example, the **Management** > **Stack Rules** feature, **Analytics** > **Discover** or **Machine Learning** features, **Observability**, or **Security** features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - post: - summary: Create a rule - operationId: createRuleId + summary: Get the alerting framework health + operationId: getAlertingHealth description: | - This API creates a rule with a specific rule identifier. If you omit the identifer, it is automatically generated. To create a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're creating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. + You must have `read` privileges for the **Management > Stack Rules** feature or for at least one of the **Analytics > Discover**, **Analytics > Machine Learning**, **Observability**, or **Security** features. tags: - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - in: path - name: ruleId - description: | - An UUID v1 or v4 identifier for the rule. If you omit this parameter, an identifier is randomly generated. - required: true - schema: - type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/create_rule_request' - examples: - createEsQueryEsqlRuleIdRequest: - $ref: '#/components/examples/create_es_query_esql_rule_request' - createEsQueryRuleIdRequest: - $ref: '#/components/examples/create_es_query_rule_request' - createEsQueryKqlRuleIdRequest: - $ref: '#/components/examples/create_es_query_kql_rule_request' - createIndexThreholdRuleIdRequest: - $ref: '#/components/examples/create_index_threshold_rule_request' responses: '200': description: Indicates a successful call. content: application/json: schema: - $ref: '#/components/schemas/rule_response_properties' + type: object + properties: + alerting_framework_health: + type: object + description: | + Three substates identify the health of the alerting framework: `decryption_health`, `execution_health`, and `read_health`. + properties: + decryption_health: + type: object + description: The timestamp and status of the rule decryption. + properties: + status: + type: string + example: ok + enum: + - error + - ok + - warn + timestamp: + type: string + format: date-time + example: '2023-01-13T01:28:00.280Z' + execution_health: + type: object + description: The timestamp and status of the rule run. + properties: + status: + type: string + example: ok + enum: + - error + - ok + - warn + timestamp: + type: string + format: date-time + example: '2023-01-13T01:28:00.280Z' + read_health: + type: object + description: The timestamp and status of the rule reading events. + properties: + status: + type: string + example: ok + enum: + - error + - ok + - warn + timestamp: + type: string + format: date-time + example: '2023-01-13T01:28:00.280Z' + has_permanent_encryption_key: + type: boolean + description: If `false`, the encrypted saved object plugin does not have a permanent encryption key. + example: true + is_sufficiently_secure: + type: boolean + description: If `false`, security is enabled but TLS is not. + example: true examples: - createEsQueryEsqlRuleIdResponse: - $ref: '#/components/examples/create_es_query_esql_rule_response' - createEsQueryRuleIdResponse: - $ref: '#/components/examples/create_es_query_rule_response' - createEsQueryKqlRuleIdResponse: - $ref: '#/components/examples/create_es_query_kql_rule_response' - createIndexThresholdRuleIdResponse: - $ref: '#/components/examples/create_index_threshold_rule_response' + getAlertingHealthResponse: + $ref: '#/components/examples/get_health_response' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - put: - summary: Update a rule - operationId: updateRule + /api/alerting/rule_types: + get: + summary: Get the rule types + operationId: getRuleTypes description: | - To update a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule you're updating. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. NOTE: If the API key has different privileges than the key that created or most recently updated the rule, the rule behavior might change. Though some properties are optional, when you update the rule the existing property values are overwritten with default values. Therefore, it is recommended to explicitly set all property values. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/update_rule_request' - examples: - updateRuleRequest: - $ref: '#/components/examples/update_rule_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/rule_response_properties' - examples: - updateRuleResponse: - $ref: '#/components/examples/update_rule_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - /api/alerting/rule/{ruleId}/_disable: - post: - summary: Disable a rule - operationId: disableRule - description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - /api/alerting/rule/{ruleId}/_enable: - post: - summary: Enable a rule - operationId: enableRule - description: | - To enable a rule, you must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. This API supports both key- and token-based authentication. To use key-based authentication, create an API key in Kibana and use it in the header of the API call. To use token-based authentication, provide a username and password; an API key that matches the current privileges of the user is created automatically. In both cases, the API key is subsequently used for authorization when the rule runs. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/rules/_find: - get: - summary: Find rule information - operationId: findRules - description: | - You must have `read` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rules you're seeking. For example, you must have privileges for the **Management > Stack rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, or **Security** features. To find rules associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. - tags: - - alerting - parameters: - - name: default_search_operator - in: query - description: The default operator to use for the simple_query_string. - schema: - type: string - default: OR - example: OR - - name: fields - in: query - description: The fields to return in the `attributes` key of the response. - schema: - type: array - items: - type: string - - name: filter - in: query - description: | - A KQL string that you filter with an attribute from your saved object. It should look like `savedObjectType.attributes.title: "myTitle"`. However, if you used a direct attribute of a saved object, such as `updatedAt`, you must define your filter, for example, `savedObjectType.updatedAt > 2018-12-22`. - schema: - type: string - - name: has_reference - in: query - description: Filters the rules that have a relation with the reference objects with a specific type and identifier. - schema: - type: object - properties: - id: - type: string - type: - type: string - - name: page - in: query - description: The page number to return. - schema: - type: integer - default: 1 - example: 1 - - name: per_page - in: query - description: The number of rules to return per page. - schema: - type: integer - default: 20 - example: 20 - - name: search - in: query - description: An Elasticsearch simple_query_string query that filters the objects in the response. - schema: - type: string - example: threshold +-test* - - name: search_fields - in: query - description: The fields to perform the simple_query_string parsed query against. - schema: - oneOf: - - type: string - example: name - - type: array - items: - type: string - - name: sort_field - in: query - description: | - Determines which field is used to sort the results. The field must exist in the `attributes` key of the response. - schema: - type: string - - name: sort_order - in: query - description: Determines the sort order. - schema: - type: string - enum: - - asc - - desc - default: desc - example: asc - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/rule_response_properties' - page: - type: integer - per_page: - type: integer - total: - type: integer - examples: - findRulesResponse: - $ref: '#/components/examples/find_rules_response' - findConditionalActionRulesResponse: - $ref: '#/components/examples/find_rules_response_conditional_action' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/_health: - get: - summary: Get the alerting framework health - operationId: getAlertingHealth - description: | - You must have `read` privileges for the **Management > Stack Rules** feature or for at least one of the **Analytics > Discover**, **Analytics > Machine Learning**, **Observability**, or **Security** features. - tags: - - alerting - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - alerting_framework_health: - type: object - description: | - Three substates identify the health of the alerting framework: `decryption_health`, `execution_health`, and `read_health`. - properties: - decryption_health: - type: object - description: The timestamp and status of the rule decryption. - properties: - status: - type: string - example: ok - enum: - - error - - ok - - warn - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' - execution_health: - type: object - description: The timestamp and status of the rule run. - properties: - status: - type: string - example: ok - enum: - - error - - ok - - warn - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' - read_health: - type: object - description: The timestamp and status of the rule reading events. - properties: - status: - type: string - example: ok - enum: - - error - - ok - - warn - timestamp: - type: string - format: date-time - example: '2023-01-13T01:28:00.280Z' - has_permanent_encryption_key: - type: boolean - description: If `false`, the encrypted saved object plugin does not have a permanent encryption key. - example: true - is_sufficiently_secure: - type: boolean - description: If `false`, security is enabled but TLS is not. - example: true - examples: - getAlertingHealthResponse: - $ref: '#/components/examples/get_health_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/rule_types: - get: - summary: Get the rule types - operationId: getRuleTypes - description: | - If you have `read` privileges for one or more Kibana features, the API response contains information about the appropriate rule types. For example, there are rule types associated with the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, and **Security** features. To get rule types associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. + If you have `read` privileges for one or more Kibana features, the API response contains information about the appropriate rule types. For example, there are rule types associated with the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability** features, and **Security** features. To get rule types associated with the **Stack Monitoring** feature, use the `monitoring_user` built-in role. tags: - alerting responses: @@ -737,107 +353,6 @@ paths: application/json: schema: $ref: '#/components/schemas/401_response' - /api/alerting/rule/{ruleId}/_mute_all: - post: - summary: Mute all alerts - operationId: muteAllAlerts - description: | - This API snoozes the notifications for the rule indefinitely. The rule checks continue to occur but alerts will not trigger any actions. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/rule/{ruleId}/_unmute_all: - post: - summary: Unmute all alerts - operationId: unmuteAllAlerts - description: | - If the rule has its notifications snoozed indefinitely, this API cancels the snooze. You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/rule/{ruleId}/_update_api_key: - post: - summary: Update the API key for a rule - operationId: updateRuleAPIKey - description: The new API key has the credentials of the user that submits the request. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/rule_id' - responses: - '200': - description: Indicates a successful call. - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /api/alerting/rule/{ruleId}/alert/{alertId}/_mute: - post: - summary: Mute an alert - operationId: muteAlert - description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/alert_id' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' - /api/alerting/rule/{ruleId}/alert/{alertId}/_unmute: - post: - summary: Unmute an alert - operationId: unmuteAlert - description: | - You must have `all` privileges for the appropriate Kibana features, depending on the `consumer` and `rule_type_id` of the rule. For example, the **Management > Stack Rules** feature, **Analytics > Discover** and **Machine Learning** features, **Observability**, and **Security** features. If the rule has actions, you must also have `read` privileges for the **Management > Actions and Connectors** feature. - tags: - - alerting - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/alert_id' - - $ref: '#/components/parameters/rule_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' /api/alerts/alert/{alertId}: delete: summary: Delete an alert @@ -1539,4071 +1054,25 @@ paths: required: true schema: type: string - example: 41893910-6bca-11eb-9e0d-85d233e3ee35 - - in: path - name: alertInstanceId - description: An identifier for the alert instance. - required: true - schema: - type: string - example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/401_response' -components: - parameters: - kbn_xsrf: - schema: - type: string - in: header - name: kbn-xsrf - description: Cross-site request forgery protection - required: true - rule_id: - in: path - name: ruleId - description: An identifier for the rule. - required: true - schema: - type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - alert_id: - in: path - name: alertId - description: An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. - required: true - schema: - type: string - example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - schemas: - create_anomaly_detection_alert_rule_request: - title: Create anomaly detection rule request - description: | - A rule that checks if the anomaly detection job results contain anomalies that match the rule conditions. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an anomaly detection rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.ml.anomaly_detection_alert - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_anomaly_detection_jobs_health_rule_request: - title: Create anomaly detection jobs health rule request - description: | - An rule that monitors job health and alerts if an operational issue occurred that may prevent the job from detecting anomalies. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an anomaly detection jobs health rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.ml.anomaly_detection_jobs_health - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_apm_anomaly_rule_request: - title: Create APM anomaly rule rule request - description: A rule that detects when either the latency, throughput, or failed transaction rate of a service is anomalous. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_apm_anomaly' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.anomaly - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_apm_error_count_rule_request: - title: Create APM error count rule request - description: A rule that detects when the number of errors in a service exceeds a defined threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_apm_error_count' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.error_rate - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_apm_transaction_duration_rule_request: - title: Create latency threshold rule request - description: A rule that detects when the latency of a specific transaction type in a service exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_apm_transaction_duration' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.transaction_duration - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_apm_transaction_error_rate_rule_request: - title: Create APM transaction error rate rule request - description: A rule that sends notifications when the rate of transaction errors in a service exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_apm_transaction_error_rate' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.transaction_error_rate - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_es_query_rule_request: - title: Create Elasticsearch query rule request - description: | - A rule that runs a user-configured query, compares the number of matches to a configured threshold, and schedules actions to run when the threshold condition is met. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_es_query_rule' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .es-query - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_geo_containment_rule_request: - title: Create tracking containment rule request - description: | - A rule that runs an Elasticsearch query over indices to determine whether any documents are currently contained within any boundaries from the specified boundary index. In the event that an entity is contained within a boundary, an alert may be generated. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an tracking containment rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .geo-containment - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_index_threshold_rule_request: - title: Create index threshold rule request - description: A rule that runs an Elasticsearch query, aggregates field values from documents, compares them to threshold values, and schedules actions to run when the thresholds are met. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_index_threshold_rule' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .index-threshold - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_infra_inventory_rule_request: - title: Create infra inventory rule request - description: | - A rule that sends notifications when a metric has reached or exceeded a value for a specific resource or a group of resources within your infrastructure. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_infra_inventory' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.inventory.threshold - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_infra_metric_anomaly_rule_request: - title: Create infrastructure anomaly rule request - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an infrastructure anomaly rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.anomaly - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_infra_metric_threshold_rule_request: - title: Create infra metric threshold rule request - description: | - A rule that sends notifications when a metric has reached or exceeded a value for a specific time period. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_infra_metric_threshold' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.threshold - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_jvm_memory_usage_rule_request: - title: Create JVM memory usage rule request - description: A rule that detects when a node reports high memory usage. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a JVM memory usage rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_jvm_memory_usage - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_log_threshold_rule_request: - title: Create log threshold rule request - description: A rule that detects when a log aggregation exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_log_threshold' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - logs.alert.document.count - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_ccr_exceptions_rule_request: - title: Create CCR read exceptions rule request - description: A rule that detects cross-cluster replication (CCR) read exceptions. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a CCR read exceptions rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_ccr_read_exceptions - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_cluster_health_rule_request: - title: Create cluster health rule request - description: A rule that detects when the health of the cluster changes. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a cluster health rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_cluster_health - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_cpu_usage_rule_request: - title: Create CPU usage rule request - description: A rule that detects when the CPU load for a node is consistently high. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a CPU usage rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_cpu_usage - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_disk_usage_rule_request: - title: Create disk usage rule request - description: A rule that detects when the disk usage for a node is consistently high. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a disk usage rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_disk_usage - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_elasticsearch_version_mismatch_rule_request: - title: Create Elasticsearch version mismatch rule request - description: A rule that detects when the cluster has multipe versions of Elasticsearch. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a Elasticsearch version mismatch rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_elasticsearch_version_mismatch - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_license_expiration_rule_request: - title: Create license expiration rule request - description: A rule that detects when the cluster license is about to expire. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a license expiration rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_license_expiration - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_kibana_version_mismatch_rule_request: - title: Create Kibana version mismatch rule request - description: A rule that detects when the cluster has multiple versions of Kibana. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a Kibana version mismatch rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_kibana_version_mismatch - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_logstash_version_mismatch_rule_request: - title: Create Logstash version mismatch rule request - description: A rule that detects when the cluster has multiple versions of Logstash. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a Logstash version mismatch rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_logstash_version_mismatch - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_missing_data_rule_request: - title: Create missing monitoring data rule request - description: A rule that detects when monitoring data is missing. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a missing monitoring data rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_missing_monitoring_data - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_nodes_changed_rule_request: - title: Create nodes changed rule request - description: A rule that detects when nodes are added, removed, or restarted. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a nodes changed rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_nodes_changed - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_shard_size_rule_request: - title: Create shard size rule request - description: A rule that detects when the average shard size is larger than a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a shard size rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_shard_size - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_thread_pool_search_rejections_rule_request: - title: Create thread pool search rejections rule request - description: A rule that detects when the number of rejections in the thread pool exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a thread pool search rejections rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_thread_pool_search_rejections - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_monitoring_thread_pool_write_rejections_rule_request: - title: Create thread pool write rejections rule request - description: A rule that detects when the number of rejections in the write thread pool exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a thread pool write rejections rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_thread_pool_write_rejections - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_eql_rule_request: - title: Create event correlation rule request - description: | - A rule that uses Event Query Language (EQL) to match events, generate sequences, and stack data. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an event correlation rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.eqlRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_indicator_rule_request: - title: Create indicator match rule request - description: | - A rule that uses indicators from intelligence sources to detect matching events and alerts. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for an indicator match rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.indicatorRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_ml_rule_request: - title: Create machine learning rule request - description: | - A rule that detects when a machine learning job discovers an anomaly above the defined threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a machine learning rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.mlRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_new_terms_rule_request: - title: Create new terms rule request - description: A rule that finds documents with values that appear for the first time. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a new terms rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.newTermsRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_notifications_rule_request: - title: Create security solution notification (legacy) rule request - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a notification rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.notifications - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_query_rule_request: - title: Create custom query rule request - description: | - A rule that uses KQL or Lucene to detect issues across indices. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a custom query rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.queryRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_saved_query_rule_request: - title: Create saved query rule request - description: | - A rule that searches the defined indices and creates an alert when a document matches the saved search. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a saved query rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.savedQueryRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_siem_threshold_rule_request: - title: Create threshold rule request - description: | - A rule that aggregates query results to detect when the number of matches exceeds a threshold. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a threshold rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.thresholdRule - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_slo_burn_rate_rule_request: - title: Create slo burn rate rule request - description: | - A rule that detects when the burn rate is above a defined threshold for two different lookback periods. The two periods are a long period and a short period that is 1/12th of the long period. For each lookback period, the burn rate is computed as the error rate divided by the error budget. When the burn rates for both periods surpass the threshold, an alert occurs. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_slo_burn_rate' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - slo.rules.burnRate - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_synthetics_monitor_status_rule_request: - title: Create synthetics monitor status rule request - description: A rule that detects when a monitor is down or an availability threshold is breached. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for the synthetics monitor status rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.synthetics.alerts.monitorStatus - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_synthetics_uptime_duration_anomaly_rule_request: - title: Create synthetics uptime duration anomaly rule request - description: | - A rule that detects response durations for all of the geographic locations of each monitor. When a monitor runs for an unusual amount of time, at a particular time, an anomaly is recorded. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for the uptime duration anomaly rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.durationAnomaly - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_synthetics_uptime_tls_rule_request: - title: Create synthetics uptime TLS rule request - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_synthetics_uptime_tls' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.tls - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_synthetics_uptime_tls_certificate_rule_request: - title: Create TLS certificate rule request - description: | - A rule that detects when a monitor has a TLS certificate expiring or when it exceeds an age limit. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a TLS certificate rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.tlsCertificate - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_transform_health_rule_request: - title: Create transform health rule request - description: | - A rule that monitors transforms health and alerts if an operational issue occurred. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for a transform health rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - transform_health - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - create_uptime_monitor_status_rule_request: - title: Create uptime monitor status rule request - description: A rule that detects monitor errors and outages. - type: object - required: - - consumer - - name - - params - - rule_type_id - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - consumer: - $ref: '#/components/schemas/consumer' - enabled: - $ref: '#/components/schemas/enabled_rule' - name: - $ref: '#/components/schemas/name_rule' - notify_when: - $ref: '#/components/schemas/notify_when' - params: - $ref: '#/components/schemas/params_property_synthetics_monitor_status' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.monitorStatus - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - filter: - type: object - description: A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the `kbn-es-query` package. - properties: - meta: - type: object - properties: - alias: - type: string - nullable: true - controlledBy: - type: string - disabled: - type: boolean - field: - type: string - group: - type: string - index: - type: string - isMultiIndex: - type: boolean - key: - type: string - negate: - type: boolean - params: - type: object - type: - type: string - value: - type: string - query: - type: object - $state: - type: object - notify_when_action: - type: string - description: | - Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. - enum: - - onActionGroupChange - - onActiveAlert - - onThrottleInterval - example: onActiveAlert - throttle_action: - type: string - nullable: true - description: | - The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. - default: null - example: 10m - actions: - type: array - default: [] - nullable: true - items: - type: object - required: - - group - - id - - params - description: | - An action that runs under defined conditions. - properties: - alerts_filter: - type: object - description: | - Conditions that affect whether the action runs. If you specify multiple conditions, all conditions must be met for the action to run. For example, if an alert occurs within the specified time frame and matches the query, the action runs. - properties: - query: - type: object - description: Defines a query filter that determines whether the action runs. - properties: - kql: - type: string - description: A filter written in Kibana Query Language (KQL). - filters: - type: array - items: - $ref: '#/components/schemas/filter' - timeframe: - type: object - description: Defines a period that limits whether the action runs. - properties: - days: - type: array - description: Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week. - items: - type: integer - example: - - 1 - - 2 - - 3 - - 4 - - 5 - hours: - type: object - description: | - Defines the range of time in a day that the action can run. If the `start` value is `00:00` and the `end` value is `24:00`, actions be generated all day. - properties: - end: - type: string - description: The end of the time frame in 24-hour notation (`hh:mm`). - example: '17:00' - start: - type: string - description: The start of the time frame in 24-hour notation (`hh:mm`). - example: '08:00' - timezone: - type: string - description: | - The ISO time zone for the `hours` values. Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended. - example: Europe/Madrid - connector_type_id: - type: string - description: The type of connector. This property appears in responses but cannot be set in requests. - example: .server-log - readOnly: true - frequency: - type: object - description: | - The properties that affect how often actions are generated. If the rule type supports setting `summary` to `true`, the action can be a summary of alerts at the specified notification interval. Otherwise, an action runs for each alert at the specified notification interval. NOTE: You cannot specify these parameters when `notify_when` or `throttle` are defined at the rule level. - required: - - notify_when - - summary - properties: - notify_when: - $ref: '#/components/schemas/notify_when_action' - summary: - type: boolean - description: Indicates whether the action is a summary. - throttle: - $ref: '#/components/schemas/throttle_action' - group: - type: string - description: | - The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to `default`. - example: default - id: - type: string - description: The identifier for the connector saved object. - example: 9dca3e00-74f5-11ed-9801-35303b735aef - params: - type: object - description: The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context. - additionalProperties: true - uuid: - type: string - description: A universally unique identifier (UUID) for the action. - example: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 - alert_delay: - type: object - description: Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions. - required: - - active - properties: - active: - type: number - description: The number of consecutive runs that must meet the rule conditions. - example: 3 - consumer: - type: string - description: | - The name of the application or feature that owns the rule. For example: `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. - enabled_rule: - type: boolean - description: Indicates whether you want to run the rule on an interval basis after it is created. - name_rule: - type: string - description: | - The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule. - notify_when: - type: string - description: | - Deprecated in 8.13.0. Use the `notify_when` property in the action `frequency` object instead. Indicates how often alerts generate actions. NOTE: You cannot specify `notify_when` at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. - enum: - - onActionGroupChange - - onActiveAlert - - onThrottleInterval - deprecated: true - example: onActiveAlert - schedule: - type: object - description: The check interval, which specifies how frequently the rule conditions are checked. The interval is specified in seconds, minutes, hours, or days. - properties: - interval: - type: string - example: 1m - tags: - type: array - description: The tags for the rule. - items: - type: string - default: [] - throttle: - type: string - description: | - Deprecated in 8.13.0. Use the `throttle` property in the action `frequency` object instead. The throttle interval, which defines how often an alert generates repeated actions. NOTE: You cannot specify the throttle interval at both the rule and action level. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values. - nullable: true - default: null - deprecated: true - example: 10m - params_property_apm_anomaly: - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - properties: - serviceName: - type: string - description: The service name from APM - transactionType: - type: string - description: The transaction type from APM - windowSize: - type: number - example: 6 - description: The window size - windowUnit: - type: string - description: The window size unit - enum: - - m - - h - - d - environment: - type: string - description: The environment from APM - anomalySeverityType: - type: string - description: The anomaly threshold value - enum: - - critical - - major - - minor - - warning - params_property_apm_error_count: - required: - - windowSize - - windowUnit - - threshold - - environment - properties: - serviceName: - type: string - description: The service name from APM - windowSize: - type: number - description: The window size - example: 6 - windowUnit: - type: string - description: The window size unit - enum: - - m - - h - - d - environment: - type: string - description: The environment from APM - threshold: - type: number - description: The error count threshold value - groupBy: - type: array - default: - - service.name - - service.environment - uniqueItems: true - items: - type: string - enum: - - service.name - - service.environment - - transaction.name - - error.grouping_key - errorGroupingKey: - type: string - params_property_apm_transaction_duration: - required: - - windowSize - - windowUnit - - threshold - - environment - - aggregationType - properties: - serviceName: - type: string - description: The service name from APM - transactionType: - type: string - description: The transaction type from APM - transactionName: - type: string - description: The transaction name from APM - windowSize: - type: number - description: The window size - example: 6 - windowUnit: - type: string - description: ç - enum: - - m - - h - - d - environment: - type: string - threshold: - type: number - description: The latency threshold value - groupBy: - type: array - default: - - service.name - - service.environment - - transaction.type - uniqueItems: true - items: - type: string - enum: - - service.name - - service.environment - - transaction.type - - transaction.name - aggregationType: - type: string - enum: - - avg - - 95th - - 99th - params_property_apm_transaction_error_rate: - required: - - windowSize - - windowUnit - - threshold - - environment - properties: - serviceName: - type: string - description: The service name from APM - transactionType: - type: string - description: The transaction type from APM - transactionName: - type: string - description: The transaction name from APM - windowSize: - type: number - description: The window size - example: 6 - windowUnit: - type: string - description: The window size unit - enum: - - m - - h - - d - environment: - type: string - description: The environment from APM - threshold: - type: number - description: The error rate threshold value - groupBy: - type: array - default: - - service.name - - service.environment - - transaction.type - uniqueItems: true - items: - type: string - enum: - - service.name - - service.environment - - transaction.type - - transaction.name - aggfield: - description: | - The name of the numeric field that is used in the aggregation. This property is required when `aggType` is `avg`, `max`, `min` or `sum`. - type: string - aggtype: - description: The type of aggregation to perform. - type: string - enum: - - avg - - count - - max - - min - - sum - default: count - excludehitsfrompreviousrun: - description: | - Indicates whether to exclude matches from previous runs. If `true`, you can avoid alert duplication by excluding documents that have already been detected by the previous rule run. This option is not available when a grouping field is specified. - type: boolean - groupby: - description: | - Indicates whether the aggregation is applied over all documents (`all`) or split into groups (`top`) using a grouping field (`termField`). If grouping is used, an alert will be created for each group when it exceeds the threshold; only the top groups (up to `termSize` number of groups) are checked. - type: string - enum: - - all - - top - default: all - termsize: - description: | - This property is required when `groupBy` is `top`. It specifies the number of groups to check against the threshold and therefore limits the number of alerts on high cardinality fields. - type: integer - timefield: - description: The field that is used to calculate the time window. - type: string - timewindowsize: - description: | - The size of the time window (in `timeWindowUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection. - type: integer - example: 5 - timewindowunit: - description: | - The type of units for the time window: seconds, minutes, hours, or days. - type: string - enum: - - s - - m - - h - - d - example: m - size: - description: | - The number of documents to pass to the configured actions when the threshold condition is met. - type: integer - termfield: - description: | - The names of up to four fields that are used for grouping the aggregation. This property is required when `groupBy` is `top`. - oneOf: - - type: string - - type: array - items: - type: string - maxItems: 4 - threshold: - description: | - The threshold value that is used with the `thresholdComparator`. If the `thresholdComparator` is `between` or `notBetween`, you must specify the boundary values. - type: array - items: - type: integer - example: 4000 - thresholdcomparator: - description: The comparison function for the threshold. For example, "is above", "is above or equals", "is below", "is below or equals", "is between", and "is not between". - type: string - enum: - - '>' - - '>=' - - < - - <= - - between - - notBetween - example: '>' - params_es_query_rule: - oneOf: - - type: object - x-technical-preview: true - description: | - The parameters for an Elasticsearch query rule that uses ES|QL to define the query. This functionality is in technical pre view and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - required: - - esqlQuery - - searchType - - size - - threshold - - thresholdComparator - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: '#/components/schemas/aggfield' - aggType: - $ref: '#/components/schemas/aggtype' - esqlQuery: - type: object - required: - - esql - properties: - esql: - description: The query definition, which uses Elasticsearch Query Language. - type: string - excludeHitsFromPreviousRun: - $ref: '#/components/schemas/excludehitsfrompreviousrun' - groupBy: - $ref: '#/components/schemas/groupby' - searchType: - description: The type of query, in this case a query that uses Elasticsearch Query Language (ES|QL). - type: string - enum: - - esqlQuery - example: esqlQuery - size: - type: integer - description: | - When `searchType` is `esqlQuery`, this property is required but it does not affect the rule behavior. - example: 0 - termSize: - $ref: '#/components/schemas/termsize' - threshold: - type: array - items: - type: integer - minimum: 0 - maximum: 0 - description: | - The threshold value that is used with the `thresholdComparator`. When `searchType` is `esqlQuery`, this property is required and must be set to zero. - thresholdComparator: - type: string - description: | - The comparison function for the threshold. When `searchType` is `esqlQuery`, this property is required and must be set to ">". Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results. - enum: - - '>' - example: '>' - timeField: - $ref: '#/components/schemas/timefield' - timeWindowSize: - $ref: '#/components/schemas/timewindowsize' - timeWindowUnit: - $ref: '#/components/schemas/timewindowunit' - - type: object - description: The parameters for an Elasticsearch query rule that uses KQL or Lucene to define the query. - required: - - searchType - - size - - threshold - - thresholdComparator - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: '#/components/schemas/aggfield' - aggType: - $ref: '#/components/schemas/aggtype' - excludeHitsFromPreviousRun: - $ref: '#/components/schemas/excludehitsfrompreviousrun' - groupBy: - $ref: '#/components/schemas/groupby' - searchConfiguration: - description: The query definition, which uses KQL or Lucene to fetch the documents from Elasticsearch. - type: object - properties: - filter: - type: array - items: - $ref: '#/components/schemas/filter' - index: - description: The indices to query. - oneOf: - - type: string - - type: array - items: - type: string - query: - type: object - properties: - language: - type: string - example: kuery - query: - type: string - searchType: - description: The type of query, in this case a text-based query that uses KQL or Lucene. - type: string - enum: - - searchSource - example: searchSource - size: - $ref: '#/components/schemas/size' - termField: - $ref: '#/components/schemas/termfield' - termSize: - $ref: '#/components/schemas/termsize' - threshold: - $ref: '#/components/schemas/threshold' - thresholdComparator: - $ref: '#/components/schemas/thresholdcomparator' - timeField: - $ref: '#/components/schemas/timefield' - timeWindowSize: - $ref: '#/components/schemas/timewindowsize' - timeWindowUnit: - $ref: '#/components/schemas/timewindowunit' - - type: object - description: The parameters for an Elasticsearch query rule that uses Elasticsearch Query DSL to define the query. - required: - - esQuery - - index - - threshold - - thresholdComparator - - timeField - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: '#/components/schemas/aggfield' - aggType: - $ref: '#/components/schemas/aggtype' - esQuery: - description: The query definition, which uses Elasticsearch Query DSL. - type: string - excludeHitsFromPreviousRun: - $ref: '#/components/schemas/excludehitsfrompreviousrun' - groupBy: - $ref: '#/components/schemas/groupby' - index: - description: The indices to query. - oneOf: - - type: array - items: - type: string - - type: string - searchType: - description: The type of query, in this case a query that uses Elasticsearch Query DSL. - type: string - enum: - - esQuery - default: esQuery - example: esQuery - size: - $ref: '#/components/schemas/size' - termField: - $ref: '#/components/schemas/termfield' - termSize: - $ref: '#/components/schemas/termsize' - threshold: - $ref: '#/components/schemas/threshold' - thresholdComparator: - $ref: '#/components/schemas/thresholdcomparator' - timeField: - $ref: '#/components/schemas/timefield' - timeWindowSize: - $ref: '#/components/schemas/timewindowsize' - timeWindowUnit: - $ref: '#/components/schemas/timewindowunit' - params_index_threshold_rule: - type: object - description: The parameters for an index threshold rule. - required: - - index - - threshold - - thresholdComparator - - timeField - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: '#/components/schemas/aggfield' - aggType: - $ref: '#/components/schemas/aggtype' - filterKuery: - description: A KQL expression thats limits the scope of alerts. - type: string - groupBy: - $ref: '#/components/schemas/groupby' - index: - description: The indices to query. - type: array - items: - type: string - termField: - $ref: '#/components/schemas/termfield' - termSize: - $ref: '#/components/schemas/termsize' - threshold: - $ref: '#/components/schemas/threshold' - thresholdComparator: - $ref: '#/components/schemas/thresholdcomparator' - timeField: - $ref: '#/components/schemas/timefield' - timeWindowSize: - $ref: '#/components/schemas/timewindowsize' - timeWindowUnit: - $ref: '#/components/schemas/timewindowunit' - params_property_infra_inventory: - properties: - criteria: - type: array - items: - type: object - properties: - metric: - type: string - enum: - - count - - cpu - - diskLatency - - load - - memory - - memoryTotal - - tx - - rx - - logRate - - diskIOReadBytes - - diskIOWriteBytes - - s3TotalRequests - - s3NumberOfObjects - - s3BucketSize - - s3DownloadBytes - - s3UploadBytes - - rdsConnections - - rdsQueriesExecuted - - rdsActiveTransactions - - rdsLatency - - sqsMessagesVisible - - sqsMessagesDelayed - - sqsMessagesSent - - sqsMessagesEmpty - - sqsOldestMessage - - custom - timeSize: - type: number - timeUnit: - type: string - enum: - - s - - m - - h - - d - sourceId: - type: string - threshold: - type: array - items: - type: number - comparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - customMetric: - type: object - properties: - type: - type: string - enum: - - custom - field: - type: string - aggregation: - type: string - enum: - - avg - - max - - min - - rate - id: - type: string - label: - type: string - warningThreshold: - type: array - items: - type: number - warningComparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - filterQuery: - type: string - filterQueryText: - type: string - nodeType: - type: string - enum: - - host - - pod - - container - - awsEC2 - - awsS3 - - awsSQS - - awsRDS - sourceId: - type: string - alertOnNoData: - type: boolean - params_property_infra_metric_threshold: - properties: - criteria: - type: array - items: - oneOf: - - title: non count criterion - type: object - properties: - threshold: - type: array - items: - type: number - comparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - timeUnit: - type: string - timeSize: - type: number - warningThreshold: - type: array - items: - type: number - warningComparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - metric: - type: string - aggType: - type: string - enum: - - avg - - max - - min - - cardinality - - rate - - count - - sum - - p95 - - p99 - - custom - - title: count criterion - type: object - properties: - threshold: - type: array - items: - type: number - comparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - timeUnit: - type: string - timeSize: - type: number - warningThreshold: - type: array - items: - type: number - warningComparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - aggType: - type: string - enum: - - count - - title: custom criterion - type: object - properties: - threshold: - type: array - items: - type: number - comparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - timeUnit: - type: string - timeSize: - type: number - warningThreshold: - type: array - items: - type: number - warningComparator: - type: string - enum: - - < - - <= - - '>' - - '>=' - - between - - outside - aggType: - type: string - enum: - - custom - customMetric: - type: array - items: - oneOf: - - type: object - properties: - name: - type: string - aggType: - type: string - enum: - - avg - - sum - - max - - min - - cardinality - field: - type: string - - type: object - properties: - name: - type: string - aggType: - type: string - enum: - - count - filter: - type: string - equation: - type: string - label: - type: string - groupBy: - oneOf: - - type: string - - type: array - items: - type: string - filterQuery: - type: string - sourceId: - type: string - alertOnNoData: - type: boolean - alertOnGroupDisappear: - type: boolean - params_property_log_threshold: - oneOf: - - title: Count - type: object - required: - - count - - timeSize - - timeUnit - - logView - properties: - criteria: - type: array - items: - type: object - properties: - field: - type: string - example: my.field - comparator: - type: string - enum: - - more than - - more than or equals - - less than - - less than or equals - - equals - - does not equal - - matches - - does not match - - matches phrase - - does not match phrase - value: - oneOf: - - type: number - example: 42 - - type: string - example: value - count: - type: object - properties: - comparator: - type: string - enum: - - more than - - more than or equals - - less than - - less than or equals - - equals - - does not equal - - matches - - does not match - - matches phrase - - does not match phrase - value: - type: number - example: 100 - timeSize: - type: number - example: 6 - timeUnit: - type: string - enum: - - s - - m - - h - - d - logView: - type: object - properties: - logViewId: - type: string - type: - type: string - enum: - - log-view-reference - example: log-view-reference - groupBy: - type: array - items: - type: string - - title: Ratio - type: object - required: - - count - - timeSize - - timeUnit - - logView - properties: - criteria: - type: array - items: - minItems: 2 - maxItems: 2 - type: array - items: - type: object - properties: - field: - type: string - example: my.field - comparator: - type: string - enum: - - more than - - more than or equals - - less than - - less than or equals - - equals - - does not equal - - matches - - does not match - - matches phrase - - does not match phrase - value: - oneOf: - - type: number - example: 42 - - type: string - example: value - count: - type: object - properties: - comparator: - type: string - enum: - - more than - - more than or equals - - less than - - less than or equals - - equals - - does not equal - - matches - - does not match - - matches phrase - - does not match phrase - value: - type: number - example: 100 - timeSize: - type: number - example: 6 - timeUnit: - type: string - enum: - - s - - m - - h - - d - logView: - type: object - properties: - logViewId: - type: string - type: - type: string - enum: - - log-view-reference - example: log-view-reference - groupBy: - type: array - items: - type: string - params_property_slo_burn_rate: - properties: - sloId: - description: The SLO identifier used by the rule - type: string - example: 8853df00-ae2e-11ed-90af-09bb6422b258 - burnRateThreshold: - description: The burn rate threshold used to trigger the alert - type: number - example: 14.4 - maxBurnRateThreshold: - description: The maximum burn rate threshold value defined by the SLO error budget - type: number - example: 168 - longWindow: - description: The duration of the long window used to compute the burn rate - type: object - properties: - value: - description: The duration value - type: number - example: 6 - unit: - description: The duration unit - type: string - example: h - shortWindow: - description: The duration of the short window used to compute the burn rate - type: object - properties: - value: - description: The duration value - type: number - example: 30 - unit: - description: The duration unit - type: string - example: m - params_property_synthetics_uptime_tls: - properties: - search: - type: string - certExpirationThreshold: - type: number - certAgeThreshold: - type: number - params_property_synthetics_monitor_status: - required: - - numTimes - - shouldCheckStatus - - shouldCheckAvailability - properties: - availability: - type: object - properties: - range: - type: number - rangeUnit: - type: string - threshold: - type: string - filters: - oneOf: - - type: string - - type: object - deprecated: true - properties: - monitor.type: - type: array - items: - type: string - observer.geo.name: - type: array - items: - type: string - tags: - type: array - items: - type: string - url.port: - type: array - items: - type: string - locations: - deprecated: true - type: array - items: - type: string - numTimes: - type: number - search: - type: string - shouldCheckStatus: - type: boolean - shouldCheckAvailability: - type: boolean - timerangeCount: - type: number - timerangeUnit: - type: string - timerange: - deprecated: true - type: object - properties: - from: - type: string - to: - type: string - version: - type: number - isAutoGenerated: - type: boolean - create_rule_request: - title: Create rule request body properties - description: The properties vary depending on the rule type. - oneOf: - - $ref: '#/components/schemas/create_anomaly_detection_alert_rule_request' - - $ref: '#/components/schemas/create_anomaly_detection_jobs_health_rule_request' - - $ref: '#/components/schemas/create_apm_anomaly_rule_request' - - $ref: '#/components/schemas/create_apm_error_count_rule_request' - - $ref: '#/components/schemas/create_apm_transaction_duration_rule_request' - - $ref: '#/components/schemas/create_apm_transaction_error_rate_rule_request' - - $ref: '#/components/schemas/create_es_query_rule_request' - - $ref: '#/components/schemas/create_geo_containment_rule_request' - - $ref: '#/components/schemas/create_index_threshold_rule_request' - - $ref: '#/components/schemas/create_infra_inventory_rule_request' - - $ref: '#/components/schemas/create_infra_metric_anomaly_rule_request' - - $ref: '#/components/schemas/create_infra_metric_threshold_rule_request' - - $ref: '#/components/schemas/create_monitoring_jvm_memory_usage_rule_request' - - $ref: '#/components/schemas/create_log_threshold_rule_request' - - $ref: '#/components/schemas/create_monitoring_ccr_exceptions_rule_request' - - $ref: '#/components/schemas/create_monitoring_cluster_health_rule_request' - - $ref: '#/components/schemas/create_monitoring_cpu_usage_rule_request' - - $ref: '#/components/schemas/create_monitoring_disk_usage_rule_request' - - $ref: '#/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request' - - $ref: '#/components/schemas/create_monitoring_license_expiration_rule_request' - - $ref: '#/components/schemas/create_monitoring_kibana_version_mismatch_rule_request' - - $ref: '#/components/schemas/create_monitoring_logstash_version_mismatch_rule_request' - - $ref: '#/components/schemas/create_monitoring_missing_data_rule_request' - - $ref: '#/components/schemas/create_monitoring_nodes_changed_rule_request' - - $ref: '#/components/schemas/create_monitoring_shard_size_rule_request' - - $ref: '#/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request' - - $ref: '#/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request' - - $ref: '#/components/schemas/create_siem_eql_rule_request' - - $ref: '#/components/schemas/create_siem_indicator_rule_request' - - $ref: '#/components/schemas/create_siem_ml_rule_request' - - $ref: '#/components/schemas/create_siem_new_terms_rule_request' - - $ref: '#/components/schemas/create_siem_notifications_rule_request' - - $ref: '#/components/schemas/create_siem_query_rule_request' - - $ref: '#/components/schemas/create_siem_saved_query_rule_request' - - $ref: '#/components/schemas/create_siem_threshold_rule_request' - - $ref: '#/components/schemas/create_slo_burn_rate_rule_request' - - $ref: '#/components/schemas/create_synthetics_monitor_status_rule_request' - - $ref: '#/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request' - - $ref: '#/components/schemas/create_synthetics_uptime_tls_rule_request' - - $ref: '#/components/schemas/create_synthetics_uptime_tls_certificate_rule_request' - - $ref: '#/components/schemas/create_transform_health_rule_request' - - $ref: '#/components/schemas/create_uptime_monitor_status_rule_request' - discriminator: - propertyName: rule_type_id - mapping: - xpack.ml.anomaly_detection_alert: '#/components/schemas/create_anomaly_detection_alert_rule_request' - xpack.ml.anomaly_detection_jobs_health: '#/components/schemas/create_anomaly_detection_jobs_health_rule_request' - apm.anomaly: '#/components/schemas/create_apm_anomaly_rule_request' - apm.error_rate: '#/components/schemas/create_apm_error_count_rule_request' - apm.transaction_duration: '#/components/schemas/create_apm_transaction_duration_rule_request' - apm.transaction_error_rate: '#/components/schemas/create_apm_transaction_error_rate_rule_request' - .es-query: '#/components/schemas/create_es_query_rule_request' - .geo-containment: '#/components/schemas/create_geo_containment_rule_request' - .index-threshold: '#/components/schemas/create_index_threshold_rule_request' - metrics.alert.inventory.threshold: '#/components/schemas/create_infra_inventory_rule_request' - metrics.alert.anomaly: '#/components/schemas/create_infra_metric_anomaly_rule_request' - metrics.alert.threshold: '#/components/schemas/create_infra_metric_threshold_rule_request' - monitoring_alert_jvm_memory_usage: '#/components/schemas/create_monitoring_jvm_memory_usage_rule_request' - logs.alert.document.count: '#/components/schemas/create_log_threshold_rule_request' - monitoring_ccr_read_exceptions: '#/components/schemas/create_monitoring_ccr_exceptions_rule_request' - monitoring_alert_cluster_health: '#/components/schemas/create_monitoring_cluster_health_rule_request' - monitoring_alert_cpu_usage: '#/components/schemas/create_monitoring_cpu_usage_rule_request' - monitoring_alert_disk_usage: '#/components/schemas/create_monitoring_disk_usage_rule_request' - monitoring_alert_elasticsearch_version_mismatch: '#/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request' - monitoring_alert_license_expiration: '#/components/schemas/create_monitoring_license_expiration_rule_request' - monitoring_alert_kibana_version_mismatch: '#/components/schemas/create_monitoring_kibana_version_mismatch_rule_request' - monitoring_alert_logstash_version_mismatch: '#/components/schemas/create_monitoring_logstash_version_mismatch_rule_request' - monitoring_alert_missing_monitoring_data: '#/components/schemas/create_monitoring_missing_data_rule_request' - monitoring_alert_nodes_changed: '#/components/schemas/create_monitoring_nodes_changed_rule_request' - monitoring_shard_size: '#/components/schemas/create_monitoring_shard_size_rule_request' - monitoring_alert_thread_pool_search_rejections: '#/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request' - monitoring_alert_thread_pool_write_rejections: '#/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request' - siem.eqlRule: '#/components/schemas/create_siem_eql_rule_request' - siem.indicatorRule: '#/components/schemas/create_siem_indicator_rule_request' - siem.mlRule: '#/components/schemas/create_siem_ml_rule_request' - siem.newTermsRule: '#/components/schemas/create_siem_new_terms_rule_request' - siem.notifications: '#/components/schemas/create_siem_notifications_rule_request' - siem.queryRule: '#/components/schemas/create_siem_query_rule_request' - siem.savedQueryRule: '#/components/schemas/create_siem_saved_query_rule_request' - siem.thresholdRule: '#/components/schemas/create_siem_threshold_rule_request' - slo.rules.burnRate: '#/components/schemas/create_slo_burn_rate_rule_request' - xpack.synthetics.alerts.monitorStatus: '#/components/schemas/create_synthetics_monitor_status_rule_request' - xpack.uptime.alerts.durationAnomaly: '#/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request' - xpack.uptime.alerts.tls: '#/components/schemas/create_synthetics_uptime_tls_rule_request' - xpack.uptime.alerts.tlsCertificate: '#/components/schemas/create_synthetics_uptime_tls_certificate_rule_request' - transform_health: '#/components/schemas/create_transform_health_rule_request' - xpack.uptime.alerts.monitorStatus: '#/components/schemas/create_uptime_monitor_status_rule_request' - rule_response_properties: - title: Rule response properties - type: object - required: - - actions - - api_key_owner - - consumer - - created_at - - created_by - - enabled - - execution_status - - id - - mute_all - - muted_alert_ids - - name - - params - - rule_type_id - - schedule - - tags - - throttle - - updated_at - - updated_by - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - api_key_created_by_user: - type: boolean - description: Indicates whether the API key that is associated with the rule was created by the user. - example: false - api_key_owner: - type: string - description: | - The owner of the API key that is associated with the rule and used to run background tasks. - nullable: true - example: elastic - consumer: - type: string - description: The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`. - example: alerts - created_at: - type: string - description: The date and time that the rule was created. - format: date-time - example: '2022-12-05T23:36:58.284Z' - created_by: - type: string - description: The identifier for the user that created the rule. - nullable: true - example: elastic - enabled: - type: boolean - description: Indicates whether the rule is currently enabled. - example: true - execution_status: - type: object - properties: - last_duration: - type: integer - example: 55 - last_execution_date: - type: string - format: date-time - example: '2022-12-06T00:13:43.890Z' - status: - type: string - example: ok - id: - type: string - description: The identifier for the rule. - example: b530fed0-74f5-11ed-9801-35303b735aef - last_run: - type: object - properties: - alerts_count: - type: object - properties: - active: - type: integer - ignored: - type: integer - new: - type: integer - recovered: - type: integer - outcome: - type: string - example: succeeded - outcome_msg: - type: array - items: - type: string - nullable: true - outcome_order: - type: integer - warning: - type: string - nullable: true - example: null - muted_alert_ids: - type: array - nullable: true - items: - type: string - mute_all: - type: boolean - example: false - name: - type: string - description: The name of the rule. - example: cluster_health_rule - next_run: - type: string - format: date-time - nullable: true - example: '2022-12-06T00:14:43.818Z' - notify_when: - type: string - description: Indicates how often alerts generate actions. - nullable: true - params: - type: object - description: The parameters for the rule. - additionalProperties: true - revision: - type: integer - description: The rule revision number. - rule_type_id: - type: string - description: | - The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`. - example: monitoring_alert_cluster_health - running: - type: boolean - description: Indicates whether the rule is running. - schedule: - $ref: '#/components/schemas/schedule' - scheduled_task_id: - type: string - example: b530fed0-74f5-11ed-9801-35303b735aef - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - updated_at: - type: string - description: The date and time that the rule was updated most recently. - example: '2022-12-05T23:36:58.284Z' - updated_by: - type: string - description: The identifier for the user that updated this rule most recently. - nullable: true - example: elastic - 401_response: - type: object - title: Unsuccessful rule API response - properties: - error: - type: string - example: Unauthorized - enum: - - Unauthorized - message: - type: string - statusCode: - type: integer - example: 401 - enum: - - 401 - 404_response: - type: object - properties: - error: - type: string - example: Not Found - enum: - - Not Found - message: - type: string - example: Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found - statusCode: - type: integer - example: 404 - enum: - - 404 - update_rule_request: - title: Update rule request - description: | - The update rule API request body varies depending on the type of rule and actions. - type: object - required: - - name - - params - - schedule - properties: - actions: - $ref: '#/components/schemas/actions' - alert_delay: - $ref: '#/components/schemas/alert_delay' - name: - type: string - description: The name of the rule. - example: cluster_health_rule - notify_when: - $ref: '#/components/schemas/notify_when' - params: - type: object - description: The parameters for the rule. - additionalProperties: true - schedule: - $ref: '#/components/schemas/schedule' - tags: - $ref: '#/components/schemas/tags' - throttle: - $ref: '#/components/schemas/throttle' - fieldmap_properties: - title: Field map objects in the get rule types response - type: object - properties: - array: - type: boolean - description: Indicates whether the field is an array. - dynamic: - type: boolean - description: Indicates whether it is a dynamic field mapping. - format: - type: string - description: | - Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. - ignore_above: - type: integer - description: Specifies the maximum length of a string field. Longer strings are not indexed or stored. - index: - type: boolean - description: Indicates whether field values are indexed. - path: - type: string - description: TBD - properties: - type: object - description: | - Details about the object properties. This property is applicable when `type` is `object`. - additionalProperties: - type: object - properties: - type: - type: string - description: The data type for each object property. - required: - type: boolean - description: Indicates whether the field is required. - scaling_factor: - type: integer - description: | - The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. - type: - type: string - description: Specifies the data type for the field. - example: scaled_float - 400_response: - title: Bad request - type: object - required: - - error - - message - - statusCode - properties: - error: - type: string - enum: - - Bad Request - message: - type: string - statusCode: - type: integer - enum: - - 400 - alert_response_properties: - title: Legacy alert response properties - type: object - properties: - actions: - type: array - items: - type: object - alertTypeId: - type: string - example: .index-threshold - apiKeyOwner: - type: string - nullable: true - example: elastic - createdAt: - type: string - description: The date and time that the alert was created. - format: date-time - example: '2022-12-05T23:36:58.284Z' - createdBy: - type: string - description: The identifier for the user that created the alert. - example: elastic - enabled: - type: boolean - description: Indicates whether the alert is currently enabled. - example: true - executionStatus: - type: object - properties: - lastExecutionDate: - type: string - format: date-time - example: '2022-12-06T00:13:43.890Z' - status: - type: string - example: ok - id: - type: string - description: The identifier for the alert. - example: b530fed0-74f5-11ed-9801-35303b735aef - muteAll: - type: boolean - example: false - mutedInstanceIds: - type: array - nullable: true - items: - type: string - name: - type: string - description: The name of the alert. - example: my alert - notifyWhen: - type: string - example: onActionGroupChange - params: - type: object - additionalProperties: true - schedule: - type: object - properties: - interval: - type: string - scheduledTaskId: - type: string - example: b530fed0-74f5-11ed-9801-35303b735aef - tags: - type: array - items: + example: 41893910-6bca-11eb-9e0d-85d233e3ee35 + - in: path + name: alertInstanceId + description: An identifier for the alert instance. + required: true + schema: type: string - throttle: - type: string - nullable: true - updatedAt: - type: string - example: '2022-12-05T23:36:58.284Z' - updatedBy: - type: string - description: The identifier for the user that updated this alert most recently. - nullable: true - example: elastic + example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 + responses: + '204': + description: Indicates a successful call. + '401': + description: Authorization information is missing or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' +components: examples: - create_es_query_esql_rule_request: - summary: Create an Elasticsearch query rule that uses Elasticsearch Query Language (ES|QL). - value: - name: my Elasticsearch query ESQL rule - params: - searchType: esqlQuery - esqlQuery: - esql: FROM kibana_sample_data_logs | KEEP bytes, clientip, host, geo.dest | where geo.dest != "GB" | STATS sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | SORT sumbytes desc | LIMIT 10 - timeField: '@timestamp' - timeWindowSize: 1 - timeWindowUnit: d - size: 0 - thresholdComparator: '>' - threshold: - - 0 - consumer: stackAlerts - rule_type_id: .es-query - schedule: - interval: 1d - actions: - - group: query matched - id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 - params: - level: info - message: |- - Elasticsearch query rule '{{rule.name}}' is active: - - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} - frequency: - summary: false - notify_when: onActiveAlert - create_es_query_rule_request: - summary: Create an Elasticsearch query rule that uses Elasticsearch query domain specific language (DSL) to define its query and a server log connector to send notifications. - value: - actions: - - group: query matched - params: - level: info - message: The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts. - id: fdbece50-406c-11ee-850e-c71febc4ca7f - frequency: - throttle: 1d - summary: true - notify_when: onThrottleInterval - - group: recovered - params: - level: info - message: Recovered - id: fdbece50-406c-11ee-850e-c71febc4ca7f - frequency: - summary: false - notify_when: onActionGroupChange - consumer: alerts - name: my Elasticsearch query rule - params: - esQuery: '"""{"query":{"match_all" : {}}}"""' - index: - - kibana_sample_data_logs - size: 100 - threshold: - - 100 - thresholdComparator: '>' - timeField: '@timestamp' - timeWindowSize: 1 - timeWindowUnit: d - rule_type_id: .es-query - schedule: - interval: 1d - create_es_query_kql_rule_request: - summary: Create an Elasticsearch query rule that uses Kibana query language (KQL). - value: - consumer: alerts - name: my Elasticsearch query KQL rule - params: - aggType: count - excludeHitsFromPreviousRun: true - groupBy: all - searchConfiguration: - query: - query: '""geo.src : "US" ""' - language: kuery - index: 90943e30-9a47-11e8-b64d-95841ca0b247 - searchType: searchSource - size: 100 - threshold: - - 1000 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - rule_type_id: .es-query - schedule: - interval: 1m - create_index_threshold_rule_request: - summary: Create an index threshold rule. - value: - actions: - - id: 48de3460-f401-11ed-9f8e-399c75a2deeb - frequency: - notify_when: onActionGroupChange - summary: false - group: threshold met - params: - level: info - message: |- - Rule '{{rule.name}}' is active for group '{{context.group}}': - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date}} - alert_delay: - active: 3 - consumer: alerts - name: my rule - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - .test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - rule_type_id: .index-threshold - schedule: - interval: 1m - tags: - - cpu - create_tracking_containment_rule_request: - summary: Create a tracking containment rule. - value: - consumer: alerts - name: my tracking rule - params: - index: kibana_sample_data_logs - dateField": '@timestamp' - geoField: geo.coordinates - entity: agent.keyword - boundaryType: entireIndex - boundaryIndexTitle: boundary* - boundaryGeoField: location - boundaryNameField: name - indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 - boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc - rule_type_id: .geo-containment - schedule: - interval: 1h - create_es_query_esql_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - id: e0d62360-78e8-11ee-9177-f7d404c8c945 - enabled: true - name: my Elasticsearch query ESQL rule - tags: [] - rule_type_id: .es-query - consumer: stackAlerts - schedule: - interval: 1d - actions: - - group: query matched - id: d0db1fe0-78d6-11ee-9177-f7d404c8c945 - params: - level: info - message: |- - Elasticsearch query rule '{{rule.name}}' is active: - - Value: {{context.value}} - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - Timestamp: {{context.date}} - Link: {{context.link}} - connector_type_id: .server-log - frequency: - summary: false - notify_when: onActiveAlert - throttle: null - uuid: bfe370a3-531b-4855-bbe6-ad739f578844 - params: - searchType: esqlQuery - esqlQuery: - esql: FROM kibana_sample_data_logs | keep bytes, clientip, host, geo.dest | WHERE geo.dest != "GB" | stats sumbytes = sum(bytes) by clientip, host | WHERE sumbytes > 5000 | sort sumbytes desc | limit 10 - timeField: '@timestamp' - timeWindowSize: 1 - timeWindowUnit: d - size: 0 - thresholdComparator: '>' - threshold: - - 0 - excludeHitsFromPreviousRun": true, - aggType: count - groupBy: all - scheduled_task_id: e0d62360-78e8-11ee-9177-f7d404c8c945 - created_by: elastic - updated_by: elastic", - created_at: '2023-11-01T19:00:10.453Z' - updated_at: '2023-11-01T19:00:10.453Z' - api_key_owner: elastic - api_key_created_by_user: false - throttle: null - mute_all: false - notify_when: null - muted_alert_ids: [] - execution_status: - status: pending - last_execution_date: '2023-11-01T19:00:10.453Z' - revision: 0 - running: false - create_es_query_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - id: 58148c70-407f-11ee-850e-c71febc4ca7f - enabled: true - name: my Elasticsearch query rule - tags: [] - rule_type_id: .es-query - consumer: alerts - schedule: - interval: 1d - actions: - - group: query matched - id: fdbece50-406c-11ee-850e-c71febc4ca7f - params: - level: info - message: The system has detected {{alerts.new.count}} new, {{alerts.ongoing.count}} ongoing, and {{alerts.recovered.count}} recovered alerts. - connector_type_id: .server-log - frequency: - summary: true - notify_when: onThrottleInterval - throttle: 1d - uuid: 53f3c2a3-e5d0-4cfa-af3b-6f0881385e78 - - group: recovered - id: fdbece50-406c-11ee-850e-c71febc4ca7f - params: - level: info - message: Recovered - connector_type_id: .server-log - frequency: - summary: false - notify_when: onActionGroupChange - throttle: null - uuid: 2324e45b-c0df-45c7-9d70-4993e30be758 - params: - thresholdComparator: '>' - timeWindowSize: 1 - timeWindowUnit: d - threshold: - - 100 - size: 100 - timeField: '@timestamp' - index: - - kibana_sample_data_logs - esQuery: '"""{"query":{"match_all" : {}}}"""' - excludeHitsFromPreviousRun: true - aggType: count - groupBy: all - searchType: esQuery - scheduled_task_id: 58148c70-407f-11ee-850e-c71febc4ca7f - created_by: elastic - updated_by: elastic - created_at: '2023-08-22T00:03:38.263Z' - updated_at: '2023-08-22T00:03:38.263Z' - api_key_owner: elastic - api_key_created_by_user: false - throttle: null - mute_all: false - notify_when: null - muted_alert_ids: [] - execution_status: - status: pending - last_execution_date: '2023-08-22T00:03:38.263Z' - revision: 0 - running: false - create_es_query_kql_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - id: 7bd506d0-2284-11ee-8fad-6101956ced88 - enabled: true - name: my Elasticsearch query KQL rule" - tags: [] - rule_type_id: .es-query - consumer: alerts - schedule: - interval: 1m - actions: [] - params: - searchConfiguration: - query: - query: '""geo.src : "US" ""' - language: kuery - index: 90943e30-9a47-11e8-b64d-95841ca0b247 - searchType: searchSource - timeWindowSize: 5 - timeWindowUnit: m - threshold: - - 1000 - thresholdComparator: '>' - size: 100 - aggType: count - groupBy: all - excludeHitsFromPreviousRun: true - created_by: elastic - updated_by: elastic - created_at: '2023-07-14T20:24:50.729Z' - updated_at: '2023-07-14T20:24:50.729Z' - api_key_owner: elastic - api_key_created_by_user: false - throttle: null - notify_when: null - mute_all: false - muted_alert_ids: [] - scheduled_task_id: 7bd506d0-2284-11ee-8fad-6101956ced88 - execution_status: - status: pending - last_execution_date: '2023-07-14T20:24:50.729Z' - revision: 0 - running: false - create_index_threshold_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - actions: - - group: threshold met - id: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2 - uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d - connector_type_id: .server-log - frequency: - notify_when: onActionGroupChange - summary: false - throttle: null - params: - level: info - message: |- - Rule {{rule.name}} is active for group {{context.group} : - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date}} - alert_delay: - active: 3 - api_key_created_by_user: false - api_key_owner: elastic - consumer: alerts - created_at: '2022-06-08T17:20:31.632Z' - created_by: elastic - enabled: true - execution_status: - last_execution_date: '2022-06-08T17:20:31.632Z' - status: pending - id: 41893910-6bca-11eb-9e0d-85d233e3ee35 - muted_alert_ids: [] - mute_all: false - name: my rule - notify_when: null - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - .test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - revision: 0 - rule_type_id: .index-threshold - running: false - schedule: - interval: 1m - scheduled_task_id: 425b0800-6bca-11eb-9e0d-85d233e3ee35 - tags: - - cpu - throttle: null - updated_at: '2022-06-08T17:20:31.632Z' - updated_by: elastic - create_tracking_containment_rule_response: - summary: The create rule API returns a JSON object that contains details about the rule. - value: - id: b6883f9d-5f70-4758-a66e-369d7c26012f - name: my tracking rule - tags: [] - enabled: true - consumer: alerts - throttle: null - revision: 1 - running: false - schedule: - interval: 1h - params: - index: kibana_sample_data_logs - dateField: '@timestamp' - geoField: geo.coordinates - entity: agent.keyword - boundaryType: entireIndex - boundaryIndexTitle: boundary* - boundaryGeoField: location - boundaryNameField: name - indexId: 90943e30-9a47-11e8-b64d-95841ca0b247 - boundaryIndexId: 0cd90abf-abe7-44c7-909a-f621bbbcfefc - rule_type_id: .geo-containment - created_by: elastic - updated_by: elastic - created_at: '2024-02-14T19:52:55.920Z' - updated_at: '2024-02-15T03:24:32.574Z' - api_key_owner: elastic - notify_when: null - mute_all: false - muted_alert_ids: [] - scheduled_task_id: b6883f9d-5f70-4758-a66e-369d7c26012f - execution_status: - status: ok - last_execution_date: '2024-02-15T03:25:38.125Z' - last_duration: 74 - actions: [] - last_run: - alerts_count: - active: 0 - new: 0 - recovered: 0 - ignored: 0 - outcome_msg: null - outcome_order: 0 - outcome: succeeded - warning: null - next_run: '2024-02-15T03:26:38.033Z' - api_key_created_by_user: false - get_rule_response: - summary: The get rule API returns a JSON object that contains details about the rule. - value: - id: 31697a40-7b36-11ed-aa79-f742c05329b2 - consumer: alerts - tags: - - cpu - name: my alert - enabled: true - throttle: null - schedule: - interval: 1m - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - revision: 1 - rule_type_id: .index-threshold - created_by: elastic - updated_by: elastic - created_at: '2022-12-13T22:33:41.163Z' - updated_at: '2022-12-13T22:33:41.163Z' - api_key_owner: elastic - notify_when: null - muted_alert_ids: [] - mute_all: false - scheduled_task_id: 31697a40-7b36-11ed-aa79-f742c05329b2 - execution_status: - status: ok - last_execution_date: '2022-12-13T22:33:44.388Z' - last_duration: 83 - actions: - - group: threshold met - id: 1007a0c0-7a6e-11ed-89d5-abec321c0def - uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 - params: - level: info - message: |- - Rule {{rule.name}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date} - connector_type_id: .server-log - connector_type_id: .server-log - frequency: - throttle: null - summary: false - notify_when: onActionGroupChange - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: null - warning: null - outcome: succeeded - next_run: '2022-12-13T22:34:44.314Z' - api_key_created_by_user: false - update_rule_request: - summary: Update an index threshold rule. - value: - actions: - - frequency: - summary: false - notify_when: onActionGroupChange - group: threshold met - id: 96b668d0-a1b6-11ed-afdf-d39a49596974 - params: - level: info - message: |- - Rule {{rule.name}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date}} - params: - aggField: sheet.version - aggType: avg - index: - - .updated-index - groupBy: top - termField: name.keyword - termSize: 6 - threshold: - - 1000 - thresholdComparator: '>' - timeField: '@timestamp' - timeWindowSize: 5 - timeWindowUnit: m - name: new name - schedule: - interval: 1m - tags: [] - update_rule_response: - summary: The update rule API returns a JSON object that contains details about the rule. - value: - id: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 - consumer: alerts - tags: [] - name: new name - enabled: true - throttle: null - revision: 1 - running: false - schedule: - interval: 1m - params: - index: - - .updated-index - timeField: '@timestamp' - groupBy: top - aggType: avg - timeWindowSize: 5 - timeWindowUnit: m - thresholdComparator: '>' - threshold: - - 1000 - aggField: sheet.version - termField: name.keyword - termSize: 6 - api_key_owner: elastic - created_by: elastic - updated_by: elastic - rule_type_id: .index-threshold - scheduled_task_id: 4c5eda00-e74f-11ec-b72f-5b18752ff9ea - created_at: '2024-03-26T23:13:20.985Z' - updated_at: '2024-03-26T23:22:59.949Z' - mute_all: false - muted_alert_ids: [] - execution_status: - status: ok - last_execution_date: '2024-03-26T23:22:51.390Z' - last_duration: 52 - actions: - - group: threshold met - params: - level: info - message: |- - Rule {{rule.name}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date} - id: 96b668d0-a1b6-11ed-afdf-d39a49596974 - uuid: 07aef2a0-9eed-4ef9-94ec-39ba58eb609d - connector_type_id: .server-log - frequency: - summary: false - throttle: null - notify_when: onActionGroupChange - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: null - warning: null - outcome: succeeded - next_run: '2024-03-26T23:23:51.316Z' - api_key_created_by_user: false - find_rules_response: - summary: Retrieve information about a rule. - value: - page: 1 - total: 1 - per_page: 10 - data: - - id: 3583a470-74f6-11ed-9801-35303b735aef - consumer: alerts - tags: - - cpu - name: my alert - enabled: true - throttle: null - schedule: - interval: 1m - params: - aggType: avg - termSize: 6 - thresholdComparator: '>' - timeWindowSize: 5 - timeWindowUnit: m - groupBy: top - threshold: - - 1000 - index: - - test-index - timeField: '@timestamp' - aggField: sheet.version - termField: name.keyword - revision: 1 - rule_type_id: .index-threshold - created_by: elastic - updated_by: elastic - created_at: '2022-12-05T23:40:33.132Z' - updated_at: '2022-12-05T23:40:33.132Z' - api_key_owner: elastic - mute_all: false - muted_alert_ids: [] - scheduled_task_id: 3583a470-74f6-11ed-9801-35303b735aef - execution_status: - status: ok - last_execution_date: '2022-12-06T01:44:23.983Z' - last_duration: 48 - actions: - - id: 9dca3e00-74f5-11ed-9801-35303b735aef - group: threshold met - uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 - params: - level: info - message: |- - Rule {{rule.name}} is active for group {{context.group}}: - - - Value: {{context.value}} - - Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}} - - Timestamp: {{context.date}} - connector_type_id: .server-log - frequency: - summary: false - notify_when: onActionGroupChange - throttle: null - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: null - warning: null - outcome: succeeded - next_run: '2022-12-06T01:45:23.912Z' - api_key_created_by_user: false - find_rules_response_conditional_action: - summary: Retrieve information about a rule that has conditional actions. - value: - page: 1 - total: 1 - per_page: 10 - data: - - id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb - name: security_rule - consumer: siem - enabled: true - tags: [] - throttle: null - revision: 1 - running: false - schedule: - interval: 1m - params: - author: [] - description: A security threshold rule. - ruleId: an_internal_rule_id - falsePositives: [] - from: now-3660s - immutable: false - license: '' - outputIndex: '' - meta: - from: 1h - kibana_siem_app_url: https://localhost:5601/app/security - maxSignals: 100 - riskScore: 21 - riskScoreMapping: [] - severity: low - severityMapping: [] - threat: [] - to: now - references: [] - version: 1 - exceptionsList: [] - type: threshold - language: kuery - index: - - kibana_sample_data_logs - query: '*' - filters: [] - threshold: - field: - - bytes - value: 1 - cardinality: [] - rule_type_id: siem.thresholdRule - created_by: elastic - updated_by: elastic - created_at: '2023-05-16T15:50:28.358Z' - updated_at: '2023-05-16T20:25:42.559Z' - api_key_owner: elastic - notify_when: null - mute_all: false - muted_alert_ids: [] - scheduled_task_id: 6107a8f0-f401-11ed-9f8e-399c75a2deeb - execution_status: - status: ok - last_execution_date: '2023-05-16T20:26:49.590Z' - last_duration: 166 - actions: - - group: default - id: 49eae970-f401-11ed-9f8e-399c75a2deeb - params: - documents: - - rule_id: - '[object Object]': null - rule_name: - '[object Object]': null - alert_id: - '[object Object]': null - context_message: - '[object Object]': null - connector_type_id: .index - frequency: - summary: true - notify_when: onActiveAlert - throttle: null - uuid: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61 - alerts_filter: - timeframe: - days: - - 7 - timezone: UTC - hours: - start: '08:00' - end: '17:00' - query: - kql: '' - filters: - - meta: - disabled: false - negate: false - alias: null - index: c4bdca79-e69e-4d80-82a1-e5192c621bea - key: client.geo.region_iso_code - field: client.geo.region_iso_code - params: - query: CA-QC - type: phrase - $state: - store: appState - query: - match_phrase: - client.geo.region_iso_code: CA-QC - last_run: - alerts_count: - new: 0 - ignored: 0 - recovered: 0 - active: 0 - outcome_msg: - - Rule execution completed successfully - outcome_order: 0 - warning: null - outcome: succeeded - next_run: '2023-05-16T20:27:49.507Z' - api_key_created_by_user: false get_health_response: summary: Retrieve information about the health of the alerting framework. value: @@ -5840,3 +1309,155 @@ components: does_set_recovery_context: true has_alerts_mappings: false has_fields_for_a_a_d: false + schemas: + 401_response: + type: object + title: Unsuccessful rule API response + properties: + error: + type: string + example: Unauthorized + enum: + - Unauthorized + message: + type: string + statusCode: + type: integer + example: 401 + enum: + - 401 + fieldmap_properties: + title: Field map objects in the get rule types response + type: object + properties: + array: + type: boolean + description: Indicates whether the field is an array. + dynamic: + type: boolean + description: Indicates whether it is a dynamic field mapping. + format: + type: string + description: | + Indicates the format of the field. For example, if the `type` is `date_range`, the `format` can be `epoch_millis||strict_date_optional_time`. + ignore_above: + type: integer + description: Specifies the maximum length of a string field. Longer strings are not indexed or stored. + index: + type: boolean + description: Indicates whether field values are indexed. + path: + type: string + description: TBD + properties: + type: object + description: | + Details about the object properties. This property is applicable when `type` is `object`. + additionalProperties: + type: object + properties: + type: + type: string + description: The data type for each object property. + required: + type: boolean + description: Indicates whether the field is required. + scaling_factor: + type: integer + description: | + The scaling factor to use when encoding values. This property is applicable when `type` is `scaled_float`. Values will be multiplied by this factor at index time and rounded to the closest long value. + type: + type: string + description: Specifies the data type for the field. + example: scaled_float + alert_response_properties: + title: Legacy alert response properties + type: object + properties: + actions: + type: array + items: + type: object + alertTypeId: + type: string + example: .index-threshold + apiKeyOwner: + type: string + nullable: true + example: elastic + createdAt: + type: string + description: The date and time that the alert was created. + format: date-time + example: '2022-12-05T23:36:58.284Z' + createdBy: + type: string + description: The identifier for the user that created the alert. + example: elastic + enabled: + type: boolean + description: Indicates whether the alert is currently enabled. + example: true + executionStatus: + type: object + properties: + lastExecutionDate: + type: string + format: date-time + example: '2022-12-06T00:13:43.890Z' + status: + type: string + example: ok + id: + type: string + description: The identifier for the alert. + example: b530fed0-74f5-11ed-9801-35303b735aef + muteAll: + type: boolean + example: false + mutedInstanceIds: + type: array + nullable: true + items: + type: string + name: + type: string + description: The name of the alert. + example: my alert + notifyWhen: + type: string + example: onActionGroupChange + params: + type: object + additionalProperties: true + schedule: + type: object + properties: + interval: + type: string + scheduledTaskId: + type: string + example: b530fed0-74f5-11ed-9801-35303b735aef + tags: + type: array + items: + type: string + throttle: + type: string + nullable: true + updatedAt: + type: string + example: '2022-12-05T23:36:58.284Z' + updatedBy: + type: string + description: The identifier for the user that updated this alert most recently. + nullable: true + example: elastic + parameters: + kbn_xsrf: + schema: + type: string + in: header + name: kbn-xsrf + description: Cross-site request forgery protection + required: true diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_alert_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_alert_rule_request.yaml deleted file mode 100644 index 27db1b6a72a53..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_alert_rule_request.yaml +++ /dev/null @@ -1,40 +0,0 @@ -title: Create anomaly detection rule request -description: > - A rule that checks if the anomaly detection job results contain anomalies that match the rule conditions. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an anomaly detection rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.ml.anomaly_detection_alert - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_jobs_health_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_jobs_health_rule_request.yaml deleted file mode 100644 index 01a6737bb7715..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_anomaly_detection_jobs_health_rule_request.yaml +++ /dev/null @@ -1,40 +0,0 @@ -title: Create anomaly detection jobs health rule request -description: > - An rule that monitors job health and alerts if an operational issue occurred that may prevent the job from detecting anomalies. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an anomaly detection jobs health rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.ml.anomaly_detection_jobs_health - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_anomaly_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_anomaly_rule_request.yaml deleted file mode 100644 index 79de09845df62..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_anomaly_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create APM anomaly rule rule request -description: A rule that detects when either the latency, throughput, or failed transaction rate of a service is anomalous. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.anomaly - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_error_count_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_error_count_rule_request.yaml deleted file mode 100644 index 6f1a088f79e9a..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_error_count_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create APM error count rule request -description: A rule that detects when the number of errors in a service exceeds a defined threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.error_rate - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_duration_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_duration_rule_request.yaml deleted file mode 100644 index 366baffbb1664..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_duration_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create latency threshold rule request -description: A rule that detects when the latency of a specific transaction type in a service exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.transaction_duration - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_error_rate_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_error_rate_rule_request.yaml deleted file mode 100644 index 638b01dc6e77d..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_apm_transaction_error_rate_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create APM transaction error rate rule request -description: A rule that sends notifications when the rate of transaction errors in a service exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - apm.transaction_error_rate - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_es_query_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_es_query_rule_request.yaml deleted file mode 100644 index b3f86de78972b..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_es_query_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create Elasticsearch query rule request -description: > - A rule that runs a user-configured query, compares the number of matches to a configured threshold, and schedules actions to run when the threshold condition is met. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: 'params_es_query_rule.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .es-query - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_geo_containment_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_geo_containment_rule_request.yaml deleted file mode 100644 index bd875097a0653..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_geo_containment_rule_request.yaml +++ /dev/null @@ -1,41 +0,0 @@ -title: Create tracking containment rule request -description: > - A rule that runs an Elasticsearch query over indices to determine whether any documents are currently contained within any boundaries from the specified boundary index. - In the event that an entity is contained within a boundary, an alert may be generated. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an tracking containment rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .geo-containment - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_index_threshold_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_index_threshold_rule_request.yaml deleted file mode 100644 index b7fd292e5c4e8..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_index_threshold_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create index threshold rule request -description: >- - A rule that runs an Elasticsearch query, aggregates field values from documents, compares them to threshold values, and schedules actions to run when the thresholds are met. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: 'params_index_threshold_rule.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - .index-threshold - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_inventory_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_inventory_rule_request.yaml deleted file mode 100644 index 29087672db1eb..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_inventory_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create infra inventory rule request -description: > - A rule that sends notifications when a metric has reached or exceeded a value for a specific resource or a group of resources within your infrastructure. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.inventory.threshold - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_anomaly_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_anomaly_rule_request.yaml deleted file mode 100644 index 0beda5b40555e..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_anomaly_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create infrastructure anomaly rule request -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an infrastructure anomaly rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.anomaly - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_threshold_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_threshold_rule_request.yaml deleted file mode 100644 index fa19ad4c29ae5..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_infra_metric_threshold_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create infra metric threshold rule request -description: > - A rule that sends notifications when a metric has reached or exceeded a value for a specific time period. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - metrics.alert.threshold - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_log_threshold_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_log_threshold_rule_request.yaml deleted file mode 100644 index 7354903ba28b2..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_log_threshold_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create log threshold rule request -description: A rule that detects when a log aggregation exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - logs.alert.document.count - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_ccr_exceptions_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_ccr_exceptions_rule_request.yaml deleted file mode 100644 index cf031888d89fc..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_ccr_exceptions_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create CCR read exceptions rule request -description: A rule that detects cross-cluster replication (CCR) read exceptions. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a CCR read exceptions rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_ccr_read_exceptions - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cluster_health_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cluster_health_rule_request.yaml deleted file mode 100644 index e32c121272538..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cluster_health_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create cluster health rule request -description: A rule that detects when the health of the cluster changes. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a cluster health rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_cluster_health - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cpu_usage_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cpu_usage_rule_request.yaml deleted file mode 100644 index b1d31b6365df6..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_cpu_usage_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create CPU usage rule request -description: A rule that detects when the CPU load for a node is consistently high. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a CPU usage rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_cpu_usage - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_disk_usage_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_disk_usage_rule_request.yaml deleted file mode 100644 index df7b66a234a14..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_disk_usage_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create disk usage rule request -description: A rule that detects when the disk usage for a node is consistently high. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a disk usage rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_disk_usage - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request.yaml deleted file mode 100644 index 87be34ef18d11..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_elasticsearch_version_mismatch_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create Elasticsearch version mismatch rule request -description: A rule that detects when the cluster has multipe versions of Elasticsearch. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a Elasticsearch version mismatch rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_elasticsearch_version_mismatch - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_jvm_memory_usage_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_jvm_memory_usage_rule_request.yaml deleted file mode 100644 index 8ba1e561010e3..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_jvm_memory_usage_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create JVM memory usage rule request -description: A rule that detects when a node reports high memory usage. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a JVM memory usage rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_jvm_memory_usage - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_kibana_version_mismatch_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_kibana_version_mismatch_rule_request.yaml deleted file mode 100644 index 2b0fbe88f5442..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_kibana_version_mismatch_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create Kibana version mismatch rule request -description: A rule that detects when the cluster has multiple versions of Kibana. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a Kibana version mismatch rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_kibana_version_mismatch - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_license_expiration_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_license_expiration_rule_request.yaml deleted file mode 100644 index c11db425738ce..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_license_expiration_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create license expiration rule request -description: A rule that detects when the cluster license is about to expire. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a license expiration rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_license_expiration - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_logstash_version_mismatch_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_logstash_version_mismatch_rule_request.yaml deleted file mode 100644 index bac07fd3d9e39..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_logstash_version_mismatch_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create Logstash version mismatch rule request -description: A rule that detects when the cluster has multiple versions of Logstash. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a Logstash version mismatch rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_logstash_version_mismatch - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_missing_data_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_missing_data_rule_request.yaml deleted file mode 100644 index 8e2484db9b892..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_missing_data_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create missing monitoring data rule request -description: A rule that detects when monitoring data is missing. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a missing monitoring data rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_missing_monitoring_data - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_nodes_changed_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_nodes_changed_rule_request.yaml deleted file mode 100644 index c8af9bb84c151..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_nodes_changed_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create nodes changed rule request -description: A rule that detects when nodes are added, removed, or restarted. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a nodes changed rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_nodes_changed - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_shard_size_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_shard_size_rule_request.yaml deleted file mode 100644 index 0d75dca26cf24..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_shard_size_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create shard size rule request -description: A rule that detects when the average shard size is larger than a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a shard size rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_shard_size - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request.yaml deleted file mode 100644 index fbf20b7b867c5..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_search_rejections_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create thread pool search rejections rule request -description: A rule that detects when the number of rejections in the thread pool exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a thread pool search rejections rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_thread_pool_search_rejections - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request.yaml deleted file mode 100644 index 741d2af4a9b13..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_monitoring_thread_pool_write_rejections_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create thread pool write rejections rule request -description: A rule that detects when the number of rejections in the write thread pool exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a thread pool write rejections rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - monitoring_alert_thread_pool_write_rejections - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_rule_request.yaml index 4c5127f54b4c0..aa8421915efc0 100644 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_rule_request.yaml +++ b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_rule_request.yaml @@ -1,90 +1,36 @@ title: Create rule request body properties description: The properties vary depending on the rule type. -oneOf: - - $ref: 'create_anomaly_detection_alert_rule_request.yaml' - - $ref: 'create_anomaly_detection_jobs_health_rule_request.yaml' - - $ref: 'create_apm_anomaly_rule_request.yaml' - - $ref: 'create_apm_error_count_rule_request.yaml' - - $ref: 'create_apm_transaction_duration_rule_request.yaml' - - $ref: 'create_apm_transaction_error_rate_rule_request.yaml' - - $ref: 'create_es_query_rule_request.yaml' - - $ref: 'create_geo_containment_rule_request.yaml' - - $ref: 'create_index_threshold_rule_request.yaml' - - $ref: 'create_infra_inventory_rule_request.yaml' - - $ref: 'create_infra_metric_anomaly_rule_request.yaml' - - $ref: 'create_infra_metric_threshold_rule_request.yaml' - - $ref: 'create_monitoring_jvm_memory_usage_rule_request.yaml' - - $ref: 'create_log_threshold_rule_request.yaml' - - $ref: 'create_monitoring_ccr_exceptions_rule_request.yaml' - - $ref: 'create_monitoring_cluster_health_rule_request.yaml' - - $ref: 'create_monitoring_cpu_usage_rule_request.yaml' - - $ref: 'create_monitoring_disk_usage_rule_request.yaml' - - $ref: 'create_monitoring_elasticsearch_version_mismatch_rule_request.yaml' - - $ref: 'create_monitoring_license_expiration_rule_request.yaml' - - $ref: 'create_monitoring_kibana_version_mismatch_rule_request.yaml' - - $ref: 'create_monitoring_logstash_version_mismatch_rule_request.yaml' - - $ref: 'create_monitoring_missing_data_rule_request.yaml' - - $ref: 'create_monitoring_nodes_changed_rule_request.yaml' - - $ref: 'create_monitoring_shard_size_rule_request.yaml' - - $ref: 'create_monitoring_thread_pool_search_rejections_rule_request.yaml' - - $ref: 'create_monitoring_thread_pool_write_rejections_rule_request.yaml' - - $ref: 'create_siem_eql_rule_request.yaml' - - $ref: 'create_siem_indicator_rule_request.yaml' - - $ref: 'create_siem_ml_rule_request.yaml' - - $ref: 'create_siem_new_terms_rule_request.yaml' - - $ref: 'create_siem_notifications_rule_request.yaml' - - $ref: 'create_siem_query_rule_request.yaml' - - $ref: 'create_siem_saved_query_rule_request.yaml' - - $ref: 'create_siem_threshold_rule_request.yaml' - - $ref: 'create_slo_burn_rate_rule_request.yaml' - - $ref: 'create_synthetics_monitor_status_rule_request.yaml' - - $ref: 'create_synthetics_uptime_duration_anomaly_rule_request.yaml' - - $ref: 'create_synthetics_uptime_tls_rule_request.yaml' - - $ref: 'create_synthetics_uptime_tls_certificate_rule_request.yaml' - - $ref: 'create_transform_health_rule_request.yaml' - - $ref: 'create_uptime_monitor_status_rule_request.yaml' -discriminator: - propertyName: rule_type_id - mapping: - xpack.ml.anomaly_detection_alert: 'create_anomaly_detection_alert_rule_request.yaml' - xpack.ml.anomaly_detection_jobs_health: 'create_anomaly_detection_jobs_health_rule_request.yaml' - apm.anomaly: 'create_apm_anomaly_rule_request.yaml' - apm.error_rate: 'create_apm_error_count_rule_request.yaml' - apm.transaction_duration: 'create_apm_transaction_duration_rule_request.yaml' - apm.transaction_error_rate: 'create_apm_transaction_error_rate_rule_request.yaml' - .es-query: 'create_es_query_rule_request.yaml' - .geo-containment: 'create_geo_containment_rule_request.yaml' - .index-threshold: 'create_index_threshold_rule_request.yaml' - metrics.alert.inventory.threshold: 'create_infra_inventory_rule_request.yaml' - metrics.alert.anomaly: 'create_infra_metric_anomaly_rule_request.yaml' - metrics.alert.threshold: 'create_infra_metric_threshold_rule_request.yaml' - monitoring_alert_jvm_memory_usage: 'create_monitoring_jvm_memory_usage_rule_request.yaml' - logs.alert.document.count: 'create_log_threshold_rule_request.yaml' - monitoring_ccr_read_exceptions: 'create_monitoring_ccr_exceptions_rule_request.yaml' - monitoring_alert_cluster_health: 'create_monitoring_cluster_health_rule_request.yaml' - monitoring_alert_cpu_usage: 'create_monitoring_cpu_usage_rule_request.yaml' - monitoring_alert_disk_usage: 'create_monitoring_disk_usage_rule_request.yaml' - monitoring_alert_elasticsearch_version_mismatch: 'create_monitoring_elasticsearch_version_mismatch_rule_request.yaml' - monitoring_alert_license_expiration: 'create_monitoring_license_expiration_rule_request.yaml' - monitoring_alert_kibana_version_mismatch: 'create_monitoring_kibana_version_mismatch_rule_request.yaml' - monitoring_alert_logstash_version_mismatch: 'create_monitoring_logstash_version_mismatch_rule_request.yaml' - monitoring_alert_missing_monitoring_data: 'create_monitoring_missing_data_rule_request.yaml' - monitoring_alert_nodes_changed: 'create_monitoring_nodes_changed_rule_request.yaml' - monitoring_shard_size: 'create_monitoring_shard_size_rule_request.yaml' - monitoring_alert_thread_pool_search_rejections: 'create_monitoring_thread_pool_search_rejections_rule_request.yaml' - monitoring_alert_thread_pool_write_rejections: 'create_monitoring_thread_pool_write_rejections_rule_request.yaml' - siem.eqlRule: 'create_siem_eql_rule_request.yaml' - siem.indicatorRule: 'create_siem_indicator_rule_request.yaml' - siem.mlRule: 'create_siem_ml_rule_request.yaml' - siem.newTermsRule: 'create_siem_new_terms_rule_request.yaml' - siem.notifications: 'create_siem_notifications_rule_request.yaml' - siem.queryRule: 'create_siem_query_rule_request.yaml' - siem.savedQueryRule: 'create_siem_saved_query_rule_request.yaml' - siem.thresholdRule: 'create_siem_threshold_rule_request.yaml' - slo.rules.burnRate: 'create_slo_burn_rate_rule_request.yaml' - xpack.synthetics.alerts.monitorStatus: 'create_synthetics_monitor_status_rule_request.yaml' - xpack.uptime.alerts.durationAnomaly: 'create_synthetics_uptime_duration_anomaly_rule_request.yaml' - xpack.uptime.alerts.tls: 'create_synthetics_uptime_tls_rule_request.yaml' - xpack.uptime.alerts.tlsCertificate: 'create_synthetics_uptime_tls_certificate_rule_request.yaml' - transform_health: 'create_transform_health_rule_request.yaml' - xpack.uptime.alerts.monitorStatus: 'create_uptime_monitor_status_rule_request.yaml' +type: object +required: + - consumer + - name + - params + - rule_type_id + - schedule +properties: + actions: + $ref: 'actions.yaml' + alert_delay: + $ref: 'alert_delay.yaml' + consumer: + $ref: 'consumer.yaml' + enabled: + $ref: 'enabled_rule.yaml' + name: + $ref: 'name_rule.yaml' + notify_when: + $ref: 'notify_when.yaml' + params: + type: object + description: The parameters for the rule. + additionalProperties: true + rule_type_id: + type: string + description: The ID of the rule type that you want to call when the rule is scheduled to run. + schedule: + $ref: 'schedule.yaml' + tags: + $ref: 'tags.yaml' + throttle: + $ref: 'throttle.yaml' + \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_eql_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_eql_rule_request.yaml deleted file mode 100644 index 8eb332ed2ded5..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_eql_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create event correlation rule request -description: > - A rule that uses Event Query Language (EQL) to match events, generate sequences, and stack data. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an event correlation rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.eqlRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_indicator_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_indicator_rule_request.yaml deleted file mode 100644 index 744217e788bf6..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_indicator_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create indicator match rule request -description: > - A rule that uses indicators from intelligence sources to detect matching events and alerts. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for an indicator match rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.indicatorRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_ml_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_ml_rule_request.yaml deleted file mode 100644 index 90a4146066ddd..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_ml_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create machine learning rule request -description: > - A rule that detects when a machine learning job discovers an anomaly above the defined threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a machine learning rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.mlRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_new_terms_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_new_terms_rule_request.yaml deleted file mode 100644 index 19cc1ff3a2516..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_new_terms_rule_request.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: Create new terms rule request -description: A rule that finds documents with values that appear for the first time. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a new terms rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.newTermsRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_notifications_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_notifications_rule_request.yaml deleted file mode 100644 index 4190f31ce1160..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_notifications_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create security solution notification (legacy) rule request -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a notification rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.notifications - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_query_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_query_rule_request.yaml deleted file mode 100644 index 9cd8f3ec92744..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_query_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create custom query rule request -description: > - A rule that uses KQL or Lucene to detect issues across indices. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a custom query rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.queryRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_saved_query_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_saved_query_rule_request.yaml deleted file mode 100644 index 3048c922e492a..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_saved_query_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create saved query rule request -description: > - A rule that searches the defined indices and creates an alert when a document matches the saved search. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a saved query rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.savedQueryRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_threshold_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_threshold_rule_request.yaml deleted file mode 100644 index 67b5642a26681..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_siem_threshold_rule_request.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: Create threshold rule request -description: > - A rule that aggregates query results to detect when the number of matches exceeds a threshold. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a threshold rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - siem.thresholdRule - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_slo_burn_rate_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_slo_burn_rate_rule_request.yaml deleted file mode 100644 index 5d2992f54c61e..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_slo_burn_rate_rule_request.yaml +++ /dev/null @@ -1,40 +0,0 @@ -title: Create slo burn rate rule request -description: > - A rule that detects when the burn rate is above a defined threshold for two different lookback periods. - The two periods are a long period and a short period that is 1/12th of the long period. - For each lookback period, the burn rate is computed as the error rate divided by the error budget. - When the burn rates for both periods surpass the threshold, an alert occurs. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - slo.rules.burnRate - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_monitor_status_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_monitor_status_rule_request.yaml deleted file mode 100644 index 4c79b44a3d869..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_monitor_status_rule_request.yaml +++ /dev/null @@ -1,39 +0,0 @@ -title: Create synthetics monitor status rule request -description: A rule that detects when a monitor is down or an availability threshold is breached. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for the synthetics monitor status rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.synthetics.alerts.monitorStatus - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request.yaml deleted file mode 100644 index e9746f14f0ecf..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_duration_anomaly_rule_request.yaml +++ /dev/null @@ -1,41 +0,0 @@ -title: Create synthetics uptime duration anomaly rule request -description: > - A rule that detects response durations for all of the geographic locations of each monitor. - When a monitor runs for an unusual amount of time, at a particular time, an anomaly is recorded. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for the uptime duration anomaly rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.durationAnomaly - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_certificate_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_certificate_rule_request.yaml deleted file mode 100644 index 8c71961b4961d..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_certificate_rule_request.yaml +++ /dev/null @@ -1,40 +0,0 @@ -title: Create TLS certificate rule request -description: > - A rule that detects when a monitor has a TLS certificate expiring or when it exceeds an age limit. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a TLS certificate rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.tlsCertificate - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_rule_request.yaml deleted file mode 100644 index 603ff97158c16..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_synthetics_uptime_tls_rule_request.yaml +++ /dev/null @@ -1,33 +0,0 @@ -title: Create synthetics uptime TLS rule request -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.tls - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_transform_health_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_transform_health_rule_request.yaml deleted file mode 100644 index a655db451ec84..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_transform_health_rule_request.yaml +++ /dev/null @@ -1,40 +0,0 @@ -title: Create transform health rule request -description: > - A rule that monitors transforms health and alerts if an operational issue occurred. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - type: object - description: The parameters for a transform health rule. - # TO-DO: Add the parameter details for this rule. - additionalProperties: true - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - transform_health - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_uptime_monitor_status_rule_request.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/create_uptime_monitor_status_rule_request.yaml deleted file mode 100644 index f23da2eb87046..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/create_uptime_monitor_status_rule_request.yaml +++ /dev/null @@ -1,36 +0,0 @@ -title: Create uptime monitor status rule request -description: A rule that detects monitor errors and outages. -type: object -required: - - consumer - - name - - params - - rule_type_id - - schedule -properties: - actions: - $ref: 'actions.yaml' - alert_delay: - $ref: 'alert_delay.yaml' - consumer: - $ref: 'consumer.yaml' - enabled: - $ref: 'enabled_rule.yaml' - name: - $ref: 'name_rule.yaml' - notify_when: - $ref: 'notify_when.yaml' - params: - $ref: '../../../../../observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' - rule_type_id: - type: string - description: The ID of the rule type that you want to call when the rule is scheduled to run. - enum: - - xpack.uptime.alerts.monitorStatus - schedule: - $ref: 'schedule.yaml' - tags: - $ref: 'tags.yaml' - throttle: - $ref: 'throttle.yaml' - \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml new file mode 100644 index 0000000000000..1b7efab88e532 --- /dev/null +++ b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml @@ -0,0 +1,54 @@ +title: Elasticsearch DSL query rule params +description: > + An Elasticsearch query rule can run a query defined in Elasticsearch Query DSL and compare the number of matches to a configured threshold. These parameters are appropriate when `rule_type_id` is `.es-query`. +type: object +required: + - esQuery + - index + - threshold + - thresholdComparator + - timeField + - timeWindowSize + - timeWindowUnit +properties: + aggField: + $ref: 'aggfield.yaml' + aggType: + $ref: 'aggtype.yaml' + esQuery: + description: The query definition, which uses Elasticsearch Query DSL. + type: string + excludeHitsFromPreviousRun: + $ref: 'excludehitsfrompreviousrun.yaml' + groupBy: + $ref: 'groupby.yaml' + index: + description: The indices to query. + oneOf: + - type: array + items: + type: string + - type: string + searchType: + description: The type of query, in this case a query that uses Elasticsearch Query DSL. + type: string + enum: + - esQuery + default: esQuery + example: esQuery + size: + $ref: 'size.yaml' + termField: + $ref: 'termfield.yaml' + termSize: + $ref: 'termsize.yaml' + threshold: + $ref: 'threshold.yaml' + thresholdComparator: + $ref: 'thresholdcomparator.yaml' + timeField: + $ref: 'timefield.yaml' + timeWindowSize: + $ref: 'timewindowsize.yaml' + timeWindowUnit: + $ref: 'timewindowunit.yaml' diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml new file mode 100644 index 0000000000000..342231145066b --- /dev/null +++ b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml @@ -0,0 +1,70 @@ +title: Elasticsearch ES|QL query rule params +description: > + An Elasticsearch query rule can run an ES|QL query and compare the number of matches to a configured threshold. + These parameters are appropriate when `rule_type_id` is `.es-query`. + NOTE: This functionality is in technical pre view and may be changed or removed in a future release. + Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. +type: object +x-technical-preview: true +required: + - esqlQuery + - searchType + - size + - threshold + - thresholdComparator + - timeWindowSize + - timeWindowUnit +properties: + aggField: + $ref: 'aggfield.yaml' + aggType: + $ref: 'aggtype.yaml' + esqlQuery: + type: object + required: + - esql + properties: + esql: + description: The query definition, which uses Elasticsearch Query Language. + type: string + excludeHitsFromPreviousRun: + $ref: 'excludehitsfrompreviousrun.yaml' + groupBy: + $ref: 'groupby.yaml' + searchType: + description: The type of query, in this case a query that uses Elasticsearch Query Language (ES|QL). + type: string + enum: + - esqlQuery + example: esqlQuery + size: + type: integer + description: > + When `searchType` is `esqlQuery`, this property is required but it does not affect the rule behavior. + example: 0 + termSize: + $ref: 'termsize.yaml' + threshold: + type: array + items: + type: integer + minimum: 0 + maximum: 0 + description: > + The threshold value that is used with the `thresholdComparator`. + When `searchType` is `esqlQuery`, this property is required and must be set to zero. + thresholdComparator: + type: string + description: > + The comparison function for the threshold. + When `searchType` is `esqlQuery`, this property is required and must be set to ">". + Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results. + enum: + - ">" + example: ">" + timeField: + $ref: 'timefield.yaml' + timeWindowSize: + $ref: 'timewindowsize.yaml' + timeWindowUnit: + $ref: 'timewindowunit.yaml' diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml new file mode 100644 index 0000000000000..c31084cd8acbb --- /dev/null +++ b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml @@ -0,0 +1,65 @@ +title: Elasticsearch KQL query rule params +description: > + An Elasticsearch query rule can run a query defined in KQL or Lucene and compare the number of matches to a configured threshold. These parameters are appropriate when `rule_type_id` is `.es-query`. +type: object +required: + - searchType + - size + - threshold + - thresholdComparator + - timeWindowSize + - timeWindowUnit +properties: + aggField: + $ref: 'aggfield.yaml' + aggType: + $ref: 'aggtype.yaml' + excludeHitsFromPreviousRun: + $ref: 'excludehitsfrompreviousrun.yaml' + groupBy: + $ref: 'groupby.yaml' + searchConfiguration: + description: The query definition, which uses KQL or Lucene to fetch the documents from Elasticsearch. + type: object + properties: + filter: + type: array + items: + $ref: 'filter.yaml' + index: + description: The indices to query. + oneOf: + - type: string + - type: array + items: + type: string + query: + type: object + properties: + language: + type: string + example: kuery + query: + type: string + searchType: + description: The type of query, in this case a text-based query that uses KQL or Lucene. + type: string + enum: + - searchSource + example: searchSource + size: + $ref: 'size.yaml' + termField: + $ref: 'termfield.yaml' + termSize: + $ref: 'termsize.yaml' + threshold: + $ref: 'threshold.yaml' + thresholdComparator: + $ref: 'thresholdcomparator.yaml' + timeField: + $ref: 'timefield.yaml' + timeWindowSize: + $ref: 'timewindowsize.yaml' + timeWindowUnit: + $ref: 'timewindowunit.yaml' \ No newline at end of file diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_rule.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_rule.yaml deleted file mode 100644 index 99b6a6f393a32..0000000000000 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_rule.yaml +++ /dev/null @@ -1,184 +0,0 @@ -oneOf: - - type: object - x-technical-preview: true - description: > - The parameters for an Elasticsearch query rule that uses ES|QL to define the query. - This functionality is in technical pre view and may be changed or removed in a future release. - Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - required: - - esqlQuery - - searchType - - size - - threshold - - thresholdComparator - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: 'aggfield.yaml' - aggType: - $ref: 'aggtype.yaml' - esqlQuery: - type: object - required: - - esql - properties: - esql: - description: The query definition, which uses Elasticsearch Query Language. - type: string - excludeHitsFromPreviousRun: - $ref: 'excludehitsfrompreviousrun.yaml' - groupBy: - $ref: 'groupby.yaml' - searchType: - description: The type of query, in this case a query that uses Elasticsearch Query Language (ES|QL). - type: string - enum: - - esqlQuery - example: esqlQuery - size: - type: integer - description: > - When `searchType` is `esqlQuery`, this property is required but it does not affect the rule behavior. - example: 0 - termSize: - $ref: 'termsize.yaml' - threshold: - type: array - items: - type: integer - minimum: 0 - maximum: 0 - description: > - The threshold value that is used with the `thresholdComparator`. - When `searchType` is `esqlQuery`, this property is required and must be set to zero. - thresholdComparator: - type: string - description: > - The comparison function for the threshold. - When `searchType` is `esqlQuery`, this property is required and must be set to ">". - Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results. - enum: - - ">" - example: ">" - timeField: - $ref: 'timefield.yaml' - timeWindowSize: - $ref: 'timewindowsize.yaml' - timeWindowUnit: - $ref: 'timewindowunit.yaml' - - type: object - description: The parameters for an Elasticsearch query rule that uses KQL or Lucene to define the query. - required: - - searchType - - size - - threshold - - thresholdComparator - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: 'aggfield.yaml' - aggType: - $ref: 'aggtype.yaml' - excludeHitsFromPreviousRun: - $ref: 'excludehitsfrompreviousrun.yaml' - groupBy: - $ref: 'groupby.yaml' - searchConfiguration: - description: The query definition, which uses KQL or Lucene to fetch the documents from Elasticsearch. - type: object - properties: - filter: - type: array - items: - $ref: 'filter.yaml' - index: - description: The indices to query. - oneOf: - - type: string - - type: array - items: - type: string - query: - type: object - properties: - language: - type: string - example: kuery - query: - type: string - searchType: - description: The type of query, in this case a text-based query that uses KQL or Lucene. - type: string - enum: - - searchSource - example: searchSource - size: - $ref: 'size.yaml' - termField: - $ref: 'termfield.yaml' - termSize: - $ref: 'termsize.yaml' - threshold: - $ref: 'threshold.yaml' - thresholdComparator: - $ref: 'thresholdcomparator.yaml' - timeField: - $ref: 'timefield.yaml' - timeWindowSize: - $ref: 'timewindowsize.yaml' - timeWindowUnit: - $ref: 'timewindowunit.yaml' - - type: object - description: The parameters for an Elasticsearch query rule that uses Elasticsearch Query DSL to define the query. - required: - - esQuery - - index - - threshold - - thresholdComparator - - timeField - - timeWindowSize - - timeWindowUnit - properties: - aggField: - $ref: 'aggfield.yaml' - aggType: - $ref: 'aggtype.yaml' - esQuery: - description: The query definition, which uses Elasticsearch Query DSL. - type: string - excludeHitsFromPreviousRun: - $ref: 'excludehitsfrompreviousrun.yaml' - groupBy: - $ref: 'groupby.yaml' - index: - description: The indices to query. - oneOf: - - type: array - items: - type: string - - type: string - searchType: - description: The type of query, in this case a query that uses Elasticsearch Query DSL. - type: string - enum: - - esQuery - default: esQuery - example: esQuery - size: - $ref: 'size.yaml' - termField: - $ref: 'termfield.yaml' - termSize: - $ref: 'termsize.yaml' - threshold: - $ref: 'threshold.yaml' - thresholdComparator: - $ref: 'thresholdcomparator.yaml' - timeField: - $ref: 'timefield.yaml' - timeWindowSize: - $ref: 'timewindowsize.yaml' - timeWindowUnit: - $ref: 'timewindowunit.yaml' diff --git a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml index c1755bf7d3310..a0334320e23d1 100644 --- a/x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml +++ b/x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml @@ -1,5 +1,7 @@ +title: Index threshold rule params +description: >- + An index threshold rule runs an Elasticsearch query, aggregates field values from documents, compares them to threshold values, and schedules actions to run when the thresholds are met. These parameters are appropriate when `rule_type_id` is `.index-threshold`. type: object -description: The parameters for an index threshold rule. required: - index - threshold diff --git a/x-pack/plugins/alerting/docs/openapi/entrypoint.yaml b/x-pack/plugins/alerting/docs/openapi/entrypoint.yaml index da0a3091f3dce..48f7efd53b839 100644 --- a/x-pack/plugins/alerting/docs/openapi/entrypoint.yaml +++ b/x-pack/plugins/alerting/docs/openapi/entrypoint.yaml @@ -8,36 +8,13 @@ info: license: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license -tags: - - name: alerting - description: Alerting APIs enable you to create and manage rules and alerts. servers: - url: / paths: - '/api/alerting/rule': - $ref: 'paths/api@alerting@rule.yaml' - '/api/alerting/rule/{ruleId}': - $ref: 'paths/api@alerting@rule@{ruleid}.yaml' - '/api/alerting/rule/{ruleId}/_disable': - $ref: 'paths/api@alerting@rule@{ruleid}@_disable.yaml' - '/api/alerting/rule/{ruleId}/_enable': - $ref: 'paths/api@alerting@rule@{ruleid}@_enable.yaml' - '/api/alerting/rules/_find': - $ref: 'paths/api@alerting@rules@_find.yaml' '/api/alerting/_health': $ref: paths/api@alerting@_health.yaml '/api/alerting/rule_types': $ref: 'paths/api@alerting@rule_types.yaml' - '/api/alerting/rule/{ruleId}/_mute_all': - $ref: 'paths/api@alerting@rule@{ruleid}@_mute_all.yaml' - '/api/alerting/rule/{ruleId}/_unmute_all': - $ref: 'paths/api@alerting@rule@{ruleid}@_unmute_all.yaml' - '/api/alerting/rule/{ruleId}/_update_api_key': - $ref: 'paths/api@alerting@rule@{ruleid}@_update_api_key.yaml' - '/api/alerting/rule/{ruleId}/alert/{alertId}/_mute': - $ref: 'paths/api@alerting@rule@{ruleid}@alert@{alertid}@_mute.yaml' - '/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute': - $ref: 'paths/api@alerting@rule@{ruleid}@alert@{alertid}@_unmute.yaml' # Deprecated APIs '/api/alerts/alert/{alertId}': $ref: 'paths/api@alerts@alert@{alertid}.yaml' diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx index cd69f972c675a..e74f3117d55f9 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx @@ -9,6 +9,7 @@ import moment from 'moment'; import { FIELD_TYPES, Form, + FormSubmitHandler, getUseField, useForm, useFormData, @@ -136,7 +137,7 @@ export const CreateMaintenanceWindowForm = React.memo>( async (formData, isValid) => { if (!isValid || scopedQueryErrors.length !== 0) { return; diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx index dd396057e3724..7e474859981ef 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx @@ -29,7 +29,7 @@ import { MaintenanceWindow, } from '../../../../common'; import { StatusFilter } from './status_filter'; -import { TableActionsPopover } from './table_actions_popover'; +import { TableActionsPopover, TableActionsPopoverProps } from './table_actions_popover'; import { useFinishMaintenanceWindow } from '../../../hooks/use_finish_maintenance_window'; import { useArchiveMaintenanceWindow } from '../../../hooks/use_archive_maintenance_window'; import { useFinishAndArchiveMaintenanceWindow } from '../../../hooks/use_finish_and_archive_maintenance_window'; @@ -115,13 +115,13 @@ export const MaintenanceWindowsList = React.memo( }; const { euiTheme } = useEuiTheme(); const { navigateToEditMaintenanceWindows } = useEditMaintenanceWindowsNavigation(); - const onEdit = useCallback( + const onEdit = useCallback( (id) => navigateToEditMaintenanceWindows(id), [navigateToEditMaintenanceWindows] ); const { mutate: finishMaintenanceWindow, isLoading: isLoadingFinish } = useFinishMaintenanceWindow(); - const onCancel = useCallback( + const onCancel = useCallback( (id) => finishMaintenanceWindow(id, { onSuccess: () => refreshData() }), [finishMaintenanceWindow, refreshData] ); diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx index ffe0509c1fd32..c91f518f6976f 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx @@ -18,7 +18,7 @@ import { import * as i18n from '../translations'; import { MaintenanceWindowStatus } from '../../../../common'; -interface TableActionsPopoverProps { +export interface TableActionsPopoverProps { id: string; status: MaintenanceWindowStatus; onEdit: (id: string) => void; 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 fcf151b1d0afd..4391fdce06c28 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 @@ -287,6 +287,9 @@ const defaultExecutionOpts = { startedAt: null, }; +const ruleInfo = `for test.rule-type:1 'rule-name'`; +const logTags = { tags: ['test.rule-type', '1', 'alerts-client'] }; + describe('Alerts Client', () => { let alertsClientParams: AlertsClientParams; let processAndLogAlertsOpts: ProcessAndLogAlertsOpts; @@ -484,7 +487,8 @@ describe('Alerts Client', () => { }); expect(logger.error).toHaveBeenCalledWith( - `Error searching for tracked alerts by UUID - search failed!` + `Error searching for tracked alerts by UUID ${ruleInfo} - search failed!`, + logTags ); spy.mockRestore(); @@ -778,7 +782,8 @@ describe('Alerts Client', () => { expect(spy).toHaveBeenNthCalledWith(2, 'recoveredCurrent'); expect(logger.error).toHaveBeenCalledWith( - "Error writing alert(2) to .alerts-test.alerts-default - alert(2) doesn't exist in active alerts" + `Error writing alert(2) to .alerts-test.alerts-default - alert(2) doesn't exist in active alerts ${ruleInfo}.`, + logTags ); spy.mockRestore(); @@ -1346,7 +1351,8 @@ describe('Alerts Client', () => { expect(clusterClient.bulk).toHaveBeenCalled(); expect(logger.error).toHaveBeenCalledWith( - `Error writing alerts: 1 successful, 0 conflicts, 2 errors: Validation Failed: 1: index is missing;2: type is missing;; failed to parse field [process.command_line] of type [wildcard] in document with id 'f0c9805be95fedbc3c99c663f7f02cc15826c122'.` + `Error writing alerts ${ruleInfo}: 1 successful, 0 conflicts, 2 errors: Validation Failed: 1: index is missing;2: type is missing;; failed to parse field [process.command_line] of type [wildcard] in document with id 'f0c9805be95fedbc3c99c663f7f02cc15826c122'.`, + { tags: ['test.rule-type', '1', 'resolve-alert-conflicts'] } ); }); @@ -1423,7 +1429,8 @@ describe('Alerts Client', () => { }); expect(logger.warn).toHaveBeenCalledWith( - `Could not update alert abc in partial-.internal.alerts-test.alerts-default-000001. Partial and restored alert indices are not supported.` + `Could not update alert abc in partial-.internal.alerts-test.alerts-default-000001. Partial and restored alert indices are not supported ${ruleInfo}.`, + logTags ); }); @@ -1448,7 +1455,8 @@ describe('Alerts Client', () => { expect(clusterClient.bulk).toHaveBeenCalled(); expect(logger.error).toHaveBeenCalledWith( - `Error writing 2 alerts to .alerts-test.alerts-default - fail` + `Error writing 2 alerts to .alerts-test.alerts-default ${ruleInfo} - fail`, + logTags ); }); @@ -1478,7 +1486,8 @@ describe('Alerts Client', () => { }); expect(logger.debug).toHaveBeenCalledWith( - `Resources registered and installed for test context but "shouldWrite" is set to false.` + `Resources registered and installed for test context but "shouldWrite" is set to false ${ruleInfo}.`, + logTags ); expect(clusterClient.bulk).not.toHaveBeenCalled(); }); @@ -2026,7 +2035,8 @@ describe('Alerts Client', () => { ).rejects.toBe('something went wrong!'); expect(logger.warn).toHaveBeenCalledWith( - 'Error updating alert maintenance window IDs: something went wrong!' + `Error updating alert maintenance window IDs for test.rule-type:1 'rule-name': something went wrong!`, + logTags ); }); }); 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 162cdb3cd21fb..9926ea9ec9039 100644 --- a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts @@ -112,6 +112,8 @@ export class AlertsClient< private reportedAlerts: Record> = {}; private _isUsingDataStreams: boolean; + private ruleInfoMessage: string; + private logTags: { tags: string[] }; constructor(private readonly options: AlertsClientParams) { this.legacyAlertsClient = new LegacyAlertsClient< @@ -130,6 +132,8 @@ export class AlertsClient< this.rule = formatRule({ rule: this.options.rule, ruleType: this.options.ruleType }); this.ruleType = options.ruleType; this._isUsingDataStreams = this.options.dataStreamAdapter.isUsingDataStreams(); + this.ruleInfoMessage = `for ${this.ruleType.id}:${this.options.rule.id} '${this.options.rule.name}'`; + this.logTags = { tags: [this.ruleType.id, this.options.rule.id, 'alerts-client'] }; } public async initializeExecution(opts: InitializeExecutionOpts) { @@ -202,7 +206,10 @@ export class AlertsClient< this.fetchedAlerts.primaryTerm[alertUuid] = hit._primary_term; } } catch (err) { - this.options.logger.error(`Error searching for tracked alerts by UUID - ${err.message}`); + this.options.logger.error( + `Error searching for tracked alerts by UUID ${this.ruleInfoMessage} - ${err.message}`, + this.logTags + ); } } @@ -327,7 +334,8 @@ export class AlertsClient< ); } catch (e) { this.options.logger.debug( - `Failed to update alert matched by maintenance window scoped query for rule ${this.ruleType.id}:${this.options.rule.id}: '${this.options.rule.name}'.` + `Failed to update alert matched by maintenance window scoped query ${this.ruleInfoMessage}`, + this.logTags ); } @@ -407,7 +415,8 @@ export class AlertsClient< private async persistAlertsHelper() { if (!this.ruleType.alerts?.shouldWrite) { this.options.logger.debug( - `Resources registered and installed for ${this.ruleType.alerts?.context} context but "shouldWrite" is set to false.` + `Resources registered and installed for ${this.ruleType.alerts?.context} context but "shouldWrite" is set to false ${this.ruleInfoMessage}.`, + this.logTags ); return; } @@ -482,7 +491,8 @@ export class AlertsClient< } } else { this.options.logger.error( - `Error writing alert(${id}) to ${this.indexTemplateAndPattern.alias} - alert(${id}) doesn't exist in active alerts` + `Error writing alert(${id}) to ${this.indexTemplateAndPattern.alias} - alert(${id}) doesn't exist in active alerts ${this.ruleInfoMessage}.`, + this.logTags ); } } @@ -529,7 +539,8 @@ export class AlertsClient< return true; } else if (!isValidAlertIndexName(alertIndex)) { this.options.logger.warn( - `Could not update alert ${alertUuid} in ${alertIndex}. Partial and restored alert indices are not supported.` + `Could not update alert ${alertUuid} in ${alertIndex}. Partial and restored alert indices are not supported ${this.ruleInfoMessage}.`, + this.logTags ); return false; } @@ -573,11 +584,15 @@ export class AlertsClient< operations: bulkBody, }, bulkResponse: response, + ruleId: this.options.rule.id, + ruleName: this.options.rule.name, + ruleType: this.ruleType.id, }); } } catch (err) { this.options.logger.error( - `Error writing ${alertsToIndex.length} alerts to ${this.indexTemplateAndPattern.alias} - ${err.message}` + `Error writing ${alertsToIndex.length} alerts to ${this.indexTemplateAndPattern.alias} ${this.ruleInfoMessage} - ${err.message}`, + this.logTags ); } } @@ -669,7 +684,10 @@ export class AlertsClient< }); return response; } catch (err) { - this.options.logger.warn(`Error updating alert maintenance window IDs: ${err}`); + this.options.logger.warn( + `Error updating alert maintenance window IDs ${this.ruleInfoMessage}: ${err}`, + this.logTags + ); throw err; } } @@ -739,7 +757,8 @@ export class AlertsClient< // Update alerts with new maintenance window IDs, await not needed this.updateAlertMaintenanceWindowIds(uniqueAlertsId).catch(() => { this.options.logger.debug( - 'Failed to update new alerts with scoped query maintenance window Ids by updateByQuery.' + `Failed to update new alerts with scoped query maintenance window Ids by updateByQuery ${this.ruleInfoMessage}.`, + this.logTags ); }); } diff --git a/x-pack/plugins/alerting/server/alerts_client/legacy_alerts_client.ts b/x-pack/plugins/alerting/server/alerts_client/legacy_alerts_client.ts index 3a1838342c5d6..c63987bea9428 100644 --- a/x-pack/plugins/alerting/server/alerts_client/legacy_alerts_client.ts +++ b/x-pack/plugins/alerting/server/alerts_client/legacy_alerts_client.ts @@ -236,8 +236,8 @@ export class LegacyAlertsClient< return {}; } - public getAlertsToSerialize(shouldSetFlapping: boolean = true) { - if (shouldSetFlapping) { + public getAlertsToSerialize(shouldSetFlappingAndOptimize: boolean = true) { + if (shouldSetFlappingAndOptimize) { setFlapping( this.flappingSettings, this.processedAlerts.active, @@ -246,7 +246,8 @@ export class LegacyAlertsClient< } return determineAlertsToReturn( this.processedAlerts.active, - this.processedAlerts.recovered + this.processedAlerts.recovered, + shouldSetFlappingAndOptimize ); } 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 index 281b358854be9..cc6b43b40da7b 100644 --- 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 @@ -25,6 +25,12 @@ import { resolveAlertConflicts } from './alert_conflict_resolver'; const logger = loggingSystemMock.create().get(); const esClient = elasticsearchServiceMock.createElasticsearchClient(); +const ruleId = 'rule-id'; +const ruleName = 'name of rule'; +const ruleType = 'rule-type'; + +const ruleInfo = `for ${ruleType}:${ruleId} '${ruleName}'`; +const logTags = { tags: [ruleType, ruleId, 'resolve-alert-conflicts'] }; const alertDoc = { [EVENT_ACTION]: 'active', @@ -45,11 +51,20 @@ describe('alert_conflict_resolver', () => { esClient.mget.mockRejectedValueOnce(new Error('mget failed')); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).toHaveBeenNthCalledWith( 2, - 'Error resolving alert conflicts: mget failed' + `Error resolving alert conflicts ${ruleInfo}: mget failed`, + logTags ); }); @@ -61,11 +76,20 @@ describe('alert_conflict_resolver', () => { }); esClient.bulk.mockRejectedValueOnce(new Error('bulk failed')); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).toHaveBeenNthCalledWith( 2, - 'Error resolving alert conflicts: bulk failed' + `Error resolving alert conflicts ${ruleInfo}: bulk failed`, + logTags ); }); }); @@ -73,13 +97,29 @@ describe('alert_conflict_resolver', () => { describe('is successful with', () => { test('no bulk results', async () => { const { bulkRequest, bulkResponse } = getReqRes(''); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); 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 }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).not.toHaveBeenCalled(); }); @@ -96,16 +136,30 @@ describe('alert_conflict_resolver', () => { items: [getBulkResItem(0)], }); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).toHaveBeenNthCalledWith( 1, - `Error writing alerts: 0 successful, 1 conflicts, 0 errors: ` + `Error writing alerts ${ruleInfo}: 0 successful, 1 conflicts, 0 errors: `, + logTags + ); + expect(logger.info).toHaveBeenNthCalledWith( + 1, + `Retrying bulk update of 1 conflicted alerts ${ruleInfo}`, + logTags ); - 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` + `Retried bulk update of 1 conflicted alerts succeeded ${ruleInfo}`, + logTags ); }); @@ -122,16 +176,30 @@ describe('alert_conflict_resolver', () => { items: [getBulkResItem(2)], }); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).toHaveBeenNthCalledWith( 1, - `Error writing alerts: 2 successful, 1 conflicts, 1 errors: hallo` + `Error writing alerts ${ruleInfo}: 2 successful, 1 conflicts, 1 errors: hallo`, + logTags + ); + expect(logger.info).toHaveBeenNthCalledWith( + 1, + `Retrying bulk update of 1 conflicted alerts ${ruleInfo}`, + logTags ); - 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` + `Retried bulk update of 1 conflicted alerts succeeded ${ruleInfo}`, + logTags ); }); @@ -148,16 +216,30 @@ describe('alert_conflict_resolver', () => { items: [getBulkResItem(2), getBulkResItem(3), getBulkResItem(5)], }); - await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + await resolveAlertConflicts({ + logger, + esClient, + bulkRequest, + bulkResponse, + ruleId, + ruleName, + ruleType, + }); expect(logger.error).toHaveBeenNthCalledWith( 1, - `Error writing alerts: 2 successful, 3 conflicts, 1 errors: hallo` + `Error writing alerts ${ruleInfo}: 2 successful, 3 conflicts, 1 errors: hallo`, + logTags + ); + expect(logger.info).toHaveBeenNthCalledWith( + 1, + `Retrying bulk update of 3 conflicted alerts ${ruleInfo}`, + logTags ); - 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` + `Retried bulk update of 3 conflicted alerts succeeded ${ruleInfo}`, + logTags ); }); }); 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 index 383d8dbb103fb..55a3a885f1c71 100644 --- 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 @@ -35,6 +35,9 @@ export interface ResolveAlertConflictsParams { logger: Logger; bulkRequest: BulkRequest; bulkResponse: BulkResponse; + ruleId: string; + ruleName: string; + ruleType: string; } interface NormalizedBulkRequest { @@ -46,26 +49,33 @@ interface NormalizedBulkRequest { // 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; + const { logger, ruleId, ruleType, ruleName } = params; + const ruleInfoMessage = `for ${ruleType}:${ruleId} '${ruleName}'`; + const logTags = { tags: [ruleType, ruleId, 'resolve-alert-conflicts'] }; + try { await resolveAlertConflicts_(params); } catch (err) { - logger.error(`Error resolving alert conflicts: ${err.message}`); + logger.error(`Error resolving alert conflicts ${ruleInfoMessage}: ${err.message}`, logTags); } } async function resolveAlertConflicts_(params: ResolveAlertConflictsParams): Promise { - const { logger, esClient, bulkRequest, bulkResponse } = params; + const { logger, esClient, bulkRequest, bulkResponse, ruleId, ruleType, ruleName } = params; if (bulkRequest.operations && bulkRequest.operations?.length === 0) return; if (bulkResponse.items && bulkResponse.items?.length === 0) return; + const ruleInfoMessage = `for ${ruleType}:${ruleId} '${ruleName}'`; + const logTags = { tags: [ruleType, ruleId, 'resolve-alert-conflicts'] }; + // 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}` + `Error writing alerts ${ruleInfoMessage}: ${success} successful, ${conflicts} conflicts, ${errors} errors: ${allMessages}`, + logTags ); // get a new bulk request for just conflicted docs @@ -79,14 +89,18 @@ async function resolveAlertConflicts_(params: ResolveAlertConflictsParams): Prom await updateOCC(conflictRequest, freshDocs); await refreshFieldsInDocs(conflictRequest, freshDocs); - logger.info(`Retrying bulk update of ${conflictRequest.length} conflicted alerts`); + logger.info( + `Retrying bulk update of ${conflictRequest.length} conflicted alerts ${ruleInfoMessage}`, + logTags + ); 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}` + `Unexpected number of bulk response items retried; expecting ${expected}, retried ${actual} ${ruleInfoMessage}`, + logTags ); return; } @@ -94,16 +108,21 @@ async function resolveAlertConflicts_(params: ResolveAlertConflictsParams): Prom if (mbrResponse.error) { const index = bulkRequest.index || 'unknown index'; logger.error( - `Error writing ${conflictRequest.length} alerts to ${index} - ${mbrResponse.error.message}` + `Error writing ${conflictRequest.length} alerts to ${index} ${ruleInfoMessage} - ${mbrResponse.error.message}`, + logTags ); return; } if (mbrResponse.errors === 0) { - logger.info(`Retried bulk update of ${conflictRequest.length} conflicted alerts succeeded`); + logger.info( + `Retried bulk update of ${conflictRequest.length} conflicted alerts succeeded ${ruleInfoMessage}`, + logTags + ); } else { logger.error( - `Retried bulk update of ${conflictRequest.length} conflicted alerts still had ${mbrResponse.errors} conflicts` + `Retried bulk update of ${conflictRequest.length} conflicted alerts still had ${mbrResponse.errors} conflicts ${ruleInfoMessage}`, + logTags ); } } diff --git a/x-pack/plugins/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts b/x-pack/plugins/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts index e9e706331f360..4f0aa0fb003df 100644 --- a/x-pack/plugins/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts +++ b/x-pack/plugins/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts @@ -324,7 +324,6 @@ export const getQueryByScopedQueries = ({ aggs: { alertId: { top_hits: { - size: 1, _source: { includes: [ALERT_UUID], }, diff --git a/x-pack/plugins/alerting/server/alerts_service/alerts_service.test.ts b/x-pack/plugins/alerting/server/alerts_service/alerts_service.test.ts index 08d183771b53c..ccc1bb9ea8427 100644 --- a/x-pack/plugins/alerting/server/alerts_service/alerts_service.test.ts +++ b/x-pack/plugins/alerting/server/alerts_service/alerts_service.test.ts @@ -12,7 +12,7 @@ import { IndicesDataStreamIndex, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { ReplaySubject, Subject } from 'rxjs'; +import { ReplaySubject, Subject, of } from 'rxjs'; import { AlertsService } from './alerts_service'; import { IRuleTypeAlerts, RecoveredActionGroup } from '../types'; import { retryUntil } from './test_utils'; @@ -219,6 +219,7 @@ const ruleTypeWithAlertDefinition: jest.Mocked = { describe('Alerts Service', () => { let pluginStop$: Subject; + const elasticsearchAndSOAvailability$ = of(true); beforeEach(() => { jest.resetAllMocks(); @@ -251,6 +252,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -275,6 +277,46 @@ describe('Alerts Service', () => { expect(componentTemplate3.name).toEqual('.alerts-ecs-mappings'); }); + test('should not initialize common resources if ES is not ready', async () => { + const test$ = new Subject(); + const alertsService = new AlertsService({ + logger, + elasticsearchClientPromise: Promise.resolve(clusterClient), + pluginStop$, + kibanaVersion: '8.8.0', + dataStreamAdapter, + elasticsearchAndSOAvailability$: test$, + }); + + await retryUntil( + 'alert service initialized', + async () => alertsService.isInitialized() === true + ); + expect(alertsService.isInitialized()).toEqual(false); + + // ES is ready, should initialize the resources + test$.next(true); + await retryUntil( + 'alert service initialized', + async () => alertsService.isInitialized() === true + ); + expect(alertsService.isInitialized()).toEqual(true); + expect(clusterClient.ilm.putLifecycle).toHaveBeenCalledTimes( + useDataStreamForAlerts ? 0 : 1 + ); + if (!useDataStreamForAlerts) { + expect(clusterClient.ilm.putLifecycle).toHaveBeenCalledWith(IlmPutBody); + } + expect(clusterClient.cluster.putComponentTemplate).toHaveBeenCalledTimes(3); + + const componentTemplate1 = clusterClient.cluster.putComponentTemplate.mock.calls[0][0]; + expect(componentTemplate1.name).toEqual('.alerts-framework-mappings'); + const componentTemplate2 = clusterClient.cluster.putComponentTemplate.mock.calls[1][0]; + expect(componentTemplate2.name).toEqual('.alerts-legacy-alert-mappings'); + const componentTemplate3 = clusterClient.cluster.putComponentTemplate.mock.calls[2][0]; + expect(componentTemplate3.name).toEqual('.alerts-ecs-mappings'); + }); + test('should log error and set initialized to false if adding ILM policy throws error', async () => { if (useDataStreamForAlerts) return; @@ -285,6 +327,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil('error log called', async () => logger.error.mock.calls.length > 0); @@ -306,6 +349,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil('error log called', async () => logger.error.mock.calls.length > 0); @@ -386,6 +430,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -427,6 +472,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -1447,6 +1493,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -1508,6 +1555,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -1546,6 +1594,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -1644,6 +1693,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -1765,6 +1815,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -1846,6 +1897,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -1944,6 +1996,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -2006,6 +2059,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -2072,6 +2126,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -2145,6 +2200,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); alertsService.register(TestRegistrationContext); @@ -2198,6 +2254,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2218,6 +2275,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2238,6 +2296,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2266,6 +2325,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2297,6 +2357,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2333,6 +2394,7 @@ describe('Alerts Service', () => { pluginStop$, kibanaVersion: '8.8.0', dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil( @@ -2367,6 +2429,7 @@ describe('Alerts Service', () => { kibanaVersion: '8.8.0', timeoutMs: 10, dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil('error logger called', async () => logger.error.mock.calls.length > 0); @@ -2383,6 +2446,7 @@ describe('Alerts Service', () => { kibanaVersion: '8.8.0', timeoutMs: 10, dataStreamAdapter, + elasticsearchAndSOAvailability$, }); await retryUntil('debug logger called', async () => logger.debug.mock.calls.length > 0); diff --git a/x-pack/plugins/alerting/server/alerts_service/alerts_service.ts b/x-pack/plugins/alerting/server/alerts_service/alerts_service.ts index 10161b4e09635..f37481c9ccb86 100644 --- a/x-pack/plugins/alerting/server/alerts_service/alerts_service.ts +++ b/x-pack/plugins/alerting/server/alerts_service/alerts_service.ts @@ -7,7 +7,7 @@ import { isEmpty, isEqual, omit } from 'lodash'; import { Logger, ElasticsearchClient } from '@kbn/core/server'; -import { Observable } from 'rxjs'; +import { filter, firstValueFrom, Observable } from 'rxjs'; import { alertFieldMap, ecsFieldMap, legacyAlertFieldMap } from '@kbn/alerts-as-data-utils'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { @@ -58,6 +58,7 @@ interface AlertsServiceParams { elasticsearchClientPromise: Promise; timeoutMs?: number; dataStreamAdapter: DataStreamAdapter; + elasticsearchAndSOAvailability$: Observable; } export interface CreateAlertsClientParams extends LegacyAlertsClientParams { @@ -131,7 +132,10 @@ export class AlertsService implements IAlertsService { this.dataStreamAdapter = options.dataStreamAdapter; // Kick off initialization of common assets and save the promise - this.commonInitPromise = this.initializeCommon(this.options.timeoutMs); + this.commonInitPromise = this.initializeCommon( + this.options.elasticsearchAndSOAvailability$, + this.options.timeoutMs + ); // Create helper for initializing context-specific resources this.resourceInitializationHelper = createResourceInstallationHelper( @@ -181,7 +185,10 @@ export class AlertsService implements IAlertsService { if (!this.initialized) { if (!this.isInitializing) { this.options.logger.info(`Retrying common resource initialization`); - initPromise = this.initializeCommon(this.options.timeoutMs); + initPromise = this.initializeCommon( + this.options.elasticsearchAndSOAvailability$, + this.options.timeoutMs + ); } else { this.options.logger.info( `Skipped retrying common resource initialization because it is already being retried.` @@ -295,8 +302,16 @@ export class AlertsService implements IAlertsService { * - ILM policy - common policy shared by all AAD indices * - Component template - common mappings for fields populated and used by the framework */ - private async initializeCommon(timeoutMs?: number): Promise { + private async initializeCommon( + elasticsearchAndSOAvailability$: Observable, + timeoutMs?: number + ): Promise { this.isInitializing = true; + // Wait to install resources until ES is ready + await firstValueFrom( + elasticsearchAndSOAvailability$.pipe(filter((areESAndSOAvailable) => areESAndSOAvailable)) + ); + try { this.options.logger.debug(`Initializing resources for AlertsService`); const esClient = await this.options.elasticsearchClientPromise; diff --git a/x-pack/plugins/alerting/server/application/rule/constants.ts b/x-pack/plugins/alerting/server/application/rule/constants.ts index bc75d91375ecb..ea7504a4d3a8a 100644 --- a/x-pack/plugins/alerting/server/application/rule/constants.ts +++ b/x-pack/plugins/alerting/server/application/rule/constants.ts @@ -41,4 +41,5 @@ export const ruleExecutionStatusWarningReason = { MAX_EXECUTABLE_ACTIONS: 'maxExecutableActions', MAX_ALERTS: 'maxAlerts', MAX_QUEUED_ACTIONS: 'maxQueuedActions', + EXECUTION: 'ruleExecution', } as const; diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts index f43ffc6096dcf..c7c795359aaee 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts @@ -3214,7 +3214,8 @@ describe('bulkEdit()', () => { value: ['test-1'], }, ], - paramsModifier: async (params) => { + paramsModifier: async (rule) => { + const params = rule.params; params.index = ['test-index-*']; return { modifiedParams: params, isParamsUpdateSkipped: false, skipReasons: [] }; @@ -3431,7 +3432,8 @@ describe('bulkEdit()', () => { value: ['test-1'], }, ], - paramsModifier: async (params) => { + paramsModifier: async (rule) => { + const params = rule.params; params.index = ['test-index-*']; return { modifiedParams: params, isParamsUpdateSkipped: false, skipReasons: [] }; diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts index 8bd10fe722c1d..81dd189116949 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts @@ -16,7 +16,7 @@ import { SavedObjectsUpdateResponse, } from '@kbn/core/server'; import { validateAndAuthorizeSystemActions } from '../../../../lib/validate_authorize_system_actions'; -import { RuleAction, RuleSystemAction } from '../../../../../common'; +import { Rule, RuleAction, RuleSystemAction } from '../../../../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { BulkActionSkipResult } from '../../../../../common/bulk_edit'; import { RuleTypeRegistry } from '../../../../types'; @@ -505,7 +505,8 @@ async function updateRuleAttributesAndParamsInMemory( validateScheduleInterval(context, updatedRule.schedule.interval, ruleType.id, rule.id); const { modifiedParams: ruleParams, isParamsUpdateSkipped } = paramsModifier - ? await paramsModifier(updatedRule.params) + ? // TODO (http-versioning): Remove the cast when all rule types are fixed + await paramsModifier(updatedRule as Rule) : { modifiedParams: updatedRule.params, isParamsUpdateSkipped: true, diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts index c099cde044363..7c30f6583865e 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts @@ -12,14 +12,15 @@ import { bulkEditOperationsSchema, bulkEditOperationSchema, } from '../schemas'; -import { RuleParams, RuleDomain, Rule } from '../../../types'; +import { RuleParams, RuleDomain } from '../../../types'; +import { Rule } from '../../../../../../common'; export type BulkEditRuleSnoozeSchedule = TypeOf; export type BulkEditOperation = TypeOf; export type BulkEditOperations = TypeOf; export type ParamsModifier = ( - params: Params + rule: Rule ) => Promise>; interface ParamsModifierResult { diff --git a/x-pack/plugins/alerting/server/application/rule/schemas/rule_schemas.ts b/x-pack/plugins/alerting/server/application/rule/schemas/rule_schemas.ts index cd3b465244976..416fdc4d11c0d 100644 --- a/x-pack/plugins/alerting/server/application/rule/schemas/rule_schemas.ts +++ b/x-pack/plugins/alerting/server/application/rule/schemas/rule_schemas.ts @@ -56,6 +56,7 @@ export const ruleExecutionStatusSchema = schema.object({ schema.literal(ruleExecutionStatusWarningReason.MAX_EXECUTABLE_ACTIONS), schema.literal(ruleExecutionStatusWarningReason.MAX_ALERTS), schema.literal(ruleExecutionStatusWarningReason.MAX_QUEUED_ACTIONS), + schema.literal(ruleExecutionStatusWarningReason.EXECUTION), ]), message: schema.string(), }) @@ -83,6 +84,7 @@ export const ruleLastRunSchema = schema.object({ schema.literal(ruleExecutionStatusWarningReason.MAX_EXECUTABLE_ACTIONS), schema.literal(ruleExecutionStatusWarningReason.MAX_ALERTS), schema.literal(ruleExecutionStatusWarningReason.MAX_QUEUED_ACTIONS), + schema.literal(ruleExecutionStatusWarningReason.EXECUTION), ]) ) ), diff --git a/x-pack/plugins/alerting/server/data/rule/constants.ts b/x-pack/plugins/alerting/server/data/rule/constants.ts index 267864bdfd9e8..d3580ffbb242b 100644 --- a/x-pack/plugins/alerting/server/data/rule/constants.ts +++ b/x-pack/plugins/alerting/server/data/rule/constants.ts @@ -41,4 +41,5 @@ export const ruleExecutionStatusWarningReasonAttributes = { MAX_EXECUTABLE_ACTIONS: 'maxExecutableActions', MAX_ALERTS: 'maxAlerts', MAX_QUEUED_ACTIONS: 'maxQueuedActions', + EXECUTION: 'ruleExecution', } as const; diff --git a/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.test.ts b/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.test.ts index 4fd80033fd341..28ce69b6ca8cf 100644 --- a/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.test.ts +++ b/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.test.ts @@ -31,5 +31,14 @@ describe('determineAlertsToReturn', () => { const { recoveredAlertsToReturn } = determineAlertsToReturn({}, recoveredAlerts); expect(keys(recoveredAlertsToReturn)).toEqual(['1']); }); + + test('should return all recovered alerts if the optimization flag is set to false', () => { + const recoveredAlerts = { + '1': new Alert('1', { meta: { flappingHistory: flapping } }), + '2': new Alert('2', { meta: { flappingHistory: notFlapping } }), + }; + const { recoveredAlertsToReturn } = determineAlertsToReturn({}, recoveredAlerts, false); + expect(keys(recoveredAlertsToReturn)).toEqual(['1', '2']); + }); }); }); diff --git a/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.ts b/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.ts index 5916bf91efcc0..2449c48ca83f7 100644 --- a/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.ts +++ b/x-pack/plugins/alerting/server/lib/determine_alerts_to_return.ts @@ -17,7 +17,8 @@ export function determineAlertsToReturn< RecoveryActionGroupId extends string >( activeAlerts: Record> = {}, - recoveredAlerts: Record> = {} + recoveredAlerts: Record> = {}, + shouldOptimizeTaskState: boolean = true ): { alertsToReturn: Record; recoveredAlertsToReturn: Record; @@ -32,15 +33,19 @@ export function determineAlertsToReturn< for (const id of keys(recoveredAlerts)) { const alert = recoveredAlerts[id]; - // return recovered alerts if they are flapping or if the flapping array is not at capacity - // this is a space saving effort that will stop tracking a recovered alert if it wasn't flapping and doesn't have state changes - // in the last max capcity number of executions - const flapping = alert.getFlapping(); - const flappingHistory: boolean[] = alert.getFlappingHistory() || []; - const numStateChanges = flappingHistory.filter((f) => f).length; - if (flapping) { - recoveredAlertsToReturn[id] = alert.toRaw(true); - } else if (numStateChanges > 0) { + if (shouldOptimizeTaskState) { + // return recovered alerts if they are flapping or if the flapping array is not at capacity + // this is a space saving effort that will stop tracking a recovered alert if it wasn't flapping and doesn't have state changes + // in the last max capcity number of executions + const flapping = alert.getFlapping(); + const flappingHistory: boolean[] = alert.getFlappingHistory() || []; + const numStateChanges = flappingHistory.filter((f) => f).length; + if (flapping) { + recoveredAlertsToReturn[id] = alert.toRaw(true); + } else if (numStateChanges > 0) { + recoveredAlertsToReturn[id] = alert.toRaw(true); + } + } else { recoveredAlertsToReturn[id] = alert.toRaw(true); } } diff --git a/x-pack/plugins/alerting/server/mocks.ts b/x-pack/plugins/alerting/server/mocks.ts index 1abd11703dd4f..ac4e2f4c4f8b2 100644 --- a/x-pack/plugins/alerting/server/mocks.ts +++ b/x-pack/plugins/alerting/server/mocks.ts @@ -174,10 +174,10 @@ const createRuleExecutorServicesMock = < shouldWriteAlerts: () => true, shouldStopExecution: () => true, search: createAbortableSearchServiceMock(), - searchSourceClient: searchSourceCommonMock, + getSearchSourceClient: jest.fn().mockResolvedValue(searchSourceCommonMock), ruleMonitoringService: createRuleMonitoringServiceMock(), share: createShareStartMock(), - dataViews: dataViewPluginMocks.createStartContract(), + getDataViews: jest.fn().mockResolvedValue(dataViewPluginMocks.createStartContract()), }; }; export type RuleExecutorServicesMock = ReturnType; diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index d310c6e3567c3..447dab2b94715 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -6,7 +6,14 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs'; +import { + BehaviorSubject, + ReplaySubject, + Subject, + Observable, + map, + distinctUntilChanged, +} from 'rxjs'; import { pick } from 'lodash'; import { UsageCollectionSetup, UsageCounter } from '@kbn/usage-collection-plugin/server'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; @@ -33,6 +40,7 @@ import { ServiceStatus, SavedObjectsBulkGetObject, ServiceStatusLevels, + CoreStatus, } from '@kbn/core/server'; import { LICENSE_TYPE, @@ -254,6 +262,8 @@ export class AlertingPlugin { this.licenseState = new LicenseState(plugins.licensing.license$); this.security = plugins.security; + const elasticsearchAndSOAvailability$ = getElasticsearchAndSOAvailability(core.status.core$); + const useDataStreamForAlerts = !!plugins.serverless; this.dataStreamAdapter = getDataStreamAdapter({ useDataStreamForAlerts }); @@ -315,6 +325,7 @@ export class AlertingPlugin { elasticsearchClientPromise: core .getStartServices() .then(([{ elasticsearch }]) => elasticsearch.client.asInternalUser), + elasticsearchAndSOAvailability$, }); } } @@ -677,3 +688,16 @@ export class AlertingPlugin { this.pluginStop$.complete(); } } + +export function getElasticsearchAndSOAvailability( + core$: Observable +): Observable { + return core$.pipe( + map( + ({ elasticsearch, savedObjects }) => + elasticsearch.level === ServiceStatusLevels.available && + savedObjects.level === ServiceStatusLevels.available + ), + distinctUntilChanged() + ); +} diff --git a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_rule/v1.ts b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_rule/v1.ts index caa5f47a959f1..cc4d9311f8294 100644 --- a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_rule/v1.ts +++ b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_rule/v1.ts @@ -11,6 +11,7 @@ const executionStatusWarningReason = schema.oneOf([ schema.literal('maxExecutableActions'), schema.literal('maxAlerts'), schema.literal('maxQueuedActions'), + schema.literal('ruleExecution'), ]); const executionStatusErrorReason = schema.oneOf([ diff --git a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts index 84181bb512a78..9b65f6613baaf 100644 --- a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts @@ -47,7 +47,7 @@ import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_e import { alertsMock } from '../mocks'; import { UntypedNormalizedRuleType } from '../rule_type_registry'; import { AlertsService } from '../alerts_service'; -import { ReplaySubject } from 'rxjs'; +import { of, ReplaySubject } from 'rxjs'; import { getDataStreamAdapter } from '../alerts_service/lib/data_stream_adapter'; import { AlertInstanceContext, @@ -124,12 +124,14 @@ type TaskRunnerFactoryInitializerParamsType = jest.Mocked & { const clusterClient = elasticsearchServiceMock.createClusterClient().asInternalUser; const alertingEventLogger = alertingEventLoggerMock.create(); +const elasticsearchAndSOAvailability$ = of(true); const alertsService = new AlertsService({ logger, pluginStop$: new ReplaySubject(1), kibanaVersion: '8.8.0', elasticsearchClientPromise: Promise.resolve(clusterClient), dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts }), + elasticsearchAndSOAvailability$, }); const backfillClient = backfillClientMock.create(); const dataPlugin = dataPluginMock.createStartContract(); diff --git a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts index 61f8f411aef8b..6c6ad31fb6d89 100644 --- a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts @@ -212,7 +212,7 @@ export class AdHocTaskRunner implements CancellableTask { taskInstance: this.taskInstance, }); - const executorServices = await getExecutorServices({ + const executorServices = getExecutorServices({ context: this.context, fakeRequest, abortController: this.searchAbortController, diff --git a/x-pack/plugins/alerting/server/task_runner/get_executor_services.ts b/x-pack/plugins/alerting/server/task_runner/get_executor_services.ts index 543915df0d073..08bf3297fef06 100644 --- a/x-pack/plugins/alerting/server/task_runner/get_executor_services.ts +++ b/x-pack/plugins/alerting/server/task_runner/get_executor_services.ts @@ -40,16 +40,16 @@ interface GetExecutorServicesOpts { } export interface ExecutorServices { - dataViews: DataViewsContract; ruleMonitoringService: PublicRuleMonitoringService; ruleResultService: PublicRuleResultService; savedObjectsClient: SavedObjectsClientContract; uiSettingsClient: IUiSettingsClient; wrappedScopedClusterClient: WrappedScopedClusterClient; - wrappedSearchSourceClient: WrappedSearchSourceClient; + getDataViews: () => Promise; + getWrappedSearchSourceClient: () => Promise; } -export const getExecutorServices = async (opts: GetExecutorServicesOpts) => { +export const getExecutorServices = (opts: GetExecutorServicesOpts) => { const { context, abortController, fakeRequest, logger, ruleData, ruleTaskTimeout } = opts; const wrappedClientOptions = { @@ -66,34 +66,35 @@ export const getExecutorServices = async (opts: GetExecutorServicesOpts) => { scopedClusterClient, }); - const searchSourceClient = await withAlertingSpan('alerting:get-search-source-client', () => - context.data.search.searchSource.asScoped(fakeRequest) - ); - const wrappedSearchSourceClient = wrapSearchSourceClient({ - ...wrappedClientOptions, - searchSourceClient, - }); - const savedObjectsClient = context.savedObjects.getScopedClient(fakeRequest, { includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE, 'action'], }); - const dataViews = await await withAlertingSpan('alerting:get-data-views-factory', () => - context.dataViews.dataViewsServiceFactory( - savedObjectsClient, - scopedClusterClient.asInternalUser - ) - ); - const uiSettingsClient = context.uiSettings.asScopedToClient(savedObjectsClient); return { - dataViews, ruleMonitoringService: opts.ruleMonitoringService.getLastRunMetricsSetters(), ruleResultService: opts.ruleResultService.getLastRunSetters(), savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getDataViews: async () => { + const dataViews = await withAlertingSpan('alerting:get-data-views-factory', () => + context.dataViews.dataViewsServiceFactory( + savedObjectsClient, + scopedClusterClient.asInternalUser + ) + ); + return dataViews; + }, + getWrappedSearchSourceClient: async () => { + const searchSourceClient = await withAlertingSpan('alerting:get-search-source-client', () => + context.data.search.searchSource.asScoped(fakeRequest) + ); + return wrapSearchSourceClient({ + ...wrappedClientOptions, + searchSourceClient, + }); + }, }; }; diff --git a/x-pack/plugins/alerting/server/task_runner/rule_type_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/rule_type_runner.test.ts index 42af7ba476085..e839887a6122c 100644 --- a/x-pack/plugins/alerting/server/task_runner/rule_type_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/rule_type_runner.test.ts @@ -21,7 +21,6 @@ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { publicRuleMonitoringServiceMock } from '../monitoring/rule_monitoring_service.mock'; import { publicRuleResultServiceMock } from '../monitoring/rule_result_service.mock'; import { wrappedScopedClusterClientMock } from '../lib/wrap_scoped_cluster_client.mock'; -import { wrappedSearchSourceClientMock } from '../lib/wrap_search_source_client.mock'; import { NormalizedRuleType } from '../rule_type_registry'; import { ConcreteTaskInstance, @@ -41,7 +40,8 @@ const ruleRunMetricsStore = ruleRunMetricsStoreMock.create(); const savedObjectsClient = savedObjectsClientMock.create(); const uiSettingsClient = uiSettingsServiceMock.createClient(); const wrappedScopedClusterClient = wrappedScopedClusterClientMock.create(); -const wrappedSearchSourceClient = wrappedSearchSourceClientMock.create(); +const getDataViews = jest.fn().mockResolvedValue(dataViews); +const getWrappedSearchSourceClient = jest.fn(); const timer = new TaskRunnerTimer({ logger }); const ruleType: jest.Mocked< @@ -172,13 +172,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -192,12 +192,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -277,13 +277,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -297,12 +297,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -385,13 +385,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -446,13 +446,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -466,12 +466,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -545,13 +545,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -565,12 +565,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -644,13 +644,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -679,13 +679,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -699,12 +699,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -791,13 +791,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -811,12 +811,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -903,13 +903,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -924,12 +924,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -1005,13 +1005,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -1026,12 +1026,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), @@ -1107,13 +1107,13 @@ describe('RuleTypeRunner', () => { alertsClient, executionId: 'abc', executorServices: { - dataViews, + getDataViews, ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, uiSettingsClient, wrappedScopedClusterClient, - wrappedSearchSourceClient, + getWrappedSearchSourceClient, }, rule: mockedRule, ruleType, @@ -1128,12 +1128,12 @@ describe('RuleTypeRunner', () => { services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews, + getDataViews: expect.any(Function), ruleMonitoringService: publicRuleMonitoringService, ruleResultService: publicRuleResultService, savedObjectsClient, scopedClusterClient: wrappedScopedClusterClient.client(), - searchSourceClient: wrappedSearchSourceClient.searchSourceClient, + getSearchSourceClient: expect.any(Function), share: {}, shouldStopExecution: expect.any(Function), shouldWriteAlerts: expect.any(Function), diff --git a/x-pack/plugins/alerting/server/task_runner/rule_type_runner.ts b/x-pack/plugins/alerting/server/task_runner/rule_type_runner.ts index 960771be7af83..301057d405e9a 100644 --- a/x-pack/plugins/alerting/server/task_runner/rule_type_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/rule_type_runner.ts @@ -31,6 +31,7 @@ import { ExecutorServices } from './get_executor_services'; import { TaskRunnerTimer, TaskRunnerTimerSpan } from './task_runner_timer'; import { RuleRunnerErrorStackTraceLog, RuleTypeRunnerContext, TaskRunnerContext } from './types'; import { withAlertingSpan } from './lib'; +import { WrappedSearchSourceClient } from '../lib/wrap_search_source_client'; interface ConstructorOpts< Params extends RuleTypeParams, @@ -203,6 +204,7 @@ export class RuleTypeRunner< }; let executorResult: { state: RuleState } | undefined; + let wrappedSearchSourceClient: WrappedSearchSourceClient | undefined; try { const ctx = { type: 'alert', @@ -219,17 +221,23 @@ export class RuleTypeRunner< services: { alertFactory: alertsClient.factory(), alertsClient: alertsClient.client(), - dataViews: executorServices.dataViews, ruleMonitoringService: executorServices.ruleMonitoringService, ruleResultService: executorServices.ruleResultService, savedObjectsClient: executorServices.savedObjectsClient, scopedClusterClient: executorServices.wrappedScopedClusterClient.client(), - searchSourceClient: executorServices.wrappedSearchSourceClient.searchSourceClient, share: this.options.context.share, shouldStopExecution: () => this.cancelled, shouldWriteAlerts: () => this.shouldLogAndScheduleActionsForAlerts(ruleType.cancelAlertsOnRuleTimeout), uiSettingsClient: executorServices.uiSettingsClient, + getDataViews: executorServices.getDataViews, + getSearchSourceClient: async () => { + if (!wrappedSearchSourceClient) { + wrappedSearchSourceClient = + await executorServices.getWrappedSearchSourceClient(); + } + return wrappedSearchSourceClient.searchSourceClient; + }, }, params: validatedParams, state: ruleTypeState as RuleState, @@ -306,10 +314,12 @@ export class RuleTypeRunner< context.alertingEventLogger.setExecutionSucceeded( `rule executed: ${context.ruleLogPrefix}` ); - context.ruleRunMetricsStore.setSearchMetrics([ - executorServices.wrappedScopedClusterClient.getMetrics(), - executorServices.wrappedSearchSourceClient.getMetrics(), - ]); + + const metrics = [executorServices.wrappedScopedClusterClient.getMetrics()]; + if (wrappedSearchSourceClient) { + metrics.push(wrappedSearchSourceClient.getMetrics()); + } + context.ruleRunMetricsStore.setSearchMetrics(metrics); return { updatedRuleTypeState: executorResult?.state || undefined, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index 0898c29a85a86..4739ec5a91d3b 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -220,6 +220,7 @@ describe('Task Runner', () => { beforeEach(() => { jest.resetAllMocks(); + jest.restoreAllMocks(); // clear spy mock implementations logger.isLevelEnabled.mockReturnValue(true); jest .requireMock('../lib/wrap_scoped_cluster_client') @@ -1969,9 +1970,9 @@ describe('Task Runner', () => { }); test('should set unexpected errors as framework-error', async () => { - (getExecutorServicesModule.getExecutorServices as jest.Mock).mockRejectedValue( - new Error('test') - ); + jest.spyOn(getExecutorServicesModule, 'getExecutorServices').mockImplementation(() => { + throw new Error('test'); + }); const taskRunner = new TaskRunner({ ruleType, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 5eb15bff0107b..c394d5b16f296 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -339,23 +339,21 @@ export class TaskRunner< taskInstance: this.taskInstance, }) ); - const executorServices = await withAlertingSpan('alerting:get-executor-services', () => - getExecutorServices({ - context: this.context, - fakeRequest, - abortController: this.searchAbortController, - logger: this.logger, - ruleMonitoringService: this.ruleMonitoring, - ruleResultService: this.ruleResult, - ruleData: { - name: rule.name, - alertTypeId: rule.alertTypeId, - id: rule.id, - spaceId, - }, - ruleTaskTimeout: this.ruleType.ruleTaskTimeout, - }) - ); + const executorServices = getExecutorServices({ + context: this.context, + fakeRequest, + abortController: this.searchAbortController, + logger: this.logger, + ruleMonitoringService: this.ruleMonitoring, + ruleResultService: this.ruleResult, + ruleData: { + name: rule.name, + alertTypeId: rule.alertTypeId, + id: rule.id, + spaceId, + }, + ruleTaskTimeout: this.ruleType.ruleTaskTimeout, + }); const { state: updatedRuleTypeState, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_alerts_client.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_alerts_client.test.ts index 9f5ad725465e7..851bdddaed62a 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_alerts_client.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_alerts_client.test.ts @@ -65,7 +65,7 @@ import * as RuleRunMetricsStoreModule from '../lib/rule_run_metrics_store'; import { legacyAlertsClientMock } from '../alerts_client/legacy_alerts_client.mock'; import { ruleRunMetricsStoreMock } from '../lib/rule_run_metrics_store.mock'; import { AlertsService } from '../alerts_service'; -import { ReplaySubject } from 'rxjs'; +import { ReplaySubject, Subject } from 'rxjs'; import { IAlertsClient } from '../alerts_client/types'; import { getDataStreamAdapter } from '../alerts_service/lib/data_stream_adapter'; import { @@ -180,6 +180,7 @@ describe('Task Runner', () => { const ruleRunMetricsStore = ruleRunMetricsStoreMock.create(); const maintenanceWindowClient = maintenanceWindowClientMock.create(); const connectorAdapterRegistry = new ConnectorAdapterRegistry(); + const elasticsearchAndSOAvailability$ = new Subject(); type TaskRunnerFactoryInitializerParamsType = jest.Mocked & { actionsPlugin: jest.Mocked; @@ -387,7 +388,10 @@ describe('Task Runner', () => { kibanaVersion: '8.8.0', elasticsearchClientPromise: Promise.resolve(clusterClient), dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts }), + elasticsearchAndSOAvailability$, }); + elasticsearchAndSOAvailability$.next(true); + const spy = jest .spyOn(alertsService, 'getContextInitializationPromise') .mockResolvedValue({ result: true }); @@ -446,12 +450,12 @@ describe('Task Runner', () => { expect(logger.debug).toHaveBeenCalledTimes(useDataStreamForAlerts ? 9 : 10); let debugCall = 1; - expect(logger.debug).nthCalledWith(debugCall++, `Initializing resources for AlertsService`); expect(logger.debug).nthCalledWith( debugCall++, 'executing rule test:1 at 1970-01-01T00:00:00.000Z', { tags: ['1', 'test'] } ); + expect(logger.debug).nthCalledWith(debugCall++, `Initializing resources for AlertsService`); if (!useDataStreamForAlerts) { expect(logger.debug).nthCalledWith( @@ -516,7 +520,10 @@ describe('Task Runner', () => { kibanaVersion: '8.8.0', elasticsearchClientPromise: Promise.resolve(clusterClient), dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts }), + elasticsearchAndSOAvailability$, }); + elasticsearchAndSOAvailability$.next(true); + const spy = jest .spyOn(alertsService, 'getContextInitializationPromise') .mockResolvedValue({ result: true }); diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index 342c3070379c5..3df6f241061c3 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -11,7 +11,7 @@ import type { SavedObjectReference, IUiSettingsClient, } from '@kbn/core/server'; -import z from 'zod'; +import z from '@kbn/zod'; import { DataViewsContract } from '@kbn/data-views-plugin/common'; import { ISearchStartSearchSource } from '@kbn/data-plugin/common'; import { LicenseType } from '@kbn/licensing-plugin/server'; @@ -102,7 +102,6 @@ export interface RuleExecutorServices< ActionGroupIds extends string = never, AlertData extends RuleAlertData = RuleAlertData > { - searchSourceClient: ISearchStartSearchSource; savedObjectsClient: SavedObjectsClientContract; uiSettingsClient: IUiSettingsClient; scopedClusterClient: IScopedClusterClient; @@ -121,8 +120,9 @@ export interface RuleExecutorServices< shouldStopExecution: () => boolean; ruleMonitoringService?: PublicRuleMonitoringService; share: SharePluginStart; - dataViews: DataViewsContract; ruleResultService?: PublicRuleResultService; + getDataViews: () => Promise; + getSearchSourceClient: () => Promise; } export interface RuleExecutorOptions< diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 0f07c2e8f8b8e..c09816222b010 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -71,7 +71,8 @@ "@kbn/search-types", "@kbn/alerting-state-types", "@kbn/core-security-server", - "@kbn/core-http-server" + "@kbn/core-http-server", + "@kbn/zod" ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx index 89c3cf35a7c36..488abfcc80e0a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useEffect, useCallback } from 'react'; -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSelect, EuiSelectProps } from '@elastic/eui'; import { DatatableColumn, ExpressionAstExpression } from '@kbn/expressions-plugin/common'; import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; import { ArgumentStrings } from '../../../i18n'; @@ -15,7 +15,7 @@ import { ResolvedArgProps, ResolvedColumns } from '../../../public/expression_ty const { VisDimension: strings } = ArgumentStrings; type VisDimensionArgInputProps = { - onValueChange: (value: ExpressionAstExpression) => void; + onValueChange: (value: ExpressionAstExpression | string) => void; argValue: ExpressionAstExpression; typeInstance: { options?: { @@ -30,14 +30,14 @@ const VisDimensionArgInput: React.FC = ({ onValueChange, resolved: { columns }, }) => { - const [value, setValue] = useState(argValue); + const [value, setValue] = useState(argValue); const confirm = typeInstance?.options?.confirm; useEffect(() => { setValue(argValue); }, [argValue]); - const onChange = useCallback( + const onChange = useCallback>( (ev) => { const onChangeFn = confirm ? setValue : onValueChange; const astObj: ExpressionAstExpression = { diff --git a/x-pack/plugins/canvas/kibana.jsonc b/x-pack/plugins/canvas/kibana.jsonc index 1f6a3bf5554b4..f752f37443fef 100644 --- a/x-pack/plugins/canvas/kibana.jsonc +++ b/x-pack/plugins/canvas/kibana.jsonc @@ -12,7 +12,6 @@ "canvas" ], "requiredPlugins": [ - "bfetch", "charts", "data", "dataViews", diff --git a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx index 053cda9dd03f3..f2abceff1f67f 100644 --- a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx +++ b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx @@ -59,14 +59,18 @@ const ArgTemplateFormComponent: React.FunctionComponent = mountedArgumentRef.current = undefined; }); - const onMount = useCallback((ref) => { - if (!mountedArgumentRef.current && ref) { - mountedArgumentRef.current = ref; - } - }, []); + const onMount = useCallback( + (ref: UpdatePropsRef | null) => { + if (!mountedArgumentRef.current && ref) { + mountedArgumentRef.current = ref; + } + }, + [] + ); const renderTemplate = useCallback( - (domNode) => template && template(domNode, argumentProps, updatedHandlers, onMount), + (domNode: HTMLElement) => + template && template(domNode, argumentProps, updatedHandlers, onMount), [argumentProps, onMount, template, updatedHandlers] ); diff --git a/x-pack/plugins/canvas/public/components/hooks/use_canvas_api.tsx b/x-pack/plugins/canvas/public/components/hooks/use_canvas_api.tsx index 3d1784bf65c82..fa302c57ead8c 100644 --- a/x-pack/plugins/canvas/public/components/hooks/use_canvas_api.tsx +++ b/x-pack/plugins/canvas/public/components/hooks/use_canvas_api.tsx @@ -49,6 +49,7 @@ export const useCanvasApi: () => CanvasContainerApi = () => { createNewEmbeddable(panelType, initialState); }, disableTriggers: true, + type: 'canvas', /** * getSerializedStateForChild is left out here because we cannot access the state here. That method * is injected in `x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx` diff --git a/x-pack/plugins/canvas/public/components/var_config/var_value_field.tsx b/x-pack/plugins/canvas/public/components/var_config/var_value_field.tsx index 24b9a82e32e5c..6b91497fa0f64 100644 --- a/x-pack/plugins/canvas/public/components/var_config/var_value_field.tsx +++ b/x-pack/plugins/canvas/public/components/var_config/var_value_field.tsx @@ -48,7 +48,7 @@ export const VarValueField: FC = ({ type, value, onChange }) => { ]; const onNumberChange = useCallback( - (e) => { + (e: React.ChangeEvent) => { const floatVal = parseFloat(e.target.value); const varValue = isNaN(floatVal) ? '' : floatVal; onChange(varValue); diff --git a/x-pack/plugins/canvas/public/components/workpad/workpad.tsx b/x-pack/plugins/canvas/public/components/workpad/workpad.tsx index 7cc077203c737..1e604a6deb850 100644 --- a/x-pack/plugins/canvas/public/components/workpad/workpad.tsx +++ b/x-pack/plugins/canvas/public/components/workpad/workpad.tsx @@ -74,7 +74,7 @@ export const Workpad: FC = (props) => { ); const getAnimation = useCallback( - (pageNumber) => { + (pageNumber: number) => { if (!transition || !transition.name) { return null; } @@ -94,7 +94,7 @@ export const Workpad: FC = (props) => { const onTransitionEnd = useCallback(() => setTransition(null), [setTransition]); const setFullscreenWithEffect = useCallback( - (fullscreen) => { + (fullscreen: boolean) => { setFullscreen(fullscreen); if (fullscreen === true) { trackCanvasUiMetric( diff --git a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx index c14e54d8e8549..64e0c259cd048 100644 --- a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx @@ -21,8 +21,11 @@ const strings = { export const WorkpadColorPicker = (props: Props) => { const dispatch = useDispatch(); - const onAddColor = useCallback((payload) => dispatch(addColor(payload)), [dispatch]); - const onRemoveColor = useCallback((payload) => dispatch(removeColor(payload)), [dispatch]); + const onAddColor = useCallback((payload: string) => dispatch(addColor(payload)), [dispatch]); + const onRemoveColor = useCallback( + (payload: string) => dispatch(removeColor(payload)), + [dispatch] + ); const colors = useSelector(getWorkpadColors); return ( diff --git a/x-pack/plugins/canvas/public/expression_types/datasource.tsx b/x-pack/plugins/canvas/public/expression_types/datasource.tsx index a7d5cd4e7a2b4..f7bd89200cfda 100644 --- a/x-pack/plugins/canvas/public/expression_types/datasource.tsx +++ b/x-pack/plugins/canvas/public/expression_types/datasource.tsx @@ -61,12 +61,12 @@ const DatasourceWrapperComponent: React.FunctionComponent { + const onMount = useCallback((ref: UpdatePropsRef | null) => { datasourceRef.current = ref ?? undefined; }, []); const callRenderFn = useCallback( - (domNode) => { + (domNode: HTMLDivElement) => { const { template } = spec; if (!template) { return null; diff --git a/x-pack/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx index 495dea5873f95..5f385ce5f079b 100644 --- a/x-pack/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -27,7 +27,6 @@ import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { Start as InspectorStart } from '@kbn/inspector-plugin/public'; -import { BfetchPublicSetup } from '@kbn/bfetch-plugin/public'; import { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; @@ -53,7 +52,6 @@ export interface CanvasSetupDeps { expressions: ExpressionsSetup; home?: HomePublicPluginSetup; usageCollection?: UsageCollectionSetup; - bfetch: BfetchPublicSetup; charts: ChartsPluginSetup; uiActions: UiActionsSetup; } diff --git a/x-pack/plugins/canvas/public/setup_expressions.ts b/x-pack/plugins/canvas/public/setup_expressions.ts index 655daef80f856..848fb9a12b0cd 100644 --- a/x-pack/plugins/canvas/public/setup_expressions.ts +++ b/x-pack/plugins/canvas/public/setup_expressions.ts @@ -21,7 +21,7 @@ export const setupExpressions = async ({ coreSetup: CoreSetup; setupPlugins: CanvasSetupDeps; }) => { - const { expressions, bfetch } = setupPlugins; + const { expressions } = setupPlugins; const loadServerFunctionWrappers = async () => { if (!cached) { @@ -29,7 +29,6 @@ export const setupExpressions = async ({ const serverFunctionList = await coreSetup.http.get(API_ROUTE_FUNCTIONS, { version: '1', }); - const batchedFunction = bfetch.batchedFunction({ url: API_ROUTE_FUNCTIONS }); const { serialize } = serializeProvider(expressions.getTypes()); // For every sever-side function, register a client-side @@ -43,7 +42,10 @@ export const setupExpressions = async ({ const fn = () => ({ ...serverFunctionList[functionName], fn: (input: any, args: any) => { - return batchedFunction({ functionName, args, context: serialize(input) }); + return coreSetup.http.post(API_ROUTE_FUNCTIONS, { + body: JSON.stringify({ functionName, args, context: serialize(input) }), + version: '1', + }); }, }); diff --git a/x-pack/plugins/canvas/server/plugin.ts b/x-pack/plugins/canvas/server/plugin.ts index 36a6fbbd0e3e2..074d29ec977f9 100644 --- a/x-pack/plugins/canvas/server/plugin.ts +++ b/x-pack/plugins/canvas/server/plugin.ts @@ -11,7 +11,6 @@ import { PluginStart as DataPluginStart, } from '@kbn/data-plugin/server'; import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; -import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { HomeServerPluginSetup } from '@kbn/home-plugin/server'; import { EmbeddableSetup } from '@kbn/embeddable-plugin/server'; @@ -33,7 +32,6 @@ interface PluginsSetup { embeddable: EmbeddableSetup; features: FeaturesPluginSetup; home: HomeServerPluginSetup; - bfetch: BfetchServerSetup; data: DataPluginSetup; reporting?: ReportingServerPluginSetup; usageCollection?: UsageCollectionSetup; @@ -81,7 +79,6 @@ export class CanvasPlugin implements Plugin { initRoutes({ router: canvasRouter, expressions: expressionsSetup, - bfetch: plugins.bfetch, logger: this.logger, }); diff --git a/x-pack/plugins/canvas/server/routes/functions/functions.ts b/x-pack/plugins/canvas/server/routes/functions/functions.ts index 73036b35af05b..3a8ff207fa000 100644 --- a/x-pack/plugins/canvas/server/routes/functions/functions.ts +++ b/x-pack/plugins/canvas/server/routes/functions/functions.ts @@ -6,6 +6,7 @@ */ import { serializeProvider } from '@kbn/expressions-plugin/common'; +import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '..'; import { API_ROUTE_FUNCTIONS } from '../../../common/lib/constants'; @@ -32,7 +33,43 @@ export function initializeGetFunctionsRoute(deps: RouteInitializerDeps) { } export function initializeBatchFunctionsRoute(deps: RouteInitializerDeps) { - const { bfetch, expressions } = deps; + const { router, expressions } = deps; + router.versioned + .post({ + path: API_ROUTE_FUNCTIONS, + access: 'internal', + }) + .addVersion( + { + version: '1', + validate: { + request: { + body: schema.object({ + functionName: schema.string(), + args: schema.object({}, { unknowns: 'allow' }), + context: schema.object({}, { unknowns: 'allow' }), + }), + }, + }, + }, + async (context, request, response) => { + const handlers = { + environment: 'server', + }; + const fnCall: FunctionCall = { + functionName: request.body.functionName, + args: request.body.args, + context: request.body.context, + }; + const result = await runFunction(handlers, fnCall); + if (typeof result === 'undefined') { + throw new Error(`Function ${fnCall.functionName} did not return anything.`); + } + return response.ok({ + body: result, + }); + } + ); async function runFunction(handlers: { environment: string }, fnCall: FunctionCall) { const { functionName, args, context } = fnCall; @@ -46,23 +83,4 @@ export function initializeBatchFunctionsRoute(deps: RouteInitializerDeps) { return result; } - - /** - * Register an endpoint that executes a batch of functions, and streams the - * results back using ND-JSON. - */ - bfetch.addBatchProcessingRoute(API_ROUTE_FUNCTIONS, (request) => { - return { - onBatchItem: async (fnCall: FunctionCall) => { - const handlers = { - environment: 'server', - }; - const result = await runFunction(handlers, fnCall); - if (typeof result === 'undefined') { - throw new Error(`Function ${fnCall.functionName} did not return anything.`); - } - return result; - }, - }; - }); } diff --git a/x-pack/plugins/canvas/server/routes/index.ts b/x-pack/plugins/canvas/server/routes/index.ts index 9b2d712b17c5f..80dc1b56e3dba 100644 --- a/x-pack/plugins/canvas/server/routes/index.ts +++ b/x-pack/plugins/canvas/server/routes/index.ts @@ -7,7 +7,6 @@ import { IRouter, Logger } from '@kbn/core/server'; import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; -import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { initCustomElementsRoutes } from './custom_elements'; import { initShareablesRoutes } from './shareables'; import { initWorkpadRoutes } from './workpad'; @@ -19,7 +18,6 @@ export interface RouteInitializerDeps { router: IRouter; logger: Logger; expressions: ExpressionsServerSetup; - bfetch: BfetchServerSetup; } export function initRoutes(deps: RouteInitializerDeps) { diff --git a/x-pack/plugins/canvas/server/routes/test_helpers.ts b/x-pack/plugins/canvas/server/routes/test_helpers.ts index 30d63576ed6f2..ded9076909cb9 100644 --- a/x-pack/plugins/canvas/server/routes/test_helpers.ts +++ b/x-pack/plugins/canvas/server/routes/test_helpers.ts @@ -10,13 +10,11 @@ import { loggingSystemMock, elasticsearchServiceMock, } from '@kbn/core/server/mocks'; -import { bfetchPluginMock } from '@kbn/bfetch-plugin/server/mocks'; import { expressionsPluginMock } from '@kbn/expressions-plugin/server/mocks'; export function getMockedRouterDeps() { const httpService = httpServiceMock.createSetupContract(); const elasticsearch = elasticsearchServiceMock.createSetup(); - const bfetch = bfetchPluginMock.createSetupContract(); const expressions = expressionsPluginMock.createSetupContract(); const router = httpService.createRouter(); @@ -24,7 +22,6 @@ export function getMockedRouterDeps() { router, expressions, elasticsearch, - bfetch, logger: loggingSystemMock.create().get(), }; } diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 124d2c660e9fe..85121b72c868c 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -27,7 +27,6 @@ "kbn_references": [ { "path": "../../../src/setup_node_env/tsconfig.json" }, "@kbn/core", - "@kbn/bfetch-plugin", "@kbn/charts-plugin", "@kbn/data-plugin", "@kbn/share-plugin", diff --git a/x-pack/plugins/canvas/types/embeddables.ts b/x-pack/plugins/canvas/types/embeddables.ts index dfdce31c9058b..794e0b8f1cdad 100644 --- a/x-pack/plugins/canvas/types/embeddables.ts +++ b/x-pack/plugins/canvas/types/embeddables.ts @@ -11,6 +11,7 @@ import { EmbeddableInput as Input } from '@kbn/embeddable-plugin/common'; import type { HasAppContext, HasDisableTriggers, + HasType, PublishesViewMode, PublishesUnifiedSearch, } from '@kbn/presentation-publishing'; @@ -25,5 +26,6 @@ export type EmbeddableInput = Input & { export type CanvasContainerApi = PublishesViewMode & CanAddNewPanel & HasDisableTriggers & + HasType & HasSerializedChildState & Partial; diff --git a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx index 60a19df11b04a..7ee2dc2796c28 100644 --- a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx +++ b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx @@ -460,4 +460,18 @@ describe('EditAssigneesSelectable', () => { ], }); }); + + it('renders even with no assignee set yet', async () => { + const selectedCases = [{ ...basicCase, assignees: [] }]; + const result = appMock.render( + + ); + + await waitFor(() => { + expect(result.getByTestId('cases-actions-assignees-edit-selectable')).toBeInTheDocument(); + }); + + expect(result.getByPlaceholderText('Find a user')).toBeInTheDocument(); + expect(result.getByText('Selected: 0')).toBeInTheDocument(); + }); }); diff --git a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx index d3a4d9cbb06e1..52c9ab896f1cd 100644 --- a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx +++ b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx @@ -79,7 +79,7 @@ const EditAssigneesSelectableComponent: React.FC = ({ [selectedCases] ); - const { data, isLoading: isLoadingUserProfiles } = useBulkGetUserProfiles({ + const { data, isFetching: isLoadingUserProfiles } = useBulkGetUserProfiles({ uids: Array.from(assignees.values()), }); @@ -198,7 +198,7 @@ const EditAssigneesSelectableComponent: React.FC = ({ ); const onSearchChange = useCallback( - (value) => { + (value: string) => { setSearchValue(value); onContentChange(value); }, diff --git a/x-pack/plugins/cases/public/components/actions/tags/edit_tags_selectable.tsx b/x-pack/plugins/cases/public/components/actions/tags/edit_tags_selectable.tsx index 9f5a0cdfca828..947228ce9b136 100644 --- a/x-pack/plugins/cases/public/components/actions/tags/edit_tags_selectable.tsx +++ b/x-pack/plugins/cases/public/components/actions/tags/edit_tags_selectable.tsx @@ -70,22 +70,25 @@ const EditTagsSelectableComponent: React.FC = ({ const [searchValue, setSearchValue] = useState(''); const { euiTheme } = useEuiTheme(); - const renderOption = useCallback((option: ItemSelectableOption, search: string) => { - const dataTestSubj = option.newItem - ? 'cases-actions-tags-edit-selectable-add-new-tag-icon' - : `cases-actions-tags-edit-selectable-tag-${option.label}-icon-${option.itemIcon}`; - - return ( - <> - - {option.label} - - ); - }, []); + const renderOption = useCallback( + (option: ItemSelectableOption, search: string) => { + const dataTestSubj = option.newItem + ? 'cases-actions-tags-edit-selectable-add-new-tag-icon' + : `cases-actions-tags-edit-selectable-tag-${option.label}-icon-${option.itemIcon}`; + + return ( + <> + + {option.label} + + ); + }, + [euiTheme] + ); /** * While the user searches we need to add the ability @@ -117,10 +120,6 @@ const EditTagsSelectableComponent: React.FC = ({ [options, searchValue, state.items] ); - const onSearchChange = useCallback((value) => { - setSearchValue(value); - }, []); - return ( = ({ placeholder: i18n.SEARCH_PLACEHOLDER, isLoading, isClearable: !isLoading, - onChange: onSearchChange, + onChange: setSearchValue, value: searchValue, 'data-test-subj': 'cases-actions-tags-edit-selectable-search-input', }} diff --git a/x-pack/plugins/cases/public/components/add_comment/index.tsx b/x-pack/plugins/cases/public/components/add_comment/index.tsx index 009594df200f7..c84f799b1c899 100644 --- a/x-pack/plugins/cases/public/components/add_comment/index.tsx +++ b/x-pack/plugins/cases/public/components/add_comment/index.tsx @@ -26,7 +26,7 @@ import { import { AttachmentType } from '../../../common/types/domain'; import { useCreateAttachments } from '../../containers/use_create_attachments'; import type { CaseUI } from '../../containers/types'; -import type { EuiMarkdownEditorRef } from '../markdown_editor'; +import type { MarkdownEditorRef } from '../markdown_editor'; import { MarkdownEditorForm } from '../markdown_editor'; import { getMarkdownEditorStorageKey } from '../markdown_editor/utils'; import { removeItemFromSessionStorage } from '../utils'; @@ -45,7 +45,7 @@ const initialCommentValue: AddCommentFormSchema = { export interface AddCommentRefObject { addQuote: (quote: string) => void; setComment: (newComment: string) => void; - editor: EuiMarkdownEditorRef | null; + editor: MarkdownEditorRef | null; } /* eslint-disable react/no-unused-prop-types */ @@ -65,7 +65,7 @@ export const AddComment = React.memo( { id, caseId, onCommentPosted, onCommentSaving, showLoading = true, statusActionButton }, ref ) => { - const editorRef = useRef(null); + const editorRef = useRef(null); const [focusOnContext, setFocusOnContext] = useState(false); const { permissions, owner } = useCasesContext(); const { isLoading, mutate: createAttachments } = useCreateAttachments(); @@ -85,7 +85,7 @@ export const AddComment = React.memo( const { setFieldValue, reset, submit } = form; const [{ comment }] = useFormData<{ comment: string }>({ form, watch: [fieldName] }); - const addQuote = useCallback( + const addQuote = useCallback( (quote) => { const addCarrots = quote.replace(new RegExp('\r?\n', 'g'), '\n> '); const val = `> ${addCarrots} \n\n`; @@ -95,7 +95,7 @@ export const AddComment = React.memo( [comment, setFieldValue] ); - const setComment = useCallback( + const setComment = useCallback( (newComment) => { setFieldValue(fieldName, newComment); }, diff --git a/x-pack/plugins/cases/public/components/all_cases/nav_buttons.tsx b/x-pack/plugins/cases/public/components/all_cases/nav_buttons.tsx index 29b0607ec62af..310340f0366eb 100644 --- a/x-pack/plugins/cases/public/components/all_cases/nav_buttons.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/nav_buttons.tsx @@ -27,7 +27,7 @@ export const NavButtons: FunctionComponent = ({ actionsErrors }) => { const { getCreateCaseUrl, navigateToCreateCase } = useCreateCaseNavigation(); const { euiTheme } = useEuiTheme(); const navigateToCreateCaseClick = useCallback( - (e) => { + (e: React.SyntheticEvent) => { e.preventDefault(); navigateToCreateCase(); }, diff --git a/x-pack/plugins/cases/public/components/all_cases/search.tsx b/x-pack/plugins/cases/public/components/all_cases/search.tsx index 265c42470cdbd..542ebf9e0c51d 100644 --- a/x-pack/plugins/cases/public/components/all_cases/search.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/search.tsx @@ -22,7 +22,7 @@ const TableSearchComponent: React.FC = ({ const [search, setSearch] = useState(filterOptionsSearch); const onSearch = useCallback( - (newSearch) => { + (newSearch: string) => { const trimSearch = newSearch.trim(); setSearch(trimSearch); onFilterOptionsChange({ search: trimSearch }); diff --git a/x-pack/plugins/cases/public/components/all_cases/table.tsx b/x-pack/plugins/cases/public/components/all_cases/table.tsx index c2b429f4789eb..c95059660b3e4 100644 --- a/x-pack/plugins/cases/public/components/all_cases/table.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/table.tsx @@ -59,7 +59,7 @@ export const CasesTable: FunctionComponent = ({ const { getCreateCaseUrl, navigateToCreateCase } = useCreateCaseNavigation(); const { euiTheme } = useEuiTheme(); const navigateToCreateCaseClick = useCallback( - (ev) => { + (ev: React.SyntheticEvent) => { ev.preventDefault(); if (goToCreateCase != null) { goToCreateCase(); diff --git a/x-pack/plugins/cases/public/components/app/routes.tsx b/x-pack/plugins/cases/public/components/app/routes.tsx index 501cd665ff24b..ee2c82777dbf6 100644 --- a/x-pack/plugins/cases/public/components/app/routes.tsx +++ b/x-pack/plugins/cases/public/components/app/routes.tsx @@ -28,6 +28,7 @@ import { NoPrivilegesPage } from '../no_privileges'; import * as i18n from './translations'; import { useReadonlyHeader } from './use_readonly_header'; import type { CaseViewProps } from '../case_view/types'; +import type { CreateCaseFormProps } from '../create/form'; const CaseViewLazy: React.FC = lazy(() => import('../case_view')); @@ -45,7 +46,7 @@ const CasesRoutesComponent: React.FC = ({ const { navigateToCaseView } = useCaseViewNavigation(); useReadonlyHeader(); - const onCreateCaseSuccess = useCallback( + const onCreateCaseSuccess: CreateCaseFormProps['onSuccess'] = useCallback( async ({ id }) => navigateToCaseView({ detailName: id }), [navigateToCaseView] ); diff --git a/x-pack/plugins/cases/public/components/case_form_fields/severity.test.tsx b/x-pack/plugins/cases/public/components/case_form_fields/severity.test.tsx index 8251e0a1f18fa..d063c2fea3421 100644 --- a/x-pack/plugins/cases/public/components/case_form_fields/severity.test.tsx +++ b/x-pack/plugins/cases/public/components/case_form_fields/severity.test.tsx @@ -6,9 +6,7 @@ */ import React from 'react'; -import { screen, waitFor } from '@testing-library/react'; -import type { AppMockRenderer } from '../../common/mock'; -import { createAppMockRenderer } from '../../common/mock'; +import { screen, waitFor, render } from '@testing-library/react'; import { Severity } from './severity'; import userEvent from '@testing-library/user-event'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; @@ -16,28 +14,21 @@ import { FormTestComponent } from '../../common/test_utils'; const onSubmit = jest.fn(); -// FLAKY: https://github.com/elastic/kibana/issues/188951 -describe.skip('Severity form field', () => { - let appMockRender: AppMockRenderer; - - beforeEach(() => { - appMockRender = createAppMockRenderer(); - }); - +describe('Severity form field', () => { it('renders', async () => { - appMockRender.render( + render( ); expect(await screen.findByTestId('caseSeverity')).toBeInTheDocument(); - expect(await screen.findByTestId('case-severity-selection')).not.toHaveAttribute('disabled'); + expect(await screen.findByTestId('case-severity-selection')).toBeEnabled(); }); // default to LOW in this test configuration it('defaults to the correct value', async () => { - appMockRender.render( + render( @@ -48,7 +39,7 @@ describe.skip('Severity form field', () => { }); it('selects the correct value when changed', async () => { - appMockRender.render( + render( @@ -70,12 +61,12 @@ describe.skip('Severity form field', () => { }); it('disables when loading data', async () => { - appMockRender.render( + render( ); - expect(await screen.findByTestId('case-severity-selection')).toHaveAttribute('disabled'); + expect(await screen.findByTestId('case-severity-selection')).toBeDisabled(); }); }); diff --git a/x-pack/plugins/cases/public/components/case_form_fields/sync_alerts_toggle.test.tsx b/x-pack/plugins/cases/public/components/case_form_fields/sync_alerts_toggle.test.tsx index 959dcba6d4e7e..01a688c474241 100644 --- a/x-pack/plugins/cases/public/components/case_form_fields/sync_alerts_toggle.test.tsx +++ b/x-pack/plugins/cases/public/components/case_form_fields/sync_alerts_toggle.test.tsx @@ -14,7 +14,8 @@ import { FormTestComponent } from '../../common/test_utils'; import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; -describe('SyncAlertsToggle', () => { +// Failing: See https://github.com/elastic/kibana/issues/190270 +describe.skip('SyncAlertsToggle', () => { let appMockRender: AppMockRenderer; const onSubmit = jest.fn(); const defaultFormProps = { diff --git a/x-pack/plugins/cases/public/components/case_view/case_view_page.tsx b/x-pack/plugins/cases/public/components/case_view/case_view_page.tsx index adc2b41f6ce6a..add85202d0e55 100644 --- a/x-pack/plugins/cases/public/components/case_view/case_view_page.tsx +++ b/x-pack/plugins/cases/public/components/case_view/case_view_page.tsx @@ -73,7 +73,7 @@ export const CaseViewPage = React.memo( }, [isLoading, refreshRef, refreshCaseViewPage]); const onSubmitTitle = useCallback( - (newTitle) => + (newTitle: string) => onUpdateField({ key: 'title', value: newTitle, diff --git a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.tsx b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.tsx index d0e5cefa458a4..6e945ef836272 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.tsx @@ -25,6 +25,7 @@ import { useGetSupportedActionConnectors } from '../../../containers/configure/u import type { CaseSeverity, CaseStatuses } from '../../../../common/types/domain'; import type { CaseUICustomField, UseFetchAlertData } from '../../../../common/ui/types'; import type { CaseUI } from '../../../../common'; +import type { EditConnectorProps } from '../../edit_connector'; import { EditConnector } from '../../edit_connector'; import type { CasesNavigation } from '../../links'; import { StatusActionButton } from '../../status/button'; @@ -115,12 +116,12 @@ export const CaseViewActivity = ({ ); const onSubmitTags = useCallback( - (newTags) => onUpdateField({ key: 'tags', value: newTags }), + (newTags: string[]) => onUpdateField({ key: 'tags', value: newTags }), [onUpdateField] ); const onSubmitCategory = useCallback( - (newCategory) => onUpdateField({ key: 'category', value: newCategory }), + (newCategory: string | null) => onUpdateField({ key: 'category', value: newCategory }), [onUpdateField] ); @@ -142,7 +143,7 @@ export const CaseViewActivity = ({ const { isLoading: isLoadingAllAvailableConnectors, data: supportedActionConnectors } = useGetSupportedActionConnectors(); - const onSubmitConnector = useCallback( + const onSubmitConnector = useCallback( (connector) => { onUpdateField({ key: 'connector', diff --git a/x-pack/plugins/cases/public/components/case_view/components/case_view_files.tsx b/x-pack/plugins/cases/public/components/case_view/components/case_view_files.tsx index 85cd4685a41fb..25f6929fbb81b 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/case_view_files.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/case_view_files.tsx @@ -57,7 +57,7 @@ export const CaseViewFiles = ({ caseData }: CaseViewFilesProps) => { ); const onSearchChange = useCallback( - (newSearch) => { + (newSearch: string) => { const trimSearch = newSearch.trim(); if (!isEqual(trimSearch, filteringOptions.searchTerm)) { setFilteringOptions({ diff --git a/x-pack/plugins/cases/public/components/case_view/components/custom_fields.tsx b/x-pack/plugins/cases/public/components/case_view/components/custom_fields.tsx index 32d03bac8dc8e..c30e2b1767eed 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/custom_fields.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/custom_fields.tsx @@ -33,7 +33,7 @@ const CustomFieldsComponent: React.FC = ({ ); const onSubmitCustomField = useCallback( - (customFieldToAdd) => { + (customFieldToAdd: CaseUICustomField) => { onSubmit(customFieldToAdd); }, [onSubmit] diff --git a/x-pack/plugins/cases/public/components/case_view/components/edit_category.tsx b/x-pack/plugins/cases/public/components/case_view/components/edit_category.tsx index f4992f96d9856..460fa364bc4d7 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/edit_category.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/edit_category.tsx @@ -28,7 +28,7 @@ import { RemovableItem } from '../../removable_item/removable_item'; export interface EditCategoryProps { isLoading: boolean; - onSubmit: (category?: string | null) => void; + onSubmit: (category: string | null) => void; category?: string | null; } diff --git a/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx b/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx index c61dd83dea42f..fb34b7fb0fedf 100644 --- a/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx +++ b/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx @@ -15,7 +15,8 @@ import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; import userEvent from '@testing-library/user-event'; -describe('Case Owner Selection', () => { +// FLAKY: https://github.com/elastic/kibana/issues/188488 +describe.skip('Case Owner Selection', () => { const onOwnerChange = jest.fn(); const selectedOwner = SECURITY_SOLUTION_OWNER; diff --git a/x-pack/plugins/cases/public/components/create/template.test.tsx b/x-pack/plugins/cases/public/components/create/template.test.tsx index d3b1c59b71254..837b87827e591 100644 --- a/x-pack/plugins/cases/public/components/create/template.test.tsx +++ b/x-pack/plugins/cases/public/components/create/template.test.tsx @@ -13,7 +13,8 @@ import { createAppMockRenderer } from '../../common/mock'; import { templatesConfigurationMock } from '../../containers/mock'; import { TemplateSelector } from './templates'; -describe('CustomFields', () => { +// FLAKY: https://github.com/elastic/kibana/issues/178457 +describe.skip('CustomFields', () => { let appMockRender: AppMockRenderer; const onTemplateChange = jest.fn(); diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/view.tsx b/x-pack/plugins/cases/public/components/custom_fields/text/view.tsx index 239ab8a1a5387..ddd1554cbd1d6 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/view.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/text/view.tsx @@ -14,7 +14,14 @@ import type { CustomFieldType } from '../types'; const ViewComponent: CustomFieldType['View'] = ({ customField }) => { const value = customField?.value ?? '-'; - return {value}; + return ( + + {value} + + ); }; ViewComponent.displayName = 'View'; diff --git a/x-pack/plugins/cases/public/components/custom_fields/toggle/create.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/toggle/create.test.tsx index 8eb7c50300840..9eb47f86bb693 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/toggle/create.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/toggle/create.test.tsx @@ -13,7 +13,8 @@ import { Create } from './create'; import { customFieldsConfigurationMock } from '../../../containers/mock'; import userEvent from '@testing-library/user-event'; -describe('Create ', () => { +// FLAKY: https://github.com/elastic/kibana/issues/177304 +describe.skip('Create ', () => { const onSubmit = jest.fn(); beforeEach(() => { diff --git a/x-pack/plugins/cases/public/components/description/index.tsx b/x-pack/plugins/cases/public/components/description/index.tsx index 78440cf9b7f1e..6599bc3ef43cb 100644 --- a/x-pack/plugins/cases/public/components/description/index.tsx +++ b/x-pack/plugins/cases/public/components/description/index.tsx @@ -21,7 +21,7 @@ import { getMarkdownEditorStorageKey } from '../markdown_editor/utils'; import * as i18n from '../user_actions/translations'; import { useCasesContext } from '../cases_context/use_cases_context'; import { useLensDraftComment } from '../markdown_editor/plugins/lens/use_lens_draft_comment'; -import type { EditableMarkdownRefObject, EuiMarkdownEditorRef } from '../markdown_editor'; +import type { EditableMarkdownRefObject, MarkdownEditorRef } from '../markdown_editor'; import { EditableMarkdown, ScrollableMarkdown } from '../markdown_editor'; import type { CaseUI } from '../../containers/types'; import type { OnUpdateFields } from '../case_view/types'; @@ -30,7 +30,7 @@ import { schema } from './schema'; const DESCRIPTION_ID = 'description'; export interface DescriptionMarkdownRefObject extends EditableMarkdownRefObject { - editor: EuiMarkdownEditorRef | null; + editor: MarkdownEditorRef | null; } export interface DescriptionProps { caseData: CaseUI; diff --git a/x-pack/plugins/cases/public/components/files/add_file.tsx b/x-pack/plugins/cases/public/components/files/add_file.tsx index 449e9bf269923..7b91879834a78 100644 --- a/x-pack/plugins/cases/public/components/files/add_file.tsx +++ b/x-pack/plugins/cases/public/components/files/add_file.tsx @@ -31,6 +31,7 @@ import { useCasesContext } from '../cases_context/use_cases_context'; import * as i18n from './translations'; import { useRefreshCaseViewPage } from '../case_view/use_on_refresh_case_view_page'; import { deleteFileAttachments } from '../../containers/api'; +import type { ServerError } from '../../types'; interface AddFileProps { caseId: string; @@ -47,7 +48,7 @@ const AddFileComponent: React.FC = ({ caseId }) => { const showModal = () => setIsModalVisible(true); const onError = useCallback( - (error) => { + (error: Error | ServerError) => { showErrorToast(error, { title: i18n.FAILED_UPLOAD, }); diff --git a/x-pack/plugins/cases/public/components/files/file_type.test.tsx b/x-pack/plugins/cases/public/components/files/file_type.test.tsx index 6a96870f14cf9..242fb2fa6af09 100644 --- a/x-pack/plugins/cases/public/components/files/file_type.test.tsx +++ b/x-pack/plugins/cases/public/components/files/file_type.test.tsx @@ -17,7 +17,8 @@ import { basicCase, basicFileMock } from '../../containers/mock'; import { getFileType } from './file_type'; import { FILE_ATTACHMENT_TYPE } from '../../../common/constants'; -describe('getFileType', () => { +// FLAKY: https://github.com/elastic/kibana/issues/175841 +describe.skip('getFileType', () => { const fileType = getFileType(); it('invalid props return blank FileAttachmentViewObject', () => { diff --git a/x-pack/plugins/cases/public/components/filter_popover/index.tsx b/x-pack/plugins/cases/public/components/filter_popover/index.tsx index 60b7964761499..142a8aac8833a 100644 --- a/x-pack/plugins/cases/public/components/filter_popover/index.tsx +++ b/x-pack/plugins/cases/public/components/filter_popover/index.tsx @@ -62,7 +62,7 @@ export const FilterPopoverComponent = ({ const setIsPopoverOpenCb = useCallback(() => setIsPopoverOpen(!isPopoverOpen), [isPopoverOpen]); const toggleSelectedGroupCb = useCallback( - (option) => onSelectedOptionsChanged(toggleSelectedGroup(option, selectedOptions)), + (option: string) => onSelectedOptionsChanged(toggleSelectedGroup(option, selectedOptions)), [selectedOptions, onSelectedOptionsChanged] ); diff --git a/x-pack/plugins/cases/public/components/header_page/index.tsx b/x-pack/plugins/cases/public/components/header_page/index.tsx index 60aa4a9160cf8..1901700fe428d 100644 --- a/x-pack/plugins/cases/public/components/header_page/index.tsx +++ b/x-pack/plugins/cases/public/components/header_page/index.tsx @@ -56,7 +56,7 @@ const HeaderPageComponent: React.FC = ({ const xsFontSize = useEuiFontSize('xs').fontSize; const navigateToAllCasesClick = useCallback( - (e) => { + (e: React.SyntheticEvent) => { if (e) { e.preventDefault(); } diff --git a/x-pack/plugins/cases/public/components/links/index.tsx b/x-pack/plugins/cases/public/components/links/index.tsx index f09a9f852a28f..cc6e29da8008c 100644 --- a/x-pack/plugins/cases/public/components/links/index.tsx +++ b/x-pack/plugins/cases/public/components/links/index.tsx @@ -44,7 +44,7 @@ const CaseDetailsLinkComponent: React.FC = ({ }) => { const { getCaseViewUrl, navigateToCaseView } = useCaseViewNavigation(); const navigateToCaseViewClick = useCallback( - (ev) => { + (ev: React.SyntheticEvent) => { ev.preventDefault(); navigateToCaseView({ detailName }); }, @@ -83,7 +83,7 @@ const ConfigureCaseButtonComponent: React.FC = ({ const { getConfigureCasesUrl, navigateToConfigureCases } = useConfigureCasesNavigation(); const navigateToConfigureCasesClick = useCallback( - (e) => { + (e: React.SyntheticEvent) => { e.preventDefault(); navigateToConfigureCases(); }, diff --git a/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.tsx b/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.tsx index bd91d219ee877..0353c7491d00c 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.tsx @@ -50,7 +50,7 @@ const EditableMarkDownRenderer = forwardRef< const { submit, setFieldValue, isValid: isFormValid } = form; const setComment = useCallback( - (newComment) => { + (newComment: string) => { setFieldValue(fieldName, newComment); }, [setFieldValue, fieldName] diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts index 95e558ca1f79f..23c4a66fa4e58 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts @@ -11,6 +11,7 @@ import { first } from 'rxjs'; import { useKibana } from '../../../../common/lib/kibana'; import { DRAFT_COMMENT_STORAGE_ID } from './constants'; import { VISUALIZATION } from './translations'; +import type { MarkdownEditorRef } from '../../editor'; interface DraftComment { commentId: string; @@ -51,9 +52,11 @@ export const useLensDraftComment = () => { fetchDraftComment(); }, [currentAppId$, embeddable, storage]); - const openLensModal = useCallback(({ editorRef }) => { + const openLensModal = useCallback(({ editorRef }: { editorRef: MarkdownEditorRef }) => { if (editorRef && editorRef.textarea && editorRef.toolbar) { - const lensPluginButton = editorRef.toolbar?.querySelector(`[aria-label="${VISUALIZATION}"]`); + const lensPluginButton = editorRef.toolbar?.querySelector( + `[aria-label="${VISUALIZATION}"]` + ); if (lensPluginButton) { lensPluginButton.click(); } diff --git a/x-pack/plugins/cases/public/components/recent_cases/filters/index.tsx b/x-pack/plugins/cases/public/components/recent_cases/filters/index.tsx index 5478f5b918822..1d7c22eccb68f 100644 --- a/x-pack/plugins/cases/public/components/recent_cases/filters/index.tsx +++ b/x-pack/plugins/cases/public/components/recent_cases/filters/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import type { EuiSelectOption } from '@elastic/eui'; +import type { EuiSelectOption, EuiSelectProps } from '@elastic/eui'; import { EuiSelect } from '@elastic/eui'; import React, { useCallback } from 'react'; @@ -50,7 +50,7 @@ export const RecentCasesFilters = React.memo<{ }; }); - const onChange = useCallback( + const onChange = useCallback>( (e) => { setFilterBy(e.target.value as FilterMode); }, diff --git a/x-pack/plugins/cases/public/components/recent_cases/index.tsx b/x-pack/plugins/cases/public/components/recent_cases/index.tsx index 28c632f843d76..55df7a6c9ac43 100644 --- a/x-pack/plugins/cases/public/components/recent_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/recent_cases/index.tsx @@ -48,7 +48,7 @@ const RecentCasesComponent = React.memo(({ maxCasesToShow }: RecentCasesProps) = useState('recentlyCreated'); const navigateToAllCasesClick = useCallback( - (e) => { + (e: React.SyntheticEvent) => { e.preventDefault(); navigateToAllCases(); }, diff --git a/x-pack/plugins/cases/public/components/recent_cases/no_cases/index.tsx b/x-pack/plugins/cases/public/components/recent_cases/no_cases/index.tsx index d284c99af76d0..5fc24e8655eef 100644 --- a/x-pack/plugins/cases/public/components/recent_cases/no_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/recent_cases/no_cases/index.tsx @@ -23,7 +23,7 @@ const NoCasesComponent = ({ recentCasesFilterBy }: NoCasesComp) => { const { getCreateCaseUrl, navigateToCreateCase } = useCreateCaseNavigation(); const navigateToCreateCaseClick = useCallback( - (e) => { + (e: React.SyntheticEvent) => { e.preventDefault(); navigateToCreateCase(); }, diff --git a/x-pack/plugins/cases/public/components/use_create_case_modal/index.tsx b/x-pack/plugins/cases/public/components/use_create_case_modal/index.tsx index 92a24b615e383..a83fa98836716 100644 --- a/x-pack/plugins/cases/public/components/use_create_case_modal/index.tsx +++ b/x-pack/plugins/cases/public/components/use_create_case_modal/index.tsx @@ -24,7 +24,7 @@ export const useCreateCaseModal = ({ onCaseCreated }: UseCreateCaseModalProps) = const closeModal = useCallback(() => setIsModalOpen(false), []); const openModal = useCallback(() => setIsModalOpen(true), []); const onSuccess = useCallback( - async (theCase) => { + async (theCase: CaseUI) => { onCaseCreated(theCase); closeModal(); }, diff --git a/x-pack/plugins/cases/public/components/use_push_to_service/callout/callout.tsx b/x-pack/plugins/cases/public/components/use_push_to_service/callout/callout.tsx index c94fbb826df48..a3326b3cb90f4 100644 --- a/x-pack/plugins/cases/public/components/use_push_to_service/callout/callout.tsx +++ b/x-pack/plugins/cases/public/components/use_push_to_service/callout/callout.tsx @@ -36,7 +36,7 @@ const CallOutComponent = ({ const { permissions } = useCasesContext(); const handleCallOut = useCallback( - (e) => handleButtonClick(e, id, type), + (e: React.MouseEvent) => handleButtonClick(e, id, type), [handleButtonClick, id, type] ); diff --git a/x-pack/plugins/cases/public/components/use_push_to_service/callout/index.tsx b/x-pack/plugins/cases/public/components/use_push_to_service/callout/index.tsx index 07f4ab2768c0b..f311044e835a2 100644 --- a/x-pack/plugins/cases/public/components/use_push_to_service/callout/index.tsx +++ b/x-pack/plugins/cases/public/components/use_push_to_service/callout/index.tsx @@ -36,7 +36,7 @@ const CaseCallOutComponent = ({ }: CaseCallOutProps) => { const { navigateToConfigureCases } = useConfigureCasesNavigation(); const handleCallOut = useCallback( - (e) => { + (e: React.SyntheticEvent) => { e.preventDefault(); // if theres connectors open dropdown editor // if no connectors, redirect to create case page diff --git a/x-pack/plugins/cases/public/components/user_actions/comment/alert_event.tsx b/x-pack/plugins/cases/public/components/user_actions/comment/alert_event.tsx index 94f9d290e3757..42e5e6b9d4427 100644 --- a/x-pack/plugins/cases/public/components/user_actions/comment/alert_event.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/comment/alert_event.tsx @@ -29,7 +29,7 @@ interface MultipleAlertsProps extends SingleAlertProps { const RuleLink: React.FC = memo( ({ onRuleDetailsClick, getRuleDetailsHref, ruleId, ruleName, loadingAlertData, actionId }) => { const onLinkClick = useCallback( - (ev) => { + (ev: React.MouseEvent) => { ev.preventDefault(); if (onRuleDetailsClick) onRuleDetailsClick(ruleId, ev); }, diff --git a/x-pack/plugins/cases/public/components/user_actions/comment/host_isolation_event.tsx b/x-pack/plugins/cases/public/components/user_actions/comment/host_isolation_event.tsx index a638c1a69b30e..66e7c65f8695b 100644 --- a/x-pack/plugins/cases/public/components/user_actions/comment/host_isolation_event.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/comment/host_isolation_event.tsx @@ -31,7 +31,7 @@ const HostIsolationCommentEventComponent: React.FC = ({ const endpointDetailsHref = href ? href(endpoints[0].endpointId) : ''; const onLinkClick = useCallback( - (ev) => { + (ev: React.MouseEvent) => { ev.preventDefault(); if (onClick) onClick(endpoints[0].endpointId, ev); }, diff --git a/x-pack/plugins/cloud_defend/common/utils/helpers.ts b/x-pack/plugins/cloud_defend/common/utils/helpers.ts index ae1b3a4f3d00c..c918c0fe5d9f2 100644 --- a/x-pack/plugins/cloud_defend/common/utils/helpers.ts +++ b/x-pack/plugins/cloud_defend/common/utils/helpers.ts @@ -48,7 +48,7 @@ export function getSelectorsAndResponsesFromYaml(configuration: string): { let responses: Response[] = []; try { - const result = yaml.load(configuration); + const result = yaml.safeLoad(configuration); if (result) { // iterate selector/response types @@ -107,5 +107,5 @@ export function getYamlFromSelectorsAndResponses(selectors: Selector[], response return current; }, schema); - return yaml.dump(schema); + return yaml.safeDump(schema); } diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx b/x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx index 6b27395e10d4f..5e398a3062b7a 100644 --- a/x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx +++ b/x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx @@ -44,7 +44,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.file.selectors.length).toBe(getAllByTestId('cloud-defend-selector').length); expect(json.file.responses.length).toBe(getAllByTestId('cloud-defend-file-response').length); @@ -69,7 +69,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.file.selectors.length).toBe(getAllByTestId('cloud-defend-selector').length); } catch (err) { @@ -91,7 +91,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.file.responses.length).toBe(getAllByTestId('cloud-defend-file-response').length); } catch (err) { @@ -113,7 +113,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.process.responses.length).toBe( getAllByTestId('cloud-defend-process-response').length @@ -166,7 +166,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.file.responses[0].match).toHaveLength(1); } catch (err) { @@ -205,7 +205,7 @@ describe('', () => { const configuration = input?.vars?.configuration?.value; try { - const json = yaml.load(configuration); + const json = yaml.safeLoad(configuration); expect(json.file.selectors).toHaveLength(4); expect(json.file.selectors[3].name).toEqual(json.file.selectors[0].name + '1'); diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx b/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx index af2d7c0fd1cdf..1c782973dd0ed 100644 --- a/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx +++ b/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx @@ -139,7 +139,7 @@ export const ControlGeneralViewResponse = ({ }, [closePopover, onDuplicate, response]); const onChangeMatches = useCallback( - (options) => { + (options: any) => { response.match = options.map((option: EuiComboBoxOptionOption) => option.value); onResponseChange(response, index); @@ -148,7 +148,7 @@ export const ControlGeneralViewResponse = ({ ); const onChangeExcludes = useCallback( - (options) => { + (options: any) => { response.exclude = options.map((option: EuiComboBoxOptionOption) => option.value); if (response.exclude?.length === 0) { diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx b/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx index 4511aa71f056c..05820541fd02c 100644 --- a/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx +++ b/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx @@ -24,6 +24,7 @@ import { EuiFlexItem, EuiText, EuiCheckbox, + EuiCheckboxProps, } from '@elastic/eui'; import { useStyles } from './styles'; import { @@ -69,7 +70,7 @@ const BooleanCondition = ({ onRemoveCondition, }: BooleanConditionProps) => { const value = selector[prop as keyof Selector] as boolean; - const onChange = useCallback( + const onChange = useCallback( (e) => { onChangeBooleanCondition(prop, e.target.checked); }, diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx b/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx index 4dc47b8b5263f..6d1262afa135b 100644 --- a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx +++ b/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx @@ -43,7 +43,7 @@ export const ControlYamlView = ({ policy, onChange, show }: ViewDeps) => { const currentModel = useConfigModel(configuration); // not all validations can be done via json-schema - const validateAdditional = useCallback((value) => { + const validateAdditional = useCallback((value: any) => { const errors: string[] = []; const { selectors, responses } = getSelectorsAndResponsesFromYaml(value); @@ -125,7 +125,7 @@ export const ControlYamlView = ({ policy, onChange, show }: ViewDeps) => { ]); const onYamlChange = useCallback( - (value) => { + (value: any) => { if (show && input?.vars) { input.vars.configuration.value = value; diff --git a/x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx b/x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx index 0c74551183942..b842453382b68 100644 --- a/x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx +++ b/x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx @@ -16,6 +16,7 @@ import { EuiFormRow, EuiFieldText, EuiHorizontalRule, + EuiSwitchProps, } from '@elastic/eui'; import { INPUT_CONTROL } from '../../../common/constants'; import { getInputFromPolicy } from '../../../common/utils/helpers'; @@ -27,7 +28,7 @@ export const PolicySettings = ({ policy, onChange }: SettingsDeps) => { const [policyHasErrors, setPolicyHasErrors] = useState(false); const controlInput = getInputFromPolicy(policy, INPUT_CONTROL); const controlEnabled = !!controlInput?.enabled; - const onToggleEnabled = useCallback( + const onToggleEnabled = useCallback( (e) => { if (controlInput) { controlInput.enabled = e.target.checked; diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts index b0abbbe568d21..8409a8275ef19 100644 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts @@ -52,6 +52,7 @@ describe('Cloud Plugin', () => { fullStoryOrgId: 'foo', scriptUrl: '/internal/cloud/100/fullstory.js', namespace: 'FSKibana', + captureOnStartup: false, }); }); @@ -66,6 +67,7 @@ describe('Cloud Plugin', () => { pageVarsDebounceTimeMs: 500, scriptUrl: '/internal/cloud/100/fullstory.js', namespace: 'FSKibana', + captureOnStartup: false, }); }); diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts index 420346c19b3ce..05a635d782c0e 100755 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts @@ -85,6 +85,8 @@ export class CloudFullStoryPlugin implements Plugin { `/internal/cloud/${this.initializerContext.env.packageInfo.buildNum}/fullstory.js` ), namespace: 'FSKibana', + // Tell FullStory to not capture from the start, and wait for the opt-in confirmation + captureOnStartup: false, }); } } diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/fullstory_library.js b/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/fullstory_library.js index b522ae7e4cbcc..54f66c7aac324 100644 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/fullstory_library.js +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/fullstory_library.js @@ -1,9 +1,9 @@ /* @notice * This code is part of the Services provided by FullStory, Inc. For license information, please refer to https://www.fullstory.com/legal/terms-and-conditions/ * Portions of this code are licensed under the following license: - * For license information please see fs.js.LICENSE.txt + * For license information please see https://edge.fullstory.com/s/fs.js.LEGAL.txt */ /* eslint-disable prettier/prettier,no-var,eqeqeq,new-cap,no-nested-ternary,no-use-before-define,no-sequences,block-scoped-var,one-var, dot-notation,no-script-url,no-restricted-globals,no-unused-vars,guard-for-in,no-proto,camelcase,no-empty,no-redeclare,no-caller, strict,no-extend-native,no-undef,no-loop-func */ -!function(){"use strict";var t={248:function(t,n,i){var r,e=i(940);function s(t){}!function(t){t[t.Unknown=0]="Unknown",t[t.Clean=1]="Clean",t[t.UnrecoverableFailure=2]="UnrecoverableFailure"}(r||(r={}));var o=new(function(){function t(t){this.rebuildFromSnapshot(t)}return t.prototype.rebuildFromSnapshot=function(t){var n=this.snapshot;if(this.snapshot=t,!n||n.functions!==t.functions){var i=t.functions;this.arrayIsArray=i.arrayIsArray,this.clearWindowInterval=a(i.clearWindowInterval),this.clearWindowTimeout=a(i.clearWindowTimeout),this.dateGetTime=a(i.dateGetTime),this.dateNow=i.dateNow,this.docFragQuerySelectorAll=a(i.docFragQuerySelectorAll),this.docQuerySelectorAll=a(i.docQuerySelectorAll),this.elMatches=a(i.elMatches),this.elQuerySelectorAll=a(i.elQuerySelectorAll),this.jsonParse=i.jsonParse,this.jsonStringify=i.jsonStringify,this.matchMedia=c(i.matchMedia),this.mathAbs=i.mathAbs,this.mathFloor=i.mathFloor,this.mathMax=i.mathMax,this.mathMin=i.mathMin,this.mathPow=i.mathPow,this.mathRandom=i.mathRandom,this.mathRound=i.mathRound,this.objectHasOwnProp=a(i.objectHasOwnProp),this.objectKeys=i.objectKeys,this.objectValues=i.objectValues||null,this.requestWindowAnimationFrame=c(i.requestWindowAnimationFrame),this.requestWindowIdleCallback=c(i.requestWindowIdleCallback),this.setWindowInterval=a(i.setWindowInterval),this.setWindowTimeout=a(i.setWindowTimeout)}},t}())(u(window));function u(t,n){void 0===n&&(n=r.Unknown);var i=n,e=[],s=function(t){return i=r.UnrecoverableFailure,e.push("Snapshot failed: "+t),function(){throw new Error("Invoked failed snapshot")}},o=function(t){try{return t()}catch(t){return s(t.message)}},u=function(t){try{return t()||s("snapshot not found")}catch(t){return s(t.message)}},a={arrayIsArray:o(function(){return t.Array.isArray}),clearWindowInterval:o(function(){return t.clearInterval}),clearWindowTimeout:o(function(){return t.clearTimeout}),dateGetTime:o(function(){return t.Date.prototype.getTime}),dateNow:o(function(){return t.Date.now}),docFragQuerySelectorAll:u(function(){var n;return null===(n=t.DocumentFragment)||void 0===n?void 0:n.prototype.querySelectorAll}),docQuerySelectorAll:u(function(){var n;return null!==(n=t.Document.prototype.querySelectorAll)&&void 0!==n?n:t.document.querySelectorAll}),elMatches:u(function(){return v(t,h)}),elQuerySelectorAll:u(function(){return v(t,f)}),jsonParse:o(function(){return t.JSON.parse}),jsonStringify:o(function(){return t.JSON.stringify}),matchMedia:o(function(){return t.matchMedia}),mathAbs:o(function(){return t.Math.abs}),mathFloor:o(function(){return t.Math.floor}),mathMax:o(function(){return t.Math.max}),mathMin:o(function(){return t.Math.min}),mathPow:o(function(){return t.Math.pow}),mathRandom:o(function(){return t.Math.random}),mathRound:o(function(){return t.Math.round}),objectHasOwnProp:o(function(){return t.Object.prototype.hasOwnProperty}),objectKeys:o(function(){return t.Object.keys}),objectValues:o(function(){return t.Object.values}),requestWindowAnimationFrame:o(function(){return t.requestAnimationFrame}),requestWindowIdleCallback:o(function(){return t.requestIdleCallback}),setWindowInterval:o(function(){return t.setInterval}),setWindowTimeout:o(function(){return t.setTimeout})},c={functionToString:o(function(){return t.Function.prototype.toString}),objectToString:o(function(){return t.Object.prototype.toString})};return{status:i,functions:a,helpers:c,errors:e}}function a(t){return function(n){for(var i=[],r=1;r=0){var s=e.split("/"),o=s[0],u=s[1];i[r]=o,n=u;break}}var a=function(t){var n=parseInt(null!=t?t:"",10),i=E(),r=S();return isNaN(n)?r:n<=i?void 0:n>r?r:n}(n);if(!a)return null;i[0];var c=i[1],h=i[2],f=i[3],v="";f&&(v=decodeURIComponent(f),(y.indexOf(v)>=0||b.indexOf(v)>=0)&&(v=""));var l=(null!=h?h:"").split(":"),d=l[0],p=l[1],w=l[2];return l[3],{appKeyHash:v,expirationAbsTimeSeconds:a,userId:d,orgId:c,pageCount:_(l[4]),sessionId:null!=p?p:"",sessionStartTime:_(w)}}function k(t){var n={};try{for(var i=t.cookie.split(";"),r=0;r1))return s}}(t);if(!i||!K(n))return n;var r="";return 0===n.indexOf("www.")&&(n=n.slice(4),r="www."),0===n.indexOf(i+".")&&(n=n.slice((i+".").length)),""+r+i+"."+n}}function $(t){return t?C(function(t){var n=t,i=n.indexOf(":");return i>=0&&(n=n.slice(0,i)),n}(t))?t:0==t.indexOf("www.")?"app."+t.slice(4):"app."+t:t}function G(t){var n=j(t);if(n)return n+"/s/fs.js"}function X(t,n){return function(){for(var i=[],r=0;rn)return!1;return i==n}function ot(t,n){var i=0;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&++i>n)return!0;return!1}function ut(t){var n=t.nextSibling;return n&&t.parentNode&&n===t.parentNode.firstChild?null:n}function at(t){var n=t.previousSibling;return n&&t.parentNode&&n===t.parentNode.lastChild?null:n}function ct(t){return function(){for(var n=this,i=[],r=0;r"}function pt(t){return o.jsonParse(t)}var wt=function(){function t(t,n,i){void 0===i&&(i=!1),this.i=t,this.u=n,this.l=i,this.g=J,this.m=J,this.S=J,this.k=!1}return t.prototype.before=function(t){return this.g=ft(t),this},t.prototype.afterSync=function(t){return this.m=ft(t),this},t.prototype.afterAsync=function(t){return this.S=ft(function(n){o.setWindowTimeout(window,X(function(){t(n)}),0)}),this},t.prototype.disable=function(){if(this.k=!1,this._){var t=this._,n=t.override,i=t["native"];this.i[this.u]===n&&(this.i[this.u]=i,this._=void 0)}},t.prototype.enable=function(){if(this.k=!0,this._)return!0;this._=this.A();try{this.i[this.u]=this._.override}catch(t){return!1}return!0},t.prototype.getTarget=function(){return this.i},t.prototype.A=function(){var t=this,n=this,i=this.i[this.u],r=function(){for(var t=[],r=0;r\n";var i=[];try{for(var r=arguments.callee.caller.caller;r&&i.length<10;){var e=kt.test(r.toString())&&RegExp.$1||xt;i.push(e),r=r.caller}}catch(t){t.toString()}n=i.join("\n")}return t+n}function It(){try{return window.self!==window.top}catch(t){return!0}}var Tt=function(){function t(){}return t.wrap=function(n,i){return void 0===i&&(i="error"),X(n,function(n){return t.sendToBugsnag(n,i)})},t.I=15,t.sendToBugsnag=function(n,i,r){if(!(t.I<=0)){t.I--;var e=n;"string"==typeof e&&(e=new Error(e));var s=k(document).fs_uid,o=s?x(s):void 0;o&&o.orgId!=F(window)&&(o=void 0);var u=new Date(1678707725e3).toISOString(),a={projectRoot:window.location.origin,deviceTime:p(),inIframe:It(),CompiledVersion:"11aa377d19",CompiledTimestamp:1678707725,CompiledTime:u,orgId:F(window),"userId:sessionId":o?o.userId+":"+o.sessionId:"NA",context:document.location&&document.location.pathname,message:e.message,name:"Recording Error",releaseStage:"production "+u,severity:i,language:Et(window),stacktrace:_t(e)||At()},c=function(t,n,i){var r=encodeURIComponent(n)+"="+encodeURIComponent(i);t.push(r)},h=[];for(var f in a)c(h,f,a[f]||"");if(r)for(var f in r)c(h,"aux_"+f,Ct(r[f]));new Image().src="https://"+L(window)+"/rec/except?"+h.join("&")}},t}();function Ct(t){try{var n=typeof t+": "+vt(t);return"function"==typeof t.toString&&(n+=" (toString: "+t.toString()+")"),n}catch(t){return"failed to serialize \""+(null==t?void 0:t.message)+"\""}}var Pt={};function jt(t,n,i){if(void 0===i&&(i=1),t)return!0;if(Pt[n]=Pt[n]||0,Pt[n]++,Pt[n]>i)return!1;var r=new Error("Assertion failed: "+n);return Tt.sendToBugsnag(r,"error"),t}var Ot,Mt,Kt,Rt,Ht,Nt,Lt={};function Ut(t,n,i){var r;Lt[t]=null!==(r=Lt[t])&&void 0!==r?r:0,Lt[t]++,Lt[t]>1||Tt.sendToBugsnag(n,"error",i)}!function(t){t.MUT_INSERT=2,t.MUT_REMOVE=3,t.MUT_ATTR=4,t.MUT_TEXT=6,t.MOUSEMOVE=8,t.MOUSEMOVE_CURVE=9,t.SCROLL_LAYOUT=10,t.SCROLL_LAYOUT_CURVE=11,t.MOUSEDOWN=12,t.MOUSEUP=13,t.CLICK=16,t.FOCUS=17,t.VALUECHANGE=18,t.RESIZE_LAYOUT=19,t.DOMLOADED=20,t.LOAD=21,t.PLACEHOLDER_SIZE=22,t.UNLOAD=23,t.BLUR=24,t.SET_FRAME_BASE=25,t.TOUCHSTART=32,t.TOUCHEND=33,t.TOUCHCANCEL=34,t.TOUCHMOVE=35,t.TOUCHMOVE_CURVE=36,t.NAVIGATE=37,t.PLAY=38,t.PAUSE=39,t.RESIZE_VISUAL=40,t.RESIZE_VISUAL_CURVE=41,t.RESIZE_DOCUMENT_CONTENT=42,t.RESIZE_SCROLLABLE_ELEMENT_CONTENT=43,t.LOG=48,t.ERROR=49,t.DBL_CLICK=50,t.FORM_SUBMIT=51,t.WINDOW_FOCUS=52,t.WINDOW_BLUR=53,t.HEARTBEAT=54,t.WATCHED_ELEM=56,t.PERF_ENTRY=57,t.REC_FEAT_SUPPORTED=58,t.SELECT=59,t.CSSRULE_INSERT=60,t.CSSRULE_DELETE=61,t.FAIL_THROTTLED=62,t.AJAX_REQUEST=63,t.SCROLL_VISUAL_OFFSET=64,t.SCROLL_VISUAL_OFFSET_CURVE=65,t.MEDIA_QUERY_CHANGE=66,t.RESOURCE_TIMING_BUFFER_FULL=67,t.MUT_SHADOW=68,t.DISABLE_STYLESHEET=69,t.FULLSCREEN=70,t.FULLSCREEN_ERROR=71,t.ADOPTED_STYLESHEETS=72,t.CUSTOM_ELEMENT_DEFINED=73,t.MODAL_OPEN=74,t.MODAL_CLOSE=75,t.SLOW_INTERACTION=76,t.LONG_FRAME=77,t.TIMING=78,t.STORAGE_WRITE_FAILURE=79,t.DOCUMENT_PROPERTIES=80,t.ENTRY_NAVIGATE=81,t.STATS=82,t.VIEWPORT_INTERSECTION=83,t.COPY=84,t.PASTE=85,t.URL_SALT=86,t.URL_ID=87,t.FRAME_STATUS=88,t.SCRIPT_COMPILED_VERSION=89,t.RESET_CSS_SHEET=90,t.ANIMATION_CREATED=91,t.ANIMATION_METHOD_CALLED=92,t.ANIMATION_PROPERTY_SET=93,t.DOCUMENT_TIMELINE_CREATED=94,t.KEYFRAME_EFFECT_CREATED=95,t.KEYFRAME_EFFECT_METHOD_CALLED=96,t.KEYFRAME_EFFECT_PROPERTY_SET=97,t.CAPTURE_SOURCE=98,t.PAGE_DATA=99,t.VISIBILITY_STATE=100,t.DIALOG=101,t.CSSRULE_UPDATE=102,t.CANVAS=103,t.CANVAS_DETACHED_DIMENSION=104,t.INIT_API=105,t.DEFERRED_RESOLVED=106,t.KEEP_ELEMENT=2e3,t.KEEP_URL=2001,t.KEEP_BOUNCE=2002,t.SYS_SETVAR=8193,t.SYS_RESOURCEHASH=8195,t.SYS_SETCONSENT=8196,t.SYS_CUSTOM=8197,t.SYS_REPORTCONSENT=8198,t.SYS_LETHE_MOBILE_BUNDLE_SEQ=8199}(Ot||(Ot={})),function(t){t.Animation=0,t.CSSAnimation=1,t.CSSTransition=2}(Mt||(Mt={})),function(t){t.Unknown=0,t.Serialization=1}(Kt||(Kt={})),function(t){t.Unknown=0,t.Successful=1,t.BlocklistedFrame=2,t.PartiallyLoaded=3,t.MissingWindowOrDocument=4,t.MissingDocumentHead=5,t.MissingBodyOrChildren=6,t.AlreadyDefined=7,t.NoNonScriptElement=8,t.Exception=9}(Rt||(Rt={})),function(t){t.Unknown=0,t.DomSnapshot=1,t.NodeEncoding=2,t.LzEncoding=3}(Ht||(Ht={})),function(t){t.Internal=0,t.Public=1}(Nt||(Nt={}));var Ft,Dt,Bt,Wt,qt,Qt,Vt,zt,$t,Gt,Xt,Jt,Zt,Yt,tn,nn,rn,en,sn,on,un,an,cn,hn=["print","alert","confirm"];function fn(t){switch(t){case Ot.MOUSEDOWN:case Ot.MOUSEMOVE:case Ot.MOUSEMOVE_CURVE:case Ot.MOUSEUP:case Ot.TOUCHSTART:case Ot.TOUCHEND:case Ot.TOUCHMOVE:case Ot.TOUCHMOVE_CURVE:case Ot.TOUCHCANCEL:case Ot.CLICK:case Ot.SCROLL_LAYOUT:case Ot.SCROLL_LAYOUT_CURVE:case Ot.SCROLL_VISUAL_OFFSET:case Ot.SCROLL_VISUAL_OFFSET_CURVE:case Ot.NAVIGATE:return!0;}return!1}!function(t){t[t.Index=1]="Index",t[t.Cached=2]="Cached"}(Ft||(Ft={})),function(t){t.GrantConsent=!0,t.RevokeConsent=!1}(Dt||(Dt={})),function(t){t.Page=0,t.Document=1}(Bt||(Bt={})),function(t){t.Unknown=0,t.Api=1,t.FsShutdownFrame=2,t.Hibernation=3,t.Reidentify=4,t.SettingsBlocked=5,t.Size=6,t.Unload=7,t.Hidden=8}(Wt||(Wt={})),function(t){t.Unknown=0,t.NotEmpty=1,t.EmptyBody=2}(qt||(qt={})),function(t){t.Timing=0,t.Navigation=1,t.Resource=2,t.Paint=3,t.Mark=4,t.Measure=5,t.Memory=6,t.TimeOrigin=7,t.LayoutShift=8,t.FirstInput=9,t.LargestContentfulPaint=10,t.LongTask=11}(Qt||(Qt={})),function(t){t.Timing=["navigationStart","unloadEventStart","unloadEventEnd","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"],t.Navigation=["name","startTime","duration","initiatorType","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","unloadEventStart","unloadEventEnd","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd","type","redirectCount","decodedBodySize","encodedBodySize","transferSize"],t.Resource=["name","startTime","duration","initiatorType","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","decodedBodySize","encodedBodySize","transferSize"],t.Measure=["name","startTime","duration"],t.Memory=["jsHeapSizeLimit","totalJSHeapSize","usedJSHeapSize"],t.TimeOrigin=["timeOrigin"],t.LayoutShift=["startTime","value","hadRecentInput"],t.FirstInput=["name","startTime","duration","processingStart"],t.LargestContentfulPaint=["name","startTime","duration","renderTime","loadTime","size"]}(Vt||(Vt={})),function(t){t.Performance=0,t.PerformanceEntries=1,t.PerformanceMemory=2,t.Console=3,t.Ajax=4,t.PerformanceObserver=5,t.PerformanceTimeOrigin=7,t.WebAnimation=8,t.LayoutShift=9,t.FirstInput=10,t.LargestContentfulPaint=11,t.LongTask=12,t.HTMLDialogElement=13,t.CaptureOnStartEnabled=14,t.CanvasWatcherEnabled=15}(zt||(zt={})),function(t){t.Node=1,t.Sheet=2}($t||($t={})),function(t){t.StyleSheetHooks=0,t.SetPropertyHooks=1}(Gt||(Gt={})),function(t){t.Document="document",t.Event="evt",t.Page="page",t.User="user"}(Xt||(Xt={})),function(t){t.FsId="fsidentity",t.NewUid="newuid"}(Jt||(Jt={})),function(t){t.Elide=0,t.Record=1,t.Allowlist=2}(Zt||(Zt={})),function(t){t.Any=0,t.Exclude=1,t.Mask=2}(Yt||(Yt={})),function(t){t.Erase=0,t.MaskText=1,t.ScrubUrl=2,t.ScrubCss=3}(tn||(tn={})),function(t){t.Static=0,t.Prefix=1}(nn||(nn={})),function(t){t.SignalInvalid=0,t.SignalDeadClick=1,t.SignalRageClick=2}(rn||(rn={})),function(t){t.ReasonNoSuchOrg=1,t.ReasonOrgDisabled=2,t.ReasonOrgOverQuota=3,t.ReasonBlockedDomain=4,t.ReasonBlockedIp=5,t.ReasonBlockedUserAgent=6,t.ReasonBlockedGeo=7,t.ReasonBlockedTrafficRamping=8,t.ReasonInvalidURL=9,t.ReasonUserOptOut=10,t.ReasonInvalidRecScript=11,t.ReasonDeletingUser=12,t.ReasonNativeHookFailure=13}(en||(en={})),function(t){t.Unset=0,t.Exclude=1,t.Mask=2,t.Unmask=3,t.Watch=4,t.Keep=5,t.Defer=6}(sn||(sn={})),function(t){t.Unset=0,t.Click=1}(on||(on={})),function(t){t[t.Page=1]="Page",t[t.Bundle=2]="Bundle"}(un||(un={})),function(t){t[t.Error=3]="Error",t[t.Page=4]="Page",t[t.Bundle=5]="Bundle",t[t.Settings=6]="Settings"}(an||(an={})),function(t){t.MaxPerfMarksPerPage=16384,t.MaxLogsPerPage=1024,t.MaxUrlLength=2048,t.MutationProcessingInterval=250,t.CurveSamplingInterval=142,t.DefaultBundleUploadInterval=5e3,t.HeartbeatInitial=4e3,t.HeartbeatMax=256200,t.PageInactivityTimeout=18e5,t.BackoffMax=3e5,t.ScrollSampleInterval=t.MutationProcessingInterval/5,t.InactivityThreshold=4e3,t.MaxAjaxPayloadLength=16384,t.DefaultOrgSettings={MaxPerfMarksPerPage:t.MaxPerfMarksPerPage,MaxConsoleLogPerPage:t.MaxLogsPerPage,MaxAjaxPayloadLength:t.MaxAjaxPayloadLength,MaxUrlLength:t.MaxUrlLength,RecordPerformanceResourceImg:!0,RecordPerformanceResourceTiming:!0,HttpRequestHeadersAllowlist:[],HttpResponseHeadersAllowlist:[],UrlPrivacyConfig:[{Exclude:{Hash:[{Expression:"#.*"}],QueryParam:[{Expression:"(=)(.*)"}]}}],AttributeBlocklist:[{Target:Yt.Any,Tag:"*",Name:"",Type:nn.Prefix,Action:tn.Erase}]},t.DefaultStatsSettings={MaxPayloadLength:8192,MaxEventTypeLength:1024},t.BlockedFieldValue="__fs__redacted"}(cn||(cn={}));var vn,ln,dn,pn="_fs_uid",wn="_fs_cid",gn="_fs_lua";function mn(t,n,i,r){void 0!==i&&("function"==typeof t.addEventListener?t.addEventListener(n,i,r):"function"==typeof t.addListener&&t.addListener(i))}function yn(t,n,i,r){void 0!==i&&("function"==typeof t.removeEventListener?t.removeEventListener(n,i,r):"function"==typeof t.removeListener&&t.removeListener(i))}!function(t){t[t.Shutdown=1]="Shutdown",t[t.Starting=2]="Starting",t[t.Started=3]="Started"}(vn||(vn={})),function(t){t.Set=0,t.Function=1}(ln||(ln={})),function(t){t[t.Disabled=0]="Disabled",t[t.CaptureCanvasOps=1]="CaptureCanvasOps",t[t.ScreenshotCanvas=2]="ScreenshotCanvas"}(dn||(dn={}));var bn=function(){function t(){var t=this;this.T=[],this.C=[],this.P=!0,this.j=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t.P={capture:!0,passive:!0},t.j={capture:!1,passive:!0}}});window.addEventListener("test",J,n)}catch(t){}}return t.prototype.add=function(t,n,i,r,e){return void 0===e&&(e=!1),this.addCustom(t,n,i,r,e)},t.prototype.addCustom=function(t,n,i,r,e){void 0===e&&(e=!1);var s={target:t,type:n,fn:Tt.wrap(function(t){(e||!1!==t.isTrusted||"message"==n||t._fs_trust_event)&&r(t)}),options:i?this.P:this.j,index:this.T.length};return this.T.push(s),mn(t,n,s.fn,s.options),s},t.prototype.remove=function(t){t.target&&(yn(t.target,t.type,t.fn,t.options),t.target=null,t.fn=void 0)},t.prototype.clear=function(){for(var t=0;ti){n.Z||(n.Z=!0,Tt.sendToBugsnag("Out of time for remaining measurement tasks.","warning",{totalRunningTimeMs:a-t}));break t}}n.G=null}finally{n.X=!1,n.wnd}}}),this.wnd=t}return t.create=function(t){return t.ResizeObserver?new ai(t,t.ResizeObserver):new ci(t)},t.prototype.requestMeasureTask=function(t,n){var i,r=this;if(this.J>16)Tt.sendToBugsnag("Too much synchronous recursion in requestMeasureTask","error");else{var e=this.X?this.J:0,s=Tt.wrap(function(){var t=r.J;r.J=e+1;try{n()}finally{r.J=t}});this.G?this.G[t].push(s):(this.G=((i={})[ii.Essential]=[],i[ii.High]=[],i[ii.Medium]=[],i[ii.Low]=[],i[t]=[s],i),this.schedule())}},t.prototype.performMeasurementsNow=function(){this.performMeasurements()},t}(),ai=function(t){function n(n,i){var r=t.call(this,n)||this;return r.Y=i,r}return(0,e.__extends)(n,t),n.prototype.schedule=function(){var t=this,n=this.Y,i=this.wnd.document,r=i.documentElement||i.body||i.head,e=new n(function(){e.unobserve(r),t.performMeasurements()});e.observe(r)},n}(ui),ci=function(t){function n(n){return t.call(this,n)||this}return(0,e.__extends)(n,t),n.prototype.schedule=function(){(0,e.__awaiter)(void 0,void 0,Yn,function(){var t;return(0,e.__generator)(this,function(n){switch(n.label){case 0:return(t=o.requestWindowAnimationFrame)?[4,new Yn(function(n){return t(window,n)})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,ei()];case 3:return n.sent(),[2];}})}).then(this.performMeasurements)},n}(ui);function hi(t,n){return n&&t.pageLeft==n.pageLeft&&t.pageTop==n.pageTop}function fi(t,n){return n&&t.width==n.width&&t.height==n.height}function vi(t){return{pageLeft:t.pageLeft,pageTop:t.pageTop,width:t.width,height:t.height}}var li=[["@import\\s+\"","\""],["@import\\s+'","'"]].concat([["url\\(\\s*\"","\"\\s*\\)"],["url\\(\\s*'","'\\s*\\)"],["url\\(\\s*","\\s*\\)"]]),di=".*?"+/(?:[^\\](?:\\\\)*)/.source,pi=new RegExp(li.map(function(t){var n=t[0],i=t[1];return"("+n+")("+di+")("+i+")"}).join("|"),"g"),wi=/url\(["']?(.+?)["']?\)/g,gi=/^\s*\/\//;function mi(t){return"BackCompat"==t.compatMode}function yi(t){return t&&t.body&&t.documentElement?mi(t)?[t.body.clientWidth,t.body.clientHeight]:[t.documentElement.clientWidth,t.documentElement.clientHeight]:[0,0]}var bi=function(){function t(t,n){var i,r,e,s;this.hasKnownPosition=!1,this.pageLeft=0,this.pageTop=0,this.width=0,this.height=0,this.clientWidth=0,this.clientHeight=0;var o=t.document;if(o&&o.documentElement&&o.body){i=yi(o),this.clientWidth=i[0],this.clientHeight=i[1];var u=t.visualViewport;if(u){this.hasKnownPosition=!0,this.pageTop=u.pageTop-u.offsetTop,this.pageLeft=u.pageLeft-u.offsetLeft,0==this.pageTop&&(this.pageTop=0),0==this.pageLeft&&(this.pageLeft=0);var a=null!==(e=xi(t,"innerWidth"))&&void 0!==e?e:0,c=null!==(s=xi(t,"innerHeight"))&&void 0!==s?s:0;if(a>0&&c>0)return this.width=a,void(this.height=c)}if(void 0!==n&&this.clientWidth==n.clientWidth&&this.clientHeight==n.clientHeight&&n.width>0&&n.height>0)return this.width=n.width,void(this.height=n.height);r=this.tt(t),this.width=r[0],this.height=r[1]}}return t.prototype.tt=function(t){var n=this.it(t,"width",this.clientWidth,this.clientWidth+128);void 0===n&&(n=xi(t,"innerWidth")),void 0===n&&(n=this.clientWidth);var i=this.it(t,"height",this.clientHeight,this.clientHeight+128);return void 0===i&&(i=xi(t,"innerHeight")),void 0===i&&(i=this.clientHeight),[n,i]},t.prototype.it=function(t,n,i,r){if(o.matchMedia){var e=i,s=r,u=o.matchMedia(t,"(min-"+n+": "+e+"px)");if(null!=u){if(u.matches&&o.matchMedia(t,"(max-"+n+": "+e+"px)").matches)return e;for(;e<=s;){var a=o.mathFloor((e+s)/2);if(o.matchMedia(t,"(min-"+n+": "+a+"px)").matches){if(o.matchMedia(t,"(max-"+n+": "+a+"px)").matches)return a;e=a+1}else s=a-1}}}},t}();function Ei(t,n){return new bi(t,n)}var Si=function(t,n){this.offsetLeft=0,this.offsetTop=0,this.pageLeft=0,this.pageTop=0,this.width=0,this.height=0,this.scale=0;var i=t.document;if(i.body){"pageXOffset"in t?(this.pageLeft=t.pageXOffset,this.pageTop=t.pageYOffset):i.scrollingElement?(this.pageLeft=i.scrollingElement.scrollLeft,this.pageTop=i.scrollingElement.scrollTop):mi(i)?(this.pageLeft=i.body.scrollLeft,this.pageTop=i.body.scrollTop):i.documentElement&&(i.documentElement.scrollLeft>0||i.documentElement.scrollTop>0)?(this.pageLeft=i.documentElement.scrollLeft,this.pageTop=i.documentElement.scrollTop):(this.pageLeft=i.body.scrollLeft||0,this.pageTop=i.body.scrollTop||0),this.offsetLeft=this.pageLeft-n.pageLeft,this.offsetTop=this.pageTop-n.pageTop;var r=0,e=0;try{r=t.innerWidth,e=t.innerHeight}catch(t){return}if(0!=r&&0!=e){this.scale=n.width/r,this.scale<1&&(this.scale=1);var s=n.width-n.clientWidth,o=n.height-n.clientHeight;this.width=r-s/this.scale,this.height=e-o/this.scale}}};function xi(t,n){try{return t[n]}catch(t){return}}function ki(t){var n=t;return n.tagName?"object"==typeof n.tagName?"form":n.tagName.toLowerCase():null}var _i,Ai,Ii=new RegExp("[^\\s]"),Ti=new RegExp("[\\s]*$");function Ci(t){var n=Ii.exec(t);if(!n)return t;for(var i=n.index,r=(n=Ti.exec(t))?t.length-n.index:0,e="\uFFFF",s=t.slice(i,t.length-r).split(/\r\n?|\n/g),o=0;o0&&n.length<1e4;){var i=n.pop();delete Mi[i.id],i.node._fs==i.id&&(i.node._fs=0),i.id=0,i.next&&n.push(i.next),i.child&&n.push(i.child)}jt(n.length<1e4,"clearIds is fast")}function Qi(t,n){void 0===n&&(n=1024);try{var i={tokens:[],opath:[],cyclic:Vi(t,n/4)};return $i(t,n,0,i),i.tokens.join("")}catch(t){return lt(t)}}function Vi(t,n){var i=0;try{o.jsonStringify(t,function(t,r){if(i++>n)throw"break";if("object"==typeof r)return r})}catch(t){return"break"!=t}return!1}var zi=function(t,n,i){return void 0===i&&(i="..."),t.length<=n?t:t.length<=i.length||n<=i.length?t.substring(0,n):t.substring(0,n-i.length)+i};function $i(t,n,i,r){if(n<1)return 0;var e=function(t){switch(!0){case function(t){return!(!t||t.constructor!=Date)}(t):return n=t,isNaN(n)?"Invalid Date":n.toUTCString();case function(t){return"object"==typeof Node?t instanceof Node:t&&"object"==typeof t&&t.nodeType>0&&"string"==typeof t.nodeName}(t):return function(t){return t.toString()}(t);case void 0===t:return"undefined";case"object"!=typeof t||null==t:return t;case t instanceof Error:return[t.toString(),t.stack].filter(Boolean).join(",");}var n}(t);if(void 0!==e){var s=function(t,n){var i=o.jsonStringify(t);return i&&"\""==i[0]?zi(i,n,"...\""):i}(e,n);return"string"==typeof s&&s.length<=n?(r.tokens.push(s),s.length):0}if(r.cyclic){r.opath.splice(i);var u=r.opath.lastIndexOf(t);if(u>-1){var a="";return a="\""+zi(a,n-2)+"\"",r.tokens.push(a),a.length}r.opath.push(t)}var c=n,h=function(t){return c>=t.length&&(c-=t.length,r.tokens.push(t),!0)},f=function(t){var n=r.tokens.length-1;","===r.tokens[n]?r.tokens[n]=t:h(t)};if(c<2)return 0;if(tt(t)){h("[");for(var v=0;v0;v++){var l=$i(t[v],c-1,i+1,r);if(c-=l,0==l&&!h("null"))break;h(",")}f("]")}else{h("{");var d=nt(t);for(v=0;v0;v++){var p=d[v],w=t[p];if(!h("\""+p+"\":"))break;if(0==(l=$i(w,c-1,i+1,r))){r.tokens.pop();break}c-=l,h(",")}f("}")}return n==1/0?1:n-c}var Gi,Xi,Ji=function(){function t(){var n=this;this.rt=Tt.wrap(function(){n.unregister(),n.et&&n.et()}),this.st=0,this.ot=t.ut++}return t.ct=function(){t.checkedAlready=!1,t.ht=0},t.checkForBrokenSchedulers=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){var n,i;return(0,e.__generator)(this,function(r){switch(r.label){case 0:return!o.requestWindowAnimationFrame||t.checkedAlready||(n=p())-t.ht<100?[2,!1]:(t.ht=n,t.checkedAlready=!0,[4,new Yn(function(t){return o.requestWindowAnimationFrame(window,t)})]);case 1:return r.sent(),i=[],rt(t.ft,function(t){var r=t.vt(n);r&&i.push(r)}),[4,Yn.all(i)];case 2:return r.sent(),o.requestWindowAnimationFrame(window,Tt.wrap(function(){t.checkedAlready=!1})),[2,!0];}})})},t.stopAll=function(){rt(this.ft,function(t){return t.stop()})},t.prototype.setTick=function(t){this.et=t},t.prototype.stop=function(){this.cancel(),delete t.ft[this.ot]},t.prototype.register=function(n){this.st=p()+100+1.5*n,t.ft[this.ot]=this},t.prototype.timerIsRunning=function(){return null!=t.ft[this.ot]},t.prototype.unregister=function(){delete t.ft[this.ot]},t.prototype.vt=function(t){if(t>this.st)return Yn.resolve().then(this.rt)["catch"](function(){})},t.ft={},t.ut=0,t.checkedAlready=!1,t.ht=0,t}(),Zi=function(t){function n(n){var i=t.call(this)||this;return i.lt=n,i.dt=-1,i}return(0,e.__extends)(n,t),n.prototype.start=function(t){var n=this;-1==this.dt&&(this.setTick(function(){t(),n.register(n.lt)}),this.dt=o.setWindowInterval(window,this.rt,this.lt),this.register(this.lt))},n.prototype.cancel=function(){-1!=this.dt&&(o.clearWindowInterval(window,this.dt),this.dt=-1,this.setTick(function(){}))},n}(Ji),Yi=function(t){function n(n,i,r){void 0===i&&(i=0);for(var e=[],s=3;sn&&(this.St=t-n,this.St>1e3&&this.kt("timekeeper set with future ts"))},t.prototype.kt=function(t){Qi({msg:t,skew:this.St,startTime:this.xt,wallTime:this.wallTime()},1024)},t}(),ir=function(){function t(t,n){this._t=t,this.At=n,this.It=!1,this.Tt={},this.Ct={},this.Pt={},this.jt=!1,this.Ot=!1,Gi=this,this.Mt=t.window.document}return t.prototype.start=function(){var t;(t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))&&t.set&&(rr||(yt(HTMLInputElement,"value",ar),yt(HTMLInputElement,"checked",ar),yt(HTMLSelectElement,"value",ar),yt(HTMLTextAreaElement,"value",ar),yt(HTMLSelectElement,"selectedIndex",ar),yt(HTMLOptionElement,"selected",ar),rr=!0),1)||(this.It=!0)},t.prototype.hookInstance=function(t){if("input"===ki(t))switch(t.type){case"checkbox":case"radio":bt(t,"checked",ar);break;default:bt(t,"value",ar);}},t.prototype.addInput=function(t){if(t){var n=Bi(t);if(n){"input"===ki(t)&&this.Kt(t);var i=!1;if(function(t){switch(t.type){case"checkbox":case"radio":return t.checked!=t.hasAttribute("checked");default:return(t.value||"")!=function(t){if("select"!=ki(t))return t.getAttribute("value")||"";var n=t,i=n.querySelector("option[selected]")||n.querySelector("option");return i&&i.value||""}(t);}}(t)&&(this.Rt(t),i=!0),this.It&&(this.Tt[n]={elem:t}),!i)if(hr(t)){var r=or(t);t.checked&&(this.Pt[r]=n)}else this.Ct[n]=cr(t)}}},t.prototype.Kt=function(t){if(this.jt)this.Ot&&this.hookInstance(t);else{var n="checkbox"===t.type||"radio"===t.type?"checked":"value",i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,n),r=Object.getOwnPropertyDescriptor(t,n);i&&r&&i!==r&&(this.Ot=!0,this.hookInstance(t)),this.jt=!0}},t.prototype.diffValue=function(t,n){void 0===n&&(n=cr(t));var i=Bi(t);if(!t||!i)return!1;if(hr(t)){var r=or(t);return this.Pt[r]===i!=("true"===n)}return this.Ct[i]!==n},t.prototype.onChange=function(t,n,i){void 0===i&&(i=cr(t));var r=Bi(t);t&&r&&(n||this.diffValue(t,i))&&this.Rt(t,n)},t.prototype.onKeyboardChange=function(t){var n,i=function(t){for(var n=t.activeElement;n&&n.shadowRoot;){var i=n.shadowRoot.activeElement;if(!i)return n;n=i}return n}(this.Mt);i&&("value"in(n=i)||"checked"in n)&&!Hi(i)&&this.diffValue(i)&&this.Rt(i,t)},t.prototype.tick=function(){for(var t in this.Tt){var n=this.Tt[t],i=n.elem;if(Bi(i))try{delete this.Tt[t];var r=cr(i);if(this.diffValue(i,r))this.Rt(i);else if(n.noFsIdInOption){var e=i;Array.prototype.slice.call(e.options).every(function(t){return Bi(t)})&&(n.noFsIdInOption=!1,this.Rt(i))}}finally{this.It&&(this.Tt[t]=n)}else delete this.Tt[t],delete this.Ct[t],hr(i)&&delete this.Pt[or(i)]}},t.prototype.stop=function(){Gi=void 0},t.prototype.Rt=function(t,n){var i=this;void 0===n&&(n=!1);var r=Bi(t);if(t&&r&&!this.Ht(r,t)){var e=cr(t);if(hr(t)){var s=or(t);"false"===e&&this.Pt[s]===r?delete this.Pt[s]:"true"===e&&(this.Pt[s]=r)}else this.Ct[r]=e;this._t.measurer.requestMeasureTask(ii.Medium,function(){var s=t.getBoundingClientRect(),o=s.width>0&&s.height>0,u=Ni(t)?Ci(e):e;i.At.enqueue({Kind:Ot.VALUECHANGE,Args:[r,u,n,o]})})}},t.prototype.Ht=function(t,n){if(this.Tt[t])return!0;if("select"!==ki(n))return!1;for(var i=n.options,r=0;r-1||wr.indexOf("Trident/")>-1,mr=(gr&&wr.indexOf("Trident/5"),gr&&wr.indexOf("Trident/6"),gr&&wr.indexOf("rv:11")>-1),yr=wr.indexOf("Edge/")>-1,br=(wr.indexOf("CriOS"),wr.indexOf("Snapchat")>-1),Er=/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);function Sr(){var t=window.navigator.userAgent.match(/Version\/(\d+)/);return t&&t[1]?parseInt(t[1],10):-1}function xr(t){if(!Er)return!1;var n=Sr();return n>=0&&n===t}function kr(t){if(!Er)return!1;var n=Sr();return n>=0&&nne?(Tt.sendToBugsnag("Ignoring huge text node","warning",{length:s}),""):t.parentNode&&"style"==ki(t.parentNode)?r:e.mask?Ci(r):r}function re(t){return Kr[t]||t.toLowerCase()}var ee=/^\s*((prefetch|preload|prerender)\s*)+$/i,se=/^\s*.*((worklet|script|worker|font|fetch)\s*)+$/i;function oe(t,n,i,r,e){var s,u;if(void 0===r&&(r=ki(t)),void 0===e&&(e=Ui(t)),null===r||""===n)return null;if("link"===r&&ee.test(null!==(s=t.getAttribute("rel"))&&void 0!==s?s:"")&&!se.test(null!==(u=t.getAttribute("as"))&&void 0!==u?u:""))return null;var a,c="style"===n?ae(i):i,h=function(t,n,i){var r,e,s,u,a,c,h,f,v,l,d,p,w,g=void 0;(null===(r=null==n?void 0:n.watchKind)||void 0===r?void 0:r.has(_i.Exclude))?g=Yt.Exclude:(null==n?void 0:n.mask)&&(g=Yt.Mask);var m=[null===(u=null===(s=null===(e=Ee.blocklist[Yt.Any])||void 0===e?void 0:e[t])||void 0===s?void 0:s["static"])||void 0===u?void 0:u[i],null===(h=null===(c=null===(a=Ee.blocklist[Yt.Any])||void 0===a?void 0:a["*"])||void 0===c?void 0:c["static"])||void 0===h?void 0:h[i],g?null===(l=null===(v=null===(f=Ee.blocklist[g])||void 0===f?void 0:f[t])||void 0===v?void 0:v["static"])||void 0===l?void 0:l[i]:void 0,g?null===(w=null===(p=null===(d=Ee.blocklist[g])||void 0===d?void 0:d["*"])||void 0===p?void 0:p["static"])||void 0===w?void 0:w[i]:void 0];return Ee.hasPrefix&&m.push(ke(Yt.Any,t,i),ke(Yt.Any,"*",i),g?ke(g,t,i):void 0,g?ke(g,"*",i):void 0),function(t){var n=t.filter(function(t){return void 0!==t});if(0!==n.length)return o.mathMin.apply(o,n)}(m)}(r,e,n);if(void 0===h&&!e)return null;switch(h){case void 0:return c;case tn.Erase:return null;case tn.MaskText:return Ci(c);case tn.ScrubCss:return a=function(t,n,i){return""+t+Se+i},c.replace(pi,function(t){for(var n=[],i=1;i-1)return f.substring(v)}return f;default:return(0,Ir.nt)(h);}}var ue={},ae=function(t,n){void 0===n&&(n=window);try{var i=n.location,r=""+i.origin+i.pathname+i.search,e=ue[r];return e?e.lastIndex=0:(e=new RegExp((s=r,($r.test(s)?s.replace(zr,"\\$&"):s)+"/?(#)"),"g"),ue[r]=e),t.replace(e,"https://fs-currenturl.invalid$1")}catch(n){return Ut("cleanCSS",n),t}var s},ce=/^data:/i;function he(t,n){if(ce.test(t))return t;switch(n.source){case"dom":switch(i=n.type){case"frame":case"iframe":return we(t);default:return fe(t);}case"event":switch(i=n.type){case Ot.AJAX_REQUEST:case Ot.NAVIGATE:return fe(t);case Ot.SET_FRAME_BASE:return we(t);default:return(0,Ir.nt)(i);}case"log":return we(t);case"page":var i;switch(i=n.type){case"base":return we(t);case"referrer":case"url":return fe(t);default:return(0,Ir.nt)(i);}case"perfEntry":switch(n.type){case"frame":case"iframe":case"navigation":case"other":return we(t);default:return fe(t);}default:return(0,Ir.nt)(n);}}function fe(t){return ge(de,t)}var ve=cn.DefaultOrgSettings.MaxUrlLength,le=Rr(cn.DefaultOrgSettings.UrlPrivacyConfig),de=Rr(cn.DefaultOrgSettings.UrlPrivacyConfig);function pe(t,n){le=Rr(cn.DefaultOrgSettings.UrlPrivacyConfig.concat(t)),de=Rr(t),ve=n||cn.DefaultOrgSettings.MaxUrlLength}function we(t){return ge(le,t)}function ge(t,n){return function(t,n,i){void 0===i&&(i=Lr);for(var r={Hash:[],Host:[],Path:[],QueryParam:[],Query:[]},e=0,s=t;e").replace(ye,function(t){return he(t,{source:"log",type:"debug"})})}var Ee,Se="https://fs-excluded.invalid";function xe(t){var n,i,r,e,s,o,u,a,c,h,f,v,l,d,p,w;try{for(var g=(Ee={blocklist:{},hasPrefix:!1}).blocklist,m=(null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0)>0?t:cn.DefaultOrgSettings.AttributeBlocklist,y={},b=0,E=m;b-1;var n}var Te="#polyfillshadow";function Ce(t){var n;return(null===(n=t.childNodes)||void 0===n?void 0:n.length)>0}function Pe(t,n){Oe(t.childNodes,n)}function je(t,n){Oe(t.childNodes,n,!0)}function Oe(t,n,i){void 0===i&&(i=!1);for(var r=i?t.length-1:0,e=i?-1:t.length;r!==e;){var s=t[r];s&&"frag"in s&&!St(s)&&Array.isArray(s.frag)?s.frag.length&&Oe(s.childNodes,n,i):n(s),i?--r:++r}}var Me={INPUT:!0,TEXTAREA:!0,NOSCRIPT:!0},Ke=function(){function t(t,n,i){this.Xt=t,this.Jt=n,this.Zt=i,Mi={},Ki=1}return t.prototype.tokenizeNode=function(t,n,i,r,e,s,o){var u=this,a=Ui(n),c=Ui(i),h=[];return function(n){var i=Ki;try{return u.Yt(t,a,c,r,h,e,s,o),!0}catch(t){return Ki=i,!1}}()||(h=[]),h},t.prototype.Yt=function(t,n,i,r,s,o,u,a){for(var c,h,f=[{parentMirror:n,nextMirror:i,node:r}],v=function(t,n){return function(i){i&&t.push({parentMirror:n,nextMirror:null,node:i})}};f.length;){var l=f.pop();if(l)if("string"!=typeof l){var d=l.node,p=ki(d),w=this.tn(t,p,l,s,o,u);if(null!=w&&!(null===(c=w.watchKind)||void 0===c?void 0:c.has(_i.Exclude))){var g=1===d.nodeType?d.shadowRoot:null,m=w.shadowRootType===Te&&window.HTMLSlotElement&&"slot"===p&&d.assignedNodes();if(g||m||Ce(d))if(null===(h=w.watchKind)||void 0===h?void 0:h.has(_i.Defer))a(w.node,Ai.Deferred);else{if(f.push("]"),je(d,v(f,w)),g)f.push({parentMirror:w,nextMirror:null,node:g});else if(m&&m.length>0){for(var y=[],b=!1,E=0,S=m;E1e3)return null;if(!i||1!=i.nodeType)return null;var r=i;if(getComputedStyle(r).display.indexOf("inline")<0)return r;i=i.parentNode}},n}(Ze),ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.observe=function(t){var n=this;if(t&&1==t.nodeType){var i=t;this.Tn(Ui(t)),this._t.measurer.requestMeasureTask(ii.Medium,function(){n.addEntry(i)})}},n.prototype.unobserveSubtree=function(t){var n=Ui(t);n&&this.Cn(n)},n.prototype.nodeChanged=function(t){var n=this,i=this.Pn(t);this._t.measurer.requestMeasureTask(ii.Medium,function(){for(var t=0,r=i;t0||this.Hn.length>0){var r={},s={};for(var o in (this.Gn(t,i,s,r), s)){var u=o.split("\t");i.push({Kind:Ot.MUT_ATTR,Args:[parseInt(u[0],10),u[1],s[o]],When:t})}for(var o in r)i.push({Kind:Ot.MUT_TEXT,Args:[parseInt(o,10),r[o]],When:t})}var a=this.Rn;this.Rn=[];for(var c=0;c0&&(i.push({Kind:Ot.DEFERRED_RESOLVED,Args:(0,e.__spreadArray)([],this.Ln),When:t}),this.Ln=[]),this.Nn.length>0){for(var f=0,v=this.Nn;f0&&this.Un.push(es(l))}this.Nn=[]}return i},t.prototype.recordingIsDetached=function(){return!!this.Wn&&this.Wn!=this.Dn.document},t.prototype.$n=function(t,n){if(!this.Kn&&this.Wn){window;var i=this.Xt.allWatchedElements(this.Wn);this.Zn(i,t,n,null,this.Wn,null),this.Jt.nodeChanged(this.Wn),this.qn&&this.Xn(this.Wn),this.Kn=!0,this.Yn(),window}},t.prototype.Yn=function(){var t=this;this.zn=mt(Element.prototype,"attachShadow",!0),this.zn&&this.zn.before(function(n){n.that.shadowRoot||t.Rn.push(n.that)})},t.prototype.Xn=function(t){var n;try{null===(n=this.qn)||void 0===n||n.observe(t,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!0,characterDataOldValue:!0})}catch(t){}},t.prototype.Gn=function(t,n,i,r){for(var e,s,o,u,a=this,c={},h={},f=function(i){if(Ui(i)){a.ti(t,n,Ui(i));var r=Ui(i.parentNode);r&&(h[r.id]=r.node)}},v=0;v0)for(var m=0;m0){h[g]=l.target;var y=!(null==(T=l.target)?void 0:T.shadowRoot)||Ie(T.shadowRoot)?null:Ui(T.shadowRoot);y&&(h[y.id]=y.node)}break;case"characterData":Hi(l.target)||l.oldValue!=l.target.textContent&&(r[g]=ie(l.target));break;case"attributes":var b=ki(j=l.target);if("link"===b&&"rel"===l.attributeName&&ee.test(null!==(o=l.oldValue)&&void 0!==o?o:"")){f(j);break}var E,S=Li(j),x=this.Xt.isWatched(j);if($e(x)>$e(S)){f(j);break}De.needsToObserve(S,x)&&(this.Jt.observe(j),(null==x?void 0:x.has(_i.Watch))&&(null===(u=this.Zt)||void 0===u||u.observe(j)),(E=Ui(j))&&(E.watchKind=De.combineKindsPreservePrivacy(S,x)));var k=(void 0===(I=l.attributeNamespace)&&(I=""),(null===I?"":{"http://www.w3.org/1999/xlink":"xlink:","http://www.w3.org/XML/1998/namespace":"xml:","http://www.w3.org/2000/xmlns/":"xmlns:"}[I]||"")+(l.attributeName||"")),_=re(k);if("dialog"===b&&"open"===k)break;if(j.hasAttribute(k)){var A=l.target.getAttribute(k);l.oldValue!=A&&(A=oe(l.target,_,A||"",b),this.Mn(b,l.target,((e={})[_]=A||"",e)),null!==A&&(i[g+"\t"+_]=A))}else i[g+"\t"+_]=null;}}catch(t){}for(var I,T,C=0,P=this.Hn;C0&&i.push({Kind:Ot.MUT_SHADOW,Args:[s,u],When:n},{Kind:Ot.TIMING,Args:[[Nt.Internal,Kt.Serialization,Ht.NodeEncoding,n,a]],When:n})},t.prototype.Zn=function(t,n,i,r,e,s){var o=Di(r)||-1,u=Di(s)||-1,a=-1===o&&-1===u,c=p();window;var h=this.ei(t,r,e,s);window;var f=p()-c;h.length>0&&i.push({Kind:Ot.MUT_INSERT,Args:[o,u,h],When:n},{Kind:Ot.TIMING,Args:[[Nt.Internal,Kt.Serialization,a?Ht.DomSnapshot:Ht.NodeEncoding,n,f]],When:n})},t.prototype.ei=function(t,n,i,r){var e=this;if(n&&Hi(n))return[];for(var s=[],o=this.Bn.tokenizeNode(t,n,r,i,function(t){if(1==t.nodeType){var n=t;if(n.shadowRoot&&e.Xn(n.shadowRoot),"SLOT"===t.nodeName){var i=Ui(t);(null==i?void 0:i.shadowRootType)===Te&&t.addEventListener("slotchange",Tt.wrap(function(n){var i;e.Hn.push(null!==(i=n.target)&&void 0!==i?i:t)}))}}e.jn(t,s)},this.Mn,function(t,n){switch(n){case Ai.Immediate:e.refreshElement(t);break;case Ai.Deferred:e.Nn.push(t);}}),u=0,a=s;u0){var e=n[n.length-1];if(e.Kind==Ot.MUT_REMOVE)return void e.Args.push(r)}n.push({Kind:Ot.MUT_REMOVE,Args:[r],When:t})},t.prototype.setUpIEWorkarounds=function(){var n=this;if(mr){var i=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"),r=i&&i.set;if(!i||!r)throw new Error("Missing textContent setter -- not safe to record mutations.");Object.defineProperty(Element.prototype,"textContent",(0,e.__assign)((0,e.__assign)({},i),{set:function(t){try{for(var n=void 0;n=this.firstChild;)this.removeChild(n);if(null===t||""==t)return;var i=(this.ownerDocument||document).createTextNode(t);this.appendChild(i)}catch(n){r&&r.call(this,t)}}}))}this.si=new tr(t.ThrottleMax,t.ThrottleInterval,function(){return new Yi(function(){n.Fn=!0,n.tearDownIEWorkarounds()}).start()});var s=this.si.guard(function(t){var n=t.cssText;t.cssText=n});this.si.open(),this.oi=mt(CSSStyleDeclaration.prototype,"setProperty"),this.oi&&this.oi.afterSync(function(t){s(t.that)}),this.ui=mt(CSSStyleDeclaration.prototype,"removeProperty"),this.ui&&this.ui.afterSync(function(t){s(t.that)})},t.prototype.tearDownIEWorkarounds=function(){this.si&&this.si.close(),this.oi&&this.oi.disable(),this.ui&&this.ui.disable()},t.prototype.updateConsent=function(){var t=this;this.Wn&&Pe(this.Wn,function(n){return t.refreshElement(n)})},t.prototype.refreshElement=function(t){Di(t)&&this.Hn.push(t)},t.ThrottleMax=1024,t.ThrottleInterval=1e4,t;}();function os(t){for(var n=new WeakMap,i=t;i;i=i.parentNode){if(n.has(i))return null;if(n.set(i,!0),11===i.nodeType)break}if(!i)return null;var r=Ui(i);return(null==r?void 0:r.shadowRootType)===Te&&(null==r?void 0:r.parent)?[r.parent.id,r.parent.node]:null}var us="navigation",as="resource",cs="paint",hs="measure",fs="mark",vs="layout-shift",ls="first-input",ds="largest-contentful-paint",ps="longtask",ws=function(){function t(t,n,i,r){var e=this;this._t=t,this.At=n,this.ai=r,this.ci=!1,this.hi=!1,this.fi=!1,this.vi=!1,this.li=!1,this.di=!1,this.pi=!1,this.wi=cn.DefaultOrgSettings.MaxPerfMarksPerPage,this.gi=0,this.mi=!1,this.yi=!1,this.bi=!1,this.Ei=!1,this.Si=0,this.xi=!1,this.qn=null,this.ki=[],this._i=new Yn(function(t){e.Ai=function(){t({timeRemaining:function(){return Number.POSITIVE_INFINITY},didTimeout:!1}),e.Ai=void 0}}),this.Ii=!1;var s=window.performance;s&&(this.fi=!0,s.timing&&(this.vi=!0),s.memory&&(this.di=!0),s.timeOrigin&&(this.pi=!0),"function"==typeof s.getEntries&&(this.li=!0),this.mi=gs(window,vs),this.yi=gs(window,ls),this.bi=gs(window,ds),this.Ei=gs(window,ps),this.T=i.createChild())}return t.prototype.initialize=function(t){var n=t.resourceUploader,i=t.recTimings,r=t.recImgs,e=t.maxPerfMarksPerPage;this.Ti=n,this.hi=i,this.ci=r,this.wi=e||cn.DefaultOrgSettings.MaxPerfMarksPerPage},t.prototype.start=function(){var t=this;this.gi=0;var n=window.performance;n&&(this._t.recording.inFrame||this.At.enqueue({Kind:Ot.REC_FEAT_SUPPORTED,Args:[zt.Performance,this.vi,zt.PerformanceEntries,this.li,zt.PerformanceMemory,this.di,zt.PerformanceObserver,!!window.PerformanceObserver,zt.PerformanceTimeOrigin,this.pi,zt.LayoutShift,this.mi,zt.FirstInput,this.yi,zt.LargestContentfulPaint,this.bi,zt.LongTask,this.Ei]}),this.Xn(),!this.qn&&n.addEventListener&&n.removeEventListener&&this.T&&this.T.add(n,"resourcetimingbufferfull",!0,function(){t.At.enqueue({Kind:Ot.RESOURCE_TIMING_BUFFER_FULL,Args:[]})}),this.Ci(),this.Pi())},t.prototype.ji=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:if(!this.fi||!this.li||0==this.ki.length)return[2];if(this.Ii)return[2];this.Ii=!0,t.label=1;case 1:return t.trys.push([1,,3,4]),[4,this.Oi()];case 2:return t.sent(),[3,4];case 3:return this.Ii=!1,this.ki=[],[7];case 4:return[2];}})})},t.prototype.Mi=function(){return this.Ai?Yn.race([this._i,si(250,1e3)]):this._i},t.prototype.Oi=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){var t,n,i,r,s,o,u,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:t=0,n=0,i=this.ki,e.label=1;case 1:if(!(nt?[4,this.Mi()]:[3,4]):[3,6];case 3:a=e.sent(),t=p()+Math.max(a.timeRemaining(),15),e.label=4;case 4:this.Ki(u),e.label=5;case 5:return s++,[3,2];case 6:return n++,[3,1];case 7:return[2];}})})},t.prototype.onLoad=function(){this.xi||(this.xi=!0,this.vi&&(this.Ri(performance.timing),this.ji()))},t.prototype.tick=function(){this.Ci()},t.prototype.stop=function(){var t;this.T&&this.T.clear(),this.Ti=void 0;var n=[];this.qn?(this.qn.takeRecords&&(n=this.qn.takeRecords()),this.qn.disconnect()):window.performance&&window.performance.getEntries&&(n=window.performance.getEntries()),n.length>300&&(n=n.slice(0,300),this.At.enqueue({Kind:Ot.RESOURCE_TIMING_BUFFER_FULL,Args:[]})),this.Ci(),null===(t=this.Ai)||void 0===t||t.call(this),this.ki.push(n),this.ji()},t.prototype.Xn=function(){var t=this;if(!this.qn&&this.li&&window.PerformanceObserver){this.ki.push(performance.getEntries()),this.ji(),this.qn=new window.PerformanceObserver(function(n){var i=n.getEntries();t.ki.push(i),t.ji()});var n=[us,as,hs,fs];window.PerformancePaintTiming&&n.push(cs),this.mi&&n.push(vs),this.yi&&n.push(ls),this.bi&&n.push(ds),this.Ei&&n.push(ps),this.qn.observe({entryTypes:n})}},t.prototype.Ci=function(){if(this.di&&!this._t.recording.inFrame){var t=performance.memory;if(t){var n=t.usedJSHeapSize-this.Si;(0==this.Si||o.mathAbs(n/this.Si)>.2)&&(this.Hi(Qt.Memory,t,Vt.Memory),this.Si=t.usedJSHeapSize)}}},t.prototype.Pi=function(){var t={timeOrigin:d.timeOrigin};this.Hi(Qt.TimeOrigin,t,Vt.TimeOrigin)},t.prototype.Ki=function(t){switch(t.entryType){case us:this.Ni(t);break;case as:this.Li(t);break;case cs:this.Ui(t);break;case hs:this.Fi(t);break;case fs:this.Di(t);break;case vs:this.Bi(t);break;case ls:this.Wi(t);break;case ds:this.qi(t);break;case ps:this.Qi(t);}},t.prototype.Ri=function(t){this.Hi(Qt.Timing,t,Vt.Timing)},t.prototype.Ni=function(t){this.Hi(Qt.Navigation,t,Vt.Navigation,{name:us})},t.prototype.Li=function(t){if(this.hi){var n=t.initiatorType;(this.ci||"img"!==n&&"image"!==n)&&this.Hi(Qt.Resource,t,Vt.Resource,{name:n})}},t.prototype.Ui=function(t){this.Hi(Qt.Paint,t,Vt.Measure)},t.prototype.Di=function(t){this.Hi(Qt.Mark,t,Vt.Measure)},t.prototype.Fi=function(t){this.Hi(Qt.Measure,t,Vt.Measure)},t.prototype.Bi=function(t){this.Hi(Qt.LayoutShift,t,Vt.LayoutShift)},t.prototype.Wi=function(t){this.Hi(Qt.FirstInput,t,Vt.FirstInput)},t.prototype.qi=function(t){this.Hi(Qt.LargestContentfulPaint,t,Vt.LargestContentfulPaint)},t.prototype.Qi=function(t){this.Hi(Qt.LongTask,t,Vt.Measure)},t.prototype.Hi=function(t,n,i,r){if(void 0===r&&(r={}),!this.atLimit(t)){for(var e=[t],s=0,o=i;s=this.wi)return!0;this.gi++;}return!1},t}();function gs(t,n){var i,r;return(null!==(r=null===(i=t.PerformanceObserver)||void 0===i?void 0:i.supportedEntryTypes)&&void 0!==r?r:[]).indexOf(n)>-1}function ms(t){var n=0,i={id:n++,edges:{}};return t.split("\n").forEach(function(t){var r=t.trim();if(""!=r){if(0==r.indexOf("/")||r.lastIndexOf("/")==r.length-1)throw new Error("Leading and trailing slashes are not supported");var e=i,s=r.split("/");s.forEach(function(t,i){var r=t.trim();if(""===r)throw new Error("Empty elements are not allowed");if("**"!=r&&"*"!=r&&-1!=r.indexOf("*"))throw new Error("Embedded wildcards are not supported");var o=null;r in e.edges&&(o=e.edges[r]),o||(o={id:n++,edges:{}},e.edges[r]=o),i==s.length-1&&(o.term=!0),e=o})}}),i}var ys=ms("**");function bs(t,n,i){if(!js(i)){try{for(var r=[],e=0,s=i;e=n&&(v?e=void 0:(e="_fs_trimmed_values",v=!0)),f[f.length-1]--,e&&e!==cn.BlockedFieldValue&&s?f.push(o.objectKeys(e).length):c.pop();f[f.length-1]<=0;)f.pop(),c.pop();for(var u=0,a=r;u0&&l!==f.length-1)throw new Error("Property matcher depth out of sync")}return e})}catch(t){Tt.sendToBugsnag(t,"error")}return"[error serializing "+t.constructor.name+"]"}}var Es=function(){function t(t){this.zi=1;var n=[t];t.edges["**"]&&n.push(t.edges["**"]),this.$i=[n]}return t.prototype.Gi=function(){if(this.$i.length<=0)return[];var t=this.$i.length-1,n=this.$i[t];return"number"==typeof n?this.$i[t-1]:n},t.prototype.depth=function(){return this.zi},t.prototype.isRedacted=function(t){var n=this.Gi();return 0===n.length||t&&!n.some(function(t){return t.term})},t.prototype.push=function(t){var n;this.zi++;var i=this.Gi(),r=[];function e(n){n.edges["**"]&&(r.push(n.edges["**"],Ss(n)),e(n.edges["**"])),n.edges["*"]&&r.push(n.edges["*"]),n.edges[t]&&r.push(n.edges[t])}for(var s=0,o=i;s0&&this.zi--;var t=this.$i[this.$i.length-1];"number"==typeof t&&t>1?this.$i[this.$i.length-1]--:this.$i.pop()},t}();function Ss(t){var n=t.edges["**"];if(!n)throw new Error("Node must have double-wildcard edge.");return ot(t.edges,1)?{id:-n.id,edges:{"**":n}}:t}var xs,ks,_s,As=function(){function t(t){this.Xi=t,this.Ji=null}return t.prototype.disable=function(){this.Ji&&(this.Ji.disable(),this.Ji=null)},t.prototype.enable=function(t){var n,i=this,r=T(t),s=null===(n=null==r?void 0:r._w)||void 0===n?void 0:n.fetch;(s||t.fetch)&&(this.Ji=mt(s?r._w:t,"fetch"),this.Ji&&this.Ji.afterSync(function(t){var n=t.result;t.result=(0,e.__awaiter)(i,void 0,void 0,function(){return(0,e.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.Zi(n,t.args[0],t.args[1])];case 1:case 2:return i.sent(),[3,3];case 3:return[2,n];}})})}))},t.prototype.Zi=function(t,n,i){return (0,e.__awaiter)(this,void 0,Yn,function(){var r,s,o,u,a,c;return (0,e.__generator)(this,function(e){switch(e.label){case 0:return r="GET",s="",a=!1,"string"==typeof n?s=n:"url"in n?(s=n.url,r=n.method,o=n.body,u=n.headers,a=!!n.signal):s=""+n,s?(i&&(r=i.method||r,u=Ds(i.headers),o=i.body||o,a=!!i.signal||a),c=this.Yi(t),a&&s.search(/\/(graphql|gql)/i)>-1?[4,Yn.race([c,ni(5e3)])]:[3,2]):[2];case 1:e.sent(),e.label=2;case 2:return this.Xi.startRequest(r,s,{body:function(){return o},headers:u},c),[2];}});});},t.prototype.Yi=function(t){return(0,e.__awaiter)(this,void 0,Yn,function(){var n,i,r,s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,t];case 1:if(n=e.sent(),i=n.headers,r=(i.get("content-type")||"default").split(";")[0],!(["default","text/plain","text/json","application/json"].indexOf(r)>-1))return[2,{status:n.status,data:{headers:i,body:null}}];s=null,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,n.clone().text()];case 3:return s=e.sent(),[3,5];case 4:return e.sent(),[3,5];case 5:return[2,{status:n.status,data:{headers:i,body:s}}];}})})},t;}(),Is=function(){function t(t){this.Xi=t,this.tr=new WeakMap}return t.prototype.disable=function(){this.nr&&(this.nr.disable(),this.nr=null),this.ir&&(this.ir.disable(),this.ir=null),this.rr&&(this.rr.disable(),this.rr=null)},t.prototype.er=function(t){var n=this.tr.get(t);if(n)return n;var i={};return this.tr.set(t,i),i},t.prototype.enable=function(t){var n,i,r,s,o=this,u=T(t),a=(null===(n=null==u?void 0:u._w)||void 0===n?void 0:n.XMLHttpRequest)||t.XMLHttpRequest;if(a){var c=a.prototype;this.nr=null===(i=mt(c,"open"))||void 0===i?void 0:i.before(function(t){var n=o.er(t.that);n.method=t.args[0],n.url=t.args[1]}),this.rr=null===(r=mt(c,"setRequestHeader"))||void 0===r?void 0:r.before(function(t){var n=t.that,i=t.args[0],r=t.args[1],e=o.er(n);e.headers||(e.headers=[]),e.headers.push([i,r])}),this.ir=null===(s=mt(c,"send"))||void 0===s?void 0:s.before(function(t){var n=t.that,i=t.args[0],r=o.er(n),s=r.url,u=r.method,a=r.headers;void 0!==s&&void 0!==u&&(o.tr["delete"](n),o.Xi.startRequest(u,s,{headers:Ds(a),body:i},function(t){return (0,e.__awaiter)(this,void 0,Yn,function(){var n;return (0,e.__generator)(this,function(i){switch(i.label){case 0:return[4,new Yn(function(n){t.addEventListener("readystatechange",function(){t.readyState===XMLHttpRequest.DONE&&n()}),t.addEventListener("load",n),t.addEventListener("error",n)})];case 1:return i.sent(),n=function(t){if(t)return {forEach:function(n){for(var i,r=/([^:]*):\s+(.*)(?:\r\n|$)/g;i=r.exec(t);)n(i[2],i[1])}};}(t.getAllResponseHeaders()),[2,{status:t.status,data:{headers:n,body:function(){return"text"===t.responseType?t.responseText:t.response}}}];}});});}(n)))})}},t;}(),Ts=/^data:/i,Cs=function(){function t(t,n){this._t=t,this.At=n,this.sr=!1,this.ur=new Ps(t,n),this.ar=new Is(this.ur),this.cr=new As(this.ur)}return t.prototype.isEnabled=function(){return this.sr},t.prototype.start=function(t){t.AjaxWatcher&&(this.sr||(this.sr=!0,this.At.enqueue({Kind:Ot.REC_FEAT_SUPPORTED,Args:[zt.Ajax,!0]}),this.ar.enable(this._t.window),this.cr.enable(this._t.window)))},t.prototype.stop=function(){this.sr&&(this.sr=!1,this.ar.disable(),this.cr.disable())},t.prototype.tick=function(){this.ur.tick()},t.prototype.setWatches=function(t){this.ur.setWatches(t)},t.prototype.initialize=function(t){this.ur.initialize(t)},t}(),Ps=function(){function t(t,n){this._t=t,this.At=n,this.hr=[],this.vr={},this.lr={},this.dr=[],this.pr=0;var i=cn.DefaultOrgSettings;this.initialize({requests:i.HttpRequestHeadersAllowlist,responses:i.HttpResponseHeadersAllowlist,maxAjaxPayloadLength:i.MaxAjaxPayloadLength})}return t.prototype.wr=function(t){for(var n=!1,i=!1,r=[],e=[],s=0,o=this.hr;s-1}function Os(t,n,i){return[t.length,Ns(t,n,i)]}function Ms(t,n,i){var r=void 0;return js(n)||(r=bs(t,i,n)),[Hs(t),r]}function Ks(t,n){var i=t.byteLength,r=void 0;return js(n)||(r="[ArrayBuffer]"),[i,r]}function Rs(t,n,i){return(0,e.__awaiter)(this,void 0,Yn,function(){var r,s,o,u,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:if(s=(r=t).size,js(n))return[2,[s,void 0]];switch(r.type){case"application/json":case"application/vnd.api+json":case"text/plain":return[3,1];}return[3,4];case 1:return e.trys.push([1,3,,4]),[4,r.text()["catch"](function(t){Tt.sendToBugsnag(t,"warning")})];case 2:return(o=e.sent())&&(u=Ns(o,n,i))?[2,[s,u]]:[3,4];case 3:return a=e.sent(),Tt.sendToBugsnag(a,"warning"),[3,4];case 4:return[2,[s,"[Blob]"]];}})})}function Hs(t){try{return o.jsonStringify(t).length}catch(t){}return 0}function Ns(t,n,i){if(!js(n))try{return bs(o.jsonParse(t),i,n)}catch(r){return n.length>0&&n.every(function(t){return!0===t})?t.slice(0,i):void 0}}function Ls(t,n){switch(t){default:case Zt.Elide:return!1;case Zt.Record:return!0;case Zt.Allowlist:try{return ms(n)}catch(t){return!1}}}function Us(t,n,i,r){var s;return(0,e.__awaiter)(this,void 0,Yn,function(){var o,u,a,c,h,f,v;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return o="",null===(s=r.headers)||void 0===s||s.forEach(function(n,i){var r=i.toLowerCase(),e=t[r];o+=r+(e?": "+n:"")+"\r\n"}),"function"!=typeof(u=null==r?void 0:r.body)?[3,2]:[4,u()];case 1:return a=e.sent(),[3,3];case 2:a=u,e.label=3;case 3:return[4,Fs(n,a,i)];case 4:return c=e.sent(),h=c[0],f=c[1],v=0!==h||f?qt.NotEmpty:qt.Unknown,[2,{headers:o,text:f,size:h,legibility:v}];}})})}function Fs(t,n,i){return void 0===i&&(i=cn.DefaultOrgSettings.MaxAjaxPayloadLength),(0,e.__awaiter)(this,void 0,Yn,function(){var r;return(0,e.__generator)(this,function(e){if(null==n)return[2,[0,void 0]];switch(typeof n){default:return[2,[-1,js(t)?void 0:"[unknown]"]];case"string":return[2,Os(n,t,i)];case"object":switch(r=n.constructor){case Object:default:return[2,Ms(n,t,i)];case Blob:return[2,Rs(n,t,i)];case ArrayBuffer:return[2,Ks(n,t)];case Document:case FormData:case URLSearchParams:case ReadableStream:return[2,[-1,js(t)?void 0:""+r.name]];}}return[2]})})}function Ds(t){return t?tt(t)?{forEach:function(n){for(var i=0,r=t;i-1){if(n.unshift(e),r instanceof CSSStyleSheet)break;i=r}else Tt.sendToBugsnag("Could not find intermediate rule in parent","warning")}return n},t.prototype.Wr=function(t,n){for(var i=0;i=t?(this.oe-=t,[!0,0]):[!1,(t-this.oe)/this.ne]},t}())(2,2e5),ho=new Set(["measureText","getImageData","getError","getTransform","isContextLost","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture"]),fo=new Set(["fillText"]),vo=function(){function t(t,n,i,r){this.At=n,this.Ti=i,this.ai=r,this.ue=dn.CaptureCanvasOps,this.ae=[],this.ce=[],this.he=new WeakMap,this.fe=new WeakMap,this.ve=new Set,this.le=0,this.de=new WeakMap,this.pe=!1,this.we=new WeakMap,this.ge=new Set,this.me=new WeakMap,this.ye=1,this.be=new WeakMap,this.Ee=1,this.Se=0,this.xe=!1}return t.prototype.start=function(t){var n,i=this;if(t.CanvasWatcherMode&&(this.At.enqueue({Kind:Ot.REC_FEAT_SUPPORTED,Args:[zt.CanvasWatcherEnabled,!0]}),this.pe=!0,this.ue=null!==(n=t.CanvasWatcherMode)&&void 0!==n?n:dn.CaptureCanvasOps,this.Ji("2d",CanvasRenderingContext2D),this.Ji("webgl",WebGLRenderingContext),this.ue===dn.ScreenshotCanvas)){if(!HTMLCanvasElement.prototype.toDataURL)return;this.le=setInterval(function(){return i.screenshotConnectedCanvases()},1e3)}},t.prototype.ke=function(t,n){return"object"!=typeof n?[void 0,0]:(this.be.has(n)||this.be.set(n,[t,this.Ee++]),this.be.get(n))},t.prototype.Ji=function(t,n){var i=this;if(n)for(var r=n.prototype,e=function(e){if(ho.has(e))return"continue";var o=Object.getOwnPropertyDescriptor(r,e);if("function"==typeof(null==o?void 0:o.value)){var u=mt(r,e);u&&(u.afterSync(function(n){return i._e(t,e,n.that,n.args,n.result)}),s.ae.push(u))}else"function"==typeof(null==o?void 0:o.set)&&s.ce.push(yt(n,e,s.Ae(t,e)))},s=this,o=0,u=Object.keys(r);o0){var o=n;if(!o){var u=t instanceof HTMLCanvasElement?Ui(t):void 0,a=t instanceof HTMLCanvasElement&&St(t);o=null!==(r=null==u?void 0:u.mask)&&void 0!==r?r:a}this.Pe(t,e,s,o)}return e}},t.prototype.je=function(t,n,i,r,e,s,o){var u;switch(typeof r){case"string":return e?Ci(r):r;case"number":case"boolean":case"bigint":return r;case"undefined":return{undef:!0};case"object":if(!r)return r;try{o.set(r,!0)}catch(t){}var a=null===(u=Object.getPrototypeOf(r))||void 0===u?void 0:u.constructor,c=(null==a?void 0:a.name)||function(t){var n;if(t){var i=t.toString(),r=po.exec(i);return r||(r=wo.exec(i)),null===(n=null==r?void 0:r[1])||void 0===n?void 0:n.trim()}}(a),h={ctor:c};if(r instanceof Node&&(l=Di(r)))return h.id=l,h;switch(c){case"Array":return this.Se+=r.length,this.Oe(t,n,i,r,e,s,o);case"CanvasGradient":return h;case"HTMLImageElement":var f=he(r.src,{source:"dom",type:"canvas"});return this.ai.record(f),h.src=f,h;case"HTMLCanvasElement":var v=r,l=this.flush(v,e);return h.srcId=l,h;}if(function(t){var n;return!!(null===(n=Object.prototype.toString.call(t))||void 0===n?void 0:n.match(lo))}(r))return this.be.has(r)?this.Me(r,h,e):(h.typedArray="["+r.toString()+"]",this.Se+=r.length,h);if("object"==typeof r&&this.be.has(r))return this.Me(r,h,e);if(r instanceof WebGLBuffer||r instanceof WebGLTexture){var d=void 0;switch(s){case"bindTexture":d=this.Ke(t,"createTexture",n,i,r);break;case"bindBuffer":d=this.Ke(t,"createBuffer",n,i,r);}if(void 0!==d)return this.Me(r,h,e)}var p=r;for(var w in (h.obj={}, p)){try{switch(typeof p[w]){case"function":continue;case"object":if(p[w]&&o.has(p[w]))continue;}}catch(t){continue}++this.Se,h.obj[w]=this.je(t,n,i,p[w],e,s,o)}return h;default:return null;}},t.prototype.Me=function(t,n,i){var r=this.be.get(t),e=r[0],s=r[1];return this.flush(e,i),n.ref=s,delete n.ctor,n},t.prototype.Ke=function(t,n,i,r,e){var s=this.ke(i,e),o=(s[0],s[1]);return this.Re(r,[[t,ln.Function,n,[],o]]),o},t.prototype.Oe=function(t,n,i,r,e,s,o){var u=this;return void 0===o&&(o=new WeakMap),this.Se+=r.length+1,r.map(function(r){return u.je(t,n,i,r,e,s,o)})},t.prototype.Pe=function(t,n,i,r){var e=this;if(void 0===r&&(r=!1),!this.xe){var s=i.map(function(i){var s=i[0],o=i[1],u=i[2],a=i[3],c=i[4];return[s,o,u,e.Oe(s,t,n,a,r&&fo.has(u),u),c]});if(!this.he.has(t)&&(this.he.set(t,!0),i.some(function(t){return"2d"===t[0]}))){var o=this.He(t);if(o.length>0)return o.push.apply(o,s),void this.Re(n,o)}this.Re(n,s)}},t.prototype.Re=function(t,n){if(!this.xe){var i=co.hasCapacityFor(this.Se),r=i[0];i[1],this.Se=0,r?this.At.enqueue({Kind:Ot.CANVAS,Args:[t,n]}):this.xe=!0}},t.prototype.He=function(t){var n=t.getContext("2d");if(!n)return[];var i=[];if((n instanceof CanvasRenderingContext2D||n instanceof OffscreenCanvasRenderingContext2D)&&"function"==typeof n.getTransform){var r=n.getTransform();if(!r.isIdentity){var e=r.a,s=r.b,o=r.c,u=r.d,a=r.e,c=r.f;i.push(["2d",ln.Function,"transform",[e,s,o,u,a,c],-1])}}return i},t.prototype.Ne=function(t,n){t instanceof HTMLCanvasElement&&(this.ue===dn.ScreenshotCanvas?(this.fe.set(t,!0),this.ve.add(t)):(this.ge.add(t),this.Ie(t,n)))},t.prototype._e=function(t,n,i,r,e){for(var s=[],o=0;o))/m,mo=/^(eval@)?(\[native code\])?$/;function yo(t){if(!t||"string"!=typeof t.stack)return[];var n=t;return n.stack.match(go)?n.stack.split("\n").filter(function(t){return!!t.match(go)}).map(function(t){var n=t;n.indexOf("(eval ")>-1&&(n=n.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var i=n.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/\(native code\)/,"").split(/\s+/).slice(1),r=Eo(i.pop());return bo(i.join(" "),["eval",""].indexOf(r[0])>-1?"":r[0],r[1],r[2])}):n.stack.split("\n").filter(function(t){return!t.match(mo)}).map(function(t){var n=t;if(n.indexOf(" > eval")>-1&&(n=n.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===n.indexOf("@")&&-1===n.indexOf(":"))return[n,"",-1,-1];var i=n.split("@"),r=Eo(i.pop());return bo(i.join("@"),r[0],r[1],r[2])});}function bo(t,n,i,r){return[t||"",n||"",parseInt(i||"-1",10),parseInt(r||"-1",10)]}function Eo(t){if(!t||-1===t.indexOf(":"))return["","",""];var n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return n?[n[1]||"",n[2]||"",n[3]||""]:["","",""]}var So,xo,ko=["log","info","warn","error","debug","_fs_debug","assert","trace"],_o=ko.filter(function(t){return !/debug/.test(t);}),Ao=function(t,n,i){void 0===i&&(i=!0);var r=Qi(t,n);return i?be(r):r},Io=function(){function t(t,n,i){this.At=n,this.sr=!1,this.Fe=!1,this.De=0,this.Dt=[],this.Be=cn.DefaultOrgSettings.MaxConsoleLogPerPage,this.Dn=t.window,this.T=i.createChild()}return t.prototype.initializeMaxLogsPerPage=function(t){this.Be=t||cn.DefaultOrgSettings.MaxConsoleLogPerPage},t.prototype.We=function(){return"\"[received more than "+this.Be+" messages]\""},t.prototype.start=function(t){var n=this;if(t.ConsoleWatcher&&(this.T.add(this.Dn,"error",!0,function(t){return n.addError(t)}),this.T.add(this.Dn,"unhandledrejection",!0,function(t){n.addError({error:t.reason,message:"Uncaught (in promise)",filename:"",lineno:0,colno:0})},!0),!this.sr))if(this.sr=!0,this.At.enqueue({Kind:Ot.REC_FEAT_SUPPORTED,Args:[zt.Console,!0]}),this.Dn.console)for(var i=function(t){var i=mt(r.Dn.console,t);if(!i)return"continue";"assert"===t?i.before(function(i){var r=i.args;r[0]||n.qe(t,Array.prototype.slice.apply(r,[1]))}):i.before(function(i){var r=i.args;return n.qe(t,r)}),r.Dt.push(i)},r=this,e=0,s=_o;e5e5)return!1;var i=Ws(Bs(t));return!!i&&(!!("style"===ki(t)&&i.length>0&&Xs.test(n))||function(t){var n;try{if((null===(n=t.classList)||void 0===n?void 0:n.contains("fs-css-in-js"))||t.hasAttribute("data-fela-type")||t.hasAttribute("data-aphrodite"))return!0}catch(t){Tt.sendToBugsnag(t,"error")}return!1}(t))}(s)&&(null==n||n.push(function(){u.snapshotEl(s),"link"===ki(s)&&i.T.add(s,"load",!1,function(){u.snapshotEl(s)})}));break;case"CANVAS":this._t.measurer.requestMeasureTask(ii.Low,function(){return i.us[So.Canvas].flush(t)});break;default:t.nodeName&&"#"!==t.nodeName[0]&&t.nodeName.indexOf("-")>-1&&this.us[So.CustomElement].onCustomNodeVisited(t);}if("scrollLeft"in t&&"scrollTop"in t){var a=t;this._t.measurer.requestMeasureTask(ii.Low,function(){0==a.scrollLeft&&0==a.scrollTop||i.Ps(a)})}null==n||n.push(function(){i._t.measurer.requestMeasureTask(ii.Low,function(){i.us[So.Animation].snapshot(t)})})},t.prototype.On=function(t){var n,i=t.node,r=ki(t.node);if("iframe"===r)this.$e(t.node);else if("function"==typeof i.getElementsByTagName)for(var e=null!==(n=i.getElementsByTagName("iframe"))&&void 0!==n?n:[],s=0;s-1&&s.push(i.href),("img"===t||"source"===t)&&(e=i.srcset)&&null==e.match(/^\s*$/))for(var c=0,h=e.split(",");c0)return i[0]}}return t.target}function Mo(t){var n;return!!(null!==(n=t._fs_trust_event)&&void 0!==n&&n||t.isTrusted)}var Ko,Ro=function(){function t(t,n){this.Vr=t,this.Gs=n,this.Xs=[],this.Js=0}return t.prototype.add=function(t){this.Xs.length>0&&this.Xs[this.Xs.length-1].When===t.When&&this.Xs.pop(),0===this.Xs.length?(this.Vr.push(t),this.Js=t.When):t.When>this.Js&&(this.Js=t.When),this.Xs.push(t)},t.prototype.finish=function(t,n){void 0===n&&(n=[]);var i=this.Xs.length;if(i<=1)return!1;for(var r=[],s=this.Xs[0].When,o=this.Xs[i-1].When,u=o-s!=0?o-s:1,a=0;a0&&this.Zs--,Lo(this.Wn.prev)},t.prototype.shift=function(){return this.Zs>0&&this.Zs--,Lo(this.Wn.next)},t}();function No(t,n){var i=t.next;n.next=i,n.prev=t,t.next=i.prev=n}function Lo(t){var n=t.prev,i=t.next;return n.next=i,i.prev=n,t.value}!function(t){t[t.rageWindowMillis=2e3]="rageWindowMillis",t[t.defaultRageThreshold=5]="defaultRageThreshold",t[t.rageThresholdIfPageChanges=8]="rageThresholdIfPageChanges",t[t.thresholdChangeQuiescenceMillis=2e3]="thresholdChangeQuiescenceMillis"}(Ko||(Ko={}));var Uo=function(){function t(t,n){var i,r;void 0===n&&(n=w),this._t=t,this.Ys=n,this.no=new Ho,this.io=Ko.defaultRageThreshold,this.ro=-1,this.eo=new WeakMap;var e=t.recording.pageResponse();if(!e)throw new Error("Attempt to construct EasyBake before rec/page response is set.");for(var s=[".fs-ignore-rage-clicks",".fs-ignore-rage-clicks *"],o=0,u=null!==(r=null===(i=e.BehaviorSignalSettings)||void 0===i?void 0:i.ElementBlocks)&&void 0!==r?r:[];o-1&&(s.push(a.Selector),s.push(a.Selector+" *"))}var c=s.join(", ");Be(c)?this.so=[c]:this.so=s}return t.prototype.oo=function(t){var n=this.eo.get(t);if(void 0!==n)return n;for(var i=0,r=this.so;i=this.io){var a=this._t.recording.getCurrentSessionURL,c={eventStartTimeStamp:this.no.first(),eventEndTimeStamp:i,eventReplayUrlAtStart:a(),eventReplayUrlAtCurrentTime:a(!0)};this.dispatchRageClickEvent(r,c),this.io=Ko.defaultRageThreshold,this.no=new Ho}}}}}},t.prototype.dispatchRageClickEvent=function(t,n){var i,r="fullstory/rageclick";try{i=new CustomEvent(r,{detail:n,bubbles:!0,cancelable:!0})}catch(t){(i=document.createEvent("customevent")).initCustomEvent(r,!0,!0,n)}o.setWindowTimeout(window,Tt.wrap(function(){t.dispatchEvent(i)}),0)},t}(),Fo=function(){function t(t){this._t=t,this.uo=this._t.time.wallTime(),this.ao=!1}return t.prototype.getLastUserAcitivityTS=function(){return this.uo},t.prototype.getMsSinceLastUserAcivity=function(){return o.mathFloor(this._t.time.wallTime()-this.uo)},t.prototype.resetUserActivity=function(){this.uo=this._t.time.wallTime()},t.prototype.isHibernating=function(){return this.ao},t.prototype.setHibernating=function(){this.ao=!0},t}(),Do=function(){function t(t,n,i,r){void 0===r&&(r=Yi),this._t=t,this.co=n,this.At=i,this.ho=!1,this.fo=!1,this.vo=cn.HeartbeatInitial,this.lo=cn.PageInactivityTimeout,this.heartbeatTimeout=new r(this["do"].bind(this)),this.hibernationTimeout=new r(this.po.bind(this),this.lo)}return t.prototype.getUserActivityModel=function(){return this.co},t.prototype.manualHibernateCheck=function(){this.co.isHibernating()||this.co.getMsSinceLastUserAcivity()>=cn.PageInactivityTimeout+5e3&&this.po()},t.prototype.scanEvents=function(t){if(!this.ho){this.manualHibernateCheck();for(var n=!1,i=0,r=t;icn.HeartbeatMax&&(this.vo=cn.HeartbeatMax),this.heartbeatTimeout.start(this.vo)},t.prototype.po=function(){if(!this.co.isHibernating()){var t=!1;this.co.getMsSinceLastUserAcivity()<=2*cn.PageInactivityTimeout?this.At.enqueue({Kind:Ot.UNLOAD,Args:[Wt.Hibernation]}):t=!0;try{this.ho=!0,this.co.setHibernating(),this.shutdown(),this.At.onHibernate(t)}finally{this.ho=!1}}},t.prototype.wo=function(){this.fo||(this.fo=!0,this._t.recording.splitPage(Wt.Hibernation))},t}(),Bo=function(){function t(t,n,i,r,e,s){void 0===r&&(r=function(){return[]}),void 0===e&&(e=Zi),void 0===s&&(s=Yi),this._t=t,this.mo=n,this.yo=r,this.bo=e,this.Eo=0,this.So=[],this.xo=!1,this.ko=!1,this._o=0,this.Ao=-1,this.Io=!1,this.Qt=[],this.To=new this.bo(cn.CurveSamplingInterval),this.Co=new this.bo(cn.MutationProcessingInterval),i&&(this.Po=new Do(this._t,i,this,s))}return t.prototype.startPipeline=function(t){var n;return(0,e.__awaiter)(this,void 0,Yn,function(){var i,r=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.ko||this.xo?[2]:(this.xo=!0,t.frameId&&(this.Eo=t.frameId),t.parentIds&&(this.So=t.parentIds),i=!0,[4,ei()]);case 1:return e.sent(),this.processEvents(),[4,ei()];case 2:return e.sent(),window,this.Co.start(function(){window,r.processEvents(),window}),this.To.start(function(){window,r.processEvents(i),window}),null===(n=this.Po)||void 0===n||n.start(),this.mo.startPipeline(t),window,[2];}})})},t.prototype.enableEasyBake=function(){this.jo=new Uo(this._t)},t.prototype.enqueueSimultaneousEventsIn=function(t){if(0===this._o){var n=this._t.time.now();this.Ao=n>this.Ao?n:this.Ao}try{return this._o++,t(this.Ao)}finally{this._o--,this._o<0&&(this._o=0)}},t.prototype.enqueue=function(t){var n=this._o>0?this.Ao:this._t.time.now();this.Oo(n,t),Ji.checkForBrokenSchedulers()},t.prototype.Oo=function(t,n){var i;if(!this.ko){var r=t;r0){var n=t;n.When=this.Qt[0].When,this.Qt.unshift(n)}else this.enqueue(t)},t.prototype.addUnload=function(t){this.Io||(this.Io=!0,this.enqueue({Kind:Ot.UNLOAD,Args:[t]}),this.singSwanSong(t))},t.prototype.shutdown=function(t){this.addUnload(t),this.Mo(),this.ko=!0,this.Ko()},t.prototype.Mo=function(){this.processEvents(),this.mo.flush()},t.prototype.singSwanSong=function(t){this.ko||(window,this.Mo(),t===Wt.Hidden&&this.Io||this.mo.singSwanSong(),window)},t.prototype.rebaseIframe=function(t,n){for(var i=Math.max(0,n),r=this._t.time.startTime(),e=function(n){var e=r+n-t;return e>=i?e:i},s=0,o=this.Qt;s0){var f=h[h.length-1].Args[2];f&&(h[0].Args[9]=f)}}for(var v in s)s[l=parseInt(v,10)].finish(Ot.SCROLL_LAYOUT_CURVE,[l]);for(var v in o)o[l=parseInt(v,10)].finish(Ot.SCROLL_VISUAL_OFFSET_CURVE,[l]);for(var v in e){var l;e[l=parseInt(v,10)].finish(Ot.TOUCHMOVE_CURVE,[l])}return n&&n.finish(Ot.RESIZE_VISUAL_CURVE),i}(n);t||(i=i.concat(this.yo())),this.Ro(i),this.sendEvents(this._t.recording.pageSignature(),i)}},t.prototype.sendEvents=function(t,n){var i;0!=n.length&&(null===(i=this.Po)||void 0===i||i.scanEvents(n),this.mo.enqueueEvents(t,n))},t.prototype.onHibernate=function(t){t||this.Mo(),this.mo.singSwanSong(),this.mo.stopPipeline()},t.prototype.Ro=function(t){if(this.Eo)for(var n=this.So,i=n&&n.length>0,r=0;r>>0).toString(16)).slice(-8);return t},t;}();function qo(t){var n=new Wo(1);return n.writeAscii(t),n.sumAsHex()}function Qo(t){var n=new Uint8Array(t);return Vo(String.fromCharCode.apply(null,n))}function Vo(t){var n;return (null!==(n=window.btoa)&&void 0!==n?n:zo)(t).replace(/\+/g,"-").replace(/\//g,"_");}function zo(t){for(var n=String(t),i=[],r=0,e=0,s=0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.charAt(0|s)||(o="=",s%1);i.push(o.charAt(63&r>>8-s%1*8))){if((e=n.charCodeAt(s+=3/4))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|e}return i.join("")}function $o(t,n,i,r){return void 0===r&&(r=new Wo),(0,e.__awaiter)(this,void 0,Yn,function(){var s,o,u,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:s=t.now(),o=i.byteLength,u=0,e.label=1;case 1:return u25?[4,n(100)]:[3,3]:[3,5];case 2:e.sent(),s=t.now(),e.label=3;case 3:a=new Uint8Array(i,u,Math.min(o-u,1e4)),r.write(a),e.label=4;case 4:return u+=1e4,[3,1];case 5:return[2,{hash:r.sum(),hasher:r}];}})})}var Go=6e6,Xo="resource-uploader",Jo=function(){function t(t,n,i,r,e){void 0===r&&(r=window.FormData),void 0===e&&(e=Yi),this._t=t,this.At=n,this.Ho=i,this.No=r,this.Lo=e,this.pe={},this.Uo={},this.Fo=!1,this.Do=[]}return t.prototype.init=function(){this.No&&this.Bo()["catch"](function(t){Tt.sendToBugsnag(t,"error")})},t.prototype.Bo=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){var t,n,i,r,s,o,u,a,c,h,f,v,l,d,p,w,g,m,y,b,E,S,x,k,_;return(0,e.__generator)(this,function(e){switch(e.label){case 0:t=this._t.options.orgId,e.label=1;case 1:return[4,this.Wo()];case 2:for(n=e.sent(),i={fsnv:{},sha1:{}},r={},s=0,o=n;sGo){var r=he(t,{source:"log",type:"bugsnag"});return Tt.sendToBugsnag("Size of blob resource exceeds limit","warning",{url:r,MaxResourceSizeBytes:Go}),void i(null)}(function(t){var n=ti(),i=n.resolve,r=n.promise,e=new FileReader;return e.readAsArrayBuffer(t),e.onload=function(){i(e.result)},e.onerror=function(t){Tt.sendToBugsnag(t,"error"),i(null)},r})(n).then(function(t){i(t?{buffer:t,blob:n,contentType:n.type}:null)})},e.send(),r)}function Yo(t,n){var i,r;return(0,e.__awaiter)(this,void 0,Yn,function(){var s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return s=t.window,(null===(r=null===(i=s.crypto)||void 0===i?void 0:i.subtle)||void 0===r?void 0:r.digest)?[4,s.crypto.subtle.digest({name:"sha-1"},n)]:[3,2];case 1:return[2,{hash:Qo(e.sent()),algorithm:"sha1"}];case 2:return[4,$o(t.time,ni,n)];case 3:return[2,{hash:e.sent().hash,algorithm:"fsnv"}];}})})}var tu=/^data:([^;,]*)(;?charset=[^;]+)?(?:;base64)?$/i,nu="Could not parse data url",iu=function(t,n,i){this.name="ProtocolError",this.message=n,this.status=t,this.data=i};function ru(t){return t>=400&&502!==t||202==t||206==t}var eu=function(){function t(t){this.Vo=0,this.zo=t.options.scheme,this.$o=t.options.cdnHost,this._t=t}return t.prototype.page=function(t){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(n){switch(n.label){case 0:return[4,uu(this.zo,vu(this._t),"/rec/page",vt(t))];case 1:return[2,pt(n.sent().text)];}})})},t.prototype.settings=function(t){return(0,e.__awaiter)(this,void 0,Yn,function(){var n;return(0,e.__generator)(this,function(i){return n=t.previewMode||t.fallback?vu(this._t):this.$o,[2,fu(this.zo,n,t)]})})},t.prototype.bundle=function(t){var n;return(0,e.__awaiter)(this,void 0,Yn,function(){var i,r,s,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,ei()];case 1:return e.sent(),window,i=vt(t.bundle),this.Vo+=i.length,this.Vo,window,i.length>2e6?[4,ei()]:[3,3];case 2:e.sent(),e.label=3;case 3:return window,r=ou(t.bundle.Seq,t),[4,uu(this.zo,null!==(n=t.recHost)&&void 0!==n?n:vu(this._t),r,i)];case 4:return s=e.sent().text,o=pt(s),window,[2,[this.Vo,o]];}})})},t.prototype.bundleBeacon=function(t){var n;return hu(this.zo,null!==(n=t.recHost)&&void 0!==n?n:vu(this._t),t)},t.prototype.exponentialBackoffMs=function(t,n){var i=o.mathMin(cn.BackoffMax,5e3*o.mathPow(2,t));return n?i+.25*o.mathRandom()*i:i},t}(),su=function(){function t(t){this.zo=t.options.scheme,this._t=t}return t.prototype.uploadResource=function(t){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(n){switch(n.label){case 0:return[4,uu(this.zo,vu(this._t),"/rec/uploadResource",t)];case 1:return[2,n.sent().text];}})})},t.prototype.queryResources=function(t){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(n){switch(n.label){case 0:return[4,uu(this.zo,vu(this._t),"/rec/queryResources",vt(t))];case 1:return[2,pt(n.sent().text)];}})})},t}();function ou(t,n){var i="/rec/bundle"+("v2"===n.version?"/v2":"")+"?OrgId="+n.orgId+"&UserId="+n.userId+"&SessionId="+n.sessionId+"&PageId="+n.pageId+"&Seq="+t;return null!=n.serverPageStart&&(i+="&PageStart="+n.serverPageStart),null!=n.serverBundleTime&&(i+="&PrevBundleTime="+n.serverBundleTime),null!=n.lastUserActivity&&(i+="&LastActivity="+n.lastUserActivity),n.isNewSession&&(i+="&IsNewSession=true"),null!=n.deltaT&&(i+="&DeltaT="+n.deltaT),i}function uu(t,n,i,r){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(e){return[2,cu("POST",t,n,lu(i),!0,r)]})})}function au(t,n,i){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(r){return[2,cu("GET",t,n,lu(i),!1)]})})}function cu(t,n,i,r,s,o){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(e){return[2,new Yn(function(e,u){var a="//"+i+r,c=!1,h=new XMLHttpRequest,f=("withCredentials"in h);jt(f,"XHR missing CORS support"),f&&(h.onreadystatechange=function(){if(4==h.readyState){if(c)return;c=!0;try{var t={text:h.responseText};if(200==h.status)return void e(t);var n=void 0;try{n=pt(t.text)}catch(t){}u(new iu(h.status,t.text,n))}catch(t){Tt.sendToBugsnag(t,"error"),u(t)}}},h.open(t,n+a,!0),h.withCredentials=s,o&&"function"!=typeof o.append&&h.setRequestHeader("Content-Type","text/plain"),h.send(o))})]})})}function hu(t,n,i){if("function"==typeof navigator.sendBeacon){var r=t+"//"+n+ou(i.bundle.Seq,i)+"&SkipResponseBody=true",e=vt(i.bundle);try{return navigator.sendBeacon.bind(navigator)(r,e)}catch(t){}}return!1}function fu(t,n,i){var r;return(0,e.__awaiter)(this,void 0,Yn,function(){var s,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return s=null!==(r=i.version)&&void 0!==r?r:"v1",o=i.previewMode?"?previewMode=true":"",[4,au(t,n,"/s/settings/"+i.orgId+"/"+s+"/web"+o)];case 1:return[2,pt(e.sent().text)];}})})}function vu(t){var n,i=null===(n=t.recording.pageResponse())||void 0===n?void 0:n.GCLBSubdomain,r=t.options.recHost;return i&&K(r)?r.replace(/^rs\./,i+"."):r;}function lu(t){if(!window.Zone)return t;var n="?";return t.indexOf(n)>-1&&(n="&"),""+t+n+"ngsw-bypass=true"}var du,pu=function(){function t(t,n,i){void 0===i&&(i=new wu),this._t=t,this.Vr=n,this.Go=i}return t.prototype.initialize=function(t){var n;if(t){this.Xo(t);var i=null===(n=this._t.window.location)||void 0===n?void 0:n.href;this.onNavigate(i)}},t.prototype.onNavigate=function(t){return!!this.Go.matches(t)&&(this.Vr.enqueue({Kind:Ot.KEEP_URL,Args:[this.Jo(t)]}),!0)},t.prototype.onClick=function(t){var n;return!!(null===(n=null==t?void 0:t.watchKind)||void 0===n?void 0:n.has(_i.Keep))&&(this.Vr.enqueue({Kind:Ot.KEEP_ELEMENT,Args:[t.id]}),!0)},t.prototype.urlMatches=function(t){return this.Go.matches(t)},t.prototype.Xo=function(t){this.Go.setRules(t)},t.prototype.Jo=function(t){return he(t,{source:"page",type:"base"})},t}(),wu=function(){function t(){this.Zo=null}return t.prototype.setRules=function(t){var n=t.map(function(t){return t.Regex}).filter(this.Yo);n.length>0&&(this.Zo=this.tu(n))},t.prototype.matches=function(t){return!!this.Zo&&this.Zo.test(t)},t.prototype.Yo=function(t){try{return new RegExp(t),!0}catch(n){return Tt.sendToBugsnag("Browser rejected UrlKeep.Regex","error",{expr:t,error:n.toString()}),!1}},t.prototype.tu=function(t){try{return new RegExp("("+t.join(")|(")+")","i")}catch(n){return Tt.sendToBugsnag("Browser rejected joining UrlKeep.Regexs","error",{exprs:t,error:n.toString()}),null}},t}(),gu=function(t){var n=(void 0===t?{}:t).wnd,i=void 0===n?window:n;!function(t,n,i,r,e,s,o,u){var a,c;function h(t){var n,i=[];function r(){n&&(i.forEach(function(t){var i;try{i=t[n[0]]&&t[n[0]](n[1])}catch(n){return void(t[3]&&t[3](n))}i&&i.then?i.then(t[2],t[3]):t[2]&&t[2](i)}),i.length=0)}function e(t){return function(i){n||(n=[t,i],r())}}return t(e(0),e(1)),{then:function(t,n){return h(function(e,s){i.push([t,n,e,s]),r()})}}}(!(i in t)||(t.console&&t.console.log&&t.console.log("FullStory namespace conflict. Please set window[\"_fs_namespace\"]."),0))&&(u=t[i]=function(){var t=function(t,i,r){function e(e,s){n(t,i,r,e,s)}var s=/Async$/;return s.test(t)?(t=t.replace(s,""),"function"==typeof Promise?new Promise(e):h(e)):n(t,i,r)};function n(n,i,r,e,s){return t._api?t._api(n,i,r,e,s):(t.q&&t.q.push([n,i,r,e,s]),null)}return t.q=[],t}(),function(){function t(){}function n(t,n,i){u("setProperties",{type:t,properties:n},i)}function i(t,i){n("user",t,i)}function r(t,n,r){i({uid:t},r),n&&i(n,r)}u.identify=r,u.setUserVars=i,u.identifyAccount=t,u.clearUserCookie=t,u.setVars=n,u.event=function(t,n,i){u("trackEvent",{name:t,properties:n},i)},u.anonymize=function(){r(!1)},u.shutdown=function(){u("shutdown")},u.restart=function(){u("restart")},u.log=function(t,n){u("log",{level:t,msg:n})},u.consent=function(t){u("setIdentity",{consent:!arguments.length||t})}}(),a="fetch",c="XMLHttpRequest",u._w={},u._w[c]=t[c],u._w[a]=t[a],t[a]&&(t[a]=function(){return u._w[a].apply(this,arguments)}),u._v="2.0.0")}(i,i.document,i._fs_namespace,0,0,i._fs_script)};function mu(t,n){if(t&&t.postMessage)try{t.postMessage(function(t){var n;return vt(((n={}).__fs=t,n))}(n),"*")}catch(t){Ut("postMessage",t)}}function yu(t){try{var n=pt(t);if("__fs"in n)return n.__fs}catch(t){}return[du.Unknown]}function bu(t,n,i,r){var e=W(t);if(!e)return!1;try{e.send(n,i,r)}catch(t){e.send(n,i)}return!0}!function(t){t.EndPreviewMode="EndPreviewMode",t.EvtBundle="EvtBundle",t.GreetFrame="GreetFrame",t.InitFrameMobile="InitFrameMobile",t.RequestFrameId="RequestFrameId",t.RestartFrame="RestartFrame",t.SetConsent="SetConsent",t.SetFrameId="SetFrameId",t.ShutdownFrame="ShutdownFrame",t.Unknown="Unknown"}(du||(du={}));var Eu=new RegExp(/^\s+$/),Su=/^fb\d{18}$/,xu=function(t){var n=t.frame,i=t.orgId,r=t.scheme,e=t.script,s=t.recHost,u=t.cdnHost,a=t.appHost,c=t.namespace,h=(t.desc,t.snippetVersion);try{if(function(t){return t.id==t.name&&Su.test(t.id)}(n))return Rt.BlocklistedFrame;if(function(t){return!(t.contentDocument&&t.contentWindow&&t.contentWindow.location)||function(t){return!!t.src&&"about:blank"!=t.src&&t.src.indexOf("javascript:")<0}(t)&&t.src!=t.contentWindow.location.href&&"loading"==t.contentDocument.readyState}(n))return Rt.PartiallyLoaded;var f=n.contentWindow,v=n.contentDocument;if(!f||!v)return Rt.MissingWindowOrDocument;if(!v.head)return Rt.MissingDocumentHead;if(!v.body||0===v.body.childNodes.length)return Rt.MissingBodyOrChildren;for(var l=!1,d=v.body.childNodes,p=0;p0&&(null!==(s=null===(e=null===(r=t.OrgSettings)||void 0===r?void 0:r.UrlPrivacyConfig)||void 0===e?void 0:e.length)&&void 0!==s?s:0)>0&&(null!==(a=null===(u=null===(o=t.OrgSettings)||void 0===o?void 0:o.AttributeBlocklist)||void 0===u?void 0:u.length)&&void 0!==a?a:0)>0;return c||Tt.sendToBugsnag("Invalid page response","error",{rsp:t}),c},t.prototype.handleResponse=function(t,n){var i,r,e,s,o=t.Flags,u=o.AjaxWatcher,a=o.ClientSideRageClick,c=o.GetCurrentSession,h=o.ResourceUploading,f=o.UseClientSideId;this.ku=t,this.Pu=t.UserIntId,this.ju=t.SessionIntId,this.Ou=t.PageIntId,this.Mu=t.PageStart,this.pu=c?_u.Enabled:_u.Disabled,this.cu=t.OrgSettings,pe(null!==(i=this.cu.UrlPrivacyConfig)&&void 0!==i?i:cn.DefaultOrgSettings.UrlPrivacyConfig,this.cu.MaxUrlLength);var v=null!==(r=this.cu.AttributeBlocklist)&&void 0!==r?r:[];(null===(s=null===(e=this._u)||void 0===e?void 0:e.privacy)||void 0===s?void 0:s.attributeBlocklist)&&(this._u.privacy.attributeBlocklist.length,v.push.apply(v,this._u.privacy.attributeBlocklist.map(Ae))),xe(v),this.yu.consoleWatcher().initializeMaxLogsPerPage(this.cu.MaxConsoleLogPerPage),this.yu.ajaxWatcher().initialize({requests:this.cu.HttpRequestHeadersAllowlist,responses:this.cu.HttpResponseHeadersAllowlist,maxAjaxPayloadLength:this.cu.MaxAjaxPayloadLength}),this.yu.perfWatcher().initialize({resourceUploader:this.yu.getResourceUploader(),recTimings:!!this.cu.RecordPerformanceResourceTiming,recImgs:!!this.cu.RecordPerformanceResourceImg,maxPerfMarksPerPage:this.cu.MaxPerfMarksPerPage}),this.Xt.initialize({canvasWatcherMode:t.Flags.CanvasWatcherMode,blocks:t.ElementBlocks,deferreds:t.ElementDeferreds,keeps:t.ElementKeeps,watches:t.ElementWatches}),this.Ve.initialize(t.UrlKeeps),this.Xt.initializeConsent(null!=n?n:!!t.Consented),"number"==typeof t.BundleUploadInterval&&(this.fu=t.BundleUploadInterval),h&&this.enableResourceUploading(),u&&t.AjaxWatches&&this.yu.ajaxWatcher().setWatches(t.AjaxWatches),a&&this.At.enableEasyBake(),f&&(this.hu=!0),this.yu.start(t.Flags)},t.prototype.fullyStarted=function(){this.Au&&this.Au()},t.prototype.enableResourceUploading=function(){this.wu=!0,this.yu.initResourceUploading()},t.prototype.flushPendingChildFrameInits=function(){if(this.du.length>0){for(var t=0;t0&&this.At.sendEvents(e,i);break;case du.RequestFrameId:if(!t)return;var s=this.Nu(t);void 0===s||(this.mu[s]=!1,this.Lu(t,s));case du.Unknown:}},t.prototype.Nu=function(t){for(var n=0,i=this.vu;n2e6))try{localStorage._fs_swan_song=i}catch(t){}},t.prototype.sing=function(){try{var t=this.purge();if(void 0===t)return;if(!(t.Bundles&&t.UserId&&t.SessionId&&t.PageId))return;t.OrgId||(t.OrgId=this.Uu.getOrgId()),t.Bundles.length>0&&(t.Bundles.length,this.Du(t))}catch(t){}},t.prototype.purge=function(){try{if("_fs_swan_song"in localStorage){var t=localStorage._fs_swan_song;return delete localStorage._fs_swan_song,pt(t)}}catch(t){}},t.prototype.Du=function(t,n){return void 0===n&&(n=0),(0,e.__awaiter)(this,void 0,Yn,function(){var i,r,s,o;return(0,e.__generator)(this,function(u){switch(u.label){case 0:if(i=null,!tt(t.Bundles)||0===t.Bundles.length||void 0===t.Bundles[0])return[2];1==t.Bundles.length&&(i=this._t.time.wallTime()-(t.LastBundleTime||0)),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.Ho.bundle({bundle:t.Bundles[0],deltaT:i,isNewSession:t.IsNewSession,orgId:t.OrgId,pageId:t.PageId,recHost:t.RecHost,serverBundleTime:t.ServerBundleTime,serverPageStart:t.ServerPageStart,sessionId:t.SessionId,userId:t.UserId,version:t.Version})];case 2:return r=u.sent(),s=r[1],t.Bundles[0].Evts.length,t.Bundles[0].Seq,t.Bundles.shift(),t.Bundles.length>0&&this.Du((0,e.__assign)((0,e.__assign)({},t),{ServerBundleTime:s.BundleTime})),[3,4];case 3:return(o=u.sent())instanceof iu&&ru(o.status)?[2]:(this.Bu=new this.Fu(this.Du,this.Ho.exponentialBackoffMs(n,!0),this,t,n+1).start(),[3,4]);case 4:return[2];}})})},t}(),ju=function(){function t(){}return t.prototype.encode=function(t){return t},t}(),Ou=function(){function t(){this.dict={idx:-1,map:{}},this.nodeCount=1,this.startIdx=0}return t.prototype.encode=function(n){if(0==n.length)return[];var i,r,e=n[0],s=Object.prototype.hasOwnProperty.call(this.dict.map,e)?this.dict.map[e]:void 0,o=[],u=1;function a(){s?u>1?o.push([s.idx,u]):o.push(s.idx):o.push(e)}for(i=1;ithis._t.recording.bundleUploadInterval()?[4,this.aa()]:[3,4]):[2];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:if((r=e.sent())instanceof iu){if(ru(r.status))return 206==r.status?Tt.sendToBugsnag("Failed to send bundle, probably because of its large size","error"):r.status>=500&&Tt.sendToBugsnag("Failed to send bundle, recording outage likely","error"),this.ea&&this.ea(),[2]}else Tt.sendToBugsnag("Failed to send bundle, unknown err","error",{err:r});return this.qu=!0,this.Vu=this.$u+this.Ho.exponentialBackoffMs(this.Qu++,!1),[3,6];case 6:return[2];}})})},t.prototype.va=function(t){var n,i;return(0,e.__awaiter)(this,void 0,Yn,function(){var r,s,o,u;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.Ou?(window,r=this.co.getMsSinceLastUserAcivity(),[4,this.Ho.bundle({bundle:t,deltaT:null,lastUserActivity:r,orgId:this.Uu.getOrgId(),pageId:this.Ou,serverBundleTime:this.Zu,serverPageStart:this.Mu,isNewSession:this.Gu,sessionId:null!==(n=this.Uu.getSessionId())&&void 0!==n?n:"",userId:this.Uu.getUserId(),version:this._t.recording.bundleApiVersion()})]):[2];case 1:return s=e.sent(),o=s[0],u=s[1],null===(i=this._t.recording.observer)||void 0===i||i.onBundleSent(o),o>this.Ju&&this.zu>16&&this._t.recording.splitPage(Wt.Size),window,[2,u];}})})},t.prototype.fa=function(t){if(0===t.Evts.length)return t;for(var n=[],i=0,r=t.Evts;i0},t.prototype.hasActiveEvents=function(){return this.da},t.prototype.pushEvent=function(t){Mu[t.Kind]||(this.da=!0),this.pa.When<0&&(this.pa.When=t.When),this.pa.Evts.push(t)},t}();function Hu(t,n){void 0===t&&(t=[]),void 0===n&&(n=0);for(var i="",r=0,e=t;r-1},t.prototype.ba=function(){return this.Dn.document.location.search.indexOf("_fs_preview=false")>-1},t.prototype.ya=function(){return!!this.wa.getValue(this.ga)},t}();function Uu(t){var n,i,r;return{Kind:Ot.CAPTURE_SOURCE,Args:[t.type,t.entrypoint,"dom",null===(i=null===(n=t.source)||void 0===n?void 0:n.integration)||void 0===i?void 0:i.slice(0,1024),!!(null===(r=t.source)||void 0===r?void 0:r.userInitiated)]}}function Fu(t){return(0,e.__awaiter)(this,void 0,Yn,function(){var n,i,r,s;return(0,e.__generator)(this,function(e){if(n=function(t){return"msCrypto"in t?t.msCrypto:t.crypto}(t),"function"==typeof(null==n?void 0:n.randomUUID))return[2,n.randomUUID()];for(i=new Uint8Array(16),n.getRandomValues(i),i[6]=15&i[6]|64,i[8]=63&i[8]|128,r=[],s=0;s=864e5)return Wu;var c=null!==(n=this.Sa.getLastUserActivityTimeMS())&&void 0!==n?n:u;return o.mathAbs(s-c)>=qu||(null!==(i=this.Sa.getPageCount())&&void 0!==i?i:0)>=250?Wu:e},t.prototype.start=function(){this.lastUserActivityTimeout.start(3e5)},t.prototype.stop=function(){this.lastUserActivityTimeout.stop()},t.prototype.ka=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){var t;return(0,e.__generator)(this,function(n){return(t=this.Sa.getUserId())&&Bu(t)?[2,t]:[2,Fu(this._t.window)]})})},t.prototype.xa=function(){var t=this.co.getLastUserAcitivityTS();t!==this.lastUserActivityTS&&(this.lastUserActivityTS=t,this.Sa.setLastUserActivityTimeMS(t),this.start())},t}(),Vu=function(t){function n(n,i,r,e,s,o,u){void 0===r&&(r=!0),void 0===e&&(e=new Fo(n)),void 0===s&&(s=new Ku(n,i,e,r)),void 0===o&&(o=Zi),void 0===u&&(u=xu);var a,c=t.call(this,n,o,e,s,u)||this;return c.Ho=i,c.mo=s,c._a=!1,c.ko=!1,c.Aa=!1,s.onShutdown(function(){return c.shutdown(Wt.SettingsBlocked)}),c.Mt=c.Dn.document,c.Eo=0,c.Uu=n.recording.identity,c.Ia=new Lu(c.xu,c.Dn,c.Uu.getClientStore()),c.pu=_u.NoInfoYet,c.Ta=new Qu(n,e,c.Uu),a=function(t){if(c.yu.stop(Wt.Api),t){var n=c.Mt.getElementById(t);n&&c.Ca&&n.setAttribute("_fs_embed_token",c.Ca)}},c.Dn._fs_shutdown=a,c}return (0,e.__extends)(n,t),n.prototype.onDomLoad=function(){var n=this;t.prototype.onDomLoad.call(this),this._a=!0,this.Pa(function(){n.fireFsReady(n.ko)})},n.prototype.ja=function(){var t=R(this.Dn,"_fs_replay_flags");if(/[?&]_fs_force_session=true(&|#|$)/.test(location.search)&&(t+=",forceSession",this.Dn.history)){var n=location.search.replace(/(^\?|&)_fs_force_session=true(&|$)/,function(t,n,i){return i?n:""});this.Dn.history.replaceState({},"",this.Dn.location.href.replace(location.search,n))}return t},n.prototype.start=function(n,i,r){var s,o,u;return(0,e.__awaiter)(this,void 0,Yn,function(){var a,c,h,f,v,l,d,p,w,g,m,y,b,E,S,x,k,_,A,I,T,C,P,j=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:t.prototype.start.call(this,n,i,r),a=this.ja(),c=yi(this.Mt),h=c[0],f=c[1],O=this.Dn,M=0,K=0,v=null==O.screen?[M,K]:(M=parseInt(String(O.screen.width),10),K=parseInt(String(O.screen.height),10),[M=isNaN(M)?0:M,K=isNaN(K)?0:K]),l=v[0],d=v[1],p="",n||(p=this.Uu.getUserId()),w=null!==(u=null===(o=null===(s=this._t)||void 0===s?void 0:s.recording)||void 0===o?void 0:o.preroll)&&void 0!==u?u:-1,g=function(){return he(Mr(j.Dn),{source:"page",type:"base"})},m=function(){return he(j.Dn.location.href,{source:"page",type:"url"})},y=function(){return""===j.Mt.referrer?"":he(j.Mt.referrer,{source:"page",type:"referrer"})},b=function(t){var n,i="_fs_tab_id";try{var r=t.sessionStorage.getItem(i);if(r)return r;var e=Math.floor(1e17*Math.random()).toString(16);return t.sessionStorage.setItem(i,e),null!==(n=t.sessionStorage.getItem(i))&&void 0!==n?n:void 0}catch(t){return}}(this.Dn),E={OrgId:this.xu,UserId:p,Url:m(),Base:g(),Width:h,Height:f,ScreenWidth:l,ScreenHeight:d,SnippetVersion:V(this.Dn),Referrer:y(),Preroll:w,Doctype:dt(this.Mt),CompiledVersion:"11aa377d19",CompiledTimestamp:1678707725,AppId:this.Uu.getAppId(),TabId:b,PreviewMode:this.Ia.isPreviewMode()||void 0},a&&(E.ReplayFlags=a),e.label=1;case 1:return e.trys.push([1,5,,6]),S=this.Oa,[4,this.Ho.page(E)];case 2:return[4,S.apply(this,[e.sent()])];case 3:return P=e.sent(),this.isSafeResponse(P)?this.gu?[2]:(window,this.handleResponse(P),window,this.Ma(P.CookieDomain,P.UserIntId,P.SessionIntId,P.PageIntId,P.EmbedToken),P.Flags.UseStatelessConsent||this.Uu.getConsentStore().setConsentState(!!P.Consented),this.Ka(),P.PreviewMode&&this.Ra(),x=function(t){return R(t,"_fs_pagestart","function")}(this.Dn),x&&x(),this.At.enqueueFirst(this.yu.getNavigateEvent(this.Dn.location.href,Ot.ENTRY_NAVIGATE)),k=!!P.Consented,this.At.enqueueFirst({Kind:Ot.SYS_REPORTCONSENT,Args:[k,Bt.Document]}),_=dt(this.Mt),A=m(),I=y(),T=g(),this.At.enqueueFirst({Kind:Ot.SET_FRAME_BASE,Args:[he(Mr(this.Dn),{source:"event",type:Ot.SET_FRAME_BASE}),_,A,I]}),this.mo.setPageData({Kind:Ot.PAGE_DATA,Args:[A,T,h,f,l,d,V(this.Dn),I,_,w,p,P.PageStart,Et(this.Dn),this.Dn.navigator.userAgent,b,!!P.IsNewSession]}),this.At.enqueue({Kind:Ot.SCRIPT_COMPILED_VERSION,Args:["11aa377d19"]}),this.At.enqueue(Uu({type:"default"})),this.yu.addVisibilityChangeEvent(),this.addInitEvent(),[4,this.At.startPipeline({pageId:P.PageIntId,serverPageStart:P.PageStart,isNewSession:!!P.IsNewSession})]):[2,this.Ha()];case 4:return e.sent(),this.enqueueDocumentProperties(this.Mt),this.fullyStarted(),[3,6];case 5:return(C=e.sent())instanceof iu&&(P=C.data)&&P.user_id&&P.cookie_domain&&P.reason_code===en.ReasonBlockedTrafficRamping&&p!==P.user_id&&this.Ma(P.cookie_domain,P.user_id,"","",""),this.Ha(),[3,6];case 6:return[2];}var O,M,K})})},n.prototype.Ka=function(){var t=this;this.Aa=!0,this.Pa(function(){t.fireFsReady(t.ko)})},n.prototype.Ma=function(t,n,i,r,e){var s=this.Uu;s.setIds(this.Dn,t,n,i),this.Ca=e,this.Ia.write(),s.getUserId(),s.getSessionId()},n.prototype.Pa=function(t){var n,i;if(this._a&&this.Aa)if(null===(i=null===(n=this.ku)||void 0===n?void 0:n.Flags)||void 0===i?void 0:i.FetchIntegrations){var r=this.Mt.createElement("script");r.addEventListener("load",t),r.addEventListener("error",t),r.async=!0,r.src=this.zo+"//"+this.Eu+"/rec/integrations?OrgId="+this.xu,this.Mt.head.appendChild(r)}else t()},n.prototype.Ra=function(){var t="FullStory-preview-script";if(!this.Mt.getElementById(t)){var n=this.Mt.createElement("script");n.id=t,n.async=!0,n.src=this.zo+"//"+this.Su+"/s/fspreview.js",this.Mt.head.appendChild(n)}},n.prototype.Ha=function(){this.Iu&&this.Iu(),this.shutdown(Wt.SettingsBlocked),this.ko=!0,this.fireFsReady(this.ko)},n.prototype.Oa=function(t){var n;return(0,e.__awaiter)(this,void 0,Yn,function(){var i,r,s,o,u;return(0,e.__generator)(this,function(a){switch(a.label){case 0:return(i=(0,e.__assign)({},t)).Flags.UseStaticSettings?(r=this.Ia.isPreviewMode(),[4,this.Ho.settings({orgId:this.xu,previewMode:r,fallback:!1})["catch"](function(t){Tt.sendToBugsnag("Edge Rec settings error","error",{err:t})})]):[3,4];case 1:return(s=a.sent())?[3,3]:[4,this.Ho.settings({orgId:this.xu,previewMode:r,fallback:!0})["catch"](function(t){Tt.sendToBugsnag("Rs Rec settings error","error",{err:t})})];case 2:s=a.sent(),a.label=3;case 3:s&&(i=(0,e.__assign)((0,e.__assign)({},i),s)),a.label=4;case 4:return i.Flags.UseClientSideId?(this.Uu.setCookieDomain(this.Dn,i.CookieDomain),Bu(o=null!==(n=t.UserUUID)&&void 0!==n?n:"")&&this.Uu.setUserId(o),[4,this.Ta.createUserSessionPage()]):[3,6];case 5:u=a.sent(),this.Ta.start(),i=(0,e.__assign)((0,e.__assign)({},i),{UserIntId:u.userId,SessionIntId:u.sessionId,PageIntId:u.pageId,IsNewSession:u.isNewSession,PageStart:p()}),a.label=6;case 6:return i.Flags.UseStatelessConsent&&(i=(0,e.__assign)((0,e.__assign)({},i),{Consented:this.Uu.getConsentStore().getConsentState()})),[2,i];}})})},n.prototype.onMessageReceived=function(n,i){t.prototype.onMessageReceived.call(this,n,i),(null==n?void 0:n.parent)==this.Dn&&i[0]===du.EndPreviewMode&&this.Ia.clear()},n;}(Cu),zu=function(){function t(t,n){void 0===n&&(n=new $u(t)),this.Dn=t,this.Na=n}return t.prototype.enqueueEvents=function(t,n){var i=null!=t?t:void 0;this.Na.postMessage(this.Dn.parent,[du.EvtBundle,n,i],i)},t.prototype.startPipeline=function(){},t.prototype.stopPipeline=function(){},t.prototype.flush=function(){return(0,e.__awaiter)(this,void 0,Yn,function(){return(0,e.__generator)(this,function(t){return[2]})})},t.prototype.singSwanSong=function(){},t.prototype.onShutdown=function(t){},t.prototype.setPageData=function(t){},t}(),$u=function(){function t(t){this.Dn=t}return t.prototype.postMessage=function(t,n,i){switch(n[0]){case du.EvtBundle:bu(this.Dn,n[0],vt(n[1]),i)||mu(t,n);break;case du.RequestFrameId:bu(this.Dn,n[0],"[]",i)||mu(t,n);break;default:n[0];}},t}(),Gu=function(t){function n(n,i,r,e,s){void 0===i&&(i=new $u(n.window)),void 0===r&&(r=new zu(n.window,i)),void 0===e&&(e=Zi),void 0===s&&(s=xu);var o=t.call(this,n,e,void 0,r,s)||this;return o.Na=i,o}return(0,e.__extends)(n,t),n.prototype.start=function(n,i,r){var e=this;t.prototype.start.call(this,n,i,r),this.La(),this.T.add(this.Dn,"load",!1,function(){e.yu.recordingIsDetached()&&e._t.recording.splitPage(Wt.FsShutdownFrame)}),this.yu.addVisibilityChangeEvent()},n.prototype.onMessageReceived=function(n,i){if(t.prototype.onMessageReceived.call(this,n,i),n===this.Dn.parent||n===this.Dn)switch(i[0]){case du.GreetFrame:this.La(i[1]);break;case du.SetFrameId:try{var r=i[1];if(!r)return void he(location.href,{source:"log",type:"debug"});this.Ua({frameId:r,parentIds:i[2],outerStartTime:i[3],scheme:i[4],script:i[5],appHost:i[6],orgId:i[7],initConfig:i[8],pageRsp:i[9],consentOverride:i[10],minimumWhen:i[11]})}catch(t){vt(i)}break;case du.SetConsent:this.setConsent(i[1]);break;case du.InitFrameMobile:try{var e=JSON.parse(i[1]),s=e.StartTime;if(i.length>2&&i[2]){var o=i[2];Object.prototype.hasOwnProperty.call(o,"ProtocolVersion")&&o.ProtocolVersion>=20180723&&Object.prototype.hasOwnProperty.call(o,"OuterStartTime")&&(s=o.OuterStartTime)}var u=e.Host;this.Ua({frameId:0,parentIds:[],outerStartTime:s,scheme:"https:",script:G(u),appHost:$(u),orgId:e.OrgId,initConfig:void 0,pageRsp:e.PageResponse,consentOverride:this.Xt.getConsent()})}catch(t){vt(i)}}},n.prototype.La=function(t){this.Eo&&this.Eo===t||0!=this.Eo&&this.Dn.parent&&this.Na.postMessage(this.Dn.parent,[du.RequestFrameId])},n.prototype.Ua=function(t){var n,i,r=this;if(this.Eo)this.Eo!==t.frameId?(this.Eo,t.frameId,this._t.recording.splitPage(Wt.FsShutdownFrame)):this.Eo;else if(he(location.href,{source:"log",type:"debug"}),t.frameId,this.zo=t.scheme,this.bu=t.script,this.Su=t.appHost,this.xu=t.orgId,this._u=t.initConfig,this.Eo=t.frameId,this.So=t.parentIds,t.pageRsp&&this.isSafeResponse(t.pageRsp)){if(!this.gu){var e=null!==(n=t.consentOverride)&&void 0!==n?n:!!t.pageRsp.Consented;this.handleResponse(t.pageRsp,e),this.fireFsReady(),this.At.enqueueFirst({Kind:Ot.SYS_REPORTCONSENT,Args:[e,Bt.Document]}),this.At.enqueueFirst({Kind:Ot.SET_FRAME_BASE,Args:[he(Mr(this.Dn),{source:"event",type:Ot.SET_FRAME_BASE}),dt(this.Dn.document)]}),this.At.enqueue({Kind:Ot.SCRIPT_COMPILED_VERSION,Args:["11aa377d19"]}),this.At.enqueue(Uu({type:"default"})),this.addInitEvent(),this.At.rebaseIframe(t.outerStartTime,null!==(i=t.minimumWhen)&&void 0!==i?i:0),this._t.time.setStartTime(t.outerStartTime),this.Ou&&this.At.startPipeline({pageId:this.Ou,serverPageStart:t.pageRsp.PageStart,isNewSession:!!t.pageRsp.IsNewSession,frameId:t.frameId,parentIds:t.parentIds}).then(function(){r.flushPendingChildFrameInits(),r.enqueueDocumentProperties(r.Dn.document),r.fullyStarted()})}}else this.shutdown(Wt.FsShutdownFrame)},n}(Cu),Xu=function(){function t(t,n,i){void 0===n&&(n=function(){}),void 0===i&&(i=!1),this.Mt=t,this.Fa=n,this.Da=i,this._cookies={},this._cookies=k(this.Mt)}return t.prototype.setDomain=function(t){this.Ba=t},t.prototype.getValue=function(t,n){var i=this._cookies[t];if(!i)try{i=localStorage[null!=n?n:t]}catch(t){}return i},t.prototype.setValue=function(t,n,i,r){if(null!=this.Ba&&!this.Da){var e=[];this._setCookie(t,n,i,e),this.Wa(null!=r?r:t,n,e,t),e.length>0&&this.Fa(e)}},t.prototype.setCookie=function(t,n,i){this._setCookie(t,n,i,[])},Object.defineProperty(t.prototype,"cookies",{get:function(){return this._cookies},enumerable:!1,configurable:!0}),t.prototype.clearCookie=function(t,n){if(this._cookies[t]&&(this.Mt.cookie=Ju(this.Ba,t,"","Thu, 01 Jan 1970 00:00:01 GMT"),delete this._cookies[t]),n)try{delete localStorage[n]}catch(t){}},t.prototype._setCookie=function(t,n,i,r){try{this.Mt.cookie=Ju(this.Ba,t,n,i),-1===this.Mt.cookie.indexOf(n)&&r.push([t,"cookie"])}finally{this._cookies=k(this.Mt)}},t.prototype.Wa=function(t,n,i,r){try{localStorage[t]=n,localStorage[t]!==n&&i.push([null!=r?r:t,"localStorage"])}catch(n){i.push([null!=r?r:t,"localStorage",String(n)])}},t}();function Ju(t,n,i,r){var e=n+"="+i;return e+="; domain="+function(t){return t?"."+encodeURIComponent(t):""}(t),e+="; Expires="+r+"; path=/; SameSite=Strict","https:"===location.protocol&&(e+="; Secure"),e}var Zu,Yu="fs_cid",ta=function(){function t(t){this.Sa=t,this.qa=1;var n=this.Sa.getValue(Yu,wn);this.Qa=function(t){var n={consent:Dt.RevokeConsent};if(!t)return n;var i=t.split(".");return i.length<1?n:(i[0],"1"===i[1]?{consent:Dt.GrantConsent}:n)}(n)}return t.prototype.getConsentState=function(){return this.Qa.consent},t.prototype.setConsentState=function(t){if(this.Qa.consent=t,t!==Dt.RevokeConsent){var n=this.Va(),i=this.za();this.Sa.setValue(Yu,n,i,wn)}else this.Sa.clearCookie(Yu,wn)},t.prototype.Va=function(){return[this.qa,this.Qa.consent===Dt.GrantConsent?1:0].join(".")},t.prototype.za=function(){return new Date(1e3*S()).toUTCString()},t}(),na="fs_lua",ia=function(){function t(t){this.qa=1,this.Sa=t;var n=this.Sa.getValue(na,gn);this.Qa=function(t){var n={lastUserActivityTime:void 0};if(!t)return n;var i=t.split(".");return i.length<1?n:(i[0],{lastUserActivityTime:_(i[1])})}(n)}return t.prototype.getLastUserActivityTimeMS=function(){return this.Qa.lastUserActivityTime},t.prototype.setLastUserActivityTimeMS=function(t){this.Qa.lastUserActivityTime=t;var n=this.Va(),i=this.za();this.Sa.setValue(na,n,i,gn)},t.prototype.Va=function(){var t;return[this.qa,null!==(t=this.Qa.lastUserActivityTime)&&void 0!==t?t:""].join(".")},t.prototype.za=function(){return new Date(p()+qu).toUTCString()},t}(),ra="fs_uid",ea=function(){function t(t,n,i,r){void 0===n&&(n=document),void 0===i&&(i=function(){}),void 0===r&&(r=!1),this.$a=void 0,this.wa=new Xu(n,i,r),this.Ga=new ta(this.wa),this.Xa=new ia(this.wa),this.Qa=this.Ja(t)}return t.prototype.Ja=function(t){var n=x(this.wa.getValue(ra,pn));return n&&n.orgId==t?n:{expirationAbsTimeSeconds:S(),orgId:t,userId:"",sessionId:"",appKeyHash:""}},t.prototype.getConsentStore=function(){return this.Ga},t.prototype.clear=function(){this.Xa.setLastUserActivityTimeMS(void 0),this.Qa.sessionStartTime=this.Qa.pageCount=void 0,this.Qa.userId=this.Qa.sessionId=this.Qa.appKeyHash=this.$a="",this.Qa.expirationAbsTimeSeconds=S(),this.Za()},t.prototype.create=function(t){this.Xa.setLastUserActivityTimeMS(t.lastUserActivityTime),this.Qa=(0,e.__assign)((0,e.__assign)({},this.Qa),t),this.Za()},t.prototype.getOrgId=function(){return this.Qa.orgId},t.prototype.getUserId=function(){return this.Qa.userId},t.prototype.setUserId=function(t){this.Qa.userId=t,this.Za()},t.prototype.getSessionId=function(){return this.Qa.sessionId},t.prototype.getAppKeyHash=function(){return this.Qa.appKeyHash},t.prototype.getCookies=function(){return this.wa.cookies},t.prototype.setAppId=function(t){this.$a=t,this.Qa.appKeyHash=qo(t),this.Za()},t.prototype.getAppId=function(){return this.$a},t.prototype.setSessionStartTimeMS=function(t){this.Qa.sessionStartTime=t,this.Za()},t.prototype.getSessionStartTimeMS=function(){return this.Qa.sessionStartTime},t.prototype.setLastUserActivityTimeMS=function(t){this.Xa.setLastUserActivityTimeMS(t)},t.prototype.getLastUserActivityTimeMS=function(){return this.Xa.getLastUserActivityTimeMS()},t.prototype.setPageCount=function(t){this.Qa.pageCount=t,this.Za()},t.prototype.getPageCount=function(){return this.Qa.pageCount},t.prototype.getClientStore=function(){return this.wa},t.prototype.setCookie=function(t,n,i){void 0===i&&(i=new Date(p()+6048e5).toUTCString()),this.wa.setCookie(t,n,i)},t.prototype.setCookieDomain=function(t,n){var i=n;(C(i)||i.match(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/g))&&(i="");var r=function(t){return R(t,"_fs_cookie_domain")}(t);"string"==typeof r&&(i=r),this.wa.setDomain(i)},t.prototype.setIds=function(t,n,i,r){this.setCookieDomain(t,n),this.Qa.userId=i,this.Qa.sessionId=r,this.Za()},t.prototype.clearAppId=function(){return!!this.Qa.appKeyHash&&(this.$a="",this.Qa.appKeyHash="",this.Za(),!0)},t.prototype.encode=function(){var t,n,i,r=[this.Qa.userId,null!==(t=this.Qa.sessionId)&&void 0!==t?t:"",""+(null!==(n=this.Qa.sessionStartTime)&&void 0!==n?n:""),"",""+(null!==(i=this.Qa.pageCount)&&void 0!==i?i:"")].join(":"),e=["",this.Qa.orgId,r];return this.Qa.appKeyHash&&e.push(encodeURIComponent(this.Qa.appKeyHash)),e.push("/"+this.Qa.expirationAbsTimeSeconds),e.join("#")},t.prototype.Za=function(){var t=this.encode(),n=new Date(1e3*this.Qa.expirationAbsTimeSeconds).toUTCString();this.wa.setValue(ra,t,n,pn)},t;}(),sa=((Zu={})[Xt.Document]={assetMapId:"str",releaseDatetime:"date",releaseVersion:"str"},Zu[Xt.Event]={},Zu[Xt.Page]={pageName:"str",releaseVersion:"str",releaseDatetime:"str"},Zu[Xt.User]={uid:"str",displayName:"str",email:"str"},Zu),oa={str:ua,bool:aa,real:ca,"int":ha,date:fa,strs:va(ua),bools:va(aa),reals:va(ca),ints:va(ha),dates:va(fa),objs:va(la),obj:la};function ua(t){return"string"==typeof t}function aa(t){return"boolean"==typeof t}function ca(t){return"number"==typeof t}function ha(t){return"number"==typeof t&&t-o.mathFloor(t)==0}function fa(t){return!(!t||(t.constructor===Date?isNaN(t):"number"!=typeof t&&"string"!=typeof t||isNaN(new Date(t))))}function va(t){return function(n){if(!(n instanceof Array))return!1;for(var i=0;i=0)return[void 0,Jt.FsId];var e=qo(r),s=void 0;return n&&n.Qa.appKeyHash&&n.Qa.appKeyHash!==e&&n.Qa.appKeyHash!==r&&(n.Qa.appKeyHash,s=Jt.NewUid),[r,s]}(f,this.Uu),l=v[0],d=v[1];if(!l)return Jt.FsId,{events:r};a.properties.uid=l,this.Uu.setAppId(l),d===Jt.NewUid&&(i=!0)}}Ea(t.source,"setVars",e),e(this.nc(s,wa(s,a.properties),u));break;default:(0,Ir.nt)(s,"Unsupported");}}catch(n){t.operation,n.message}return{events:r,reidentify:i}},t.prototype.nc=function(t,n,i,r){var e=vt(n.PayloadToSend),s=!!i&&"fs"!==i;switch(t){case Xt.Event:return{When:0,Kind:Ot.SYS_CUSTOM,Args:s?[r,e,i]:[r,e]};case Xt.Document:case Xt.Page:case Xt.User:return{When:0,Kind:Ot.SYS_SETVAR,Args:s?[t,e,i]:[t,e]};default:(0,Ir.nt)(t,"Unsupported");}},t.prototype.ic=function(t,n){var i=t.PayloadToSend;if(i&&"object"==typeof i){var r=0,e={};for(var s in i)if(!(s in this.Ya)){var o=i[s];this.Ya[s]={value:o,apiSource:n},e[s]=o,r++}if(0!==r)return{PayloadToSend:e,ValidationErrors:t.ValidationErrors}}},t;}();function wa(t,n){var i=1500;return ga(function(){return--i},t,n)}var ga=function(t,n,i){var r,e,s={PayloadToSend:{},ValidationErrors:[]},u=function(i){var r=ga(t,n,i);return s.ValidationErrors=s.ValidationErrors.concat(r.ValidationErrors),r.PayloadToSend};for(var a in i)if(o.objectHasOwnProp(i,a)){if(t()<=0)break;var c=i[a],h=ya(n,a,c,s.ValidationErrors);if(h){var f=h.name;if("obj"!==h.type){if("objs"!==h.type)s.PayloadToSend[f]=ma(h.type,h.value);else{n!=Xt.Event&&s.ValidationErrors.push({Type:"vartype",FieldName:f,ValueType:"Array (unsupported)"});for(var v=[],l=0;l0&&(s.PayloadToSend[f]=v)}}else{var d=u(h.value),p=(e="_obj").length>(r=a).length||r.substring(r.length-e.length)!=e?f.substring(0,f.length-"_obj".length):f;s.PayloadToSend[p]=d}}else s.PayloadToSend[a]=ma("str",c)}return s};function ma(t,n){var i=n;return"str"==t&&"string"==typeof i&&(i=i.trim()),null==i||"date"!=t&&i.constructor!=Date||(i=function(t){var n=t.constructor===Date?t:new Date(t);try{return n.toISOString()}catch(t){return null}}(i)),i}function ya(t,n,i,r){var e=n,s=e,u=typeof i;if("undefined"===u)return r.push({Type:"vartype",FieldName:e,ValueType:u+" (unsupported)"}),null;var a=sa[t];if(o.objectHasOwnProp(a,e))return{name:e,type:a[e],value:i};var c=e.lastIndexOf("_");if(-1==c||!ba(e.substring(c+1))){var h=function(t){for(var n in oa)if(oa[n](t))return n;return null}(i);if(null==h)return i?r.push({Type:"vartype",FieldName:e}):r.push({Type:"vartype",FieldName:e,ValueType:"null (unsupported)"}),null;c=e.length,e=e+"_"+h}var f=e.substring(0,c),v=e.substring(c+1);if("object"===u&&!i)return r.push({Type:"vartype",FieldName:s,ValueType:"null (unsupported)"}),null;if(!da.test(f)){f=f.replace(/[^a-zA-Z0-9_]/g,"").replace(/^[0-9]+/,""),/[0-9]/.test(f[0])&&(f=f.substring(1)),r.push({Type:"varname",FieldName:s});var l=f+"_"+v;if(da.source,""==f)return null;e=l}return ba(v)?function(t,n){return oa[t](n)}(v,i)?{name:e,type:v,value:i}:(vt(i),"number"===u?u=i%1==0?"integer":"real":"object"==u&&null!=i&&i.constructor==Date&&(u=isNaN(i)?"invalid date":"date"),r.push({Type:"vartype",FieldName:s,ValueType:u}),null):(r.push({Type:"varname",FieldName:s}),null)}function ba(t){return!!oa[t]}function Ea(t,n,i){var r=Uu({source:t,type:"api",entrypoint:n});r&&i({When:0,Kind:r.Kind,Args:r.Args})}function Sa(t,n){return(0,e.__awaiter)(this,void 0,Yn,function(){var i,s,o,a,c;return(0,e.__generator)(this,function(h){switch(h.label){case 0:if(h.trys.push([0,2,,3]),gr||yr||function(t){return!!R(t,"_fs_use_polyfilled_apis","boolean")}(t))return[2,(0,e.__assign)((0,e.__assign)({},n),{status:r.Clean})];if(!t.document||n.status!==r.Unknown)return[2,n];if(i=function(t,n){var i=n.functions,s={},o=(0,e.__assign)({},n.helpers);if(o.functionToString=function(t,n){var i,r,e=null===(i=t["__core-js_shared__"])||void 0===i?void 0:i.inspectSource;if(e){var s=function(){return e(this)};if(ka(s,2))return s}var o=null===(r=t["__core-js_shared__"])||void 0===r?void 0:r["native-function-to-string"];if(ka(o))return o;var u=n.__zone_symbol__OriginalDelegate;return ka(u)?u:ka(n)?n:void 0}(t,o.functionToString),!o.functionToString)return n;var u=!1;for(var a in i)if(i[a]){if(s[a]=Ia(o.functionToString,i[a]),s[a]||(s[a]=Ta(o.functionToString,o,a)),!s[a])return n;s[a]!==i[a]&&(u=!0)}else s[a]=void 0;return{status:r.Clean,functions:u?s:i,helpers:o,errors:[]}}(t,n),i.status===r.Clean)return[2,i];(s=t.document.createElement("iframe")).id="FullStory-iframe",s.className="fs-hide",s.style.display="none",o=t.document.body||t.document.head||t.document.documentElement||t.document;try{o.appendChild(s)}catch(t){return[2,(0,e.__assign)((0,e.__assign)({},n),{status:r.Clean})]}return s.contentWindow?(a=u(s.contentWindow,r.Clean),s.parentNode&&s.parentNode.removeChild(s),a.status===r.UnrecoverableFailure?[2,(0,e.__assign)((0,e.__assign)({},n),{status:r.Clean})]:[4,xa(a,n)]):[2,(0,e.__assign)((0,e.__assign)({},n),{status:r.Clean})];case 1:return[2,h.sent()];case 2:return c=h.sent(),Tt.sendToBugsnag(c,"error"),[2,(0,e.__assign)((0,e.__assign)({},n),{status:r.Clean})];case 3:return[2];}})})}function xa(t,n){var i,s=new Yn(function(t){return i=t});return setTimeout(function(){try{t.functions.jsonParse("[]").push(0)}catch(t){i((0,e.__assign)((0,e.__assign)({},n),{status:r.Clean}))}i(t)}),s}function ka(t,n){var i;if(void 0===n&&(n=0),!t)return!1;try{t.call(function(){})}catch(t){return!1}var r=function(t){try{return void t.call(null)}catch(t){return (t.stack||"").replace(/__fs_nomangle_check_stack(.|\n)*$/,"");}},e=void 0;0!==n&&"number"==typeof Error.stackTraceLimit&&(e=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY);var s=[function(){throw new Error("")},t],o=function __fs_nomangle_check_stack(){return s.map(r)}(),u=o[0],a=o[1];if(void 0!==e&&(Error.stackTraceLimit=e),!u||!a)return!1;for(var c="\n".charCodeAt(0),h=u.length>a.length?a.length:u.length,f=1,v=f;v=0}var Aa=["__zone_symbol__OriginalDelegate","nr@original"];function Ia(t,n){if(n){for(var i=0,r=Aa;i0&&this.lc[t].some(function(t){return!t.disconnected})},t.prototype.takeRecords=function(t){var n,i=null!==(n=this.lc[t.type])&&void 0!==n?n:[];if(0!==i.length)for(var r=0,e=i;r-1,!!ja.userAgent.match("CriOS")||"Google Inc."===Oa&&!Ma&&!Ka),Fa=/Firefox/.test(window.navigator.userAgent);function Da(t){if(!Fa)return!1;var n=window.navigator.userAgent.match(/Firefox\/(\d+)/);return!(!n||!n[1])&&parseInt(n[1],10)0||null===H){n="Init config rejected: "+R.unrecoverable.join(",\n"),k(t,new Error(n));break}R.recoverable.length>0&&(n="Init config partially rejected: "+R.recoverable.join(",\n")),a=H,x(t);break;default:(0,Ir.nt)(t,"invalid operation");}}catch(n){Tt.sendToBugsnag(n,"error"),k(t,n)}},A=0,I=p;A=0;u--)(e=t[u])&&(o=(s<3?e(o):s>3?e(n,i,o):e(n,i))||o);return s>3&&o&&Object.defineProperty(n,i,o),o}function a(t,n){return function(i,r){n(i,r,t)}}function c(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function h(t,n,i,r){return new(i||(i=Promise))(function(e,s){function o(t){try{a(r.next(t))}catch(t){s(t)}}function u(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(t){t(n)})).then(o,u)}a((r=r.apply(t,n||[])).next())})}function f(t,n){var i,r,e,s,o={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return s={next:u(0),"throw":u(1),"return":u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(e=2&s[0]?r["return"]:s[0]?r["throw"]||((e=r["return"])&&e.call(r),0):r.next)&&!(e=e.call(r,s[1])).done)return e;switch(r=0,e&&(s=[2&s[0],e.value]),s[0]){case 0:case 1:e=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((e=(e=o.trys).length>0&&e[e.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!e||s[1]>e[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,n){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,e,s=i.call(t),o=[];try{for(;(void 0===n||n-->0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=s["return"])&&i.call(s)}finally{if(e)throw e.error}}return o}function w(){for(var t=[],n=0;n1||u(t,n)})})}function u(t,n){try{(i=e[t](n)).value instanceof y?Promise.resolve(i.value.v).then(a,c):h(s[0][2],i)}catch(t){h(s[0][3],t)}var i}function a(t){u("next",t)}function c(t){u("throw",t)}function h(t,n){t(n),s.shift(),s.length&&u(s[0][0],s[0][1])}}function E(t){var n,i;return n={},r("next"),r("throw",function(t){throw t}),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,e){n[r]=t[r]?function(n){return(i=!i)?{value:y(t[r](n)),done:"return"===r}:e?e(n):n}:e}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=t[Symbol.asyncIterator];return i?i.call(t):(t=d(t),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=t[i]&&function(n){return new Promise(function(r,e){!function(t,n,i,r){Promise.resolve(r).then(function(n){t({value:n,done:i})},n)}(r,e,(n=t[i](n)).done,n.value)})}}}function x(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}var k=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t["default"]=n};function _(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&v(n,t,i);return k(n,t),n}function A(t){return t&&t.__esModule?t:{"default":t}}function I(t,n,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:n.get(t)}function T(t,n,i,r,e){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!e:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?e.call(t,i):e?e.value=i:n.set(t,i),i}function C(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)}}},n={};function i(r){var e=n[r];if(void 0!==e)return e.exports;var s=n[r]={exports:{}};return t[r](s,s.exports,i),s.exports}i.d=function(t,n){for(var r in n)i.o(n,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},i.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(248)}(); +"use strict";!function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};function n(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var n,i=1,r=arguments.length;i0&&e[e.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!e||o[1]>e[0]&&o[1]0&&this.i(s)}},t.prototype.setCookie=function(t,n,i){this._setCookie(t,n,i)},Object.defineProperty(t.prototype,"cookies",{get:function(){return this._cookies},enumerable:!1,configurable:!0}),t.prototype.clearCookie=function(t,n){this._cookies[t]&&(this.t.cookie=o(this.v,t,"","Thu, 01 Jan 1970 00:00:01 GMT"),delete this._cookies[t]);try{delete localStorage[null!=n?n:t]}catch(t){}},t.prototype._setCookie=function(t,n,i){try{if(this.t.cookie=o(this.v,t,n,i),this.t.cookie&&this.t.cookie.indexOf(n)>-1)return;this.t.cookie=o(this.v,t,n,i,"None")}finally{this._cookies=Ui(this.t)}},t.prototype._=function(t,n,i,r){this._setCookie(t,i,r),function(t,n){try{localStorage[t]=n}catch(t){}}(null!=n?n:t,i)},t.prototype.S=function(t,n){var i,r=this._cookies[t];try{i=localStorage[null!=n?n:t]}catch(t){}return{cookieValue:r,localStorageValue:i}},t.prototype.k=function(t,n,i,r,e,s){void 0===s&&(s=3),r();for(var u=!1,o=!1,a=1;a-1||c.indexOf("Trident/")>-1,f=(h&&c.indexOf("Trident/5"),h&&c.indexOf("Trident/6"),h&&c.indexOf("rv:11")>-1),v=c.indexOf("Edge/")>-1,l=c.indexOf("Opera/")>-1,d=(c.indexOf("CriOS"),c.indexOf("Snapchat")>-1),p=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),w=/^((?!chrome|android).)*(safari)/i.test(window.navigator.userAgent),g=p||w;function m(){var t=window.navigator.userAgent.match(/Version\/(\d+)/);return t&&t[1]?parseInt(t[1],10):-1}function y(t){if(!g)return!1;var n=m();return n>=0&&n===t}function b(t){if(!g)return!1;var n=m();return n>=0&&n0}function H(t,n){q(t.childNodes,n)}function z(t,n){q(t.childNodes,n,!0)}function q(t,n,i){void 0===i&&(i=!1);for(var r=i?t.length-1:0,e=i?-1:t.length;r!==e;){var s=t[r];if(s&&"frag"in s&&!Si(s)&&Array.isArray(s.frag))s.frag.length&&q(s.childNodes,n,i);else if(n(s)===U.Exit)break;i?--r:++r}}function $(t){var n=t.nextSibling;return n&&t.parentNode&&n===t.parentNode.firstChild?null:n}function V(t){var n=t.previousSibling;return n&&t.parentNode&&n===t.parentNode.lastChild?null:n}function G(t){return t.parentNode}function Q(t){return F(t)?t.childNodes[0]:null}(N=U||(U={})).ContinueProcessing=0,N.Exit=1;var X=1,Y=9,J=4;function Z(t){try{var n=function(t){var n,i=null!==(n=t.ownerDocument)&&void 0!==n?n:t;return i.nodeType===Y?i:document}(t);Js(n.nodeType===Y,"unable to find document");var i=n.createTreeWalker(n,NodeFilter.SHOW_ALL,null,!1);return i.currentNode=t,i}catch(t){return}}function tt(t,n){var i=Z(t);if(i)for(var r=i.firstChild();r;)n(r),r=i.nextSibling()}function nt(t,n){var i=Z(t);if(i)for(var r=i.lastChild();r;)n(r),r=i.previousSibling()}function it(t){var n=Z(t);return n?n.nextSibling():null}function rt(t){var n=Z(t);return n?n.previousSibling():null}function et(t){var n=Z(t);return n?n.parentNode():null}function st(t){var n=Z(t);return n?n.firstChild():null}function ut(t){return!!st(t)}var ot,at,ct,ht,ft,vt,lt,dt,pt,wt,gt,mt,yt=!1;function bt(t){return(yt?st:Q)(t)}function St(t,n){return(yt?tt:H)(t,n)}function kt(t,n){return(yt?nt:z)(t,n)}function _t(t){return(yt?ut:F)(t)}function At(t){return(yt?it:$)(t)}function It(t){return(yt?et:G)(t)}function Et(t){return(yt?rt:V)(t)}function Tt(t){var n="Internal error: unable to determine what JSON error was";try{n=(n="".concat(t)).replace(/[^a-zA-Z0-9.:!, ]/g,"_")}catch(t){}return"\"".concat(n,"\"")}(at=ot||(ot={})).MUT_INSERT=2,at.MUT_REMOVE=3,at.MUT_ATTR=4,at.MUT_TEXT=6,at.MOUSEMOVE=8,at.MOUSEMOVE_CURVE=9,at.SCROLL_LAYOUT=10,at.SCROLL_LAYOUT_CURVE=11,at.MOUSEDOWN=12,at.MOUSEUP=13,at.CLICK=16,at.FOCUS=17,at.VALUECHANGE=18,at.RESIZE_LAYOUT=19,at.DOMLOADED=20,at.LOAD=21,at.PLACEHOLDER_SIZE=22,at.UNLOAD=23,at.BLUR=24,at.SET_FRAME_BASE=25,at.TOUCHSTART=32,at.TOUCHEND=33,at.TOUCHCANCEL=34,at.TOUCHMOVE=35,at.TOUCHMOVE_CURVE=36,at.NAVIGATE=37,at.PLAY=38,at.PAUSE=39,at.RESIZE_VISUAL=40,at.RESIZE_VISUAL_CURVE=41,at.RESIZE_DOCUMENT_CONTENT=42,at.RESIZE_SCROLLABLE_ELEMENT_CONTENT=43,at.LOG=48,at.ERROR=49,at.DBL_CLICK=50,at.FORM_SUBMIT=51,at.WINDOW_FOCUS=52,at.WINDOW_BLUR=53,at.HEARTBEAT=54,at.WATCHED_ELEM=56,at.PERF_ENTRY=57,at.REC_FEAT_SUPPORTED=58,at.SELECT=59,at.CSSRULE_INSERT=60,at.CSSRULE_DELETE=61,at.FAIL_THROTTLED=62,at.AJAX_REQUEST=63,at.SCROLL_VISUAL_OFFSET=64,at.SCROLL_VISUAL_OFFSET_CURVE=65,at.MEDIA_QUERY_CHANGE=66,at.RESOURCE_TIMING_BUFFER_FULL=67,at.MUT_SHADOW=68,at.DISABLE_STYLESHEET=69,at.FULLSCREEN=70,at.FULLSCREEN_ERROR=71,at.ADOPTED_STYLESHEETS=72,at.CUSTOM_ELEMENT_DEFINED=73,at.MODAL_OPEN=74,at.MODAL_CLOSE=75,at.LONG_FRAME=77,at.TIMING=78,at.STORAGE_WRITE_FAILURE=79,at.DOCUMENT_PROPERTIES=80,at.ENTRY_NAVIGATE=81,at.STATS=82,at.VIEWPORT_INTERSECTION=83,at.COPY=84,at.PASTE=85,at.URL_SALT=86,at.URL_ID=87,at.FRAME_STATUS=88,at.SCRIPT_COMPILED_VERSION=89,at.RESET_CSS_SHEET=90,at.ANIMATION_CREATED=91,at.ANIMATION_METHOD_CALLED=92,at.ANIMATION_PROPERTY_SET=93,at.DOCUMENT_TIMELINE_CREATED=94,at.KEYFRAME_EFFECT_CREATED=95,at.KEYFRAME_EFFECT_METHOD_CALLED=96,at.KEYFRAME_EFFECT_PROPERTY_SET=97,at.CAPTURE_SOURCE=98,at.PAGE_DATA=99,at.VISIBILITY_STATE=100,at.DIALOG=101,at.CSSRULE_UPDATE=102,at.CANVAS=103,at.CANVAS_DETACHED_DIMENSION=104,at.INIT_API=105,at.DEFERRED_RESOLVED=106,at.DEFERRED_MUT_INSERT=107,at.DEFERRED_MUT_SHADOW=108,at.ELEMENT_PROP=109,at.BFCACHE_STATE=110,at.SESSION_INFO=111,at.EVENT_CANCELED=112,at.KEEP_ELEMENT=2e3,at.KEEP_URL=2001,at.KEEP_BOUNCE=2002,at.KEEP_CRASH=2003,at.SYS_SETVAR=8193,at.SYS_RESOURCEHASH=8195,at.SYS_SETCONSENT=8196,at.SYS_CUSTOM=8197,at.SYS_REPORTCONSENT=8198,at.SYS_LETHE_MOBILE_BUNDLE_SEQ=8199,(ht=ct||(ct={})).Animation=0,ht.CSSAnimation=1,ht.CSSTransition=2,(vt=ft||(ft={})).Internal=0,vt.Public=1,(dt=lt||(lt={})).Unknown=0,dt.Serialization=1,(wt=pt||(pt={})).Unknown=0,wt.DomSnapshot=1,wt.NodeEncoding=2,wt.LzEncoding=3,wt.ApplyRules=4,wt.ProcessMut=5,(mt=gt||(gt={})).Unknown=0,mt.Successful=1,mt.BlocklistedFrame=2,mt.PartiallyLoaded=3,mt.MissingWindowOrDocument=4,mt.MissingDocumentHead=5,mt.MissingBodyOrChildren=6,mt.AlreadyDefined=7,mt.NoNonScriptElement=8,mt.Exception=9;var Ct,xt,Kt,Rt,Mt,Ot,jt,Pt,Ut,Nt,Lt,Dt,Bt,Wt,Ft,Ht,zt,qt,$t,Vt,Gt,Qt,Xt,Yt,Jt,Zt,tn,nn,rn,en,sn,un,on,an,cn,hn,fn,vn,ln,dn,pn,wn,gn,mn,yn,bn,Sn,kn,_n,An,In=["print","alert","confirm"];(xt=Ct||(Ct={}))[xt.Unset=0]="Unset",xt[xt.Entering=1]="Entering",xt[xt.Restored=2]="Restored",(Rt=Kt||(Kt={}))[Rt.Index=1]="Index",Rt[Rt.Cached=2]="Cached",(Ot=Mt||(Mt={})).GrantConsent=!0,Ot.RevokeConsent=!1,(Pt=jt||(jt={})).Page=0,Pt.Document=1,(Nt=Ut||(Ut={})).Unknown=0,Nt.Api=1,Nt.FsShutdownFrame=2,Nt.Hibernation=3,Nt.Reidentify=4,Nt.SettingsBlocked=5,Nt.Size=6,Nt.Unload=7,Nt.Hidden=8,(Dt=Lt||(Lt={})).Unknown=0,Dt.NotEmpty=1,Dt.EmptyBody=2,(Wt=Bt||(Bt={}))[Wt.UNSET=0]="UNSET",Wt[Wt.OK=1]="OK",Wt[Wt.ABORTED=2]="ABORTED",Wt[Wt.OPAQUE=3]="OPAQUE",Wt[Wt.ERROR=4]="ERROR",(Ht=Ft||(Ft={})).Timing=0,Ht.Navigation=1,Ht.Resource=2,Ht.Paint=3,Ht.Mark=4,Ht.Measure=5,Ht.Memory=6,Ht.TimeOrigin=7,Ht.LayoutShift=8,Ht.FirstInput=9,Ht.LargestContentfulPaint=10,Ht.LongTask=11,Ht.EventTiming=12,Ht.EventTimingCount=13,(qt=zt||(zt={})).Timing=["navigationStart","unloadEventStart","unloadEventEnd","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"],qt.Navigation=["name","startTime","duration","initiatorType","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","unloadEventStart","unloadEventEnd","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd","type","redirectCount","decodedBodySize","encodedBodySize","transferSize","activationStart"],qt.Resource=["name","startTime","duration","initiatorType","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","decodedBodySize","encodedBodySize","transferSize"],qt.Measure=["name","startTime","duration"],qt.Memory=["jsHeapSizeLimit","totalJSHeapSize","usedJSHeapSize"],qt.TimeOrigin=["timeOrigin"],qt.LayoutShift=["startTime","value","hadRecentInput"],qt.FirstInput=["name","startTime","duration","processingStart"],qt.EventTiming=["name","startTime","duration","processingStart","processingEnd","interactionId","target"],qt.LargestContentfulPaint=["name","startTime","duration","renderTime","loadTime","size"],qt.EventTimingCount=["interactionCount"],(Vt=$t||($t={})).Performance=0,Vt.PerformanceEntries=1,Vt.PerformanceMemory=2,Vt.Console=3,Vt.Ajax=4,Vt.PerformanceObserver=5,Vt.PerformanceTimeOrigin=7,Vt.WebAnimation=8,Vt.LayoutShift=9,Vt.FirstInput=10,Vt.LargestContentfulPaint=11,Vt.LongTask=12,Vt.HTMLDialogElement=13,Vt.CaptureOnStartupEnabled=14,Vt.CanvasWatcherEnabled=15,Vt.CanvasScreenShotMode=16,Vt.ResizeObserver=17,(Qt=Gt||(Gt={})).Node=1,Qt.Sheet=2,(Yt=Xt||(Xt={})).StyleSheetHooks=0,Yt.SetPropertyHooks=1,(Zt=Jt||(Jt={})).Document="document",Zt.Event="evt",Zt.Page="page",Zt.User="user",(nn=tn||(tn={})).FsId="fsidentity",nn.NewUid="newuid",(en=rn||(rn={})).Elide=0,en.Record=1,en.Allowlist=2,(un=sn||(sn={})).Any=0,un.Exclude=1,un.Mask=2,(an=on||(on={})).Erase=0,an.MaskText=1,an.ScrubUrl=2,an.ScrubCss=3,(hn=cn||(cn={})).Static=0,hn.Prefix=1,(vn=fn||(fn={})).SignalInvalid=0,vn.SignalDeadClick=1,vn.SignalRageClick=2,(dn=ln||(ln={})).ReasonNoSuchOrg=1,dn.ReasonOrgDisabled=2,dn.ReasonOrgOverQuota=3,dn.ReasonBlockedDomain=4,dn.ReasonBlockedIp=5,dn.ReasonBlockedUserAgent=6,dn.ReasonBlockedGeo=7,dn.ReasonBlockedTrafficRamping=8,dn.ReasonInvalidURL=9,dn.ReasonUserOptOut=10,dn.ReasonInvalidRecScript=11,dn.ReasonDeletingUser=12,dn.ReasonNativeHookFailure=13,(wn=pn||(pn={})).Unset=0,wn.Exclude=1,wn.Mask=2,wn.Unmask=3,wn.Watch=4,wn.Keep=5,wn.Defer=6,(mn=gn||(gn={})).Unset=0,mn.Click=1,(bn=yn||(yn={}))[bn.Page=1]="Page",bn[bn.Bundle=2]="Bundle",bn[bn.Event=6]="Event",bn[bn.Settings=8]="Settings",(kn=Sn||(Sn={}))[kn.Error=3]="Error",kn[kn.Page=4]="Page",kn[kn.Bundle=5]="Bundle",kn[kn.Event=7]="Event",kn[kn.Settings=9]="Settings",(An=_n||(_n={})).MaxPerfMarksPerPage=16384,An.MaxLogsPerPage=1024,An.MaxUrlLength=2048,An.MutationProcessingInterval=250,An.CurveSamplingInterval=142,An.DefaultBundleUploadInterval=5e3,An.HeartbeatInterval=256200,An.PageInactivityTimeout=18e5,An.BackoffMax=3e5,An.ScrollSampleInterval=An.MutationProcessingInterval/5,An.SyntheticClickTimeout=An.ScrollSampleInterval+5,An.InactivityThreshold=4e3,An.MaxAjaxPayloadLength=16384,An.DefaultOrgSettings={MaxPerfMarksPerPage:An.MaxPerfMarksPerPage,MaxConsoleLogPerPage:An.MaxLogsPerPage,MaxAjaxPayloadLength:An.MaxAjaxPayloadLength,MaxUrlLength:An.MaxUrlLength,RecordPerformanceResourceImg:!0,RecordPerformanceResourceTiming:!0,HttpRequestHeadersAllowlist:[],HttpResponseHeadersAllowlist:[],UrlPrivacyConfig:[{Exclude:{Hash:[{Expression:"#.*"}],QueryParam:[{Expression:"(=)(.*)"}]}}],AttributeBlocklist:[{Target:sn.Any,Tag:"*",Name:"",Type:cn.Prefix,Action:on.Erase}]},An.DefaultStatsSettings={MaxPayloadLength:8192,MaxEventTypeLength:1024},An.BlockedFieldValue="__fs__redacted",An.DefaultRecDisabledMessage="Capture disabled. Turn on debug mode for more information.",An.ShutdownMessage="Shutdown called.",An.TextPlain="text/plain";var En,Tn,Cn,xn,Kn,Rn,Mn,On,jn,Pn,Un="_fs_uid",Nn="_fs_cid",Ln="_fs_lua",Dn="_fs_trust_event",Bn="_fs",Wn="__fs",Fn="gzip",Hn="identity";(Tn=En||(En={}))[Tn.Inactive=1]="Inactive",Tn[Tn.Pending=2]="Pending",Tn[Tn.ShouldFlush=3]="ShouldFlush",(xn=Cn||(Cn={}))[xn.Shutdown=1]="Shutdown",xn[xn.Starting=2]="Starting",xn[xn.Started=3]="Started",xn[xn.Fatal=4]="Fatal",(Rn=Kn||(Kn={})).Set=0,Rn.Function=1,(On=Mn||(Mn={}))[On.Disabled=0]="Disabled",On[On.CaptureCanvasOps=1]="CaptureCanvasOps",On[On.ScreenshotCanvas=2]="ScreenshotCanvas",(Pn=jn||(jn={})).EndPreviewMode="EndPreviewMode",Pn.EvtBundle="EvtBundle",Pn.GreetFrame="GreetFrame",Pn.InitFrameMobile="InitFrameMobile",Pn.RequestFrameId="RequestFrameId",Pn.RestartFrame="RestartFrame",Pn.SetConsent="SetConsent",Pn.SetFrameId="SetFrameId",Pn.ShutdownFrame="ShutdownFrame",Pn.Unknown="Unknown";var zn="_fs_dwell_passed",qn="__wayfinder",$n="__wayfinder_style_v1";function Vn(t){return C.arrayIsArray(t)}function Gn(t,n){for(var i=0,r=t;in)return!1;return i==n}function oi(t,n){var i=0;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&++i>n)return!0;return!1}function ai(t){return function(){for(var n,i,r=this,e=[],s=0;s")}function di(t){return C.jsonParse(t)}var pi=function(){function t(t,n,i){void 0===i&&(i=!1),this.K=t,this.R=n,this.M=i,this.O=L,this.j=void 0,this.P=L,this.U=L,this.N=!1}return t.prototype.before=function(t){return this.O=ci(t),this},t.prototype.replaceSync=function(t){return this.j=ci(t),this},t.prototype.afterSync=function(t){return this.P=ci(t),this},t.prototype.afterAsync=function(t){return this.U=ci(function(n){C.setWindowTimeout(window,P(function(){t(n)}),0)}),this},t.prototype.disable=function(){if(this.N=!1,this.L){var t=this.L,n=t.override,i=t["native"];this.K[this.R]===n&&(this.K[this.R]=i,this.L=void 0)}},t.prototype.enable=function(){if(this.N=!0,this.L)return!0;this.L=this.D();try{this.K[this.R]=this.L.override}catch(t){return!1}return!0},t.prototype.getTarget=function(){return this.K},t.prototype.D=function(){var t=this,n=this,r=this.K[this.R],e=function(){for(var t=[],e=0;e=0){var s=e.split("/"),u=s[0],o=s[1];i[r]=u,n=o;break}}var a=function(t){var n=parseInt(null!=t?t:"",10),i=Oi(),r=ji()+86400;return isNaN(n)?r:n<=i?void 0:n>r?r:n}(n);if(!a)return null;i[0];var c=i[1],h=i[2],f=i[3],v="";f&&(v=decodeURIComponent(f),(Ri.indexOf(v)>=0||Mi.indexOf(v)>=0)&&("Ignoring invalid app key \"".concat(v,"\" from cookie."),v=""));var l=(null!=h?h:"").split(":"),d=l[0],p=l[1],w=l[2];return l[3],{appKeyHash:v,expirationAbsTimeSeconds:a,userId:d,orgId:c,pageCount:Xn(l[4]),sessionId:null!=p?p:"",sessionStartTime:Xn(w)}}function Ui(t){var n={};try{for(var i=t.cookie.split(";"),r=0;r1))return s}}(t);if(!i||!Zi(n))return n;var r="";return 0===n.indexOf("www.")&&(n=n.slice(4),r="www."),0===n.indexOf("".concat(i,"."))&&(n=n.slice("".concat(i,".").length)),"".concat(r).concat(i,".").concat(n)}}function pr(t){return t?Gi(function(t){var n=t,i=n.indexOf(":");return i>=0&&(n=n.slice(0,i)),n}(t))?t:0==t.indexOf("www.")?"app.".concat(t.slice(4)):"app.".concat(t):t}function wr(t){var n=Xi(t);if(n)return"".concat(n,"/s/fs.js")}var gr=function(t,n,i){this.name="ProtocolError",this.message=n,this.status=t,this.data=i};function mr(t){return t>=400&&502!==t||202==t||206==t}function yr(t){return t instanceof gr&&mr(t.status)}function br(t){return"function"==typeof t}var Sr,kr,_r,Ar,Ir,Er=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},Tr=0,Cr=function(t,n){xr[Tr]=t,xr[Tr+1]=n,2===(Tr+=2)&&Sr()},xr=new Array(1e3);function Kr(){for(var t=0;t-1&&s>n&&o?(r.push(o.slice(0,o.length-(s-n))),t.cancel()["catch"](function(t){}),[2,r]):a?[2,r]:(void 0!==o&&r.push(o),[3,1]);case 3:return[2]}})})}var ae=function(t){return r(void 0,void 0,ie,function(){return e(this,function(n){switch(n.label){case 0:return[4,oe(t)];case 1:return[2,se(n.sent())]}})})};function ce(){return r(this,void 0,ie,function(){var t,n,i,r;return e(this,function(e){return t=new TextEncoderStream,n=new CompressionStream("gzip"),t.readable.pipeThrough(n),i=t.writable.getWriter(),r=n.readable.getReader(),[2,[{write:function(t){return i.ready.then(function(){return i.write(t)})},finalize:function(){return i.ready.then(function(){return i.close()})},onError:function(){i.abort()["catch"](function(t){}),r.cancel()["catch"](function(t){})}},ae(r)]]})})}function he(t){return r(this,void 0,ie,function(){var n,i,r;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,ce()];case 1:return r=e.sent(),n=r[0],i=r[1],[4,n.write(t)];case 2:return e.sent(),[4,n.finalize()];case 3:return e.sent(),[4,i];case 4:return[2,e.sent()];case 5:return e.sent(),null==n||n.onError(),[2,null];case 6:return[2]}})})}function fe(){return r(this,void 0,ie,function(){return e(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,he("fullstory")];case 1:return[2,null!=t.sent()];case 2:return t.sent(),[3,3];case 3:return[2,!1]}})})}var ve=new ie(function(t){r(void 0,void 0,ie,function(){var n;return e(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,ie.race([fe(),ee(500).then(function(){return!1})])];case 1:return n=i.sent(),t(n),[3,3];case 2:return i.sent(),t(!1),[3,3];case 3:return[2]}})})}),le=function(){var t=function(){try{var t=new MessageChannel;return t.port1.start(),t}catch(t){return null}}();return t?new ie(function(n){var i=t.port1,r=t.port2,e=function(){n(),i.removeEventListener("message",e),i.close()};i.addEventListener("message",e),r.postMessage(void 0),r.close()}):ee(0)},de=function(){return r(void 0,void 0,ie,function(){var t;return e(this,function(n){switch(n.label){case 0:return(t=C.requestWindowAnimationFrame)?[4,new ie(function(n){return t(window,n)})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,le()];case 3:return n.sent(),[2]}})})};function pe(t){void 0===t&&(t=16);var n=xi()+t;return{timeRemaining:function(){return Math.max(0,n-xi())},didTimeout:!1}}function we(t,n){return r(this,void 0,ie,function(){var i,r,s,u;return e(this,function(e){switch(e.label){case 0:return(i=t.ResizeObserver)?(r=t.document,s=r.documentElement||r.body||r.head,u=null!=n?n:s,[2,new ie(function(t){var n=new i(function(){de().then(function(){n.unobserve(u),t()})});n.observe(u)})]):[4,de()];case 1:return e.sent(),[2]}})})}function ge(t,n){throw void 0===n&&(n="Reached unexpected case in exhaustive switch"),new Error(n)}var me=function(t){for(var n=[],i=0,r=t;i-1)return h.substring(f)}return h;default:return ge()}}var as={},cs=function(t,n){void 0===n&&(n=window);try{var i=n.location,r=i.origin,e=i.pathname,s=i.search,u="".concat(r).concat(e).concat(s),o=as[u];return o?o.lastIndex=0:(o=new RegExp("".concat((c=u,Je.test(c)?c.replace(Ye,"\\$&"):c),"/?(#)"),"g"),as[u]=o),t.replace(o,"".concat("https://fs-currenturl.invalid","$1"))}catch(n){var a="cleanCSS";return tu(a,a,{err:n}),t}var c},hs=/^data:/i;function fs(t,n){if(hs.test(t))return t;switch(n.source){case"dom":switch(n.type){case"frame":case"iframe":return ms(t);default:return vs(t)}case"event":switch(n.type){case ot.AJAX_REQUEST:case ot.NAVIGATE:return vs(t);case ot.SET_FRAME_BASE:return ms(t);default:return ge()}case"log":return ms(t);case"page":switch(n.type){case"base":return ms(t);case"referrer":case"url":return vs(t);default:return ge()}case"perfEntry":switch(n.type){case"frame":case"iframe":case"navigation":case"other":return ms(t);default:return vs(t)}default:return ge()}}function vs(t){return ys(ps,t)}var ls=_n.DefaultOrgSettings.MaxUrlLength,ds=me(_n.DefaultOrgSettings.UrlPrivacyConfig),ps=me(_n.DefaultOrgSettings.UrlPrivacyConfig);function ws(t,n){ds=me(_n.DefaultOrgSettings.UrlPrivacyConfig.concat(t)),ps=me(t),ls=n||_n.DefaultOrgSettings.MaxUrlLength}function gs(t,n){Qs.send(t,"error",n)}function ms(t){return ys(ds,t)}function ys(t,n){return Me(t,n,ke,gs).substring(0,ls)}var bs=/([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)/gi,Ss=/(?:(http)|(ftp)|(ws)|(blob)|(file))[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+#]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+/gi;function ks(t){return t.replace(bs,"").replace(Ss,function(t){return fs(t,{source:"log",type:"debug"})})}var _s,As="https://fs-excluded.invalid";function Is(t){var n,i,r,e,s,u,o,a,c,h,f,v,l,d,p,w;try{for(var g=(_s={blocklist:{},hasPrefix:!1}).blocklist,m=(null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0)>0?t:_n.DefaultOrgSettings.AttributeBlocklist,y={},b=0,S=m;b2e6?[4,le()]:[3,4];case 3:e.sent(),e.label=4;case 4:return window,v=n(r),[4,js(this.ot.window,this.st,null!==(u=r.recHost)&&void 0!==u?u:Hs(this.ot),v,c)];case 5:return l=e.sent().text,d=di(l),window,[2,[f,d]]}})})},t.prototype.ft=function(t){return r(this,void 0,ie,function(){var n,i,r;return e(this,function(e){switch(e.label){case 0:return n=t[0],"string"===(i=t[1]).type&&this.et?[4,he(i.data)]:[3,2];case 1:if(null!=(r=e.sent()))return[2,[n,{type:"ArrayBuffer",data:r,encoding:Fn},r.byteLength]];this.et=!1,tu("compression failed","compression failed"),e.label=2;case 2:return[2,t]}})})},t.prototype.bundleBeacon=function(t){var n;return Ls(this.st,null!==(n=t.recHost)&&void 0!==n?n:Hs(this.ot),t)},t.prototype.startBeacon=function(t){return r(this,void 0,ie,function(){return e(this,function(n){return[2,Ds(this.ot.window,this.st,Hs(this.ot),t)]})})},t}(),Ks=function(){function t(t){this.st=t.options.scheme,this.ot=t}return t.prototype.uploadResource=function(t){return r(this,void 0,ie,function(){return e(this,function(n){switch(n.label){case 0:return[4,js(this.ot.window,this.st,Hs(this.ot),"/rec/uploadResource",t)];case 1:return[2,n.sent().text]}})})},t.prototype.queryResources=function(t){return r(this,void 0,ie,function(){return e(this,function(n){switch(n.label){case 0:return[4,js(this.ot.window,this.st,Hs(this.ot),"/rec/queryResources",{type:"string",data:hi(t)})];case 1:return[2,di(n.sent().text)]}})})},t}();function Rs(t,n){return void 0===n&&(n=xi()),Os("/rec/bundle".concat("v2"===t.version?"/v2":""),t,n)}function Ms(t,n){return void 0===n&&(n=xi()),Os("/rec/event",t,n)}function Os(t,n,i){var r=n.bundle,e=r[0],s=r[1],u="encoding"in s?s.encoding:Hn,o="".concat(t,"?OrgId=").concat(n.orgId,"&UserId=").concat(n.userId,"&SessionId=").concat(n.sessionId,"&PageId=").concat(n.pageId,"&Seq=").concat(e,"&ClientTime=").concat(i);return null!=n.serverPageStart&&(o+="&PageStart=".concat(n.serverPageStart)),null!=n.serverBundleTime&&(o+="&PrevBundleTime=".concat(n.serverBundleTime)),null!=n.lastUserActivity&&(o+="&LastActivity=".concat(n.lastUserActivity)),n.isNewSession&&(o+="&IsNewSession=true"),null!=n.deltaT&&(o+="&DeltaT=".concat(n.deltaT)),u===Fn&&(o+="&ContentEncoding=".concat(Fn)),o}function js(t,n,i,s,u){return r(this,void 0,ie,function(){return e(this,function(r){return[2,Us(t,"POST",n,i,zs(s),!0,u)]})})}function Ps(t,n,i,s){return r(this,void 0,ie,function(){return e(this,function(r){return[2,Us(t,"GET",n,i,zs(s),!1)]})})}function Us(t,n,i,s,u,o,a){return r(this,void 0,ie,function(){var r,c,h,f,v,l,d;return e(this,function(e){switch(e.label){case 0:switch(r=function(t){return tr(t,"_fs_request","function")}(t)||Ns,c="//".concat(s).concat(u),h={},null==a?void 0:a.type){case"string":case"ArrayBuffer":h["Content-Type"]=_n.TextPlain}e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r(i,n,c,o,h,a)];case 2:return f=e.sent(),[3,4];case 3:throw v=e.sent(),Qs.send(v,"error"),v;case 4:if(l={text:f.responseText},200==f.status)return[2,l];try{d=di(l.text)}catch(t){}throw new gr(f.status,l.text,d)}})})}function Ns(t,n,i,s,u,o){return r(this,void 0,ie,function(){var r;return e(this,function(e){return r=function(t){switch(null==t?void 0:t.type){case"string":case"ArrayBuffer":return t.data;case"FormData":var n=new FormData;for(var i in t.data){var r=t.data[i];if(void 0!==r)if("string"==typeof r)n.append(i,r);else{var e=new Blob([r.data],{type:r.contentType});n.append(i,e,r.filename)}}return n;default:return}}(o),[2,new ie(function(e){var o=!1,a=new XMLHttpRequest;for(var c in a.onreadystatechange=function(){a.readyState!==J||o||(o=!0,e({status:a.status,responseText:a.responseText}))},a.open(n,"".concat(t).concat(i),!0),a.withCredentials=s,u)a.setRequestHeader(c,u[c]);a.send(r)})]})})}function Ls(t,n,i){return Bs("".concat(t,"//").concat(n).concat(Rs(i),"&SkipResponseBody=true"),i.bundle[1])}function Ds(t,n,i,s){return r(this,void 0,ie,function(){var r,u,o,a,c;return e(this,function(e){switch(e.label){case 0:r=t.document.referrer,u=r?fs(r,{source:"page",type:"referrer"}):"",o="orgId=".concat(s.orgId,"&userId=").concat(s.userId,"&sessionId=").concat(s.sessionId),a={referrer:u},e.label=1;case 1:return e.trys.push([1,3,,4]),[4,js(t,n,i,"/rec/beacon?".concat(o),{type:"string",data:hi(a)})];case 2:return e.sent(),[3,4];case 3:return c=e.sent(),"failed to send session start beacon ".concat(c),[3,4];case 4:return[2]}})})}function Bs(t,n){return(tr(window,"_fs_beacon","function")||Ws)(t,n)}function Ws(t,n){if("function"==typeof navigator.sendBeacon)try{return navigator.sendBeacon.bind(navigator)(t,n.data)}catch(t){}return!1}function Fs(t,n,i,s){var u;return r(this,void 0,ie,function(){var r,o;return e(this,function(e){switch(e.label){case 0:return r=null!==(u=s.version)&&void 0!==u?u:"v1",o=s.previewMode?"?previewMode=true":"",[4,Ps(t,n,i,"/s/settings/".concat(s.orgId,"/").concat(r,"/web").concat(o))];case 1:return[2,di(e.sent().text)]}})})}function Hs(t){var n,i=null===(n=t.recording.pageResponse())||void 0===n?void 0:n.GCLBSubdomain,r=t.options.recHost;return i&&Zi(r)?r.replace(/^rs\./,"".concat(i,".")):r}function zs(t){if(!window.Zone)return t;var n="?";return t.indexOf(n)>-1&&(n="&"),"".concat(t).concat(n,"ngsw-bypass=true")}var qs=/function\s*([\w\-$]+)?\s*\(/i;function $s(t){return t.stack||t.backtrace||t.stacktrace}function Vs(){var t,n;try{throw new Error("")}catch(i){t="\n",n=$s(i)}if(!n){t="\n";var i=[];try{for(var r=arguments.callee.caller.caller;r&&i.length<10;){var e=qs.test(r.toString())&&RegExp.$1||"[anonymous]";i.push(e),r=r.caller}}catch(t){t.toString()}n=i.join("\n")}return t+n}function Gs(){try{return window.self!==window.top}catch(t){return!0}}var Qs=function(){function t(){}return t.wrap=function(n,i){return void 0===i&&(i="error"),P(n,function(n){return t.send(n,i)})},t.vt=15,t.send=function(n,i,r){if(!(t.vt<=0)){t.vt--;var e=n;"string"==typeof e&&(e=new Error(e));var s=Ui(document).fs_uid,u=s?Pi(s):void 0;u&&u.orgId!=sr(window)&&(u=void 0);var o=new Date(1722436201e3).toISOString(),a={projectRoot:window.location.origin,deviceTime:xi(),inIframe:Gs(),CompiledVersion:"02de958fc73c1c50dec6d324a9487bc6a363c081",CompiledTimestamp:1722436201,CompiledTime:o,orgId:sr(window),"userId:sessionId":u?"".concat(u.userId,":").concat(u.sessionId):"NA",context:document.location&&document.location.pathname,message:e.message,name:"Recording Error",releaseStage:"production ".concat(o),severity:i,language:bi(window),stacktrace:$s(e)||Vs()},c=function(t,n,i){var r="".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(i));t.push(r)},h=[];for(var f in a)c(h,f,a[f]||"");if(r)for(var f in r){var v=Xs(r[f]);c(h,"aux_".concat(f),v)}if(!cr(window)){var l="https://".concat(rr(window),"/rec/except?").concat(h.join("&"));Bs(l,{data:"",type:"string"})||(new Image().src=l)}}},t}();function Xs(t){try{var n="".concat(typeof t,": ").concat(hi(t));return"function"==typeof t.toString&&(n+=" (toString: ".concat(t.toString(),")")),n}catch(t){return"failed to serialize \"".concat(null==t?void 0:t.message,"\"")}}var Ys={};function Js(t,n,i){if(void 0===i&&(i=1),t)return!0;if(Ys[n]=Ys[n]||0,Ys[n]++,Ys[n]>i)return!1;var r=new Error("Assertion failed: ".concat(n));return Qs.send(r,"error"),t}var Zs={};function tu(t,n,i){var r;Zs[t]=null!==(r=Zs[t])&&void 0!==r?r:0,Zs[t]++,Zs[t]>1||Qs.send(n,"error",i)}function nu(t){var n=t.target,i=t.type,r=t.fn,e=t.options;void 0!==r&&null!=n&&("function"==typeof n.addEventListener?n.addEventListener(i,r,e):"function"==typeof n.addListener?n.addListener(r):"Target of ".concat(i," doesn't seem to support listeners"))}function iu(t){var n=t.target,i=t.type,r=t.fn,e=t.options;void 0!==r&&null!=n&&("function"==typeof n.removeEventListener?n.removeEventListener(i,r,e):"function"==typeof n.removeListener?n.removeListener(r):"Target of ".concat(i," doesn't seem to support listeners"))}function ru(t){t.target&&(iu(t),t.target=null,t.fn=void 0)}var eu=function(){function t(){var t=this;this.lt=[],this.dt=[],this.wt=!0,this.gt=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t.wt={capture:!0,passive:!0},t.gt={capture:!1,passive:!0}}});window.addEventListener("test",L,n)}catch(t){}}return t.prototype.add=function(t,n,i,r,e){return void 0===e&&(e=!1),this.addCustom(t,n,i,r,e)},t.prototype.addCustom=function(t,n,i,r,e){void 0===e&&(e=!1);var s={target:t,type:n,fn:Qs.wrap(ai(function(t){(e||!1!==t.isTrusted||"message"==n||t[Dn])&&r(t)})),options:i?this.wt:this.gt,index:this.lt.length};return this.lt.push(s),nu(s),s},t.prototype.clear=function(){for(var t=0;t0&&c>0)return this.width=a,void(this.height=c)}if(void 0!==n&&this.clientWidth==n.clientWidth&&this.clientHeight==n.clientHeight&&n.width>0&&n.height>0)return this.width=n.width,void(this.height=n.height);r=this.yt(t),this.width=r[0],this.height=r[1]}}return t.prototype.yt=function(t){var n=fu(t,"width",this.clientWidth,this.clientWidth+128);void 0===n&&(n=du(t,"innerWidth")),void 0===n&&(n=this.clientWidth);var i=fu(t,"height",this.clientHeight,this.clientHeight+128);return void 0===i&&(i=du(t,"innerHeight")),void 0===i&&(i=this.clientHeight),[n,i]},t}();function fu(t,n,i,r){if(C.matchMedia){var e=i,s=r,u=C.matchMedia(t,"(min-".concat(n,": ").concat(e,"px)"));if(null!=u){if(u.matches&&C.matchMedia(t,"(max-".concat(n,": ").concat(e,"px)")).matches)return e;for(;e<=s;){var o=C.mathFloor((e+s)/2);if(C.matchMedia(t,"(min-".concat(n,": ").concat(o,"px)")).matches){if(C.matchMedia(t,"(max-".concat(n,": ").concat(o,"px)")).matches)return o;e=o+1}else s=o-1}}}}function vu(t,n){return new hu(t,n)}var lu=function(t,n){this.offsetLeft=0,this.offsetTop=0,this.pageLeft=0,this.pageTop=0,this.width=0,this.height=0,this.scale=0;var i=t.document;if(i.body){"pageXOffset"in t?(this.pageLeft=t.pageXOffset,this.pageTop=t.pageYOffset):i.scrollingElement?(this.pageLeft=i.scrollingElement.scrollLeft,this.pageTop=i.scrollingElement.scrollTop):au(i)?(this.pageLeft=i.body.scrollLeft,this.pageTop=i.body.scrollTop):i.documentElement&&(i.documentElement.scrollLeft>0||i.documentElement.scrollTop>0)?(this.pageLeft=i.documentElement.scrollLeft,this.pageTop=i.documentElement.scrollTop):(this.pageLeft=i.body.scrollLeft||0,this.pageTop=i.body.scrollTop||0),this.offsetLeft=this.pageLeft-n.pageLeft,this.offsetTop=this.pageTop-n.pageTop;var r=0,e=0;try{r=t.innerWidth,e=t.innerHeight}catch(t){return}if(0!=r&&0!=e){this.scale=n.width/r,this.scale<1&&(this.scale=1);var s=n.width-n.clientWidth,u=n.height-n.clientHeight;this.width=r-s/this.scale,this.height=e-u/this.scale}}};function du(t,n){try{return t[n]}catch(t){return}}function pu(t){var n=[t.clientWidth,t.clientHeight];return t.width===t.clientWidth&&t.height===t.clientHeight||n.push(t.width,t.height),n}function wu(t){var n=t.tagName;return n?"object"==typeof n?"form":n.toLowerCase():null}var gu=/(\s*(\S+)(\s+(?:\d+w|[\d.]+x)){0,1}\s*[,])/gm,mu=/((\s*(\S+)(\s+(?:\d+w|[\d.]+x)){0,1}\s*(\s*\d+\S){0,1}(\s*\d+(.\d*){0,1}\S){0,1}\s*)[,])/gm,yu={},bu=1;function Su(t,n){var i,r;return void 0===n&&(n=Au(t)),null!==(r=null===(i=null==n?void 0:n.watchKind)||void 0===i?void 0:i.hasKinds())&&void 0!==r&&r}function ku(t,n){var i,r;return void 0===n&&(n=Au(t)),null!==(r=null===(i=null==n?void 0:n.watchKind)||void 0===i?void 0:i.has(Fe.Exclude))&&void 0!==r&&r}function _u(t,n){return void 0===n&&(n=Au(t)),!!n&&!!n.mask}function Au(t){var n=t?t[Bn]:null;return n?yu[n]:null}function Iu(t){return yu[t]}function Eu(t){try{return t&&t[Bn]||0}catch(t){return 0}}function Tu(t){return t&&!ku(t)?Eu(t):0}function Cu(t,n){t.parent&&(n(t),t.parent.child==t&&(t.parent.child=t.next),t.parent.lastChild==t&&(t.parent.lastChild=t.prev),t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent=t.prev=t.next=null,delete yu[t.id],t.node[Bn]==t.id&&(t.node[Bn]=0),t.id=0,t.child&&xu(t.child,n))}function xu(t,n){for(var i=[t];i.length>0&&i.length<1e4;){var r=i.pop();n(r),delete yu[r.id],r.node[Bn]==r.id&&(r.node[Bn]=0),r.id=0,r.next&&i.push(r.next),r.child&&i.push(r.child)}Js(i.length<1e4,"clearIds is fast")}var Ku,Ru,Mu=function(t,n,i){function r(n,i){var r=0;try{t(n,function(t,n){if(r++>i)throw"break";if("object"==typeof n)return n})}catch(t){return"break"!=t}return!1}var e=function(t,n,i){return void 0===i&&(i="..."),t.length<=n?t:t.length<=i.length||n<=i.length?t.substring(0,n):t.substring(0,n-i.length)+i};function s(r,u,o,a){if(u<1)return 0;var c=function(t){switch(!0){case function(t){return!(!t||t.constructor!=Date)}(t):return n=t,isNaN(n)?"Invalid Date":n.toUTCString();case function(t){return"object"==typeof Node?t instanceof Node:t&&"object"==typeof t&&t.nodeType>0&&"string"==typeof t.nodeName}(t):return function(t){return t.toString()}(t);case void 0===t:return"undefined";case"object"!=typeof t||null==t:return t;case t instanceof Error:return[t.toString(),t.stack].filter(Boolean).join(",")}var n}(r);if(void 0!==c){var h=function(n,i){var r=t(n);return r&&"\""==r[0]?e(r,i,"...\""):r}(c,u);return"string"==typeof h&&h.length<=u?(a.tokens.push(h),h.length):0}if(a.cyclic){a.opath.splice(o);var f=a.opath.lastIndexOf(r);if(f>-1){var v="");return v="\"".concat(e(v,u-2),"\""),a.tokens.push(v),v.length}a.opath.push(r)}var l=u,d=function(t){return l>=t.length&&(l-=t.length,a.tokens.push(t),!0)},p=function(t){var n=a.tokens.length-1;","===a.tokens[n]?a.tokens[n]=t:d(t)};if(l<2)return 0;if(n(r)){d("[");for(var w=0;w0;w++){var g=s(r[w],l-1,o+1,a);if(l-=g,0==g&&!d("null"))break;d(",")}p("]")}else{d("{");var m=i(r);for(w=0;w0;w++){var y=m[w],b=r[y];if(!d("\"".concat(y,"\":")))break;if(0==(g=s(b,l-1,o+1,a))){a.tokens.pop();break}l-=g,d(",")}p("}")}return u==1/0?1:u-l}return function(t,n){void 0===n&&(n=1024);try{var i={tokens:[],opath:[],cyclic:r(t,n/4)};return s(t,n,0,i),i.tokens.join("")}catch(t){return Tt(t)}}}(C.jsonStringify,Vn,ii),Ou=function(){function t(){var n=this;this.bt=0,this.St=t.kt++,this._t=Qs.wrap(function(){n.At(),n.It&&n.It()})}return t.checkForBrokenSchedulers=function(){return r(this,void 0,ie,function(){var n,i;return e(this,function(r){switch(r.label){case 0:return!C.requestWindowAnimationFrame||t.Et||(n=xi())-t.Tt<100?[2,!1]:(t.Tt=n,t.Et=!0,[4,new ie(function(t){return C.requestWindowAnimationFrame(window,t)})]);case 1:return r.sent(),i=[],ei(t.Ct,function(t){var r=t.xt(n);r&&i.push(r)}),[4,ie.all(i)];case 2:return r.sent(),C.requestWindowAnimationFrame(window,Qs.wrap(function(){t.Et=!1})),[2,!0]}})})},t.stopAll=function(){ei(this.Ct,function(t){return t.stop()})},t.prototype.Kt=function(t){this.It=t},t.prototype.stop=function(){this.Rt(),delete t.Ct[this.St]},t.prototype.Mt=function(n){this.bt=xi()+100+1.5*n,t.Ct[this.St]=this},t.prototype.Ot=function(){return null!=t.Ct[this.St]},t.prototype.At=function(){delete t.Ct[this.St]},t.prototype.xt=function(t){if(t>this.bt)return ie.resolve().then(this._t)["catch"](function(){})},t.Ct={},t.kt=0,t.Et=!1,t.Tt=0,t}(),ju=function(t){function i(n){var i=t.call(this)||this;return i.jt=n,i.Pt=-1,i}return n(i,t),i.prototype.start=function(t,n){var i=this;void 0===n&&(n=this.jt),-1==this.Pt&&(this.jt=n,this.Kt(function(){t(),i.Mt(i.jt)}),this.Pt=C.setWindowInterval(window,this._t,this.jt),this.Mt(this.jt))},i.prototype.Rt=function(){-1!=this.Pt&&(C.clearWindowInterval(window,this.Pt),this.Pt=-1,this.Kt(function(){}))},i}(Ou),Pu=function(t){function i(n,i,r){void 0===i&&(i=0);for(var e=[],s=3;sn&&(this.Wt=t-n,this.Wt>1e3&&this.Ht("timekeeper set with future ts"))},t.prototype.Ht=function(t){Mu({msg:t,skew:this.Wt,startTime:this.Ft,wallTime:this.wallTime()},1024)},t}();(Ru=Ku||(Ku={})).Indeterminate="indeterminate",Ru.Checked="checked",Ru.Value="value";var Lu=function(){function t(t,n){var i;this.ot=t,this.zt=n,this.qt=!1,this.$t={},this.Vt=((i={})[Ku.Checked]={},i[Ku.Indeterminate]={},i[Ku.Value]={},i),this.Gt={},this.Qt=[],this.Xt={},this.Yt=!1,this.Jt=!1,this.Zt={},this.tn=null,this.t=t.window.document}return t.prototype.start=function(){this.nn()||(this.qt=!0)},t.prototype.hookInstance=function(t,n){if("input"===wu(n))switch(n.type){case"checkbox":case"radio":this.rn(t,n,"checked");break;default:this.rn(t,n,"value")}},t.prototype.addInput=function(t){if(t){var n=Tu(t);if(n){if("input"===wu(t)){var i=t;this.en(n,i),i.indeterminate&&this.sn(i,!0)}var r=!1;if(function(t){switch(t.type){case"checkbox":return t.checked!=t.hasAttribute("checked");case"radio":return t.checked||t.hasAttribute("checked");default:return(t.value||"")!=function(t){if("select"!=wu(t))return t.getAttribute("value")||"";var n=t,i=n.querySelector("option[selected]")||n.querySelector("option");return i&&i.value||""}(t)}}(t)&&(this.un(t,!1,!0),r=!0),this.qt&&(this.$t[n]={elem:t}),!r)if(Fu(t)){var e=Du(t);t.checked&&(this.Gt[e]=n)}else this.on(n,Ku.Value,Wu(t,this.ot.window))}}},t.prototype.on=function(t,n,i){this.Vt[n][t]=i},t.prototype.an=function(t,n){return this.Vt[n][t]},t.prototype.cn=function(t){for(var n in this.Vt)delete this.Vt[n][t]},t.prototype.en=function(t,n){if(this.Yt)this.Jt&&this.hookInstance(t,n);else{var i="checkbox"===n.type||"radio"===n.type?"checked":"value",r=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,i),e=Object.getOwnPropertyDescriptor(n,i);r&&e&&r!==e&&(this.Jt=!0,this.hookInstance(t,n)),this.Yt=!0}},t.prototype.hn=function(t,n){void 0===n&&(n=Wu(t,this.ot.window));var i=Tu(t);if(!t||!i)return!1;if(Fu(t)){var r=Du(t);return this.Gt[r]===i!=("true"===n)}return this.an(i,Ku.Value)!==n},t.prototype.onChange=function(t,n,i){void 0===i&&(i=Wu(t,this.ot.window));var r=Tu(t);t&&r&&(n||this.hn(t,i))&&this.un(t,n)},t.prototype.onKeyboardChange=function(t){var n,i=function(t){for(var n=t.activeElement;n&&n.shadowRoot;){var i=n.shadowRoot.activeElement;if(!i)return n;n=i}return n}(this.t);i&&("value"in(n=i)||"checked"in n)&&!ku(i)&&this.hn(i)&&this.un(i,t)},t.prototype.tick=function(){for(var t in this.$t){var n=this.$t[t],i=n.elem;if(Tu(i))try{delete this.$t[t];var r=Wu(i,this.ot.window);if(this.hn(i,r))this.un(i);else if(n.noFsIdInOption){var e=i;Array.prototype.slice.call(e.options).every(function(t){return Tu(t)})&&(n.noFsIdInOption=!1,this.un(i))}}finally{this.qt&&(this.$t[t]=n)}else delete this.$t[t],this.cn(t),Fu(i)&&delete this.Gt[Du(i)]}},t.prototype.stop=function(){for(var t,n=0,i=this.Qt;n0&&u.height>0,a=_u(t)?We(s):s;r.zt.enqueue({Kind:ot.VALUECHANGE,Args:[e,a,n,o,i]})})}},t.prototype.vn=function(t,n){if(this.$t[t])return!0;if("select"!==wu(n))return!1;for(var i=n.options,r=0;r-1,!!Hu.userAgent.match("CriOS")||"Google Inc."===zu&&!qu&&!$u),Gu=/Firefox/.test(window.navigator.userAgent);function Qu(t){if(!Gu)return!1;var n=window.navigator.userAgent.match(/Firefox\/(\d+)/);return!(!n||!n[1])&&parseInt(n[1],10)-1;var n}var ro,eo,so,uo,oo="#polyfillshadow";function ao(t,n,i,r){var e;try{var s="invalid: no sanitizers";if(!Js(t.length>0,s))throw s;for(var u=0,o=t;u0&&this.Rn--,fo(this.Mn.prev)},t.prototype.shift=function(){return this.Rn>0&&this.Rn--,fo(this.Mn.next)},t}();function ho(t,n){var i=t.next;n.next=i,n.prev=t,t.next=i.prev=n}function fo(t){var n=t.prev,i=t.next;return n.next=i,i.prev=n,t.value}var vo,lo,po={timeRemaining:function(){return 1},didTimeout:!1};(lo=vo||(vo={}))[lo.Idle=0]="Idle",lo[lo.Scheduled=1]="Scheduled",lo[lo.Processing=2]="Processing";var wo=function(){function t(t){void 0===t&&(t=1),this.On=t,this.kt=1,this.jn=vo.Idle,this.Pn=new co,this.Un={},this.Nn=1}return t.prototype.enqueue=function(t,n){var i=this;if(void 0===n&&(n=!1),!(this.jn===vo.Processing&&this.Nn>16)){var r={id:this.kt++,isCompleted:!1,process:t,depth:this.Nn,store:n};return this.Pn.push(r),this.Ln(),n?function(){return i.Dn(r)}:void 0}tu("recursive","deep recursive task found")},t.prototype.Dn=function(t){try{var n=t.id,i=this.Un[n];return i?(delete this.Un[n],[i.result,i.err]):(go(po,t),Js(t.isCompleted,"failed to complete task"),[t.result,t.err])}finally{t.result=void 0,t.err=void 0}},t.prototype.flush=function(){this.Bn(po)},t.prototype.Ln=function(){this.jn===vo.Idle&&(this.jn=vo.Scheduled,this.Wn())},t.prototype.Bn=function(t){if(this.jn===vo.Scheduled){var n=0;this.jn=vo.Processing;for(var i=this.Pn.first();i&&mo(n,this.On,t);)this.Nn=i.depth+1,go(t,i),i.isCompleted&&(this.Pn.shift(),!i.store||void 0===i.result&&void 0===i.err||(this.Un[i.id]=i)),i=this.Pn.first(),n++;this.jn=vo.Idle,this.Nn=1,this.Pn.size()>0&&this.Ln()}},t}();function go(t,n){if(!n.isCompleted)try{var i=n.process(t)||{done:!0};i.done&&(n.isCompleted=!0,n.result=i.result)}catch(t){n.isCompleted=!0,n.err=t}}function mo(t,n,i){return t0}var yo,bo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return n(i,t),i.prototype.Wn=function(){var t=this;le().then(function(){t.Bn(pe(36))})},i}(wo),So={INPUT:!0,TEXTAREA:!0,NOSCRIPT:!0},ko=function(){function t(t,n,i,r){this.Fn=t,this.Hn=n,this.zn=i,this.qn=r,this.$n=!1,yu={},bu=1,yo=new WeakMap,this.Pn=new bo}return t.prototype.setUseTreeWalker=function(t){this.$n=t},t.prototype.tokenizeNode=function(t,n,i,r,e,s,u){var o=this,a=Au(n),c=Au(i),h=[];return function(n){var i=bu;try{return o.Vn(t,a,c,r,h,e,s,u),!0}catch(t){return bu=i,!1}}()||(h=[]),h},t.prototype.Vn=function(t,n,i,r,e,s,u,o){for(var a,c,h=[{parentMirror:n,nextMirror:i,node:r}],f=function(t,n){return function(i){i&&t.push({parentMirror:n,nextMirror:null,node:i})}};h.length;){var v=h.pop();if(v)if("string"!=typeof v){var l=v.node,d=this.Gn(t,v,e,s,u);if(null!=d&&!(null===(a=d.watchKind)||void 0===a?void 0:a.has(Fe.Exclude))){var p=d.type===X?l.shadowRoot:null,w=!this.$n&&d.shadowRootType===oo&&window.HTMLSlotElement&&"slot"===d.tag&&l.assignedNodes();if(p||w||_t(l))if(null===(c=d.watchKind)||void 0===c?void 0:c.has(Fe.Defer))o(d.node,ze.Deferred);else{if(h.push("]"),kt(l,f(h,d)),p)h.push({parentMirror:d,nextMirror:null,node:p});else if(w&&w.length>0){for(var g=[],m=!1,y=0,b=w;y=0;I--)h.push(g[I]);h.push("[","<".concat("#assigned-nodes"))}}h.push("[")}}}else"<"===v[0]&&++bu,e.push(v)}},t.prototype.Gn=function(t,n,i,r,e){var s,u,o,a,c=n.node,h=n.parentMirror,f=n.nextMirror,l=wu(c),d=c.nodeName,p=c.nodeType;if("script"===l||8===p)return null;var w=function(t){if(t.constructor===window.ShadowRoot)return io(t)?"#shadow":oo}(c);if(this.$n&&w===oo)return null;var g,m,y,b,S,k=function(t,n,i,r){void 0===n&&(n=t.nodeName),void 0===i&&(i=t.nodeType),void 0===r&&(r=wu(t));var e={id:bu++,node:t,name:n,type:i,tag:r};return yu[e.id]=e,t[Bn]=e.id,e}(c,d,p,l);k.shadowRootType=w||(null==h?void 0:h.shadowRootType),h&&(w?(h.shadow=k,k.parent=h):(g=h,y=f,Cu(m=k,this.qn.bind(this)),m.parent=g,m.next=y,y&&(m.prev=y.prev,y.prev=m),null==m.next?(m.prev=g.lastChild,g.lastChild=m):m.next.prev=m,null==m.prev?g.child=m:m.prev.next=m)),k.mask=null===(s=k.parent)||void 0===s?void 0:s.mask;try{switch(p){case 3:if(void 0===k.mask&&(k.mask=!k.parent||k.parent.mask),k.mask){var _=It(c);(null==_?void 0:_.nodeType)===X&&this.Hn.observe(_)}S=null!==(u=c.textContent)&&void 0!==u?u:"";break;case X:var A=c,I=this.getWatchState(A,d,!!k.shadowRootType,t);if(null!=I){k.watchKind=I;var E=!1;I.has(Fe.Watch)&&(E=!0,null===(o=this.zn)||void 0===o||o.observe(A)),I.has(Fe.Unmask)&&(k.mask=!1),I.has(Fe.Mask)&&(k.mask=!0),(I.has(Fe.Exclude)||I.has(Fe.Defer))&&(E=!0),E&&this.Hn.observe(A)}b=function(t,n){var i,r,e;if(!v||"output"!==n){var s={};try{if(t.hasAttributes())if(void 0!==t.getAttributeNames)for(var u=0,o=null!==(i=t.getAttributeNames())&&void 0!==i?i:[];u1e3)return null;if(!i||i.nodeType!=X)return null;var r=i;if(getComputedStyle(r).display.indexOf("inline")<0)return r;i=It(i)}}(t);if(r&&r!==t){this.li.set(t,i),this.hi(t);var e=this.vi.get(r);e||(e=Object.create(null),this.vi.set(r,e)),e[i]=i,C.setWindowTimeout(this.ot.window,P(function(){n.pi.unobserve(r),n.pi.observe(r)}),0)}}},i}(Wo),Ho=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return n(i,t),i.prototype.observe=function(t){var n=this;if(t&&t.nodeType==X){var i=t;!function(t){if(t&&Su(t.node))for(var n=t,i=t.parent;i;i=i.parent){if(zo(i)||(i.watchedChildren={}),zo(n))for(var r in zo(n))delete zo(i)[r];if(zo(i)[n.id]=n,ui(zo(i),2))n=i;else if(oi(zo(i),2))break}}(Au(t)),this.ot.measurer.enqueue(function(){n.hi(i)})}},i.prototype.unobserveSubtree=function(t){var n=Au(t);n&&function(t){if(oi(zo(t),0)||Su(t.node))for(var n=zo(t)&&oi(zo(t),1)||Su(t.node)?t.id:function(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))return n}(zo(t)),i=n?t.parent:null;i&&zo(i)&&zo(i)[n];){if(delete zo(i)[n],ui(zo(i),1)){var r=i.id,e=si(zo(i));for(i=i.parent;i&&zo(i)&&zo(i)[r];)delete zo(i)[r],zo(i)[e.id]=e,i=i.parent;break}i=i.parent}}(n)},i.prototype.nodeChanged=function(t){var n=this,i=function(t){var n=[],i=Au(t);if(i)for(var r=[i],e=0;r.length&&++e<1e3;){var s=r.pop();Su(s.node)&&n.push(s.node),zo(s)&&ei(zo(s),function(t){r.push(t)})}else{for(var u=t;u&&!Eu(u);)u=It(u);u&&Su(u)&&n.push(u)}return n}(t);this.ot.measurer.enqueue(function(){for(var t=0,r=i;tes?(Qs.send("Ignoring huge text node","warning",{length:i}),""):t.mask?We(n):n}(i,e);t[so.Text]=f}}},Xo=function(){function t(t,n,i,r,e,s){void 0===i&&(i=function(){}),void 0===e&&(e=function(){}),void 0===s&&(s=function(){});var u=this;this.ot=t,this.Fn=n,this.zn=r,this.mi=e,this.yi=s,this.bi=!1,this.Si=[],this.ki=[],this._i=[],this.Ai=[],this.Ii=[],this.Ei=!1,this.Ti=[],this.Ci=[],this.$n=!1,this.xi=this.ot.window,this.acceptSanitizer(Qo),this.acceptVisitor(this),this.Hn=Wo.create(this.ot),this.qn=function(t){u.Hn.unobserveSubtree(t.node),i(t)},this.Ki=new ko(n,this.Hn,this.zn,this.qn.bind(this)),Js(!this.Fn.onConsentChange,"This is the only consent change listener."),this.Fn.onConsentChange=function(){return u.updateConsent()}}return t.prototype.start=function(t){void 0===t&&(t=this.xi.document),this.Mn=t,this.bi=!1,this.$n=!!this.ot.recording.flags().UseTreeWalker,this.Ki.setUseTreeWalker(this.$n);var n=!0;if(h)try{this.Ri()}catch(t){"Error setting up IE workarounds for mutation watcher: ".concat(t),n=!1}if(n){var i=this.$n?C.mutationObserver:MutationObserver;this.Mi=new i(this.Oi.bind(this))}},t.prototype.Oi=function(t){for(var n=0,i=t;n0||this.ki.length>0){var o=this.Li(t,i,u),a=o[0],c=o[1];for(var h in c)i.push({Kind:ot.MUT_ATTR,Args:c[h],When:t});for(var h in a)i.push({Kind:ot.MUT_TEXT,Args:a[h],When:t})}var f=this.Si;this.Si=[];for(var v=0;v0&&(i.push({Kind:ot.DEFERRED_RESOLVED,Args:s([],this.Ai,!0),When:t}),this.Ai=[]),this._i.length>0){for(var d=0,p=this._i;d0)for(var b=0;b0&&(h[y]=p.target,!l.$n)){var S=!(null==(d=p.target)?void 0:d.shadowRoot)||io(d.shadowRoot)?null:Au(d.shadowRoot);S&&(h[S.id]=S.node)}break;case"characterData":if((K=Au(p.target))&&!ku(p.target,K)){var k=p.target.textContent;if(p.oldValue===k)break;var _=It(p.target);if(_&&"style"===wu(_)&&!rs(_))f(_);else{var A=[ro.Update,K,void 0,null!=k?k:void 0];ao(l.Ti,l.Ci,A,function(t){var n;o[y]=[y,null!==(n=t[so.Text])&&void 0!==n?n:""]})}}break;case"attributes":var I=p.target,E=wu(I);if(p.attributeNamespace==qn){"style"==E&&p.attributeName==$n&&l.yi(I);break}if("link"===E&&"rel"===p.attributeName&&ss.test(null!==(e=p.oldValue)&&void 0!==e?e:"")){f(I);break}var T=function(t,n){return void 0===n&&(n=Au(t)),null==n?void 0:n.watchKind}(I),C=l.Fn.isWatched(I);if(Uo(C)>Uo(T)){f(I);break}if(To.needsToObserve(T,C)){l.Hn.observe(I),(null==C?void 0:C.has(Fe.Watch))&&(null===(s=l.zn)||void 0===s||s.observe(I));var x=Au(I);x&&(x.watchKind=To.combineKindsPreservePrivacy(T,C))}var K,R=(void 0===(v=p.attributeNamespace)&&(v=""),(null===v?"":{"http://www.w3.org/1999/xlink":"xlink:","http://www.w3.org/XML/1998/namespace":"xml:","http://www.w3.org/2000/xmlns/":"xmlns:"}[v]||"")+(p.attributeName||"")),M=p.target.getAttribute(R);(K=Au(p.target))&&p.oldValue!=M&&(A=[ro.Update,K,(u={},u[R]=M||"",u),void 0],ao(l.Ti,l.Ci,A,function(t){var n,i=null!==(n=t[so.Attrs])&&void 0!==n?n:{};for(var r in i){var e=i[r];I.hasAttribute(r)||(e=null),a["".concat(y," ").concat(r)]=[y,r,e]}}))}}catch(t){}},l=this,d=0;d=1e3&&(o=!0)}catch(t){var f="ruleOpt";tu(f,f,{err:t})}o&&(a=t(o))}var v=!1;for(h=0;h0&&i.push({Kind:ot.DEFERRED_MUT_SHADOW,Args:[s,o],When:n},{Kind:ot.TIMING,Args:[[ft.Internal,lt.Serialization,pt.NodeEncoding,n,a]],When:n})},t.prototype.Wi=function(t,n,i,r,e,s){var u=Eu(r)||-1,o=Eu(s)||-1,a=-1===u&&-1===o,c=xi();window;var h=this.Vi(t,r,e,s);window;var f=xi()-c;h.length>0&&(i.push({Kind:ot.DEFERRED_MUT_INSERT,Args:[u,o,h],When:n},{Kind:ot.TIMING,Args:[[ft.Internal,lt.Serialization,a?pt.DomSnapshot:pt.NodeEncoding,n,f]],When:n}),this.mi())},t.prototype.Vi=function(t,n,i,r){var e=this;return n&&ku(n)?[]:this.Ki.tokenizeNode(t,n,r,i,this.Ti,this.Ci,function(t,n){switch(n){case ze.Immediate:e.refreshElement(t);break;case ze.Deferred:e._i.push(t)}})},t.prototype.Hi=function(t,n,i){var r=i.id;if(Cu(i,this.qn.bind(this)),n.length>0){var e=n[n.length-1];if(e.Kind==ot.MUT_REMOVE)return void e.Args.push(r)}n.push({Kind:ot.MUT_REMOVE,Args:[r],When:t})},t.prototype.Ri=function(){var n=this;if(f){var r=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"),e=r&&r.set;if(!r||!e)throw new Error("Missing textContent setter -- not safe to record mutations.");Object.defineProperty(Element.prototype,"textContent",i(i({},r),{set:function(t){try{for(var n=void 0;n=bt(this);)this.removeChild(n);if(null===t||""==t)return;var i=(this.ownerDocument||document).createTextNode(t);this.appendChild(i)}catch(n){e&&e.call(this,t)}}}))}this.Gi=new Uu(t.ThrottleMax,t.ThrottleInterval,function(){return new Pu(function(){n.Ei=!0,n.ji()}).start()});var s=this.Gi.guard(function(t){var n=t.cssText;t.cssText=n});this.Gi.open(),this.Qi=gi(CSSStyleDeclaration.prototype,"setProperty"),this.Qi&&this.Qi.afterSync(function(t){s(t.that)}),this.Xi=gi(CSSStyleDeclaration.prototype,"removeProperty"),this.Xi&&this.Xi.afterSync(function(t){s(t.that)})},t.prototype.ji=function(){this.Gi&&this.Gi.close(),this.Qi&&this.Qi.disable(),this.Xi&&this.Xi.disable()},t.prototype.updateConsent=function(){var t=this;this.Mn&&St(this.Mn,function(n){return t.refreshElement(n)})},t.prototype.refreshElement=function(t){Eu(t)&&this.ki.push(t)},t.prototype.acceptSanitizer=function(t){this.Ti.push(t)},t.prototype.acceptVisitor=function(t){this.Ci.push(t)},t.prototype.visit=function(t){},t.prototype.preVisit=function(t){var n=this,i=t.node,r=t.name;if(t.type===X&&!ku(i,t)){var e=i;if(e.shadowRoot&&this.Di(e.shadowRoot),"SLOT"===r){var s=Au(i);(null==s?void 0:s.shadowRootType)===oo&&i.addEventListener("slotchange",Qs.wrap(function(t){var r;n.ki.push(null!==(r=t.target)&&void 0!==r?r:i)}))}}},t.ThrottleMax=1024,t.ThrottleInterval=1e4,t}();function Yo(t,n){void 0===n&&(n=!1);var i=1;if(!t||t.nodeType!==X)return i;var r=t;if(i+=C.elQuerySelectorAll(r,"*").length,n){var e=r.shadowRoot;e&&11===e.nodeType&&(i+=C.docFragQuerySelectorAll(e,"*").length)}return i}var Jo,Zo=function(t,n,r){try{if(-1!==PerformanceObserver.supportedEntryTypes.indexOf(t)){var e=new PerformanceObserver(function(t){ie.resolve().then(function(){n(t.getEntries())})}),s=i({type:t,buffered:!0},r);return e.observe(s),e}}catch(t){}},ta=0,na=1/0,ia=0;function ra(t){for(var n=0,i=t;n0&&i.addEventListener&&i.removeEventListener&&this.lt&&this.lt.add(i,"resourcetimingbufferfull",!0,function(){t.zt.enqueue({Kind:ot.RESOURCE_TIMING_BUFFER_FULL,Args:[]})}),this.hr(),this.vr())},t.prototype.onLoad=function(){if(!this.rr){this.rr=!0;var t=window.performance;t&&t.timing&&this.lr(Ft.Timing,t.timing,zt.Timing)}},t.prototype.tick=function(){this.hr()},t.prototype.stop=function(){this.lt&&this.lt.clear(),this.ur=void 0;var t=[];if(this.er.length>0){for(var n=0,i=this.er;n300&&(t=t.slice(0,300),this.zt.enqueue({Kind:ot.RESOURCE_TIMING_BUFFER_FULL,Args:[]})),this.hr(),this.Wn(t),this.ot.taskQueue.flush()},t.prototype.Wn=function(t){for(var n=this,i=function(t){r.ot.taskQueue.enqueue(function(){return n.dr(t)})},r=this,e=0,s=t;e.2)&&(this.lr(Ft.Memory,n,zt.Memory),this.ir=n.usedJSHeapSize)}}},t.prototype.vr=function(){var t={timeOrigin:Ci.timeOrigin};this.lr(Ft.TimeOrigin,t,zt.TimeOrigin)},t.prototype.dr=function(t){switch(t.entryType){case aa:this.pr(),this.lr(Ft.EventTiming,t,zt.EventTiming);break;case ea:this.lr(Ft.FirstInput,t,zt.FirstInput);break;case sa:this.lr(Ft.LargestContentfulPaint,t,zt.LargestContentfulPaint);break;case ua:this.lr(Ft.LayoutShift,t,zt.LayoutShift);break;case oa:this.lr(Ft.LongTask,t,zt.Measure);break;case ca:this.lr(Ft.Mark,t,zt.Measure);break;case ha:this.lr(Ft.Measure,t,zt.Measure);break;case fa:this.lr(Ft.Navigation,t,zt.Navigation,{name:fa});break;case va:this.lr(Ft.Paint,t,zt.Measure);break;case la:this.wr(t)}},t.prototype.wr=function(t){if(this.Zi){var n=t.initiatorType;(this.Ji||"img"!==n&&"image"!==n)&&this.lr(Ft.Resource,t,zt.Resource,{name:n})}},t.prototype.lr=function(t,n,i,r){if(void 0===r&&(r={}),!this.atLimit(t)){for(var e=[t],s=0,u=i;s=this.tr)return!0;this.nr++}return!1},t.prototype.cr=function(t){if(!this.ot.recording.inFrame){for(var n=window.performance,i=[$t.Performance,n&&!!n.timing,$t.PerformanceEntries,n&&"function"==typeof n.getEntries,$t.PerformanceMemory,n&&!!n.memory,$t.PerformanceObserver,!!window.PerformanceObserver,$t.PerformanceTimeOrigin,n&&!!n.timeOrigin],r=0,e=t;r=n&&(f?e=void 0:(e=ma,f=!0)),h[h.length-1]--,u&&e&&e!==_n.BlockedFieldValue?h.push(C.objectKeys(e).length):a.pop();h[h.length-1]<=0;)h.pop(),a.pop();for(var o=0,v=r;o0&&l!==h.length-1)throw new Error("Property matcher depth out of sync")}return e})}catch(t){Qs.send(t,"error")}return"[error serializing ".concat(t.constructor.name,"]")}}var ba=function(){function t(t){this.mr=1;var n=[t];t.edges["**"]&&n.push(t.edges["**"]),this.yr=[n]}return t.prototype.br=function(){if(this.yr.length<=0)return[];var t=this.yr.length-1,n=this.yr[t];return"number"==typeof n?this.yr[t-1]:n},t.prototype.depth=function(){return this.mr},t.prototype.isRedacted=function(t){var n=this.br();return 0===n.length||t&&!n.some(function(t){return t.term})},t.prototype.push=function(t){var n;this.mr++;var i=this.br(),r=[];function e(n){n.edges["**"]&&(r.push(n.edges["**"],Sa(n)),e(n.edges["**"])),n.edges["*"]&&r.push(n.edges["*"]),n.edges[t]&&r.push(n.edges[t])}for(var s=0,u=i;s0&&this.mr--;var t=this.yr[this.yr.length-1];"number"==typeof t&&t>1?this.yr[this.yr.length-1]--:this.yr.pop()},t}();function Sa(t){var n=t.edges["**"];if(!n)throw new Error("Node must have double-wildcard edge.");return oi(t.edges,1)?{id:-n.id,edges:{"**":n}}:t}var ka=("TextDecoder"in window),_a=("Request"in window),Aa=!Gu&&!g,Ia="ReadableStream"in window&&"function"==typeof ReadableStream.prototype.tee,Ea=function(){function t(t){this.Sr=t,this.kr=null,this._r=_n.DefaultOrgSettings.MaxAjaxPayloadLength,this.Ar=new B}return t.prototype.setMaxAjaxPayloadLength=function(t){this._r=t||_n.DefaultOrgSettings.MaxAjaxPayloadLength},t.prototype.disable=function(){this.kr&&(this.kr.disable(),this.kr=null)},t.prototype.enable=function(t){var n,i=this,s=Vi(t),u=null===(n=null==s?void 0:s._w)||void 0===n?void 0:n.fetch;(u||t.fetch)&&(this.kr=gi(u?s._w:t,"fetch"),this.kr&&(this.kr.before(function(t){i.Ir(t)}),this.kr.afterSync(function(t){var n=t.result;t.result=r(i,void 0,void 0,function(){return e(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.Er(n,t.args[0],t.args[1])];case 1:case 2:return i.sent(),[3,3];case 3:return[2,n]}})})})))},t.prototype.Ir=function(t){if(Ia&&ka&&Aa)try{var n=t.args[0],i=t.args[1];if(_a&&!ni(n)&&"url"in n&&n instanceof Request&&Aa&&n.body instanceof ReadableStream&&Ta(n.headers)){var r=xa(n.clone().body,this._r);return void this.Ar.set(n,r)}if(i){var e=Xa(i.headers);if(i.body&&i.body instanceof ReadableStream&&Ta(e)&&Aa){var s=i.body.tee(),u=s[0],o=s[1];i.body=o,r=xa(u,this._r),this.Ar.set(i,r)}}}catch(t){}},t.prototype.Er=function(t,n,i){return r(this,void 0,ie,function(){var s,u,o,a,c,h;return e(this,function(f){switch(f.label){case 0:return s="GET",u="",c=!1,"string"!=typeof n?[3,1]:(u=n,[3,5]);case 1:return"url"in n?(u=n.url,s=n.method,o=n.body,a=n.headers,c=!!n.signal,this.Ar.has(n)?[4,this.Tr(n)]:[3,3]):[3,4];case 2:o=f.sent(),f.label=3;case 3:return[3,5];case 4:u="".concat(n),f.label=5;case 5:return u?i?(s=i.method||s,a=Xa(i.headers),this.Ar.has(i)?[4,this.Tr(i)]:[3,7]):[3,9]:[2];case 6:return o=f.sent(),[3,8];case 7:o=i.body||o,f.label=8;case 8:c=!!i.signal||c,f.label=9;case 9:return h=function(t){return r(this,void 0,ie,function(){var n,i,r,s,u;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,6,,7]),[4,t];case 1:switch(n=e.sent(),u=n.ok?Bt.OK:Bt.ERROR,n.type){case"opaque":case"opaqueredirect":u=Bt.OPAQUE;break;case"error":u=Bt.ERROR}if(!Ca(((i=n.headers).get("content-type")||_n.TextPlain).split(";")[0]))return[2,Ra(u,n.status,{headers:i,body:null})];r=null,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,n.clone().text()];case 3:return r=e.sent(),[3,5];case 4:return e.sent(),u=Bt.ABORTED,[3,5];case 5:return[2,Ra(u,n.status,{headers:i,body:r})];case 6:return s=e.sent(),[2,Ra(u=(o=s)&&"AbortError"===o.name?Bt.ABORTED:Bt.ERROR,0,{headers:{forEach:function(){}},body:void 0})];case 7:return[2]}var o})})}(t),c&&u.search(/\/(?:graph|graphql|gql)/i)>-1?[4,ie.race([h,ee(5e3)])]:[3,11];case 10:f.sent(),f.label=11;case 11:return this.Sr.startRequest(s,u,{body:function(){return o},headers:a},h),[2]}})})},t.prototype.Tr=function(t){return r(this,void 0,ie,function(){var n;return e(this,function(i){switch(i.label){case 0:return[4,ie.race([this.Ar.get(t),ee(5e3).then(function(){return null})])];case 1:return n=i.sent(),this.Ar["delete"](t),[2,n]}})})},t}();function Ta(t){var n=_n.TextPlain;return null==t||t.forEach(function(t,i){"content-type"===i.toLowerCase()&&(n=t)}),Ca(n)}function Ca(t){switch(t){case"application/json":case"application/vnd.api+json":case _n.TextPlain:return!0}return!1}function xa(t,n){return r(this,void 0,ie,function(){var i,r,s,u,o;return e(this,function(e){switch(e.label){case 0:if(!ka)return[2,""];e.label=1;case 1:return e.trys.push([1,3,,4]),i=new TextDecoder,r=t.getReader(),s=oe(r,n).then(function(t){return t.map(function(t){return i.decode(t)}).join("")}),u=ee(2e3).then(function(){return"_fs_timeout"}),[4,ie.race([s,u])];case 2:return"_fs_timeout"===(o=e.sent())?(r.cancel()["catch"](function(t){}),[2,""]):[2,o];case 3:return e.sent(),[2,""];case 4:return[2]}})})}var Ka=function(){function t(t){this.Sr=t,this.Cr=new WeakMap}return t.prototype.disable=function(){this.Kr&&(this.Kr.disable(),this.Kr=null),this.Rr&&(this.Rr.disable(),this.Rr=null),this.Mr&&(this.Mr.disable(),this.Mr=null)},t.prototype.Or=function(t){var n=this.Cr.get(t);if(n)return n;var i={};return this.Cr.set(t,i),i},t.prototype.enable=function(t){var n,i,s,u,o=this,a=Vi(t),c=(null===(n=null==a?void 0:a._w)||void 0===n?void 0:n.XMLHttpRequest)||t.XMLHttpRequest;if(c){var h=c.prototype;this.Kr=null===(i=gi(h,"open"))||void 0===i?void 0:i.before(function(t){var n=o.Or(t.that);n.method=t.args[0],n.url=t.args[1]}),this.Mr=null===(s=gi(h,"setRequestHeader"))||void 0===s?void 0:s.before(function(t){var n=t.that,i=t.args[0],r=t.args[1],e=o.Or(n);e.headers||(e.headers=[]),e.headers.push([i,r])}),this.Rr=null===(u=gi(h,"send"))||void 0===u?void 0:u.before(function(t){var n=t.that,i=t.args[0],s=o.Or(n),u=s.url,a=s.method,c=s.headers;void 0!==u&&void 0!==a&&(o.Cr["delete"](n),o.Sr.startRequest(a,u,{headers:Xa(c),body:i},function(t){return r(this,void 0,ie,function(){var n,i;return e(this,function(r){switch(r.label){case 0:return[4,new ie(function(n){t.addEventListener("load",function(){return n(Bt.OK)}),t.addEventListener("abort",function(){return n(Bt.ABORTED)}),t.addEventListener("readystatechange",function(){t.readyState===XMLHttpRequest.DONE&&0!==t.status&&(t.status<400?n(Bt.OK):n(Bt.ERROR))}),t.addEventListener("error",function(){t.readyState===t.UNSENT?n(Bt.ABORTED):n(Bt.ERROR)})})];case 1:return n=r.sent(),i=function(t){if(t)return{forEach:function(n){for(var i,r=/([^:]*):\s+(.*)(?:\r\n|$)/g;i=r.exec(t);)n(i[2],i[1])}}}(t.getAllResponseHeaders()),[2,Ra(n,t.status,{headers:i,body:function(){return"text"===t.responseType?t.responseText:t.response}})]}})})}(n)))})}},t.prototype.setMaxAjaxPayloadLength=function(t){},t}();function Ra(t,n,i){return{state:t,status:n,data:i}}var Ma,Oa,ja,Pa,Ua,Na=/^data:/i,La=function(){function t(t,n){this.ot=t,this.zt=n,this.mn=!1,this.jr=new Da(t,n),this.Pr=new Ka(this.jr),this.Ur=new Ea(this.jr)}return t.prototype.isEnabled=function(){return this.mn},t.prototype.start=function(t){t.AjaxWatcher&&(this.mn||(this.mn=!0,this.zt.enqueue({Kind:ot.REC_FEAT_SUPPORTED,Args:[$t.Ajax,!0]}),this.Pr.enable(this.ot.window),this.Ur.enable(this.ot.window)))},t.prototype.stop=function(){this.mn&&(this.mn=!1,this.Pr.disable(),this.Ur.disable())},t.prototype.tick=function(){this.jr.tick()},t.prototype.setWatches=function(t){this.jr.setWatches(t)},t.prototype.initialize=function(t){this.jr.initialize(t),this.Ur.setMaxAjaxPayloadLength(t.maxAjaxPayloadLength)},t}(),Da=function(){function t(t,n){this.ot=t,this.zt=n,this.Nr=[],this.Lr={},this.Dr={},this.Br=[],this._r=0;var i=_n.DefaultOrgSettings;this.initialize({requests:i.HttpRequestHeadersAllowlist,responses:i.HttpResponseHeadersAllowlist,maxAjaxPayloadLength:i.MaxAjaxPayloadLength})}return t.prototype.Wr=function(t){for(var n=!1,i=!1,r=[],e=[],s=0,u=this.Nr;s-1}function Wa(t,n,i){return[t.length,$a(t,n,i)]}function Fa(t,n,i){var r=void 0;return Ba(n)||(r=ya(t,i,n)),[qa(t),r]}function Ha(t,n){var i=t.byteLength,r=void 0;return Ba(n)||(r="[ArrayBuffer]"),[i,r]}function za(t,n,i){return r(this,void 0,ie,function(){var r,s,u,o,a;return e(this,function(e){switch(e.label){case 0:if(s=(r=t).size,Ba(n))return[2,[s,void 0]];if(!Ca(r.type))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.text()["catch"](function(t){Qs.send(t,"warning")})];case 2:return(u=e.sent())&&(o=$a(u,n,i))?[2,[s,o]]:[3,4];case 3:return a=e.sent(),Qs.send(a,"warning"),[3,4];case 4:return[2,[s,"[Blob]"]]}})})}function qa(t){try{return C.jsonStringify(t).length}catch(t){}return 0}function $a(t,n,i){if(!Ba(n))try{return ya(C.jsonParse(t),i,n)}catch(r){return n.length>0&&n.every(function(t){return!0===t})?t.slice(0,i):void 0}}function Va(t,n){switch(t){default:case rn.Elide:return!1;case rn.Record:return!0;case rn.Allowlist:try{return wa(n)}catch(t){return"error parsing field allowlist (".concat(n,": ").concat(t),!1}}}function Ga(t,n,i,s){var u;return r(this,void 0,ie,function(){var r,o,a,c,h,f,v;return e(this,function(e){switch(e.label){case 0:return r="",null===(u=s.headers)||void 0===u||u.forEach(function(n,i){var e=i.toLowerCase(),s=t[e];r+="".concat(e).concat(s?": ".concat(n):"").concat("\r\n")}),"function"!=typeof(o=null==s?void 0:s.body)?[3,2]:[4,o()];case 1:return a=e.sent(),[3,3];case 2:a=o,e.label=3;case 3:return[4,Qa(n,a,i)];case 4:return c=e.sent(),h=c[0],f=c[1],v=0!==h||f?Lt.NotEmpty:Lt.Unknown,[2,{headers:r,text:f,size:h,legibility:v}]}})})}function Qa(t,n,i){return void 0===i&&(i=_n.DefaultOrgSettings.MaxAjaxPayloadLength),r(this,void 0,ie,function(){var r;return e(this,function(e){if(null==n)return[2,[0,void 0]];switch(typeof n){default:return[2,[-1,Ba(t)?void 0:"[unknown]"]];case"string":return[2,Wa(n,t,i)];case"object":switch(r=n.constructor){case Object:default:return[2,Fa(n,t,i)];case Blob:return[2,za(n,t,i)];case ArrayBuffer:return[2,Ha(n,t)];case Document:case FormData:case URLSearchParams:case ReadableStream:return[2,[-1,Ba(t)?void 0:"".concat(r.name)]]}}return[2]})})}function Xa(t){return t?Vn(t)?{forEach:function(n){for(var i=0,r=t;i0&&c.push(a.path);var h=hi(c);e.has(h)?e.get(h).rules[a.key]=a.value:e.set(h,{ruleId:c,rules:(s={},s[a.key]=a.value,s)})}}catch(t){}}),this.ve(i,function(t){e.forEach(function(n){t.enqueue({Kind:ot.CSSRULE_UPDATE,Args:[n.ruleId,n.rules]})})})}catch(t){}},t.prototype.snapshotConstructedStylesheet=function(t,n){void 0===n&&(n=!1);var i=sc(this.Jr,t);return n||void 0===i?(void 0===i&&(i=this.$r++,function(t,n,i){t.set(n,i)}(this.Jr,t,i)),this.le([Gt.Sheet,i],t),i):i},t.prototype.le=function(t,n){this.zt.enqueue({Kind:ot.RESET_CSS_SHEET,Args:[t]});var i=function(t){try{return t?t.cssRules||t.rules:void 0}catch(t){return}}(n);if(i){for(var r=[],e=0;e0?[Kt.Index,u,s,e]:[Kt.Index,u,s]}}},t.prototype.stop=function(){this.Vr=!1,this.Zr.close();for(var t=0,n=this.Sn;t-1){if(n.unshift(e),r instanceof CSSStyleSheet)break;i=r}else Qs.send("Could not find intermediate rule in parent","warning")}return n}var cc="__wayfinder_cursor";function hc(t){var n,i=null!==(n=t.getAttributeNS(qn,$n))&&void 0!==n?n:"";if(!i.length)return[];var r=function(t){return cc in t?t[cc]:""}(t),e=i.split("\n").filter(function(t){return t>r});return e.length>0&&(t[cc]=e[e.length-1]),e}var fc=function(){function t(t,n,i){this.ot=t,this.pe=n,this.lt=i.createChild()}return t.prototype.start=function(){var t=this,n=this.ot.window.document;this.lt.addCustom(n,this.we(),!0,function(n){t.onFullscreenChange(n)}),this.lt.addCustom(n,this.ge(),!0,function(n){t.onFullscreenError(n)})},t.prototype.stop=function(){this.lt&&this.lt.clear()},t.prototype.onFullscreenChange=function(t){var n=this.me();if(n){var i=Eu(n);this.ye,this.pe.enqueue({Kind:ot.FULLSCREEN,Args:[i,!0]}),this.ye=i}else this.ye,this.pe.enqueue({Kind:ot.FULLSCREEN,Args:[this.ye,!1]}),this.ye=void 0},t.prototype.onFullscreenError=function(t){this.pe.enqueue({Kind:ot.FULLSCREEN_ERROR,Args:[]})},t.prototype.me=function(){var t=this.ot.window.document;return t[k(t,"fullscreenElement")]},t.prototype.we=function(){return k(this.ot.window.document,"onfullscreenchange").slice(2)},t.prototype.ge=function(){return k(this.ot.window.document,"onfullscreenerror").slice(2)},t}(),vc=function(){function t(t,n){this.zt=n,this.Ct=null,this.be={};var i=t.window;"customElements"in i&&null!=i.customElements&&"get"in i.customElements&&"whenDefined"in i.customElements&&(this.Ct=i.customElements)}return t.prototype.start=function(){},t.prototype.stop=function(){},t.prototype.onCustomNodeVisited=function(t){return r(this,void 0,ie,function(){var n,i;return e(this,function(r){switch(r.label){case 0:if(!this.Ct)return[2];if(n=t.nodeName.toLowerCase(),Object.prototype.hasOwnProperty.call(this.be,n))return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),i=!!this.Ct.get(n),this.be[n]=i,[4,this.Ct.whenDefined(n)];case 2:return r.sent(),this.zt.enqueue({Kind:ot.CUSTOM_ELEMENT_DEFINED,Args:[n]}),[3,4];case 3:return r.sent(),[3,4];case 4:return[2]}})})},t}(),lc=function(){function t(t,n){this.Se=!1,this.Sn=[],this.In=n,this._n=t.window,this.Se=dc(this._n)}return t.prototype.start=function(){this.In.enqueue({Kind:ot.REC_FEAT_SUPPORTED,Args:[$t.HTMLDialogElement,this.Se]}),this.Se&&(this.Cn("show"),this.Cn("showModal"),this.Cn("close"))},t.prototype.stop=function(){this.Sn.forEach(function(t){return t.disable()}),this.Sn=[]},t.prototype.Cn=function(t){var n=this,i=gi(this._n.HTMLDialogElement.prototype,t);null==i||i.afterSync(function(i){var r=Eu(i.that),e="close"!==t,s="showModal"===t;n.In.enqueue({Kind:ot.DIALOG,Args:[r,e,s]})}),i&&this.Sn.push(i)},t}(),dc=function(t){return void 0!==t.HTMLDialogElement},pc=function(t){try{return C.elMatches(t,"dialog:modal")}catch(t){return!0}},wc=function(){function t(){}return t.prototype.now=function(){return Date.now()},t}(),gc=function(){function t(t,n,i,r){void 0===i&&(i=n),void 0===r&&(r=new wc),this.ke=t,this._e=n,this.Ae=r,this.Ie=r.now(),this.Ee=i}return t.prototype.hasCapacityFor=function(t){var n=this.Ae.now(),i=(n-this.Ie)*this.ke;return this.Ee=Math.min(this._e,this.Ee+i),this.Ie=n,this.Ee>=t?(this.Ee-=t,[!0,0]):[!1,(t-this.Ee)/this.ke]},t}(),mc=new gc(2,2e5),yc=new Set(["measureText","getImageData","getError","getTransform","isContextLost","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture"]),bc=new Set(["fillText"]),Sc=function(){function t(t,n,i,r){this.zt=n,this.ur=i,this.Yi=r,this.Te=Mn.CaptureCanvasOps,this.Ce=[],this.xe=[],this.Ke=new WeakMap,this.Re=new WeakMap,this.Me=new Set,this.Oe=0,this.je=new WeakMap,this.Pe=!1,this.Ue=new WeakMap,this.Ne=new Set,this.Le=new WeakMap,this.De=new WeakMap,this.Be=1,this.We=new WeakMap,this.Fe=1,this.He=new WeakMap,this.ze=0,this.qe=!1}return t.prototype.start=function(t){var n,i=this;if(t.CanvasWatcherMode&&(this.zt.enqueue({Kind:ot.REC_FEAT_SUPPORTED,Args:[$t.CanvasWatcherEnabled,!0,$t.CanvasScreenShotMode,t.CanvasWatcherMode===Mn.ScreenshotCanvas]}),this.Pe=!0,this.Te=null!==(n=t.CanvasWatcherMode)&&void 0!==n?n:Mn.CaptureCanvasOps,this.kr("2d",CanvasRenderingContext2D),this.kr("webgl",WebGLRenderingContext),this.Te===Mn.ScreenshotCanvas)){if(!HTMLCanvasElement.prototype.toDataURL)return;this.Oe=setInterval(function(){return i.screenshotConnectedCanvases()},1e3)}},t.prototype.$e=function(t,n){return"object"!=typeof n?[void 0,0]:(this.We.has(n)||this.We.set(n,[t,this.Fe++]),this.We.get(n))},t.prototype.kr=function(t,n){var i=this;if(n)for(var r=n.prototype,e=function(e){if(yc.has(e))return"continue";var u=Object.getOwnPropertyDescriptor(r,e);if("function"==typeof(null==u?void 0:u.value)){var o=gi(r,e);o&&(o.afterSync(function(n){return i.Ve(t,e,n.that,n.args,n.result)}),s.Ce.push(o))}else"function"==typeof(null==u?void 0:u.set)&&s.xe.push(mi(n,e,s.Ge(t,e)))},s=this,u=0,o=Object.keys(r);u0){var s=n;if(!s){var u=t instanceof HTMLCanvasElement?Au(t):void 0,o=t instanceof HTMLCanvasElement&&Si(t);s=null!==(i=null==u?void 0:u.mask)&&void 0!==i?i:o}this.Ze(t,r,e,s)}return this.He["delete"](t),r}},t.prototype.ts=function(t,n,i,r,e,s,u){var o;switch(typeof r){case"string":return e?We(r):r;case"number":case"boolean":case"bigint":return r;case"undefined":return{undef:!0};case"object":if(!r)return r;try{u.set(r,!0)}catch(t){}var a=null===(o=Object.getPrototypeOf(r))||void 0===o?void 0:o.constructor,c=(null==a?void 0:a.name)||function(t){var n;if(t){var i=t.toString(),r=_c.exec(i);return r||(r=Ac.exec(i)),null===(n=null==r?void 0:r[1])||void 0===n?void 0:n.trim()}}(a),h={ctor:c};if(ki(r)&&(l=Eu(r)))return h.id=l,h;switch(c){case"Array":return this.ze+=r.length,this.ns(t,n,i,r,e,s,u);case"CanvasGradient":return h;case"HTMLImageElement":var f=fs(r.src,{source:"dom",type:"canvas"});return this.Yi.record(f),h.src=f,h;case"HTMLCanvasElement":var v=r,l=this.flush(v,e);return h.srcId=l,h}if(function(t){var n;return!!(null===(n=Object.prototype.toString.call(t))||void 0===n?void 0:n.match(kc))}(r))return this.We.has(r)?this.rs(r,h,e):(h.typedArray="[".concat(r.toString(),"]"),this.ze+=r.length,h);if("object"==typeof r&&this.We.has(r))return this.rs(r,h,e);if(r instanceof WebGLBuffer||r instanceof WebGLTexture){var d=void 0;switch(s){case"bindTexture":d=this.es(t,"createTexture",n,i,r);break;case"bindBuffer":d=this.es(t,"createBuffer",n,i,r)}if(void 0!==d)return this.rs(r,h,e)}var p=r;for(var w in h.obj={},p){try{switch(typeof p[w]){case"function":continue;case"object":if(p[w]&&u.has(p[w]))continue}}catch(t){continue}++this.ze,h.obj[w]=this.ts(t,n,i,p[w],e,s,u)}return h;default:return null}},t.prototype.rs=function(t,n,i){var r=this.We.get(t),e=r[0],s=r[1];return this.flush(e,i),n.ref=s,delete n.ctor,n},t.prototype.es=function(t,n,i,r,e){var s=this.$e(i,e),u=(s[0],s[1]);return this.ss(r,[[t,Kn.Function,n,[],u]]),u},t.prototype.ns=function(t,n,i,r,e,s,u){var o=this;return void 0===u&&(u=new WeakMap),this.ze+=r.length+1,r.map(function(r){return o.ts(t,n,i,r,e,s,u)})},t.prototype.Ze=function(t,n,i,r){var e=this;if(void 0===r&&(r=!1),!this.qe){var s=i.map(function(i){var s=i[0],u=i[1],o=i[2],a=i[3],c=i[4];return[s,u,o,e.ns(s,t,n,a,r&&bc.has(o),o),c]});if(!this.Ke.has(t)&&(this.Ke.set(t,!0),i.some(function(t){return"2d"===t[0]}))){var u=function(t){var n=t.getContext("2d");if(!n)return[];var i=[];if((n instanceof CanvasRenderingContext2D||window.OffscreenCanvasRenderingContext2D&&n instanceof OffscreenCanvasRenderingContext2D)&&"function"==typeof n.getTransform){var r=n.getTransform();if(!r.isIdentity){var e=r.a,s=r.b,u=r.c,o=r.d,a=r.e,c=r.f;i.push(["2d",Kn.Function,"transform",[e,s,u,o,a,c],-1])}}return i}(t);if(u.length>0)return u.push.apply(u,s),void this.ss(n,u)}this.ss(n,s)}},t.prototype.ss=function(t,n){if(!this.qe){var i=mc.hasCapacityFor(this.ze),r=i[0];i[1],this.ze=0,r?this.zt.enqueue({Kind:ot.CANVAS,Args:[t,n]}):this.qe=!0}},t.prototype.us=function(t,n){t instanceof HTMLCanvasElement&&(this.Te===Mn.ScreenshotCanvas?(this.Re.set(t,!0),this.Me.add(t)):this.Qe(t,n))},t.prototype.Ve=function(t,n,i,r,e){for(var s=[],u=0;ur&&t.Xe(n)})}catch(t){Qs.send(t,"error")}},t.prototype.hs=function(t){var n=Eu(t);if(n){var i=Au(t),r=this.Ue.get(t);r&&0!==r.length&&(this.Ze(t,n,r,!!(null==i?void 0:i.mask)),this.Xe(t))}},t}(),kc=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,_c=/^\[object ([^\]]+?)(?:Constructor)?\]/,Ac=/^function ([^(]+)/,Ic=/^\s*at .*(\S+:\d+|native|())/m,Ec=/^(eval@)?(\[native code\])?$/;function Tc(t,n,i,r,e){return[n||"",t(i||""),parseInt(r||"-1",10),parseInt(e||"-1",10)]}function Cc(t){if(!t||-1===t.indexOf(":"))return["","",""];var n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return n?[n[1]||"",n[2]||"",n[3]||""]:["","",""]}var xc=["_fs_debug","assert","debug","error","info","log","trace","warn"],Kc=xc.filter(function(t){return!/debug/.test(t)});function Rc(t,n){return ks(ni(t)?t.slice(0,n):Mu(t,n))}function Mc(t,n){var i=n?"".concat(n," "):"";return s(["".concat(i).concat(Rc(function(t){if(Yn(t)){try{if(Qn(t.toString))return t.toString()}catch(t){}return t.message}}(t.error)||t.message,1e3)),Rc(t.filename,100),Yn(t.lineno)?-1:t.lineno],function(t,n){if(!Yn(n)||!ni(n.stack))return[];var i=n;return i.stack.match(Ic)?function(t,n){return n.split("\n").filter(function(t){return!!t.match(Ic)}).map(function(n){var i=n;i.indexOf("(eval ")>-1&&(i=i.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var r=i.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/\(native code\)/,"").split(/\s+/).slice(1),e=Cc(r.pop()),s=r.join(" "),u=["eval",""].indexOf(e[0])>-1?"":e[0];return Tc(t,s,u,e[1],e[2])})}(t,i.stack):function(t,n){return n.split("\n").filter(function(t){return!t.match(Ec)}).map(function(n){var i=n;if(i.indexOf(" > eval")>-1&&(i=i.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===i.indexOf("@")&&-1===i.indexOf(":"))return[i,"",-1,-1];var r=i.split("@"),e=Cc(r.pop()),s=r.join("@");return Tc(t,s,e[0],e[1],e[2])})}(t,i.stack)}(ks,t.error),!0)}var Oc,jc,Pc,Uc,Nc=function(){function t(t,n,i){this.zt=n,this.mn=!1,this.vs=!1,this.ls=0,this.Sn=[],this.ds=_n.DefaultOrgSettings.MaxConsoleLogPerPage,this.xi=t.window,this.lt=i.createChild()}return t.prototype.initializeMaxLogsPerPage=function(t){this.ds=t||_n.DefaultOrgSettings.MaxConsoleLogPerPage},t.prototype.ps=function(){return"\"[received more than ".concat(this.ds," messages]\"")},t.prototype.start=function(t){var n=this;if(t.ConsoleWatcher&&(this.lt.add(this.xi,"error",!0,function(t){return n.ws(t)}),this.lt.add(this.xi,"unhandledrejection",!0,function(t){var i,r="";t.reason instanceof Error?i=t.reason:r=Mu(t.reason,1e3),n.ws({error:i,message:r,filename:"",lineno:0},"Uncaught (in promise)")},!0),!this.mn))if(this.mn=!0,this.zt.enqueue({Kind:ot.REC_FEAT_SUPPORTED,Args:[$t.Console,!0]}),this.xi.console)for(var i=function(t){var i=gi(r.xi.console,t);if(!i)return"continue";"assert"===t?i.before(function(i){var r=i.args;r[0]||n.gs(t,Array.prototype.slice.apply(r,[1]))}):i.before(function(i){var r=i.args;return n.gs(t,r)}),r.Sn.push(i)},r=this,e=0,s=Kc;e0;r.clientX=e?r.changedTouches[0].clientX:0,r.clientY=e?r.changedTouches[0].clientY:0,this.uu(i,r);break;case"pointerdown":case"pointerup":this.uu(i,t);break;default:"Unhandled event type: ".concat(i)}},t.prototype.initResourceUploading=function(){this.ur.init(),this.Is=!0},t.prototype.onDomLoad=function(){this.ou(),this.au(!0),this.js.qi(h)},t.prototype.onLoad=function(){var t=this,n=!1,i=Qs.wrap(function(){n||(n=!0,t.Ms[Oc.Perf].onLoad(),t.cu(),t.au())},"error");new Pu(i,0).start(),de().then(i)},t.prototype.ajaxWatcher=function(){return this.Ms[Oc.Ajax]},t.prototype.consoleWatcher=function(){return this.Ms[Oc.Console]},t.prototype.perfWatcher=function(){return this.Ms[Oc.Perf]},t.prototype.bundleEvents=function(){var t=this;return this.zt.enqueueSimultaneousEventsIn(function(n){var i,r=xi(),e=t.js.processMutations(n);if(e.length>0){var s=xi()-r;e.push({Kind:ot.TIMING,Args:[[ft.Internal,lt.Serialization,pt.ProcessMut,n,s]],When:n})}for(var u=0,o=t.Ms;u-1&&this.Ms[Oc.CustomElement].onCustomNodeVisited(r)}"scrollLeft"in r&&"scrollTop"in r&&this.ot.measurer.enqueue(function(){var t=r;0==t.scrollLeft&&0==t.scrollTop||i.Js(t)})}},t.prototype.fu=function(t,n,i){var r=this,e=this.ot.recording.flags().DisableImgUrlPrivacy;if(!e||this.Is){var s=n.node,u=n.tag;if(n.type===X&&i&&!function(t,n){return void 0===n&&(n=Au(t)),ku(t,n)||_u(t,n)}(s)){var o="unknown";"link"===u&&Lc.test(i.rel)?o="css":Dc.test(null!=u?u:"")&&(o="img");var a=function(t,n,i){for(var r,e,s=[],u=0,o=Hc;u-1&&s.push(i.href),("img"===t||"source"===t)&&(e=i.srcset)&&null==e.match(/^\s*$/))for(var c=0,h=function(t,n){void 0===n&&(n=!0);var i="".concat(t.replace(/\s+/g," "),",").match(n?mu:gu);if(!i)return[];for(var r=[],e=0,s=i;e0&&this.ot.taskQueue.enqueue(function(){return r.vu(a,!1,o)})}else this.ot.taskQueue.enqueue(function(){return r.vu(a,!0,o)})}}},t.prototype.qn=function(t){var n,i=t.id,r=t.node;switch(t.name){case"#document":case"#document-fragment":delete this.Ts[i];break;case"IFRAME":this.ks(t.node);break;case"LINK":case"STYLE":case"style":var e=r.sheet;e&&this.Ms[Oc.StyleSheet].removeHook(e);break;case"INPUT":case"TEXTAREA":case"SELECT":var s=r;this.Ms[Oc.Input].removeInput(s)}if("function"==typeof r.getElementsByTagName)for(var u=null!==(n=r.getElementsByTagName("iframe"))&&void 0!==n?n:[],o=0;o0)return i[0]}}return t.target}function qc(t){var n;return!!(null!==(n=t[Dn])&&void 0!==n&&n||t.isTrusted)}function $c(t){var n=zc(t);return!!Eu(n)&&!ku(n)}function Vc(t){var n=zc(t),i=Eu(n);if(i){var r=0,e=0,s=0,u=0;if(n&&n.getBoundingClientRect){var o=n.getBoundingClientRect();r=o.left,e=o.top,s=o.width,u=o.height}return[i,t.clientX,t.clientY,r,e,s,u]}}var Gc,Qc,Xc=function(){function t(t,n){this.pe=t,this.bu=n,this.Su=[],this.ku=0}return t.prototype.add=function(t){this.Su.length>0&&this.Su[this.Su.length-1].When===t.When&&this.Su.pop(),0===this.Su.length?(this.pe.push(t),this.ku=t.When):t.When>this.ku&&(this.ku=t.When),this.Su.push(t)},t.prototype.finish=function(t,n){void 0===n&&(n=[]);var i=this.Su.length;if(i<=1)return!1;for(var r=[],e=this.Su[0].When,u=this.Su[i-1].When,o=u-e!=0?u-e:1,a=0;a-1&&(s.push(a.Selector),s.push("".concat(a.Selector," *")))}var c=s.join(", ");Co(c)?this.Cu=[c]:this.Cu=s}return t.prototype.xu=function(t){var n=this.Tu.get(t);if(void 0!==n)return n;for(var i=0,r=this.Cu;i=this.Iu){var a=this.ot.recording.getCurrentSessionURL;!function(t,n){var i,r="fullstory/rageclick";try{i=new CustomEvent(r,{detail:n,bubbles:!0,cancelable:!0})}catch(t){(i=document.createEvent("customevent")).initCustomEvent(r,!0,!0,n)}C.setWindowTimeout(window,Qs.wrap(function(){t.dispatchEvent(i)}),0)}(r,{eventStartTimeStamp:this.Au.first(),eventEndTimeStamp:i,eventReplayUrlAtStart:a(),eventReplayUrlAtCurrentTime:a(!0)}),this.Iu=Gc.defaultRageThreshold,this.Au=new co}}}}}},t}(),Jc=function(){function t(t){this.ot=t,this.Ku=this.ot.time.wallTime(),this.Ru=!1}return t.prototype.getLastUserActivityTS=function(){return this.Ku},t.prototype.getMsSinceLastUserActivity=function(){return C.mathFloor(this.ot.time.wallTime()-this.Ku)},t.prototype.resetUserActivity=function(){this.Ku=this.ot.time.wallTime()},t.prototype.isHibernating=function(){return this.Ru},t.prototype.setHibernating=function(){this.Ru=!0},t}(),Zc=function(){function t(t,n,i,r){void 0===r&&(r=Pu),this.ot=t,this.Mu=n,this.zt=i,this.Ou=!1,this.ju=!1,this.Pu=!1,this.Uu=new r(this.Nu.bind(this),_n.HeartbeatInterval),this.Lu=new r(this.Du.bind(this),_n.PageInactivityTimeout)}return t.prototype.getUserActivityModel=function(){return this.Mu},t.prototype.manualHibernateCheck=function(){this.Mu.isHibernating()||this.Mu.getMsSinceLastUserActivity()>=_n.PageInactivityTimeout+5e3&&this.Du()},t.prototype.intercept=function(t){this.Ou||(this.manualHibernateCheck(),function(t){switch(t){case ot.MOUSEDOWN:case ot.MOUSEMOVE:case ot.MOUSEMOVE_CURVE:case ot.MOUSEUP:case ot.TOUCHSTART:case ot.TOUCHEND:case ot.TOUCHMOVE:case ot.TOUCHMOVE_CURVE:case ot.TOUCHCANCEL:case ot.CLICK:case ot.SCROLL_LAYOUT:case ot.SCROLL_LAYOUT_CURVE:case ot.SCROLL_VISUAL_OFFSET:case ot.SCROLL_VISUAL_OFFSET_CURVE:case ot.NAVIGATE:return!0}return!1}(t.Kind)&&(this.Mu.isHibernating()?this.Bu():this.Wu()))},t.prototype.shutdown=function(){this.Uu.stop(),this.Lu.stop()},t.prototype.Wu=function(t){var n=this;void 0===t&&(t=!0),this.Pu||(this.Mu.resetUserActivity(),this.Uu.start(),this.Lu.start(),t&&(this.Pu=!0,de().then(function(){n.Pu=!1})))},t.prototype.start=function(){var t=this.ot.recording.heartbeatInterval();this.Fu(t),this.Wu(!1)},t.prototype.Fu=function(t){var n=this.Uu.isRunning();this.Uu.start(t),n||this.Uu.stop()},t.prototype.Nu=function(){var t=this.Mu.getMsSinceLastUserActivity();t<=_n.PageInactivityTimeout&&this.zt.enqueue({Kind:ot.HEARTBEAT,Args:[t]}),this.Uu.start()},t.prototype.Du=function(){if(!this.Mu.isHibernating()){var t=!1;this.Mu.getMsSinceLastUserActivity()<=2*_n.PageInactivityTimeout?this.zt.enqueue({Kind:ot.UNLOAD,Args:[Ut.Hibernation]}):t=!0;try{this.Ou=!0,this.Mu.setHibernating(),this.shutdown(),this.zt.onHibernate(t)}finally{this.Ou=!1}}},t.prototype.Bu=function(){this.ju||(this.ju=!0,this.ot.recording.splitPage(Ut.Hibernation))},t}(),th=function(){function t(){}return t.prototype.encode=function(t){return t},t}(),nh=function(){function t(){this.dict={idx:-1,map:{}},this.nodeCount=1,this.startIdx=0}return t.prototype.encode=function(n){if(0==n.length)return[];var i,r,e=n[0],s=Object.prototype.hasOwnProperty.call(this.dict.map,e)?this.dict.map[e]:void 0,u=[],o=1;function a(){s?o>1?u.push([s.idx,o]):u.push(s.idx):u.push(e)}for(i=1;ithis.Hu},t.prototype.reset=function(){this.zu=0},t}(),ah=((eh={})[ot.AJAX_REQUEST]=!0,eh[ot.PERF_ENTRY]=!0,eh[ot.RESOURCE_TIMING_BUFFER_FULL]=!0,eh),ch=function(){function t(t,n){void 0===n&&(n=oh.newBudget()),this.ot=t,this.qu=n,this.zt=new co,this.$u=1,this.Vu={},this.Gu=!1,this.Qu=[],this.Xu=!0,this.init()}return t.prototype.init=function(){if(1===this.$u){var t,n="CompressionStream"in(t=this.ot.window)&&"TextEncoderStream"in t;this.Xu=!!this.ot.recording.flags().UseLZEncoding||!n}},t.prototype.size=function(){return this.zt.size()},t.prototype.add=function(t){var n=!0;switch(t.Kind){case ot.SET_FRAME_BASE:case ot.MUT_INSERT:case ot.MUT_SHADOW:case ot.DEFERRED_MUT_INSERT:case ot.DEFERRED_MUT_SHADOW:n=!1}ah[t.Kind]||(this.Gu=!0),this.zt.push([t,n?fi(t):void 0])},t.prototype.nextBundle=function(n){if(0!==this.zt.size())return n.flush||t.forceFlush||this.Gu?this.Yu(n):void 0},t.prototype.addEndMarkerEvent=function(t){this.Qu.push(t)},t.prototype.persistEndMarkerEventsTo=function(t){for(var n=0,i=this.Qu;n0,"queue should never be empty"),this.qu.reset();var n,i,r=this.zt.first()[0],e=r.When,s=this.Zu(t),u=s[0],o=s[1];if(this.no=(n=o,i=this.no,n?i?n.When>=i.When?n:i:n:i),!this.io(t))return this.ro(u,this.no),[e,hh(u)];this.zt.unshift([r,hh(u)])},t.prototype.Zu=function(t){for(var n,r=[],e=[],u=this.zt.shift();u;u=this.zt.shift()){var o=u[0],a=u[1];if(n=o,void 0===a){var c=ih([o])[0];if(this.Xu){var h=this.eo(c),f=h[0],v=h[1];a=fi(f),e.push.apply(e,v)}else{var l=xi();a=fi(c),e.push(xi()-l)}}if(r.push(a),this.qu.add(a.length),!t.flush&&this.qu.isOver())break}return n&&function(t,n,r){n.length<=0||t.push(function(t,n){var r=n[0],e=n.slice(1);return fi(i(i({},t),{Kind:ot.TIMING,Args:[s([ft.Internal,lt.Serialization,pt.LzEncoding,t.When,r],e.map(function(t){return[pt.LzEncoding,t]}),!0)]}))}(r,n))}(r,e,n),[r,n]},t.prototype.io=function(t){return!(!this.ot.recording.flags().UseMinNetworkBudget||t.bypassMinBudget||t.flush||this.qu.isOver())},t.prototype.ro=function(t,n){Js(!!n,"builder: missing last event"),n&&function(t,n,r){Js(n.length>0,"builder: missing marker events");for(var e=0,s=n;e=this.fo&&this.stopPipeline(),this.co=r.BundleTime,[3,3];case 2:return yr(e.sent())?[3,3]:[2,sh.Retry];case 3:return[2,sh.NoRetry]}})})},this.oo,function(t){return i.Io=t},this["do"])];case 2:return s.sent(),[3,5];case 3:return s.sent(),this.stopPipeline(),[3,5];case 4:return this.ao=!1,this.po.size()>0&&this.wo(),[7];case 5:return[2]}})})},t}(),wh=function(){function t(t,n,i,r,e,s,u){void 0===r&&(r=function(){return[]}),void 0===e&&(e=ju),void 0===s&&(s=Pu),this.ot=t,this.Eo=n,this.To=r,this.Co=e,this.xo=u,this.Ko=0,this.Ro=[],this.Mo=!1,this.Oo=!1,this.jo=0,this.Po=-1,this.Uo=!1,this.In=[],this.No=[],this.Lo=new gh,this.Do=new this.Co(_n.CurveSamplingInterval),this.Bo=new this.Co(_n.MutationProcessingInterval),i&&(this.Wo=new Zc(this.ot,i,this,s),this.No.push(this.Wo)),this.No.push(this.Lo),u&&this.No.push(u)}return t.prototype.startPipeline=function(t){var n,i,s;return r(this,void 0,ie,function(){var r,u=this;return e(this,function(e){switch(e.label){case 0:return this.Oo||this.Mo?[2]:(this.Mo=!0,t.frameId&&(this.Ko=t.frameId),t.parentIds&&(this.Ro=t.parentIds),t.fixWhenValues&&0===(null!==(n=t.frameId)&&void 0!==n?n:0)&&this.Lo.startPipeline(),null===(i=this.xo)||void 0===i||i.startPipeline(t),r=!0,[4,le()]);case 1:return e.sent(),this.processEvents(),[4,le()];case 2:return e.sent(),window,this.Bo.start(function(){window,u.processEvents(),window}),this.Do.start(function(){window,u.processEvents(r),window},this.ot.recording.flags().EnableRecEvents?C.mathMax(50,100):_n.CurveSamplingInterval),null===(s=this.Wo)||void 0===s||s.start(),this.Eo.startPipeline(t),window,[2]}})})},t.prototype.enableEasyBake=function(){this.Fo=new Yc(this.ot)},t.prototype.enqueueSimultaneousEventsIn=function(t){if(0===this.jo){var n=this.ot.time.now();this.Po=n>this.Po?n:this.Po}try{return this.jo++,t(this.Po)}finally{this.jo--,this.jo<0&&(this.jo=0)}},t.prototype.enqueue=function(t){var n=this.jo>0?this.Po:this.ot.time.now();this.Ho(n,t),Ou.checkForBrokenSchedulers()},t.prototype.Ho=function(t,n){var i;if(!this.Oo){var r=t;r0){var n=t;n.When=this.In[0].When,this.In.unshift(n)}else this.enqueue(t)},t.prototype.addUnload=function(t){this.Uo||(this.Uo=!0,this.enqueue({Kind:ot.UNLOAD,Args:[t]}),this.singSwanSong(t))},t.prototype.shutdown=function(t){this.addUnload(t),this.zo(),this.Oo=!0,this.qo()},t.prototype.zo=function(){var t,n;this.processEvents(),null===(n=(t=this.Eo).send)||void 0===n||n.call(t)},t.prototype.singSwanSong=function(t){var n,i;this.Oo||(window,this.zo(),t===Ut.Hidden&&this.Uo||null===(i=(n=this.Eo).send)||void 0===i||i.call(n,{mode:"sing"}),window)},t.prototype.rebaseIframe=function(t,n){for(var i=Math.max(0,n),r=this.ot.time.startTime(),e=function(n){var e=r+n-t;return e>=i?e:i},s=0,u=this.In;s0){var f=h[h.length-1].Args[2];f&&(h[0].Args[9]=f)}}for(var v in s)s[l=parseInt(v,10)].finish(ot.SCROLL_LAYOUT_CURVE,[l]);for(var v in u)u[l=parseInt(v,10)].finish(ot.SCROLL_VISUAL_OFFSET_CURVE,[l]);for(var v in e){var l;e[l=parseInt(v,10)].finish(ot.TOUCHMOVE_CURVE,[l])}return n&&n.finish(ot.RESIZE_VISUAL_CURVE),i}(n);t||(i=i.concat(this.To())),this.$o(i),this.sendEvents(this.ot.recording.pageSignature(),i)}},t.prototype.sendEvents=function(t,n){if(0!=n.length){if(this.No.length>0)for(var i=0,r=n;i0,r=0;rr?this.Vo[i]=t.When:t.When>>0).toString(16)).slice(-8);return t},t}();function yh(t){var n=new mh(1);return n.writeAscii(t),n.sumAsHex()}function bh(t){var n=new Uint8Array(t);return kh(String.fromCharCode.apply(null,n))}var Sh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function kh(t){var n;return(null!==(n=window.btoa)&&void 0!==n?n:_h)(t).replace(/\+/g,"-").replace(/\//g,"_")}function _h(t){for(var n=String(t),i=[],r=0,e=0,s=0,u=Sh;n.charAt(0|s)||(u="=",s%1);i.push(u.charAt(63&r>>8-s%1*8))){if((e=n.charCodeAt(s+=3/4))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|e}return i.join("")}var Ah=1e4,Ih=25,Eh=100;function Th(t,n,i,s){return void 0===s&&(s=new mh),r(this,void 0,ie,function(){var r,u,o,a;return e(this,function(e){switch(e.label){case 0:r=t.now(),u=i.byteLength,o=0,e.label=1;case 1:return oIh?[4,n(Eh)]:[3,3]:[3,5];case 2:e.sent(),r=t.now(),e.label=3;case 3:a=new Uint8Array(i,o,Math.min(u-o,Ah)),s.write(a),e.label=4;case 4:return o+=Ah,[3,1];case 5:return[2,{hash:s.sum(),hasher:s}]}})})}function Ch(t,n,i){var s,u;return r(this,void 0,ie,function(){return e(this,function(r){switch(r.label){case 0:return(null===(u=null===(s=t.crypto)||void 0===s?void 0:s.subtle)||void 0===u?void 0:u.digest)?[4,t.crypto.subtle.digest({name:"sha-1"},i)]:[3,2];case 1:return[2,{hash:bh(r.sent()),algorithm:"sha1"}];case 2:return[4,Th(n,xh,i)];case 3:return[2,{hash:r.sent().hash,algorithm:"fsnv"}]}})})}function xh(t){return new ie(function(n){return setTimeout(function(){try{n()}catch(t){}},t)})}var Kh=6e6,Rh=/^\/?_capacitor_file_/,Mh="resource-uploader",Oh=function(){function t(t,n,i,r,e){void 0===r&&(r=window.FormData),void 0===e&&(e=Pu),this.ot=t,this.zt=n,this.uo=i,this.Go=r,this.Qo=e,this.Pe={},this.Xo={},this.Yo=!1,this.Jo=[]}return t.prototype.init=function(){this.Go&&this.Zo()["catch"](function(t){Qs.send(t,"error")})},t.prototype.Zo=function(){return r(this,void 0,ie,function(){var t,n,i,r,s,u,o,a,c,h,f,v,l,d,p,w,g,m,y,b,S,k,_,A,I;return e(this,function(e){switch(e.label){case 0:t=this.ot.options.orgId,e.label=1;case 1:return[4,this.ta()];case 2:for(n=e.sent(),i={fsnv:{},sha1:{}},r={},s=0,u=n;sKh){var r=fs(t,{source:"log",type:"fsbugs"});return tu(Mh,"Size of blob resource exceeds limit",{url:r,MaxResourceSizeBytes:Kh}),void i(null)}ue(n).then(function(t){i(t?{buffer:t,blob:n,contentType:n.type}:null)})},e.send(),r)}var Ph=/^data:([^;,]*)(;?charset=[^;]+)?(?:;base64)?$/i,Uh="Could not parse data url",Nh=function(){function t(t,n,i){void 0===i&&(i=new Lh),this.ot=t,this.pe=n,this.ea=i}return t.prototype.initialize=function(t){var n;if(t){this.sa(t);var i=null===(n=this.ot.window.location)||void 0===n?void 0:n.href;this.onNavigate(i)}},t.prototype.onNavigate=function(t){return!!this.ea.matches(t)&&(this.pe.enqueue({Kind:ot.KEEP_URL,Args:[fs(t,{source:"page",type:"base"})]}),!0)},t.prototype.onClick=function(t){var n;return!!(null===(n=null==t?void 0:t.watchKind)||void 0===n?void 0:n.has(Fe.Keep))&&(this.pe.enqueue({Kind:ot.KEEP_ELEMENT,Args:[t.id]}),!0)},t.prototype.urlMatches=function(t){return this.ea.matches(t)},t.prototype.sa=function(t){this.ea.setRules(t)},t}(),Lh=function(){function t(){this.ua=null}return t.prototype.setRules=function(t){var n=t.map(function(t){return t.Regex}).filter(Dh);n.length>0&&(this.ua=function(t){try{return new RegExp("(".concat(t.join(")|("),")"),"i")}catch(n){return Qs.send("Browser rejected joining UrlKeep.Regexs","error",{exprs:t,error:n.toString()}),null}}(n))},t.prototype.matches=function(t){return!!this.ua&&this.ua.test(t)},t}();function Dh(t){try{return new RegExp(t),!0}catch(n){return Qs.send("Browser rejected UrlKeep.Regex","error",{expr:t,error:n.toString()}),!1}}jn.RequestFrameId,jn.EvtBundle;var Bh=function(t){var n=(void 0===t?{}:t).wnd,i=void 0===n?window:n;!function(t,n,i,r,e,s,u,o){var a,c;function h(t){var n,i=[];function r(){n&&(i.forEach(function(t){var i;try{i=t[n[0]]&&t[n[0]](n[1])}catch(n){return void(t[3]&&t[3](n))}i&&i.then?i.then(t[2],t[3]):t[2]&&t[2](i)}),i.length=0)}function e(t){return function(i){n||(n=[t,i],r())}}return t(e(0),e(1)),{then:function(t,n){return h(function(e,s){i.push([t,n,e,s]),r()})}}}i in t&&(t.console&&t.console.log&&t.console.log("FullStory namespace conflict. Please set window[\"_fs_namespace\"]."),1)||(u=t[i]=function(){var t=function(t,i,r,e){function s(s,u){n(t,i,r,s,u,e)}e=e||2;var u,o=/Async$/;return o.test(t)?(t=t.replace(o,""),"function"==typeof Promise?new Promise(s):h(s)):n(t,i,r,u,u,e)};function n(n,i,r,e,s,u){return t._api?t._api(n,i,r,e,s,u):(t.q&&t.q.push([n,i,r,e,s,u]),null)}return t.q=[],t}(),function(){function t(){}function n(t,n,i){u(t,n,i,1)}function i(t,i,r){n("setProperties",{type:t,properties:i},r)}function r(t,n){i("user",t,n)}function e(t,n,i){r({uid:t},i),n&&r(n,i)}u.identify=e,u.setUserVars=r,u.identifyAccount=t,u.clearUserCookie=t,u.setVars=i,u.event=function(t,i,r){n("trackEvent",{name:t,properties:i},r)},u.anonymize=function(){e(!1)},u.shutdown=function(){n("shutdown")},u.restart=function(){n("restart")},u.log=function(t,i){n("log",{level:t,msg:i})},u.consent=function(t){n("setIdentity",{consent:!arguments.length||t})}}(),a="fetch",c="XMLHttpRequest",u._w={},u._w[c]=t[c],u._w[a]=t[a],t[a]&&(t[a]=function(){return u._w[a].apply(this,arguments)}),u._v="2.0.0")}(i,i.document,i._fs_namespace,0,i._fs_script)};function Wh(t,n){if(t&&t.postMessage)try{t.postMessage(function(t){var n;return hi(((n={})[Wn]=t,n))}(n),"*")}catch(t){var i="postMessageTo";tu(i,i,{err:t})}}function Fh(t){try{var n=di(t);if(Wn in n)return n[Wn]}catch(t){}return[jn.Unknown]}function Hh(t,n,i,r){var e=ar(t);if(!e)return!1;try{e.send(n,i,r)}catch(t){e.send(n,i)}return!0}function zh(t,n,i){var r=ar(t);if(!r||!r.sendToChild)return!1;var e=i[0],s=hi(i.slice(1));return r.sendToChild(n,e,s),!0}var qh=new RegExp(/^\s+$/),$h=/^fb\d{18}$/,Vh=function(t){var n=t.frame,i=t.orgId,r=t.scheme,e=t.script,s=t.recHost,u=t.cdnHost,o=t.appHost,a=t.namespace,c=t.desc,h=t.snippetVersion;"Injecting into Frame ".concat(c);try{if(function(t){return t.id==t.name&&$h.test(t.id)}(n))return"Blocklisted iframe: ".concat(c),gt.BlocklistedFrame;if(function(t){return!(t.contentDocument&&t.contentWindow&&t.contentWindow.location)||function(t){return!!t.src&&"about:blank"!=t.src&&t.src.indexOf("javascript:")<0}(t)&&t.src!=t.contentWindow.location.href&&"loading"==t.contentDocument.readyState}(n))return"Frame not yet loaded: ".concat(c),gt.PartiallyLoaded;var f=n.contentWindow,v=n.contentDocument;if(!f||!v)return"Missing contentWindow or contentDocument: ".concat(c),gt.MissingWindowOrDocument;if(!v.head)return"Missing contentDocument.head: ".concat(c),gt.MissingDocumentHead;if(!v.body||!_t(v.body))return gt.MissingBodyOrChildren;for(var l=!1,d=bt(v.body);d;d=At(d)){switch(d.nodeType){case X:if("SCRIPT"===d.tagName)continue;break;case 3:var p=d.textContent;if(null===p||qh.test(p))continue;break;case Node.COMMENT_NODE:continue}l=!0;break}if(!l)return gt.NoNonScriptElement;if(Vi(f))return"FS already defined in Frame contentWindow: ".concat(c," Ignoring."),gt.AlreadyDefined;var w=f;return w._fs_org=i,w._fs_script=e,w._fs_rec_host=s,w._fs_rec_settings_host=u,w._fs_app_host=o,w._fs_run_in_iframe=!0,w._fs_namespace=a,w._fs_transport=function(t){return{send:function(n,i,r){if(void 0!==t.parent){var e=Vi(t.parent);void 0!==e&&"function"==typeof e._withRecorder&&e._withRecorder(r,function(e){try{e.onMessageReceived(t,[n,C.jsonParse(i),r])}catch(t){t instanceof SyntaxError&&Qs.send(t,"error",{msg:"Received invalid JSON"})}})}}}}(w),function(t,n,i,r,e,s){/^2\./.test(s)?Bh({wnd:t}):function(t){var n,i,r,e,s,u=(void 0===t?{}:t).wnd,o=void 0===u?window:u;n=o,o.document,i=o._fs_namespace,r="user",i in n?n.console&&n.console.log&&n.console.log("FullStory namespace conflict. Please set window[\"_fs_namespace\"]."):((e=n[i]=function(t,n,i){e.q?e.q.push([t,n,i]):e._api(t,n,i)}).q=[],e.identify=function(t,n,i){e(r,{uid:t},i),n&&e(r,n,i)},e.setUserVars=function(t,n){e(r,t,n)},e.event=function(t,n,i){e("event",{n:t,p:n},i)},e.anonymize=function(){e.identify(!1)},e.shutdown=function(){e("rec",!1)},e.restart=function(){e("rec",!0)},e.log=function(t,n){e("log",[t,n])},e.consent=function(t){e("consent",!arguments.length||t)},e.identifyAccount=function(t,n){(n=n||{}).acctId=t,e("account",n)},e.clearUserCookie=function(){},e.setVars=function(t,n){e("setVars",[t,n])},e._w={},s="XMLHttpRequest",e._w[s]=n[s],s="fetch",e._w[s]=n[s],n[s]&&(n[s]=function(){return e._w[s].apply(this,arguments)}),e._v="1.3.0")}({wnd:t});var u=n.createElement("script");u.async=!0,u.crossOrigin="anonymous",u.src="".concat(i,"//").concat(r),"testdrive"==e&&(u.src+="?allowMoo=true"),n.head.appendChild(u)}(w,v,r,e,i,h),gt.Successful}catch(t){return gt.Exception}};function Gh(t){var n="".concat(Eu(t));t.id&&(n+="#".concat(t.id));var i=fs(t.src,{source:"log",type:"debug"});return n+"[src=".concat(i,"]")}var Qh,Xh,Yh=function(){function t(t,n){var i;this.xi=t,this.zt=[],this.oa=!1,this.jt=null!==(i=n.interval)&&void 0!==i?i:1e3,this.aa=n.onFlush}return t.prototype.append=function(t){this.schedule(),this.zt.push(t)},t.prototype.flush=function(){this.oa=!1,this.aa(this.zt),this.zt=[]},t.prototype.schedule=function(){this.oa||(C.setWindowTimeout(this.xi,P(this.flush.bind(this)),this.jt),this.oa=!0)},t}(),Jh="https://fs-obfuscated.invalid",Zh=function(){function t(t,n){this.xi=t,this.zt=n,this.ca=0,this.ha={},this.mn=!1}return t.prototype.enable=function(){var t=this;this.mn=!0,this.fa=function(t){var n;try{if("function"==typeof(null===(n=t.crypto)||void 0===n?void 0:n.getRandomValues)){var i="",r=new Uint32Array(2);t.crypto.getRandomValues(r);for(var e=0;e2e6?[4,le()]:[3,7];case 6:e.sent(),e.label=7;case 7:return[3,9];case 8:return e.sent(),[3,9];case 9:return[2,[r,{BundleTime:i}]]}})})},t.prototype.bundleBeacon=function(t){return!0},t.prototype.startBeacon=function(t){return r(this,void 0,ie,function(){return e(this,function(t){return[2,ie.resolve()]})})},t}(),nf=function(){function t(){}return t.prototype.uploadResource=function(t){return r(this,void 0,ie,function(){return e(this,function(t){switch(t.label){case 0:return[4,le()];case 1:return t.sent(),[2,hi({Algorithm:"fsnv",Hash:""})]}})})},t.prototype.queryResources=function(t){return r(this,void 0,ie,function(){return e(this,function(t){switch(t.label){case 0:return[4,le()];case 1:return t.sent(),[2,[]]}})})},t}(),rf=function(){function t(){this._cookies={}}return t.prototype.setDomain=function(t){},t.prototype.getValue=function(t,n){return{cookieValue:this._cookies[t],localStorageValue:void 0}},t.prototype.setValue=function(t,n,i,r){this.setCookie(t,n,i)},t.prototype.setCookie=function(t,n,i){this._cookies[t]=n},t.prototype.clearCookie=function(t,n){delete this._cookies[t]},Object.defineProperty(t.prototype,"cookies",{get:function(){return this._cookies},enumerable:!1,configurable:!0}),t}();function ef(){try{return document.domain}catch(t){}return""}function sf(){return{AjaxWatches:[],CookieDomain:ef(),ElementBlocks:s(s([],[{Selector:"input",Consent:!1,Type:pn.Mask},{Selector:"textarea",Consent:!1,Type:pn.Mask},{Selector:"select",Consent:!1,Type:pn.Mask},{Selector:"[contenteditable]",Consent:!1,Type:pn.Mask},{Selector:"input[type=radio]",Consent:!1,Type:pn.Exclude},{Selector:"input[type=checkbox]",Consent:!1,Type:pn.Exclude}],!0),_o,!0),ElementDeferreds:[],ElementKeeps:[],ElementWatches:[],OrgSettings:_n.DefaultOrgSettings,UrlKeeps:[],DwellTime:0}}(Xh=Qh||(Qh={}))[Xh.NoInfoYet=1]="NoInfoYet",Xh[Xh.Enabled=2]="Enabled",Xh[Xh.Disabled=3]="Disabled";var uf,of,af=function(){function t(t,n,i,r,e,s){var u,o=this;this.ot=t,this.ga=e,this.ma=_n.DefaultOrgSettings,this.ya=!1,this.Ko=null,this.Ro=[],this.ba=_n.DefaultBundleUploadInterval,this.Sa=_n.HeartbeatInterval,this.ka=[],this._a=new WeakMap,this.Aa=[],this.lt=new eu,this.Ia=Qh.NoInfoYet,this.Ea=!1,this.Ta=!1,this.Ca=!1,this.xa=!1,this.Ka={},this.zt=new wh(t,r,i,function(){return o.Ra.bundleEvents()},n,void 0,s);var a,c=new Oh(t,this.zt,cr((a=t).window)?new nf:new Ks(a));this.Yi=new Zh(t.window,this.zt),this.Fn=new No,this.bs=new Nh(t,this.zt),this.Ra=new Bc(t,this.zt,this.bs,this.Fn,this.lt,function(t){return o.Ss(t)},function(t){return o.ks(t)},c,this.Yi),this.st=t.options.scheme,this.Ma=t.options.script,this.Oa=t.options.recHost,this.ut=t.options.cdnHost,this.ja=t.options.appHost,this.yo=t.options.orgId,this.xi=t.window,this.Ta=null!==(u=!!tr(t.window,"_fs_skip_iframe_injection","boolean"))&&void 0!==u&&u,this.t=this.xi.document}return t.prototype.getPageResponse=function(){return this.Pa},t.prototype.bundleUploadInterval=function(){return this.ba},t.prototype.heartbeatInterval=function(){return this.Sa},t.prototype.setInitConfig=function(t){this.Ua=t},t.prototype.start=function(t,n,i){var r=this;this.Na=n,this.La=i,this.Ps();var e=this.xi.Document?this.xi.Document.prototype:this.xi.document;this.Da=gi(e,"close"),this.Da&&this.Da.afterAsync(function(){r.lt.refresh()})},t.prototype.Ps=function(){var t=this;"onpageshow"in this.xi&&this.lt.add(this.xi,"pageshow",!1,function(n){t.zt.manualHibernateCheck(),(null==n?void 0:n.persisted)&&t.zt.enqueue({Kind:ot.BFCACHE_STATE,Args:[Ct.Restored]})}),"onpagehide"in this.xi?this.lt.add(this.xi,"pagehide",!1,function(n){(null==n?void 0:n.persisted)?(t.zt.enqueue({Kind:ot.BFCACHE_STATE,Args:[Ct.Entering]}),t.zt.singSwanSong(Ut.Unload)):t.Ba()}):this.lt.add(this.xi,"unload",!1,function(){t.Ba()}),this.lt.add(this.xi,"message",!1,function(n){var i=n.data;if("string"==typeof i){var r=n.source;t.onMessageReceived(r,Fh(i))}})},t.prototype.tellAllFramesTo=function(t){for(var n=0,i=this.ka;n0){for(var t=0;t0&&this.zt.sendEvents(e,i);break;case jn.RequestFrameId:if(!t)return;var s=this.Ya(t);if(void 0===s);else{var u=Eu(s);"Responding to FID request for frame ".concat(u),this.Ka[u]=!1,this.Ja(s,u)}case jn.Unknown:}},t.prototype.Ya=function(t){for(var n=0,i=this.ka;n0&&(null!==(s=null===(e=null===(r=t.OrgSettings)||void 0===r?void 0:r.UrlPrivacyConfig)||void 0===e?void 0:e.length)&&void 0!==s?s:0)>0&&(null!==(a=null===(o=null===(u=t.OrgSettings)||void 0===u?void 0:u.AttributeBlocklist)||void 0===o?void 0:o.length)&&void 0!==a?a:0)>0;return c||Qs.send("Invalid page response","error",{rsp:t}),c}(of=uf||(uf={})).START="start",of.SHUTDOWN="shutdown",of.INTERNAL_BUNDLE="internal/bundle",of.INTERNAL_ERROR="internal/error",of.INTERNAL_FS_INIT="internal/fs-init";var hf=[uf.START,uf.SHUTDOWN,uf.INTERNAL_BUNDLE,uf.INTERNAL_ERROR,uf.INTERNAL_FS_INIT];function ff(t){var n=t.Seq,i=hi(t);return[n,{data:i,type:"string"},i.length]}function vf(t,n){var i;return new ie(function(r){var e=Zo(sa,function(s){for(var u=0,o=s;uthis.ic},t.prototype.ac=function(t,n){this.$u=t,this.ec=n,this.rc+=n},t}();function df(t,n,i){return i?"".concat(t,":").concat(i,":").concat(n):"".concat(t,":").concat(n)}function pf(t,n,i,s){return void 0===i&&(i=Pu),r(this,void 0,ie,function(){var u,o,a,c,h,f,v=this;return e(this,function(l){switch(l.label){case 0:if(!Vn(n)||0===n.length)return[2];o=!1,a=function(n){return r(v,void 0,ie,function(){var i,r,s,a,c;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),i=n.bundle,r=i[0],s=i[2],"Sending ".concat(s," trailing bytes from last session as Seq ").concat(r),void 0!==u&&(n.serverBundleTime=u),[4,t.bundle(n)];case 1:return a=e.sent(),c=a[1],u=c.BundleTime,[2,sh.NoRetry];case 2:return yr(e.sent())?(o=!0,[2,sh.NoRetry]):[3,3];case 3:return[2,sh.Retry]}})})},c=0,h=n,l.label=1;case 1:return c=0?(i=t[n],[4,this.dc(i)]):[3,4];case 2:r.sent(),r.label=3;case 3:return n--,[3,1];case 4:return[2]}})})},t.prototype.dc=function(t){return r(this,void 0,ie,function(){var n,i,r=this;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),void 0!==t&&t.Bundles&&t.UserId&&t.SessionId&&t.PageId?("Sending ".concat(t.Bundles.length," bundles as prior page swan song"),n=t.Bundles.reduce(function(n,i,e){var s=e===t.Bundles.length-1;return n.push({bundle:i,isNewSession:t.IsNewSession,orgId:t.OrgId,pageId:t.PageId,recHost:t.RecHost,serverBundleTime:t.ServerBundleTime,serverPageStart:t.ServerPageStart,sessionId:t.SessionId,userId:t.UserId,version:t.Version,deltaT:s?r.ot.time.wallTime()-(t.LastBundleTime||0):null}),n},[]),[4,pf(this.uo,n,this.oo,function(t){r.Io=t})]):[2];case 1:return e.sent(),[3,3];case 2:return i=e.sent(),"Error recovering swan-song: ".concat(i),[3,3];case 3:return[2]}})})},t}();function gf(t){try{if(t in localStorage){var n=localStorage[t];return delete localStorage[t],(i=di(n)).Bundles=function(t){for(var n=[],i=0,r=t.Bundles;ithis.gc)return!0;var i=null===(n=this.Sc)||void 0===n?void 0:n.getValue(zn);return((null==i?void 0:i.cookieValue)||(null==i?void 0:i.localStorageValue))===this.kc.sessionId&&(this.yc=!0,!0)},t}(),yf=function(){function t(t,n,i,r,e,s,u){void 0===r&&(r=ju),void 0===e&&(e=Pu),void 0===s&&(s=new mf(t,n)),this.ot=t,this.uo=n,this.Mu=i,this.Co=r,this.oo=e,this.Ic=s,this.Ec=u,this.Tc=!1,this.Cc=0,this.xc=0,this.Kc=0,this.mo=!1,this.co=0,this.Rc=[],this.Mc=xi(),this.st=t.options.scheme,this.Oc=t.time.wallTime(),this.jc=new wf(t,this.uo,e),this.po=fh(this.ot)}return t.prototype.addEndMarkerEvent=function(t){this.po.addEndMarkerEvent(t)},t.prototype.scheme=function(){return this.st},t.prototype.enqueueEvents=function(t,n){for(var i=0,r=n;i=2e4&&(i.Mc=xi(),i.Lc({bypassMinBudget:!0})),i.Dc()})},t.prototype.stopPipeline=function(){this.Uc&&this.Uc.stop(),this.po=fh(this.ot,this.po),this.Rc=[],this.yo=void 0,this._o=void 0,this.ko=void 0,this.bo=void 0,this.So=void 0,this.mo=!1},t.prototype.send=function(t){var n;return r(this,void 0,ie,function(){return e(this,function(i){switch(i.label){case 0:switch(null!==(n=null==t?void 0:t.mode)&&void 0!==n?n:"flush"){case"flush":return[3,1];case"sing":return[3,3]}return[3,4];case 1:return this.Lc({flush:!0}),[4,this.Bc()];case 2:return i.sent(),[3,5];case 3:return this.Wc(),[3,5];case 4:ge(),i.label=5;case 5:return[2]}})})},t.prototype.Wc=function(){if(this.Lc({flush:!0}),this.Fc(this.Hc))Js(!this.Hc,"_pendingBundle in dwell period");else{var t=[];this.Hc&&t.push(this.Hc);for(var n=0,r=this.Rc;nthis.Pc()?[4,this.Bc()]:[3,4]):[2];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:if((s=e.sent())instanceof gr){if(mr(s.status))return 206===s.status||s.status>=500&&Qs.send("Failed to send bundle, recording outage likely","error"),null===(t=this.Ec)||void 0===t||t.call(this),[2]}else Qs.send("Failed to send bundle, unknown err","error",{err:s});return this.Tc=!0,this.xc=this.Kc+lh(this.Cc++),[3,6];case 6:return[2]}})})},t.prototype.Vc=function(t){var n;return r(this,void 0,ie,function(){var i,r,s,u,o;return e(this,function(e){switch(e.label){case 0:return this.yo&&this._o&&this.ko&&this.bo?(window,i=this.Mu.getMsSinceLastUserActivity(),[4,this.uo.bundle({bundle:t,deltaT:null,isNewSession:this.mo,lastUserActivity:i,orgId:this.yo,pageId:this.bo,serverBundleTime:this.co,serverPageStart:this.So,sessionId:this.ko,userId:this._o,version:this.ot.recording.bundleApiVersion()})]):("unable to send bundle. one or more of orgId:".concat(this.yo," | userId:").concat(this._o," | sessionId:").concat(this.ko," | pageId:").concat(this.bo," are undefined"),[2]);case 1:return r=e.sent(),s=r[0],u=r[1],null===(n=this.ot.recording.observer)||void 0===n||n.addEvent({type:uf.INTERNAL_BUNDLE,data:{size:s}}),o=t[0],s>16e6&&o>=16&&("splitting large page: ".concat(s),this.ot.recording.splitPage(Ut.Size)),window,[2,u]}})})},t.prototype.Nc=function(t,n){return r(this,void 0,ie,function(){var i,r=this;return e(this,function(e){return 0===t.length?[2]:(i=t.reduce(function(t,n,i){return t.push.apply(t,n.bundles.map(function(t){return{bundle:t,isNewSession:n.isNewSession,orgId:r.yo,userId:r._o,sessionId:r.ko,pageId:n.pageId,version:n.version,serverBundleTime:n.serverBundleTime,serverPageStart:n.serverPageStart,deltaT:null}})),t},[]),[2,pf(this.uo,i,n)])})})},t}(),bf="_fs_preview",Sf=new RegExp("(^\\?|&)".concat(bf,"=(?:true|false)(&|$)")),kf=function(){function t(t,n,i){this.xi=n,this.Sc=i,this.Gc="fs_preview_".concat(t)}return t.prototype.isPreviewMode=function(){return this.Qc()||this.Xc()},t.prototype.clear=function(){this.Sc.setValue(this.Gc,"",new Date(1970,1,1).toUTCString())},t.prototype.write=function(){var t=this.Qc(),n=this.Yc();(t||n)&&(t?this.Sc.setValue(this.Gc,"true",new Date(xi()+432e5).toUTCString()):this.clear(),this.Jc())},t.prototype.Jc=function(){if(this.xi.history){var t=location.search.replace(Sf,function(t,n,i){return i?n:""});this.xi.history.replaceState({},"",this.xi.location.href.replace(location.search,t))}},t.prototype.Qc=function(){return this.xi.document.location.search.indexOf("".concat(bf,"=true"))>-1},t.prototype.Yc=function(){return this.xi.document.location.search.indexOf("".concat(bf,"=false"))>-1},t.prototype.Xc=function(){var t=this.Sc.getValue(this.Gc),n=t.cookieValue,i=t.localStorageValue;return!(!n&&!i)},t}();function _f(t){var n,i,r;return{Kind:ot.CAPTURE_SOURCE,Args:[t.type,t.entrypoint,"dom",null===(i=null===(n=t.source)||void 0===n?void 0:n.integration)||void 0===i?void 0:i.slice(0,1024),!!(null===(r=t.source)||void 0===r?void 0:r.userInitiated)]}}function Af(t){return r(this,void 0,ie,function(){var n,i,r,s;return e(this,function(e){if(n=function(t){return"msCrypto"in t?t.msCrypto:t.crypto}(t),"function"==typeof(null==n?void 0:n.randomUUID))return[2,n.randomUUID()];for(i=new Uint8Array(16),n.getRandomValues(i),i[6]=15&i[6]|64,i[8]=63&i[8]|128,r=[],s=0;s=864e5)return[Tf,"exp sid: ".concat(u,"ms ").concat(o,"ms")];var a=null!==(n=this.Zc.getLastUserActivityTimeMS())&&void 0!==n?n:u,c=C.mathMax(a,u),h=C.mathAbs(s-c);if(h>=Cf)return[Tf,"exp lua: ".concat(a,"ms ").concat(h,"ms")];var f=null!==(i=this.Zc.getPageCount())&&void 0!==i?i:0;return f>=250?[Tf,"pages: ".concat(f)]:[e]},t.prototype.start=function(){this.nh.start(3e5)},t.prototype.stop=function(){this.nh.stop()},t.prototype.eh=function(){return r(this,void 0,ie,function(){var t;return e(this,function(n){return(t=this.Zc.getUserId())&&Ef(t)?[2,t]:[2,Af(this.ot.window)]})})},t.prototype.ih=function(){var t=this.Mu.getLastUserActivityTS();t!==this.th&&(this.th=t,this.Zc.setLastUserActivityTimeMS(t)),this.start()},t}(),Kf=function(t){function s(n,i,r,e,s,u,o){void 0===r&&(r=new Jc(n)),void 0===e&&(e=new yf(n,i,r,void 0,void 0,void 0,function(){return c.shutdown(Ut.SettingsBlocked)})),void 0===s&&(s=ju),void 0===u&&(u=Vh),void 0===o&&(o=new ph(n,i));var a,c=t.call(this,n,s,r,e,u,o)||this;c.uo=i,c.Eo=e,c.xo=o,c.sh=!1,c.Oo=!1,c.uh=!1,c.t=c.xi.document,c.Ko=0,c.oh=n.recording.identity,c.ah=new kf(c.yo,c.xi,c.oh.getClientStore()),c.Ia=Qh.NoInfoYet,c.hh=new xf(n,r,c.oh),a=function(t){if(c.Ra.stop(Ut.Api),t){var n=c.t.getElementById(t);n&&c.fh&&n.setAttribute("_fs_embed_token",c.fh)}},c.xi._fs_shutdown=a;var h=c.ah.isPreviewMode();return c.lh=c.uo.settings({orgId:c.yo,previewMode:h})["catch"](function(){}),c}return n(s,t),s.prototype.onDomLoad=function(){var n=this;t.prototype.onDomLoad.call(this),this.sh=!0,this.Za(function(){n.Wa(n.Oo)})},s.prototype.dh=function(){var t=tr(this.xi,"_fs_replay_flags");if(/[?&]_fs_force_session=true(&|#|$)/.test(location.search)&&(t="".concat(t,",forceSession"),this.xi.history)){var n=location.search.replace(/(^\?|&)_fs_force_session=true(&|$)/,function(t,n,i){return i?n:""});this.xi.history.replaceState({},"",this.xi.location.href.replace(location.search,n))}return t},s.prototype.start=function(n,i,s){var u,o,a,c,h,f;return r(this,void 0,ie,function(){var r,v,l,d,p,w,g,m,y,b,S,k,_,A,I,E,T,C,x,K,R,M,O,j,P;return e(this,function(e){switch(e.label){case 0:return t.prototype.start.call(this,n,i,s),[4,this.lh];case 1:if(!(r=e.sent()))return this.ph(),[2];ws(null!==(u=r.OrgSettings.UrlPrivacyConfig)&&void 0!==u?u:_n.DefaultOrgSettings.UrlPrivacyConfig,r.OrgSettings.MaxUrlLength),v=this.dh(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,ie.race([we(this.xi),ee(250)])];case 3:case 4:return e.sent(),[3,5];case 5:l=cu(this.t),d=l[0],p=l[1],U=this.xi,N=0,L=0,w=null==U.screen?[N,L]:(N=parseInt(String(U.screen.width),10),L=parseInt(String(U.screen.height),10),[N=isNaN(N)?0:N,L=isNaN(L)?0:L]),g=w[0],m=w[1],y="",n||(y=this.oh.getUserId()),b=this.oh.getAppId(),S=this.oh.getAppKeyHash(),k=this.ah.isPreviewMode(),_=null!==(c=null===(a=null===(o=this.ot)||void 0===o?void 0:o.recording)||void 0===a?void 0:a.preroll)&&void 0!==c?c:-1,A=fs(Re(this.xi),{source:"page",type:"base"}),I=fs(this.xi.location.href,{source:"page",type:"url"}),E=""===this.t.referrer?"":fs(this.t.referrer,{source:"page",type:"referrer"}),T=li(this.t),C=function(t){var n,i="_fs_tab_id";try{var r=t.sessionStorage.getItem(i);if(r)return r;var e=Math.floor(1e17*Math.random()).toString(16);return t.sessionStorage.setItem(i,e),null!==(n=t.sessionStorage.getItem(i))&&void 0!==n?n:void 0}catch(t){return}}(this.xi),x={OrgId:this.yo,UserId:y,Url:I,Base:A,Width:d,Height:p,ScreenWidth:g,ScreenHeight:m,SnippetVersion:lr(this.xi),Referrer:E,Preroll:_,Doctype:T,CompiledVersion:"02de958fc73c1c50dec6d324a9487bc6a363c081",CompiledTimestamp:1722436201,AppId:b,TabId:C,PreviewMode:k||void 0},v&&(x.ReplayFlags=v),e.label=6;case 6:return e.trys.push([6,12,,13]),[4,this.uo.page(x)];case 7:return K=e.sent(),k||!K.PreviewMode?[3,9]:[4,this.uo.settings({orgId:this.yo,previewMode:!0})["catch"](function(){})];case 8:if(!(r=e.sent()))return this.ph(),[2];ws(null!==(h=r.OrgSettings.UrlPrivacyConfig)&&void 0!==h?h:_n.DefaultOrgSettings.UrlPrivacyConfig,r.OrgSettings.MaxUrlLength),e.label=9;case 9:return[4,this.wh(K,r)];case 10:return cf(P=e.sent())?this.xa?[2]:(window,R=this.oh.getConsentStore().getConsentState(),this.Fa(P,R),window,this.gh(P.CookieDomain,P.UserIntId,P.SessionIntId,P.PageIntId,P.EmbedToken),this.mh(),P.PreviewMode&&this.yh(),M=function(t){return tr(t,"_fs_pagestart","function")}(this.xi),M&&M(),this.zt.enqueueFirst(_f({type:"default"})),this.zt.enqueueFirst(this.Ra.getNavigateEvent(this.xi.location.href,ot.ENTRY_NAVIGATE)),this.zt.enqueueFirst({Kind:ot.SYS_REPORTCONSENT,Args:[R,jt.Document]}),this.zt.enqueueFirst({Kind:ot.SET_FRAME_BASE,Args:[fs(Re(this.xi),{source:"event",type:ot.SET_FRAME_BASE}),T,I,E]}),O={Kind:ot.PAGE_DATA,Args:[I,A,d,p,g,m,lr(this.xi),E,T,_,y,P.PageStart,bi(this.xi),this.xi.navigator.userAgent,C,!!P.IsNewSession,!!P.PreviewMode,b,S,1722436201,"02de958fc73c1c50dec6d324a9487bc6a363c081"]},this.Eo.addEndMarkerEvent(O),null===(f=this.xo)||void 0===f||f.addEndMarkerEvent(O),P.Flags.DisableInertBundles&&(ch.forceFlush=!0),this.zt.enqueue({Kind:ot.SCRIPT_COMPILED_VERSION,Args:["02de958fc73c1c50dec6d324a9487bc6a363c081"]}),this.zt.enqueue({Kind:ot.RESIZE_LAYOUT,Args:[d,p]}),this.Ra.addVisibilityChangeEvent(),this.Ga(),[4,this.zt.startPipeline({isNewSession:!!P.IsNewSession,orgId:this.yo,pageId:P.PageIntId,serverPageStart:P.PageStart,sessionId:P.SessionIntId,userId:P.UserIntId,minDwellTime:P.Flags.UseDwellTime&&P.DwellTime||0,fixWhenValues:P.Flags.FixWhenValues})]):[2,this.ph()];case 11:return e.sent(),this.tc(this.t),this.za(),[3,13];case 12:return(j=e.sent())instanceof gr&&(P=j.data)&&P.user_id&&P.cookie_domain&&P.reason_code===ln.ReasonBlockedTrafficRamping&&y!==P.user_id&&this.gh(P.cookie_domain,P.user_id,"","",""),this.ph(),[3,13];case 13:return[2]}var U,N,L})})},s.prototype.mh=function(){var t=this;this.uh=!0,this.Za(function(){t.Wa(t.Oo)})},s.prototype.gh=function(t,n,i,r,e){var s=this.oh;s.setIds(this.xi,t,n,i),this.fh=e,this.ah.write(),"/User,".concat(s.getUserId(),"/Session,").concat(s.getSessionId(),"/Page,").concat(r)},s.prototype.Za=function(n){this.sh&&this.uh&&t.prototype.Za.call(this,n)},s.prototype.yh=function(){var t="FullStory-preview-script";if(!this.t.getElementById(t)){var n=this.t.createElement("script");n.id=t,n.async=!0,n.src="".concat(this.st,"//").concat(this.ja,"/s/fspreview.js"),this.t.head.appendChild(n)}},s.prototype.ph=function(){this.qa(),this.shutdown(Ut.SettingsBlocked),this.Oo=!0,this.Wa(this.Oo)},s.prototype.wh=function(t,n){var s;return r(this,void 0,ie,function(){var r,u,o;return e(this,function(e){switch(e.label){case 0:return(r=i(i({},t),n)).Flags.UseClientSideId?(this.oh.setCookieDomain(this.xi,r.CookieDomain),Ef(u=null!==(s=r.UserUUID)&&void 0!==s?s:"")&&this.oh.setUserId(u),[4,this.hh.createUserSessionPage()]):[3,2];case 1:o=e.sent(),this.hh.start(),r=i(i({},r),{UserIntId:o.userId,SessionIntId:o.sessionId,PageIntId:o.pageId,IsNewSession:o.isNewSession,PageStart:xi()}),o.reason&&this.zt.enqueue({Kind:ot.SESSION_INFO,Args:[o.reason]}),e.label=2;case 2:return[2,r]}})})},s.prototype.onMessageReceived=function(n,i){t.prototype.onMessageReceived.call(this,n,i),(null==n?void 0:n.parent)==this.xi&&i[0]===jn.EndPreviewMode&&this.ah.clear()},s}(af),Rf=function(){function t(t,n){void 0===n&&(n=new Mf(t)),this.xi=t,this.bh=n}return t.prototype.enqueueEvents=function(t,n){var i=null!=t?t:void 0;this.bh.postMessage(this.xi.parent,[jn.EvtBundle,ih(n),i],i)},t.prototype.startPipeline=function(){},t.prototype.stopPipeline=function(){},t.prototype.addEndMarkerEvent=function(t){},t}(),Mf=function(){function t(t){this.xi=t}return t.prototype.postMessage=function(t,n,i){switch(n[0]){case jn.EvtBundle:Hh(this.xi,n[0],hi(n[1]),i)||Wh(t,n);break;case jn.RequestFrameId:Hh(this.xi,n[0],"[]",i)||Wh(t,n);break;default:"Unknown message type: ".concat(n[0])}},t}(),Of=function(t){function i(n,i,r,e,s){void 0===i&&(i=new Mf(n.window)),void 0===r&&(r=new Rf(n.window,i)),void 0===e&&(e=ju),void 0===s&&(s=Vh);var u=t.call(this,n,e,void 0,r,s,void 0)||this;return u.bh=i,u.t=u.xi.document,u}return n(i,t),i.prototype.Za=function(){var n,i;this.ot.recording.inWebView&&(null===(i=null===(n=this.Pa)||void 0===n?void 0:n.Flags)||void 0===i?void 0:i.FetchChildIntegrations)&&t.prototype.Za.call(this)},i.prototype.start=function(n,i,r){var e=this;t.prototype.start.call(this,n,i,r),this.Sh(),this.lt.add(this.xi,"load",!1,function(){e.Ra.recordingIsDetached()&&e.ot.recording.splitPage(Ut.FsShutdownFrame)}),this.Ra.addVisibilityChangeEvent()},i.prototype.onMessageReceived=function(n,i){var s;return r(this,void 0,ie,function(){var r,u,o,a,c,h,f;return e(this,function(e){switch(e.label){case 0:if(t.prototype.onMessageReceived.call(this,n,i),n!==this.xi.parent&&n!==this.xi)return[2];switch(i[0]){case jn.GreetFrame:return[3,1];case jn.SetFrameId:return[3,2];case jn.SetConsent:return[3,3];case jn.InitFrameMobile:return[3,4]}return[3,7];case 1:return this.Sh(i[1]),[3,7];case 2:try{if(!(r=i[1]))return u=fs(location.href,{source:"log",type:"debug"}),"Outer page gave us a bogus frame Id! Iframe: ".concat(u),[2];this.kh({frameId:r,parentIds:i[2],outerStartTime:i[3],scheme:i[4],script:i[5],appHost:i[6],orgId:i[7],initConfig:i[8],pageRsp:i[9],consented:i[10],minimumWhen:i[11]})}catch(t){"Failed to parse frameId from message: ".concat(hi(i))}return[3,7];case 3:return this.setConsent(i[1]),[3,7];case 4:return e.trys.push([4,6,,7]),o=JSON.parse(i[1]),a=o.StartTime,c=void 0,i.length>2&&i[2]&&(h=i[2],Object.prototype.hasOwnProperty.call(h,"ProtocolVersion")&&h.ProtocolVersion>=20180723&&Object.prototype.hasOwnProperty.call(h,"OuterStartTime")&&(a=h.OuterStartTime),Object.prototype.hasOwnProperty.call(h,"MobileScriptPath")&&(c=h.MobileScriptPath)),f=o.Host,[4,this.kh({frameId:0,parentIds:[],outerStartTime:a,scheme:"https:",script:null!=c?c:wr(f),appHost:pr(f),orgId:o.OrgId,initConfig:void 0,pageRsp:o.PageResponse,consented:null!==(s=this.Fn.getConsent())&&void 0!==s?s:Mt.RevokeConsent})];case 5:return e.sent(),[3,7];case 6:return e.sent(),"Failed to initialize mobile web recording from message: ".concat(hi(i)),[3,7];case 7:return[2]}})})},i.prototype.Sh=function(t){this.Ko&&this.Ko===t||0!=this.Ko&&this.xi.parent&&this.bh.postMessage(this.xi.parent,[jn.RequestFrameId])},i.prototype.kh=function(t){var n;return r(this,void 0,ie,function(){var i,r,s=this;return e(this,function(e){switch(e.label){case 0:if(this.Ko)return this.Ko!==t.frameId?("Updating frame id from ".concat(this.Ko," to ").concat(t.frameId),this.ot.recording.splitPage(Ut.FsShutdownFrame)):"frame Id is already set to ".concat(this.Ko),[2];if(i=fs(location.href,{source:"log",type:"debug"}),"FrameId received within frame ".concat(i,":").concat(t.frameId),this.st=t.scheme,this.Ma=t.script,this.ja=t.appHost,this.yo=t.orgId,this.Ua=t.initConfig,this.Ko=t.frameId,this.Ro=t.parentIds,!t.pageRsp||!cf(t.pageRsp))return this.shutdown(Ut.FsShutdownFrame),[2];if(this.xa)return[2];r=t.consented,this.Fa(t.pageRsp,r),this.Za(),this.Wa(),this.zt.enqueueFirst(_f({type:"default"})),this.zt.enqueueFirst({Kind:ot.SYS_REPORTCONSENT,Args:[r,jt.Document]}),this.zt.enqueueFirst({Kind:ot.SET_FRAME_BASE,Args:[fs(Re(this.xi),{source:"event",type:ot.SET_FRAME_BASE}),li(this.xi.document)]}),this.zt.enqueue({Kind:ot.SCRIPT_COMPILED_VERSION,Args:["02de958fc73c1c50dec6d324a9487bc6a363c081"]}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,ie.race([we(this.xi),ee(250)])];case 2:case 3:return e.sent(),[3,4];case 4:return this.zt.enqueue({Kind:ot.RESIZE_LAYOUT,Args:cu(this.xi.document)}),this.Ga(),this.zt.rebaseIframe(t.outerStartTime,null!==(n=t.minimumWhen)&&void 0!==n?n:0),this.ot.time.setStartTime(t.outerStartTime),this._o&&this.ko&&this.bo?(this.zt.startPipeline({frameId:t.frameId,isNewSession:!!t.pageRsp.IsNewSession,orgId:this.yo,pageId:t.pageRsp.PageIntId,parentIds:t.parentIds,serverPageStart:t.pageRsp.PageStart,sessionId:t.pageRsp.SessionIntId,userId:t.pageRsp.UserIntId,minDwellTime:0}).then(function(){s.$a(),s.tc(s.xi.document),s.za()}),[2]):("one or more of userId:".concat(this._o," | sessionId:").concat(this.ko," | pageId:").concat(this.bo," are undefined"),[2])}})})},i}(af),jf="fs_cid",Pf=1,Uf=function(){function t(t){this.Zc=t;var n=this.Zc.getValue(jf,Nn),i=n.cookieValue,r=n.localStorageValue,e=i||r;this._h=function(t){var n={consent:Mt.RevokeConsent};if(!t)return n;var i=t.split(".");return i.length<1?n:(i[0],"1"===i[1]?{consent:Mt.GrantConsent}:n)}(e)}return t.prototype.getConsentState=function(){return this._h.consent},t.prototype.setConsentState=function(t){var n;this._h.consent=t,t!==Mt.RevokeConsent?this.Zc.setValue(jf,(n=this._h.consent,[Pf,n===Mt.GrantConsent?1:0].join(".")),new Date(1e3*ji()).toUTCString(),Nn):this.Zc.clearCookie(jf,Nn)},t}(),Nf="fs_lua",Lf=1,Df=function(){function t(t){this.Zc=t;var n=this.Zc.getValue(Nf,Ln),i=n.cookieValue,r=n.localStorageValue;this._h=function(t,n){var i;return null!==(i=a(t,n,Bf,function(t,n){return(n.lastUserActivityTime||0)>(t.lastUserActivityTime||0)?n:t}))&&void 0!==i?i:{lastUserActivityTime:void 0}}(i,r)}return t.prototype.getLastUserActivityTimeMS=function(){return this._h.lastUserActivityTime},t.prototype.setLastUserActivityTimeMS=function(t){this._h.lastUserActivityTime=t,this.Zc.setValue(Nf,function(t){return[Lf,t].join(".")}(t),new Date(xi()+Cf).toUTCString(),Ln)},t}();function Bf(t){var n={lastUserActivityTime:void 0};if(!t)return n;var i=t.split(".");return i.length<1?n:(i[0],{lastUserActivityTime:Xn(i[1])})}var Wf,Ff,Hf="fs_uid",zf=function(){function t(t,n,i,r){if(void 0===n&&(n=window),void 0===i&&(i=function(){}),void 0===r&&(r=!1),this.Ah=void 0,cr(n))this.Sc=new rf;else{var e=tr(n,"_fs_clientstore","object");this.Sc=null!=e?e:new u(n.document,i,r)}this.Ih=new Uf(this.Sc),this.Eh=new Df(this.Sc),this._h=this.Th(t)}return t.prototype.Th=function(t){var n=this.Sc.getValue(Hf,Un),i=function(t,n,i){return a(t,n,Pi,function(t,n){return t.orgId!==i&&n.orgId!==i?null:t.orgId!==i?n:n.orgId!==i?t:n.expirationAbsTimeSeconds>t.expirationAbsTimeSeconds?n:t})}(n.cookieValue,n.localStorageValue,t);return i||{expirationAbsTimeSeconds:ji(),orgId:t,userId:"",sessionId:"",appKeyHash:""}},t.prototype.getConsentStore=function(){return this.Ih},t.prototype.clear=function(){this.Eh.setLastUserActivityTimeMS(void 0),this._h.sessionStartTime=this._h.pageCount=void 0,this._h.userId=this._h.sessionId=this._h.appKeyHash=this.Ah="",this._h.expirationAbsTimeSeconds=ji(),this.Ch()},t.prototype.create=function(t){this.Eh.setLastUserActivityTimeMS(t.lastUserActivityTime),this._h=i(i({},this._h),t),this.Ch()},t.prototype.getOrgId=function(){return this._h.orgId},t.prototype.getUserId=function(){return this._h.userId},t.prototype.setUserId=function(t){this._h.userId=t,this.Ch()},t.prototype.getSessionId=function(){return this._h.sessionId},t.prototype.getAppKeyHash=function(){return this._h.appKeyHash},t.prototype.getCookies=function(){return this.Sc.cookies},t.prototype.setAppId=function(t){this.Ah=t,this._h.appKeyHash=yh(t),this.Ch()},t.prototype.getAppId=function(){return this.Ah},t.prototype.setSessionStartTimeMS=function(t){this._h.sessionStartTime=t,this.Ch()},t.prototype.getSessionStartTimeMS=function(){return this._h.sessionStartTime},t.prototype.setLastUserActivityTimeMS=function(t){this.Eh.setLastUserActivityTimeMS(t)},t.prototype.getLastUserActivityTimeMS=function(){return this.Eh.getLastUserActivityTimeMS()},t.prototype.setPageCount=function(t){this._h.pageCount=t,this.Ch()},t.prototype.getPageCount=function(){return this._h.pageCount},t.prototype.getClientStore=function(){return this.Sc},t.prototype.setCookie=function(t,n,i){void 0===i&&(i=new Date(xi()+6048e5).toUTCString()),this.Sc.setCookie(t,n,i)},t.prototype.setCookieDomain=function(t,n){var i=n;(Gi(i)||i.match(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/g))&&(i="");var r=function(t){return tr(t,"_fs_cookie_domain")}(t);"string"==typeof r&&(i=r),this.Sc.setDomain(i)},t.prototype.setIds=function(t,n,i,r){this.setCookieDomain(t,n),this._h.userId=i,this._h.sessionId=r,this.Ch()},t.prototype.clearAppId=function(){return!!this._h.appKeyHash&&(this.Ah="",this._h.appKeyHash="",this.Ch(),!0)},t.prototype.encode=function(){var t,n,i,r=[this._h.userId,null!==(t=this._h.sessionId)&&void 0!==t?t:"","".concat(null!==(n=this._h.sessionStartTime)&&void 0!==n?n:""),"","".concat(null!==(i=this._h.pageCount)&&void 0!==i?i:"")].join(":"),e=["",this._h.orgId,r];return this._h.appKeyHash&&e.push(encodeURIComponent(this._h.appKeyHash)),e.push("/".concat(this._h.expirationAbsTimeSeconds)),e.join("#")},t.prototype.Ch=function(){this._h.expirationAbsTimeSeconds++;var t=this.encode(),n=new Date(1e3*this._h.expirationAbsTimeSeconds).toUTCString();this.Sc.setValue(Hf,t,n,Un)},t}();function qf(t,n,i,r,e){if(t&&"object"==typeof t){var s=0,u={};for(var o in t)if(!(o in e)){var a=t[o];e[o]={value:a,apiSource:n,apiVersion:i,schema:r},u[o]=a,s++}if(0!==s)return u}}function $f(t,n){var i,r,e={},s={};for(var u in n)if(C.objectHasOwnProp(n,u)){if(t()<=0)break;var o=n[u];if(void 0!==o){var a=Vf(u),c=a[0],h=a[1],f=o,v=h;if(Jn(o))f=(i=$f(t,o))[0],v=i[1];else if(Vn(r=o)&&r.length>0&&r.every(Jn)){f=[],v=[];for(var l=0,d=o;l=0)return"blocking FS.identify API call; uid value (".concat(r,") is illegal"),[void 0,tn.FsId];var e=yh(r),s=void 0;return n&&n!==e&&n!==r&&("user re-identified; existing uid hash (".concat(n,") does not match provided uid (").concat(r,")"),s=tn.NewUid),[r,s]}(s,i),o=u[0],a=u[1];if(o)return r.uid=o,{rawProps:r,rawSchema:e,nextAppId:o,reidentify:a===tn.NewUid};switch(a){case tn.FsId:case void 0:break;default:"unexpected failReason returned from setAppId: ".concat(a)}}(s,t,n);if(!o)return r;var a=o.rawProps,c=o.rawSchema,h=o.reidentify,f=o.nextAppId,v=o.eventName,l=Jf(s,null!=a?a:{},c,u,t.apiVersion,this.xh),d=l.properties,p=l.schema;if(!d&&s===Jt.Document)return r;var w=tv(s,null!=d?d:{},u,p,t.apiVersion,v);return iv(e,function(t,n){var i=rv[t];if(i)return _f({source:n,type:"api",entrypoint:i})}(s,t.source)),iv(e,w),s===Jt.Page&&(this.Kh=w),{events:e,reidentify:!!h,appId:f}}catch(n){return"unexpected exception handling ".concat(t.operation," API call: ").concat(n.message),r}},t}();function iv(t,n){n&&t.push(n)}var rv=((Gf={})[Jt.User]="setVars",Gf[Jt.Event]="event",Gf);function ev(t,n){return r(this,void 0,ie,function(){var s,u,o;return e(this,function(a){try{if(function(t){return!!tr(t,"_fs_use_polyfilled_apis","boolean")}(t))return[2,i(i({},n),{status:A.Clean})];if(!t.document||n.status!==A.Unknown)return[2,n];if(s=function(t,n){var r,e,s=n.functions,u=new Set,o={},a=i({},n.helpers);if(a.functionToString=function(t,n){var i,r,e=null===(i=t["__core-js_shared__"])||void 0===i?void 0:i.inspectSource;if(e){var s=function(){return e(this)};if(sv(s,2))return s}var u=null===(r=t["__core-js_shared__"])||void 0===r?void 0:r["native-function-to-string"];if(sv(u))return u;var o=n.__zone_symbol__OriginalDelegate;return sv(o)?o:sv(n)?n:void 0}(t,a.functionToString),!a.functionToString)return n;var c=!1;for(var h in s)s[h]?(o[h]=av(a.functionToString,null===(r=E[h])||void 0===r?void 0:r.call(E,t),s[h]),o[h]||(o[h]=cv(a.functionToString,null===(e=E[h])||void 0===e?void 0:e.call(E,t),a,h)),o[h]?o[h]!==s[h]&&(c=!0):(c=!0,u.add(h))):o[h]=void 0;return{status:u.size>0?A.Mixed:A.Clean,functions:c?o:s,helpers:a,errors:[],dirty:u}}(t,n),s.status===A.Clean)return[2,s];u=function(t,n){var i=this,s=t.document.createElement("iframe");if(s.id="FullStory-iframe",s.className="fs-hide",s.style.display="none",n){var u=hv(Node.prototype,"removeChild",function(t,n){var i=t.args[0];return i===s?(n(),i):t.origFn.apply(t.that,t.args)}),o=hv(Element.prototype,"remove",function(t,n){if(t.that!==s)return t.origFn.apply(t.that,t.args);n()});s.onload=function(){var t;try{null===(t=s.contentWindow)||void 0===t||t.addEventListener("pagehide",function(t){return r(i,void 0,ie,function(){return e(this,function(n){switch(n.label){case 0:return(null==t?void 0:t.persisted)?[2]:[4,ee(5e3)];case 1:return n.sent(),null==u||u.disable(),null==o||o.disable(),tu("windex iframe being unloaded before page","windex iframe being unloaded before page"),[2]}})})})}catch(t){}}}return s}(t,function(t){var n;return!!(null===(n=t.dirty)||void 0===n?void 0:n.has("mutationObserver"))}(s));try{(function(t){var n=t.document,i=n.documentElement,r=n.body||n.head||i||n;return function(t){return!!tr(t,"_fs_windex_iframe","boolean")}(t)?r:i||r})(t).appendChild(u)}catch(t){return[2,i(i({},n),{status:A.Clean})]}return u.contentWindow?((o=x(u.contentWindow,A.Clean)).dirty=s.dirty,o.status===A.UnrecoverableFailure?[2,i(i({},n),{status:A.Clean})]:[2,o]):[2,i(i({},n),{status:A.Clean})]}catch(t){return Qs.send(t,"error"),[2,i(i({},n),{status:A.Clean})]}return[2]})})}function sv(t,n){var i;if(void 0===n&&(n=0),!t)return!1;try{t.call(function(){})}catch(t){return!1}var r=function(t){try{return void t.call(null)}catch(t){return(t.stack||"").replace(/__fs_nomangle_check_stack(.|\n)*$/,"")}},e=void 0;0!==n&&"number"==typeof Error.stackTraceLimit&&(e=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY);var s=[function(){throw new Error("")},t],u=function __fs_nomangle_check_stack(){return s.map(r)}(),o=u[0],a=u[1];if(void 0!==e&&(Error.stackTraceLimit=e),!o||!a)return!1;for(var c="\n".charCodeAt(0),h=o.length>a.length?a.length:o.length,f=1,v=f;v=0}catch(n){if(i)return t.call(i).indexOf(r)>=0;throw n}}var ov=["__zone_symbol__OriginalDelegate","nr@original"];function av(t,n,i){if(i){for(var r=0,e=ov;r0)return i(t,function(){return e--});var n="windex iframe removed from page - circuit breaker";return tu(n,n),null==r||r.disable(),t.origFn.apply(t.that,t.args)}),r}var fv=function(){function t(t,n){void 0===n&&(n=function(t){return new WebSocket(t)}),this.Rh=n,this.Mh=!1,this.Oh=!1,this.zt={},this.$u=1,this.ot=t,this.st=t.options.scheme,this.ut=t.options.cdnHost}return t.isSupported=function(){return"WebSocket"in window},t.prototype.page=function(t){var n=this;return new ie(function(i,r){n.jh({Cmd:yn.Page,Page:t},Hs(n.ot),function(t){t.Cmd===Sn.Page?i(t.Page):("socket: unexpected page response: ".concat(t.Cmd),r(t.Cmd))},r)})},t.prototype.settings=function(t){var n=hr(this.ot.window);if(n)return ie.resolve(n);var i=t.previewMode?Hs(this.ot):this.ut;return Fs(this.ot.window,this.st,i,t)},t.prototype.event=function(t){return this.Vc({req:yn.Event,rsp:Sn.Event},t)},t.prototype.bundle=function(t){return this.Vc({req:yn.Bundle,rsp:Sn.Bundle},t)},t.prototype.Vc=function(t,n){return r(this,void 0,ie,function(){var i,r,s,u=this;return e(this,function(e){switch(e.label){case 0:return[4,le()];case 1:return e.sent(),i=n.deltaT,r=n.serverPageStart,s=n.serverBundleTime,[2,new ie(function(e,o){var a=Hs(u.ot);vv(n.recHost,a);var c=n.bundle,h=c[0],f={Bundle:lv(c[1]),DeltaT:null===i?void 0:i,OrgId:n.orgId,PageId:n.pageId,PageStart:null==r?void 0:r,PrevBundleTime:null==s?void 0:s,Seq:h,SessionId:n.sessionId,UserId:n.userId},v=u.jh({Cmd:t.req,Bundle:f},a,function(n){n.Cmd===t.rsp?e([null!=v?v:0,n.Bundle]):"socket: unexpected bundle response: ".concat(n.Cmd)},o)})]}})})},t.prototype.bundleBeacon=function(t){var n=Hs(this.ot);return vv(t.recHost,n),Ls(this.st,n,t)},t.prototype.startBeacon=function(t){return Ds(this.ot.window,this.st,Hs(this.ot),t)},t.prototype.jh=function(t,n,i,r){var e=t;e.Seq=this.$u++;var s=hi(e);return this.zt[e.Seq]={payload:s,win:i,lose:r},this.Ph(n),s.length},t.prototype.Uh=function(t){var n;try{n=di(t)}catch(t){return void"socket: error parsing frame: ".concat(t)}var i=this.zt[n.Seq];delete this.zt[n.Seq],i?n.Cmd===Sn.Error?(n.Fail.Error,i.lose(new gr(n.Fail.Status,n.Fail.Error))):i.win(n):"socket: mismatched request seq ".concat(n.Seq,"; ignoring")},t.prototype.Nh=function(){if(this.Oh&&this.Lh)for(var t in this.zt){var n=this.zt[t];n.sent||(this.Lh.send(n.payload),n.sent=!0)}},t.prototype.Dh=function(){for(var t in this.zt){var n=this.zt[t];n.sent&&(delete this.zt[t],n.lose(new gr(0,"Pending request")))}},t.prototype.Ph=function(t){var n=this;if(this.Oh)this.Nh();else if(!this.Mh){this.Mh=!0;var i="".concat("https:"==this.st?"wss:":"ws:","//").concat(t,"/rec/sock");this.Lh=this.Rh(i),this.Lh.onopen=function(t){n.Mh=!1,n.Oh=!0,n.Nh()},this.Lh.onmessage=function(t){n.Uh(t.data),n.Nh()},this.Lh.onclose=function(t){n.Mh=n.Oh=!1,n.Dh()},this.Lh.onerror=function(t){n.Mh=n.Oh=!1,n.Dh()}}},t}();function vv(t,n){t&&Js(n===t,"sock recHost mismatch")}function lv(t){if("string"===t.type)return JSON.parse(t.data);throw new Error("Unexpected bundle type: ".concat(t.type))}var dv=function(){function t(t){this.Bh=!1,this.aa=t}return t.prototype.flush=function(){this.aa(),this.Bh=!1},t.prototype.schedule=function(){var t=this;this.Bh||(this.Bh=!0,ie.resolve().then(function(){t.flush()})["catch"](function(t){return Qs.send(t,"error")}))},t}(),pv=function(){function t(){this.Wh={start:[],shutdown:[],"internal/bundle":[],"internal/error":[],"internal/fs-init":[]}}return t.prototype.registerListener=function(t,n){var i;if(-1===hf.indexOf(t)||!n)throw new Error("Invalid event type or missing callback.");var r={disconnected:!1,callback:n,count:0},e=(null!==(i=this.Wh[t])&&void 0!==i?i:[]).filter(function(t){return!t.disconnected});return e.push(r),this.Wh[t]=e,{disconnect:function(){r.disconnected=!0}}},t.prototype.hasListeners=function(t){var n;return(null!==(n=this.Wh[t])&&void 0!==n?n:[]).length>0&&this.Wh[t].some(function(t){return!t.disconnected})},t.prototype.takeRecords=function(t){var n,i=null!==(n=this.Wh[t.type])&&void 0!==n?n:[];if(0!==i.length)for(var r=0,e=i;r0&&t.once)){s.count+=1;try{s.callback(t.data)}catch(t){"Recording observer callback error: ".concat(Mu(t))}}}},t}(),wv=function(){function t(t){var n=this;this.Mi=t,this.zt=[],this.va=new dv(function(){n.aa()})}return t.prototype.addEvent=function(t){this.Mi.hasListeners(t.type)&&(this.zt.push(t),this.va.schedule())},t.prototype.aa=function(){for(var t=0,n=this.zt;t0||null===P){n="Init config rejected: ".concat(j.unrecoverable.join(",\n")),T(t,n);break}j.recoverable.length>0&&(n="Init config partially rejected: ".concat(j.recoverable.join(",\n"))),h=P,E(t);break;default:ge(0,"invalid operation")}}catch(i){Qs.send(i,"error"),"".concat(n="unknown error evaluating API"," ").concat(i),T(t,n)}},x=0,K=y;x; - evidence: Record; -} - -interface CspFindingResource { - name: string; - sub_type: string; - raw: object; - id: string; - type: string; - [other_keys: string]: unknown; -} - -interface CspFindingHost { - id: string; - containerized: boolean; - ip: string[]; - mac: string[]; - name: string; - hostname: string; - architecture: string; - os: { - kernel: string; - codename: string; - type: string; - platform: string; - version: string; - family: string; - name: string; - }; - [other_keys: string]: unknown; -} - -interface CspFindingAgent { - version: string; - // ephemeral_id: string; - id: string; - name: string; - type: string; -} diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/stats.ts b/x-pack/plugins/cloud_security_posture/common/schemas/stats.ts index e8b3657996e0f..3b2fa14c06b30 100644 --- a/x-pack/plugins/cloud_security_posture/common/schemas/stats.ts +++ b/x-pack/plugins/cloud_security_posture/common/schemas/stats.ts @@ -6,7 +6,7 @@ */ import { schema } from '@kbn/config-schema'; -import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../constants'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; // this pages follows versioning interface strategy https://docs.elastic.dev/kibana-dev-docs/versioning-interfaces diff --git a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts b/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts index efcdd38f4e9b3..d0619d4a72dde 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts @@ -7,12 +7,11 @@ // Optionally, re-export the entire set of types. Interfaces and types declared after this will override v1 declarations. import { schema } from '@kbn/config-schema'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import type { BenchmarkScore } from './v1'; export type { BenchmarkScore } from './v1'; -export type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; - export interface Benchmark { id: BenchmarksCisId; name: string; diff --git a/x-pack/plugins/cloud_security_posture/common/types/index.ts b/x-pack/plugins/cloud_security_posture/common/types/index.ts index 04fa2a95a8d5e..144a2d2e9afda 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/index.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/index.ts @@ -5,24 +5,8 @@ * 2.0. */ -export * as rulesV1 from './rules/v1'; -export * as rulesV2 from './rules/v2'; -export * as rulesV3 from './rules/v3'; -export * as rulesV4 from './rules/v4'; -export * as rulesV5 from './rules/v5'; - export * as benchmarkV1 from './benchmarks/v1'; export * as benchmarkV2 from './benchmarks/v2'; // Explicit export of everything from latest -export type { - cspBenchmarkRuleMetadataSchema, - CspBenchmarkRuleMetadata, - CspBenchmarkRule, - FindCspBenchmarkRuleRequest, - FindCspBenchmarkRuleResponse, - BenchmarkScore, - Benchmark, - GetBenchmarkResponse, - BenchmarkRuleSelectParams, -} from './latest'; +export type { BenchmarkScore, Benchmark, GetBenchmarkResponse } from './latest'; diff --git a/x-pack/plugins/cloud_security_posture/common/types/latest.ts b/x-pack/plugins/cloud_security_posture/common/types/latest.ts index 32006fe5b5aef..7844ef6e36f18 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/latest.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/latest.ts @@ -5,5 +5,4 @@ * 2.0. */ -export * from './rules/v5'; export * from './benchmarks/v2'; diff --git a/x-pack/plugins/cloud_security_posture/common/types_old.ts b/x-pack/plugins/cloud_security_posture/common/types_old.ts index f77ac4678a526..c6531605bc328 100644 --- a/x-pack/plugins/cloud_security_posture/common/types_old.ts +++ b/x-pack/plugins/cloud_security_posture/common/types_old.ts @@ -5,11 +5,11 @@ * 2.0. */ import { type TypeOf } from '@kbn/config-schema'; -import { CspFinding } from './schemas/csp_finding'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import type { CspFinding } from '@kbn/cloud-security-posture-common'; import { SUPPORTED_CLOUDBEAT_INPUTS, SUPPORTED_POLICY_TEMPLATES } from './constants'; import { getComplianceDashboardSchema } from './schemas/stats'; -import type { CspBenchmarkRuleMetadata } from './types/latest'; export type AwsCredentialsType = | 'assume_role' @@ -100,43 +100,6 @@ export interface ComplianceDashboardDataV2 { benchmarks: BenchmarkData[]; } -export type CspStatusCode = - | 'indexed' // latest findings index exists and has results - | 'indexing' // index timeout was not surpassed since installation, assumes data is being indexed - | 'unprivileged' // user lacks privileges for the latest findings index - | 'index-timeout' // index timeout was surpassed since installation - | 'not-deployed' // no healthy agents were deployed - | 'not-installed' // number of installed csp integrations is 0; - | 'waiting_for_results'; // have healthy agents but no findings at all, assumes data is being indexed for the 1st time - -export type IndexStatus = - | 'not-empty' // Index contains documents - | 'empty' // Index doesn't contain documents (or doesn't exist) - | 'unprivileged'; // User doesn't have access to query the index - -export interface IndexDetails { - index: string; - status: IndexStatus; -} - -export interface BaseCspSetupBothPolicy { - status: CspStatusCode; - installedPackagePolicies: number; - healthyAgents: number; -} - -export interface BaseCspSetupStatus { - indicesDetails: IndexDetails[]; - latestPackageVersion: string; - cspm: BaseCspSetupBothPolicy; - kspm: BaseCspSetupBothPolicy; - vuln_mgmt: BaseCspSetupBothPolicy; - isPluginInitialized: boolean; - installedPackageVersion?: string | undefined; -} - -export type CspSetupStatus = BaseCspSetupStatus; - export type BenchmarkId = CspBenchmarkRuleMetadata['benchmark']['id']; export type BenchmarkName = CspBenchmarkRuleMetadata['benchmark']['name']; export type RuleSection = CspBenchmarkRuleMetadata['section']; diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts index a067ef4e1871a..2e859ae314cb1 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { CspBenchmarkRuleMetadata } from '../types'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { convertRuleTagsToMatchAllKQL, convertRuleTagsToMatchAnyKQL, diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts index 61567211c8d22..ae888cde81c28 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { CspBenchmarkRuleMetadata } from '../types/latest'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; const CSP_RULE_TAG = 'Cloud Security'; const CSP_RULE_TAG_USE_CASE = 'Use Case: Configuration Audit'; diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts index 6222b457e7ad6..90e11734d72c6 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts @@ -6,6 +6,7 @@ */ import { Truthy } from 'lodash'; +import type { BaseCspSetupStatus, BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { NewPackagePolicy, NewPackagePolicyInput, @@ -14,6 +15,8 @@ import { PackagePolicyInput, UpdatePackagePolicy, } from '@kbn/fleet-plugin/common'; +import type { BenchmarkRuleSelectParams } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import type { BenchmarkRuleSelectParams as BenchmarkRuleSelectParamsV4 } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, CLOUDBEAT_VANILLA, @@ -25,14 +28,11 @@ import { import type { BenchmarkId, Score, - BaseCspSetupStatus, AwsCredentialsType, GcpCredentialsType, AzureCredentialsType, RuleSection, } from '../types_old'; -import type { BenchmarkRuleSelectParams, BenchmarksCisId } from '../types/latest'; -import type { BenchmarkRuleSelectParams as BenchmarkRuleSelectParamsV1 } from '../types/rules/v4'; /** * @example @@ -44,13 +44,6 @@ export const isNonNullable = (v: T): v is NonNullable => export const truthy = (value: T): value is Truthy => !!value; -export const extractErrorMessage = (e: unknown, defaultMessage = 'Unknown Error'): string => { - if (e instanceof Error) return e.message; - if (typeof e === 'string') return e; - - return defaultMessage; // TODO: i18n -}; - export const getBenchmarkFilter = (type: BenchmarkId, section?: RuleSection): string => `${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.id: "${type}"${ section @@ -236,7 +229,7 @@ export const getCloudProviderNameFromAbbreviation = (cloudProvider: string) => { export const getBenchmarkFilterQuery = ( benchmarkId: BenchmarkId, benchmarkVersion?: string, - selectParams?: BenchmarkRuleSelectParamsV1 + selectParams?: BenchmarkRuleSelectParamsV4 ): string => { const baseQuery = `${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.id:${benchmarkId} AND ${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.version:"v${benchmarkVersion}"`; const sectionQuery = selectParams?.section diff --git a/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts b/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts index a343c91af91f9..e2351d3ddcaa9 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts @@ -4,31 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; -import { CspBenchmarkRulesStates } from '../types/latest'; - -export const buildMutedRulesFilter = ( - rulesStates: CspBenchmarkRulesStates -): QueryDslQueryContainer[] => { - const mutedRules = Object.fromEntries( - Object.entries(rulesStates).filter(([key, value]) => value.muted === true) - ); - - const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { - const rule = mutedRules[key]; - return { - bool: { - must: [ - { term: { 'rule.benchmark.id': rule.benchmark_id } }, - { term: { 'rule.benchmark.version': rule.benchmark_version } }, - { term: { 'rule.benchmark.rule_number': rule.rule_number } }, - ], - }, - }; - }); - - return mutedRulesFilterQuery; -}; export const buildRuleKey = (benchmarkId: string, benchmarkVersion: string, ruleNumber: string) => { return `${benchmarkId};${benchmarkVersion};${ruleNumber}`; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_data_view.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_data_view.ts index 41b40da90a6d4..304230498d4f4 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_data_view.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_data_view.ts @@ -8,7 +8,7 @@ import { useQuery } from '@tanstack/react-query'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; -import { CspClientPluginStartDeps } from '../../types'; +import { CspClientPluginStartDeps } from '@kbn/cloud-security-posture'; /** * Hook to retrieve a Data View by it's Index Pattern title diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts index ed4b2933dddd0..d95c692bee0c4 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts @@ -34,5 +34,7 @@ export const useFetchDetectionRulesAlertsStatus = (tags: string[]) => { version: DETECTION_RULE_ALERTS_STATUS_API_CURRENT_VERSION, query: { tags }, }), + // Disabling retry to prevent stuck on loading state when the request fails due to permissions + retry: false, }); }; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts deleted file mode 100644 index 35f49282a475e..0000000000000 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts +++ /dev/null @@ -1,24 +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 { useQuery, type UseQueryOptions } from '@tanstack/react-query'; -import { useKibana } from '../hooks/use_kibana'; -import { type CspSetupStatus } from '../../../common/types_old'; -import { STATUS_API_CURRENT_VERSION, STATUS_ROUTE_PATH } from '../../../common/constants'; - -const getCspSetupStatusQueryKey = 'csp_status_key'; - -export const useCspSetupStatusApi = ( - options?: UseQueryOptions -) => { - const { http } = useKibana().services; - return useQuery( - [getCspSetupStatusQueryKey], - () => http.get(STATUS_ROUTE_PATH, { version: STATUS_API_CURRENT_VERSION }), - options - ); -}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts index e973633210d9c..77497d16cd76c 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts @@ -6,13 +6,10 @@ */ import { useQuery, UseQueryOptions } from '@tanstack/react-query'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; import { useKibana } from '../hooks/use_kibana'; import { ComplianceDashboardDataV2, PosturePolicyTemplate } from '../../../common/types_old'; -import { - CSPM_POLICY_TEMPLATE, - KSPM_POLICY_TEMPLATE, - STATS_ROUTE_PATH, -} from '../../../common/constants'; +import { STATS_ROUTE_PATH } from '../../../common/constants'; // TODO: consolidate both hooks into one hook with a dynamic key export const CSPM_STATS_QUERY_KEY = ['csp_cspm_dashboard_stats']; 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 8054917ba7462..8eb996dd15643 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/constants.ts @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { euiThemeVars } from '@kbn/ui-theme'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; import type { CloudSecurityPolicyTemplate, PostureInput } from '../../common/types_old'; import { CLOUDBEAT_EKS, @@ -15,8 +16,6 @@ import { CLOUDBEAT_GCP, CLOUDBEAT_AZURE, CLOUDBEAT_VULN_MGMT_AWS, - KSPM_POLICY_TEMPLATE, - CSPM_POLICY_TEMPLATE, VULN_MGMT_POLICY_TEMPLATE, CLOUDBEAT_VULN_MGMT_GCP, CLOUDBEAT_VULN_MGMT_AZURE, @@ -35,7 +34,6 @@ export const statusColors = { }; export const CSP_MOMENT_FORMAT = 'MMMM D, YYYY @ HH:mm:ss.SSS'; -export const MAX_FINDINGS_TO_LOAD = 500; export const DEFAULT_VISIBLE_ROWS_PER_PAGE = 25; export const LOCAL_STORAGE_DATA_TABLE_PAGE_SIZE_KEY = 'cloudPosture:dataTable:pageSize'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts index 6207885b60ab0..af488c4bb81b3 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts @@ -7,8 +7,8 @@ import { useBenchmarkDynamicValues } from './use_benchmark_dynamic_values'; import { renderHook } from '@testing-library/react-hooks/dom'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { useCspIntegrationLink } from '../navigation/use_csp_integration_link'; -import { BenchmarksCisId } from '../../../common/types/benchmarks/v2'; jest.mock('../navigation/use_csp_integration_link'); diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts index 5fe3f8f69050a..7540b96797a18 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts @@ -6,9 +6,9 @@ */ import { i18n } from '@kbn/i18n'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { useCspIntegrationLink } from '../navigation/use_csp_integration_link'; -import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../../common/constants'; -import { BenchmarksCisId } from '../../../common/types/benchmarks/v2'; type BenchmarkDynamicNames = | { diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts index ae8ddb48488c1..acd63279bdccf 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts @@ -59,7 +59,7 @@ export const useCloudPostureDataTable = ({ const { pageSize, setPageSize } = usePageSize(paginationLocalStorageKey); const onChangeItemsPerPage = useCallback( - (newPageSize) => { + (newPageSize: any) => { setPageSize(newPageSize); setUrlQuery({ pageIndex: 0, @@ -81,7 +81,7 @@ export const useCloudPostureDataTable = ({ }, [setUrlQuery]); const onChangePage = useCallback( - (newPageIndex) => { + (newPageIndex: any) => { setUrlQuery({ pageIndex: newPageIndex, }); @@ -90,7 +90,7 @@ export const useCloudPostureDataTable = ({ ); const onSort = useCallback( - (sort) => { + (sort: any) => { setUrlQuery({ sort, }); @@ -99,7 +99,7 @@ export const useCloudPostureDataTable = ({ ); const setTableOptions = useCallback( - ({ page, sort }) => { + ({ page, sort }: any) => { setPageSize(page.size); setUrlQuery({ sort, @@ -119,7 +119,7 @@ export const useCloudPostureDataTable = ({ }); const handleUpdateQuery = useCallback( - (query) => { + (query: any) => { setUrlQuery({ ...query, pageIndex: 0 }); }, [setUrlQuery] diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts new file mode 100644 index 0000000000000..99ded40b04f63 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { useContext } from 'react'; +import { useQuery } from '@tanstack/react-query'; +import { SetupContext } from '../../application/setup_context'; +import { isSubscriptionAllowed } from '../../../common/utils/subscription'; +import { useKibana } from './use_kibana'; + +const SUBSCRIPTION_QUERY_KEY = 'csp_subscription_query_key'; + +export const useIsSubscriptionStatusValid = () => { + const { licensing } = useKibana().services; + const { isCloudEnabled } = useContext(SetupContext); + + return useQuery([SUBSCRIPTION_QUERY_KEY], async () => { + const license = await licensing.refresh(); + return isSubscriptionAllowed(isCloudEnabled, license); + }); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts index 1c6f252080e11..a392e9213dffc 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts @@ -7,7 +7,7 @@ import type { CoreStart } from '@kbn/core/public'; import { useKibana as useKibanaBase } from '@kbn/kibana-react-plugin/public'; -import type { CspClientPluginStartDeps } from '../../types'; +import type { CspClientPluginStartDeps } from '@kbn/cloud-security-posture'; type CspKibanaContext = CoreStart & CspClientPluginStartDeps; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_subscription_status.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_subscription_status.ts deleted file mode 100644 index f8bda84dbcb65..0000000000000 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_subscription_status.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { useContext } from 'react'; -import { useQuery } from '@tanstack/react-query'; -import { SetupContext } from '../../application/setup_context'; -import { isSubscriptionAllowed } from '../../../common/utils/subscription'; -import { useKibana } from './use_kibana'; - -const SUBSCRIPTION_QUERY_KEY = 'csp_subscription_query_key'; - -export const useSubscriptionStatus = () => { - const { licensing } = useKibana().services; - const { isCloudEnabled } = useContext(SetupContext); - return useQuery([SUBSCRIPTION_QUERY_KEY], async () => { - const license = await licensing.refresh(); - return isSubscriptionAllowed(isCloudEnabled, license); - }); -}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts index d01aac0c57577..055495b59dd11 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts @@ -6,14 +6,8 @@ */ import { i18n } from '@kbn/i18n'; -import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../../common/constants'; -import { PosturePolicyTemplate } from '../../../common/types_old'; -import type { - CspBenchmarksPage, - CspIntegrationDocNavigationItem, - CspPage, - CspPageNavigationItem, -} from './types'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarksPage, CspPage, CspPageNavigationItem } from './types'; const NAV_ITEMS_NAMES = { DASHBOARD: i18n.translate('xpack.csp.navigation.dashboardNavItemLabel', { @@ -116,10 +110,7 @@ export const findingsNavigation = { const ELASTIC_BASE_SHORT_URL = 'https://ela.st'; -export const cspIntegrationDocsNavigation: Record< - PosturePolicyTemplate, - CspIntegrationDocNavigationItem -> = { +export const cspIntegrationDocsNavigation = { kspm: { overviewPath: `${ELASTIC_BASE_SHORT_URL}/${KSPM_POLICY_TEMPLATE}`, getStartedPath: `${ELASTIC_BASE_SHORT_URL}/${KSPM_POLICY_TEMPLATE}-get-started`, @@ -127,5 +118,8 @@ export const cspIntegrationDocsNavigation: Record< cspm: { overviewPath: `${ELASTIC_BASE_SHORT_URL}/${CSPM_POLICY_TEMPLATE}`, getStartedPath: `${ELASTIC_BASE_SHORT_URL}/${CSPM_POLICY_TEMPLATE}-get-started`, + awsGetStartedPath: `https://www.elastic.co/guide/en/security/current/cspm-get-started.html`, + gcpGetStartedPath: `https://www.elastic.co/guide/en/security/current/cspm-get-started-gcp.html`, + azureGetStartedPath: `https://www.elastic.co/guide/en/security/current/cspm-get-started-azure.html`, }, }; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts index 8f4cbabc9f9ba..f436558e085d9 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts @@ -35,8 +35,3 @@ export type CloudSecurityPosturePageId = | 'cloud_security_posture-findings' | 'cloud_security_posture-benchmarks' | 'cloud_security_posture-benchmarks-rules'; - -export interface CspIntegrationDocNavigationItem { - overviewPath: string; - getStartedPath: string; -} diff --git a/x-pack/plugins/cloud_security_posture/public/common/types.ts b/x-pack/plugins/cloud_security_posture/public/common/types.ts index d0d491c256e0e..62e0abe677679 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/types.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/types.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { Criteria } from '@elastic/eui'; -import type { BoolQuery, Filter, Query, EsQueryConfig } from '@kbn/es-query'; +import type { Filter, Query, EsQueryConfig } from '@kbn/es-query'; export interface FindingsBaseURLQuery { query: Query; @@ -24,12 +24,6 @@ export interface FindingsBaseESQueryConfig { config: EsQueryConfig; } -export interface FindingsBaseEsQuery { - query?: { - bool: BoolQuery; - }; -} - export type Sort = NonNullable['sort']>; interface RuleSeverityMapping { diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx index 05fedd4d8adec..9e2275c62e31c 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx @@ -5,7 +5,6 @@ * 2.0. */ -import { useSubscriptionStatus } from '../common/hooks/use_subscription_status'; import Chance from 'chance'; import { DEFAULT_NO_DATA_TEST_SUBJECT, @@ -13,7 +12,6 @@ import { isCommonError, LOADING_STATE_TEST_SUBJECT, PACKAGE_NOT_INSTALLED_TEST_SUBJECT, - SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT, } from './cloud_posture_page'; import { createReactQueryResponse } from '../test/fixtures/react_query'; import { TestProvider } from '../test/test_provider'; @@ -23,27 +21,17 @@ import React, { ComponentProps } from 'react'; import { UseQueryResult } from '@tanstack/react-query'; import { CloudPosturePage } from './cloud_posture_page'; import { NoDataPage } from '@kbn/kibana-react-plugin/public'; -import { useLicenseManagementLocatorApi } from '../common/api/use_license_management_locator_api'; const chance = new Chance(); -jest.mock('../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../common/api/use_license_management_locator_api'); -jest.mock('../common/hooks/use_subscription_status'); +jest.mock('../common/hooks/use_is_subscription_status_valid'); jest.mock('../common/navigation/use_csp_integration_link'); describe('', () => { beforeEach(() => { jest.resetAllMocks(); - - (useSubscriptionStatus as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: true, - }) - ); - - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(undefined); }); const renderCloudPosturePage = ( @@ -72,101 +60,16 @@ describe('', () => { ); }; - it('renders with license url locator', () => { - (useSubscriptionStatus as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: false, - }) - ); - - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => 'http://license-url'); - - renderCloudPosturePage(); - - expect(screen.getByTestId('has_locator')).toBeInTheDocument(); - }); - - it('renders no license url locator', () => { - (useSubscriptionStatus as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: false, - }) - ); - - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(undefined); - - renderCloudPosturePage(); - expect(screen.getByTestId('no_locator')).toBeInTheDocument(); - }); - it('renders children if setup status is indexed', () => { const children = chance.sentence(); renderCloudPosturePage({ children }); expect(screen.getByText(children)).toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); }); - it('renders default loading state when the subscription query is loading', () => { - (useSubscriptionStatus as jest.Mock).mockImplementation( - () => - createReactQueryResponse({ - status: 'loading', - }) as unknown as UseQueryResult - ); - - const children = chance.sentence(); - renderCloudPosturePage({ children }); - - expect(screen.getByTestId(LOADING_STATE_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByText(children)).not.toBeInTheDocument(); - expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); - }); - - it('renders default error state when the subscription query has an error', () => { - (useSubscriptionStatus as jest.Mock).mockImplementation( - () => - createReactQueryResponse({ - status: 'error', - error: new Error('error'), - }) as unknown as UseQueryResult - ); - - const children = chance.sentence(); - renderCloudPosturePage({ children }); - - expect(screen.getByTestId(ERROR_STATE_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByText(children)).not.toBeInTheDocument(); - expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); - }); - - it('renders subscription not allowed prompt if subscription is not installed', () => { - (useSubscriptionStatus as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: false, - }) - ); - - const children = chance.sentence(); - renderCloudPosturePage({ children }); - - expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByText(children)).not.toBeInTheDocument(); - expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.getByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - }); - it('renders default loading text when query isLoading', () => { const query = createReactQueryResponse({ status: 'loading', @@ -176,7 +79,6 @@ describe('', () => { renderCloudPosturePage({ children, query }); expect(screen.getByTestId(LOADING_STATE_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); @@ -191,7 +93,6 @@ describe('', () => { renderCloudPosturePage({ children, query }); expect(screen.getByTestId(LOADING_STATE_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); @@ -220,7 +121,6 @@ describe('', () => { expect(screen.getByText(text, { exact: false })).toBeInTheDocument() ); expect(screen.getByTestId(ERROR_STATE_TEST_SUBJECT)).toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); @@ -253,7 +153,6 @@ describe('', () => { [error, statusCode].forEach((text) => expect(screen.queryByText(text)).not.toBeInTheDocument()); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); }); @@ -275,7 +174,6 @@ describe('', () => { expect(screen.getByText(loading)).toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); }); @@ -291,7 +189,6 @@ describe('', () => { expect(screen.getByTestId(DEFAULT_NO_DATA_TEST_SUBJECT)).toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); @@ -320,7 +217,6 @@ describe('', () => { expect(screen.getByText(pageTitle)).toBeInTheDocument(); expect(screen.getAllByText(solution, { exact: false })[0]).toBeInTheDocument(); expect(screen.queryByTestId(LOADING_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); - expect(screen.queryByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByText(children)).not.toBeInTheDocument(); expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); expect(screen.queryByTestId(PACKAGE_NOT_INSTALLED_TEST_SUBJECT)).not.toBeInTheDocument(); diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx index b2f1d892da907..34ea821ed2620 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx @@ -11,8 +11,6 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { NoDataPage, NoDataPageProps } from '@kbn/kibana-react-plugin/public'; import { css } from '@emotion/react'; -import { SubscriptionNotAllowed } from './subscription_not_allowed'; -import { useSubscriptionStatus } from '../common/hooks/use_subscription_status'; import { FullSizeCenteredPage } from './full_size_centered_page'; import { CspLoadingState } from './csp_loading_state'; @@ -22,7 +20,6 @@ export const PACKAGE_NOT_INSTALLED_TEST_SUBJECT = 'cloud_posture_page_package_no export const CSPM_INTEGRATION_NOT_INSTALLED_TEST_SUBJECT = 'cloud_posture_page_cspm_not_installed'; export const KSPM_INTEGRATION_NOT_INSTALLED_TEST_SUBJECT = 'cloud_posture_page_kspm_not_installed'; export const DEFAULT_NO_DATA_TEST_SUBJECT = 'cloud_posture_page_no_data'; -export const SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT = 'cloud_posture_page_subscription_not_allowed'; interface CommonError { body: { @@ -150,12 +147,6 @@ export const defaultNoDataRenderer = () => ( ); -const subscriptionNotAllowedRenderer = () => ( - - - -); - interface CloudPosturePageProps { children: React.ReactNode; query?: UseQueryResult; @@ -171,21 +162,7 @@ export const CloudPosturePage = ({ errorRender = defaultErrorRenderer, noDataRenderer = defaultNoDataRenderer, }: CloudPosturePageProps) => { - const subscriptionStatus = useSubscriptionStatus(); - const render = () => { - if (subscriptionStatus.isError) { - return defaultErrorRenderer(subscriptionStatus.error); - } - - if (subscriptionStatus.isLoading) { - return defaultLoadingRenderer(); - } - - if (!subscriptionStatus.data) { - return subscriptionNotAllowedRenderer(); - } - if (!query) { return children; } diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx index 5c0cbd048f9d1..1e81f883c69f3 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx @@ -7,6 +7,7 @@ import React, { useState, useMemo } from 'react'; import _ from 'lodash'; import { + DataGridDensity, UnifiedDataTableSettings, UnifiedDataTableSettingsColumn, useColumns, @@ -26,10 +27,10 @@ import { AddFieldFilterHandler } from '@kbn/unified-field-list'; import { generateFilters } from '@kbn/data-plugin/public'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import useLocalStorage from 'react-use/lib/useLocalStorage'; +import { MAX_FINDINGS_TO_LOAD } from '@kbn/cloud-security-posture-common'; import { useKibana } from '../../common/hooks/use_kibana'; import { CloudPostureDataTableResult } from '../../common/hooks/use_cloud_posture_data_table'; import { EmptyState } from '../empty_state'; -import { MAX_FINDINGS_TO_LOAD } from '../../common/constants'; import { useStyles } from './use_styles'; import { AdditionalControls } from './additional_controls'; import { useDataViewContext } from '../../common/contexts/data_view_context'; @@ -258,12 +259,12 @@ export const CloudSecurityDataTable = ({ [dataView, filterManager, setUrlQuery] ); - const onResize = (colSettings: { columnId: string; width: number }) => { + const onResize = (colSettings: { columnId: string; width: number | undefined }) => { const grid = persistedSettings || {}; const newColumns = { ...(grid.columns || {}) }; - newColumns[colSettings.columnId] = { - width: Math.round(colSettings.width), - }; + newColumns[colSettings.columnId] = colSettings.width + ? { width: Math.round(colSettings.width) } + : {}; const newGrid = { ...grid, columns: newColumns }; setPersistedSettings(newGrid); }; @@ -362,6 +363,7 @@ export const CloudSecurityDataTable = ({ gridStyleOverride={gridStyle} rowLineHeightOverride="24px" controlColumnIds={controlColumnIds} + dataGridDensityState={DataGridDensity.EXPANDED} /> diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx index fa07ba97bded8..36faea24f786e 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx @@ -7,6 +7,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import useSessionStorage from 'react-use/lib/useSessionStorage'; import { + CriteriaWithPagination, EuiBasicTableColumn, EuiButtonEmpty, EuiCheckbox, @@ -98,6 +99,10 @@ export const FieldsSelectorTable = ({ SESSION_STORAGE_FIELDS_MODAL_SHOW_SELECTED, false ); + const [pagination, setPagination] = useState({ pageIndex: 0 }); + const onTableChange = ({ page: { index } }: CriteriaWithPagination) => { + setPagination({ pageIndex: index }); + }; const fields = useMemo( () => filterFieldsBySearch(dataView.fields.getAll(), columns, searchQuery, isFilterSelectedEnabled), @@ -260,10 +265,11 @@ export const FieldsSelectorTable = ({ items={fields} columns={tableColumns} search={search} - pagination + pagination={pagination} sorting={defaultSorting} error={error} childrenBetween={tableHeader} + onTableChange={onTableChange} /> ); }; diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx index 745540d5a4b0b..42c775fad3006 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx @@ -216,7 +216,7 @@ export const AwsCredentialsForm = ({ setupFormat, group, fields, - integrationLink, + elasticDocLink, hasCloudFormationTemplate, onSetupFormatChange, } = useAwsCredentialsForm({ @@ -237,7 +237,7 @@ export const AwsCredentialsForm = ({ defaultMessage="Utilize AWS CloudFormation (a built-in AWS tool) or a series of manual steps to set up and deploy CSPM for assessing your AWS environment's security posture. Refer to our {gettingStartedLink} guide for details." values={{ gettingStartedLink: ( - + {group.info} - + - +
    {isOrganization ? ( @@ -119,12 +119,12 @@ Utilize AWS CloudFormation (a built-in AWS tool) or a series of manual steps to defaultMessage="Tick the checkbox under {capabilities} in the opened CloudFormation stack review form: {acknowledge}" values={{ acknowledge: ( - + - + ), capabilities: ( @@ -184,7 +184,7 @@ export const AwsCredentialsFormAgentless = ({ const options = getAwsCredentialsFormOptions(); const group = options[awsCredentialsType]; const fields = getInputVarsFields(input, group.fields); - const integrationLink = cspIntegrationDocsNavigation.cspm.getStartedPath; + const documentationLink = cspIntegrationDocsNavigation.cspm.awsGetStartedPath; const accountType = input?.streams?.[0].vars?.['aws.account_type']?.value ?? SINGLE_ACCOUNT; const isValidSemantic = semverValid(packageInfo.version); @@ -209,7 +209,7 @@ export const AwsCredentialsFormAgentless = ({ defaultMessage="Utilize AWS Access Keys to set up and deploy CSPM for assessing your AWS environment's security posture. Refer to our {gettingStartedLink} guide for details." values={{ gettingStartedLink: ( - + - + Steps to Generate AWS Account Credentials} + paddingSize="l" + > + + + - + ); }; diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts index 5c9603ee17cc5..0e562c17b552a 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts @@ -87,7 +87,7 @@ export const useAwsCredentialsForm = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [setupFormat, input.type]); - const integrationLink = cspIntegrationDocsNavigation.cspm.getStartedPath; + const elasticDocLink = cspIntegrationDocsNavigation.cspm.awsGetStartedPath; useCloudFormationTemplate({ packageInfo, @@ -136,7 +136,7 @@ export const useAwsCredentialsForm = ({ setupFormat, group, fields, - integrationLink, + elasticDocLink, hasCloudFormationTemplate, onSetupFormatChange, }; diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx index 2b0aaec9bb8af..25f7be8c8f4ee 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx @@ -38,7 +38,7 @@ import { CIS_AZURE_SETUP_FORMAT_TEST_SUBJECTS } from '../../test_subjects'; import { AZURE_CREDENTIALS_TYPE_SELECTOR_TEST_SUBJ } from '../../test_subjects'; interface AzureSetupInfoContentProps { - integrationLink: string; + documentationLink: string; } export type SetupFormat = typeof AZURE_SETUP_FORMAT.ARM_TEMPLATE | typeof AZURE_SETUP_FORMAT.MANUAL; @@ -58,7 +58,7 @@ export const AZURE_CREDENTIALS_TYPE = { MANAGED_IDENTITY: 'managed_identity', } as const; -export const AzureSetupInfoContent = ({ integrationLink }: AzureSetupInfoContentProps) => { +export const AzureSetupInfoContent = ({ documentationLink }: AzureSetupInfoContentProps) => { return ( <> @@ -74,13 +74,13 @@ export const AzureSetupInfoContent = ({ integrationLink }: AzureSetupInfoContent + ), @@ -221,19 +221,19 @@ const AzureCredentialTypeSelector = ({ ); -const TemporaryManualSetup = ({ integrationLink }: { integrationLink: string }) => { +const TemporaryManualSetup = ({ documentationLink }: { documentationLink: string }) => { return ( <> + ), @@ -356,7 +356,7 @@ export const AzureCredentialsForm = ({ azureCredentialsType, setupFormat, onSetupFormatChange, - integrationLink, + documentationLink, hasArmTemplateUrl, } = useAzureCredentialsForm({ newPolicy, @@ -410,7 +410,7 @@ export const AzureCredentialsForm = ({ return ( <> - + )} {setupFormat === AZURE_SETUP_FORMAT.MANUAL && !isPackageVersionValidForManualFields && ( - + )} {setupFormat === AZURE_SETUP_FORMAT.MANUAL && isPackageVersionValidForManualFields && ( <> diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx index dbe816e326f31..d8a88e5754864 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx @@ -31,14 +31,14 @@ export const AzureCredentialsFormAgentless = ({ updatePolicy, packageInfo, }: AzureCredentialsFormProps) => { - const integrationLink = cspIntegrationDocsNavigation.cspm.getStartedPath; + const documentationLink = cspIntegrationDocsNavigation.cspm.azureGetStartedPath; const options = getAzureCredentialsFormOptions(); const group = options[AZURE_CREDENTIALS_TYPE.SERVICE_PRINCIPAL_WITH_CLIENT_SECRET]; const fields = getInputVarsFields(input, group.fields); return ( <> - + + + + ), + }} /> ) : ( + + + ), + }} /> )} @@ -510,7 +531,7 @@ export const GcpCredentialsForm = ({ )} - + ); diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx index 6d781dac95c9e..9cced3c87729b 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx @@ -6,7 +6,15 @@ */ import React from 'react'; -import { EuiButton, EuiCallOut, EuiCodeBlock, EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; +import { + EuiAccordion, + EuiButton, + EuiCallOut, + EuiCodeBlock, + EuiLink, + EuiSpacer, + EuiText, +} from '@elastic/eui'; import semverCompare from 'semver/functions/compare'; import semverValid from 'semver/functions/valid'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -64,7 +72,7 @@ const GoogleCloudShellCredentialsGuide = (props: { ), }} /> - +
    1. @@ -102,7 +110,7 @@ const GoogleCloudShellCredentialsGuide = (props: {
    2. Launch Google Cloud Shell, }} @@ -206,11 +214,19 @@ export const GcpCredentialsFormAgentless = ({ )} {showCloudCredentialsButton && ( <> - + Steps to Generate GCP Account Credentials} + paddingSize="l" + > + + + - + ); diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx index 116170b2ac29c..d62f86651f93f 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import { render, waitFor, within } from '@testing-library/react'; +import { render, screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { CspPolicyTemplateForm, @@ -39,7 +39,7 @@ import { } from '../../../common/constants'; import { useParams } from 'react-router-dom'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { usePackagePolicyList } from '../../common/api/use_package_policy_list'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { @@ -53,9 +53,12 @@ import { GCP_CREDENTIALS_TYPE_OPTIONS_TEST_SUBJ, SETUP_TECHNOLOGY_SELECTOR_ACCORDION_TEST_SUBJ, SETUP_TECHNOLOGY_SELECTOR_TEST_SUBJ, + SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT, } from '../test_subjects'; import { ExperimentalFeaturesService } from '@kbn/fleet-plugin/public/services'; import { createFleetTestRendererMock } from '@kbn/fleet-plugin/public/mock'; +import { useIsSubscriptionStatusValid } from '../../common/hooks/use_is_subscription_status_valid'; +import { useLicenseManagementLocatorApi } from '../../common/api/use_license_management_locator_api'; // mock useParams jest.mock('react-router-dom', () => ({ @@ -64,8 +67,10 @@ jest.mock('react-router-dom', () => ({ integration: undefined, }), })); -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_package_policy_list'); +jest.mock('../../common/hooks/use_is_subscription_status_valid'); +jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('@kbn/fleet-plugin/public/services/experimental_features'); const onChange = jest.fn(); @@ -85,9 +90,11 @@ describe('', () => { (useParams as jest.Mock).mockReturnValue({ integration: undefined, }); + mockedExperimentalFeaturesService.get.mockReturnValue({ secretsStorage: true, } as any); + (usePackagePolicyList as jest.Mock).mockImplementation((packageName) => createReactQueryResponseWithRefetch({ status: 'success', @@ -96,13 +103,22 @@ describe('', () => { }, }) ); + onChange.mockClear(); + (useCspSetupStatusApi as jest.Mock).mockImplementation(() => createReactQueryResponseWithRefetch({ status: 'success', data: { status: 'indexed', installedPackageVersion: '1.2.13' }, }) ); + + (useIsSubscriptionStatusValid as jest.Mock).mockImplementation(() => + createReactQueryResponse({ + status: 'success', + data: true, + }) + ); }); const WrappedComponent = ({ @@ -145,6 +161,53 @@ describe('', () => { ); }; + it('shows license block if subscription is not allowed', () => { + (useIsSubscriptionStatusValid as jest.Mock).mockImplementation(() => + createReactQueryResponse({ + status: 'success', + data: false, + }) + ); + + const policy = getMockPolicyK8s(); + const { rerender } = render(); + + rerender(); + expect(screen.getByTestId(SUBSCRIPTION_NOT_ALLOWED_TEST_SUBJECT)).toBeInTheDocument(); + }); + + it('license block renders with license url locator', () => { + (useIsSubscriptionStatusValid as jest.Mock).mockImplementation(() => + createReactQueryResponse({ + status: 'success', + data: false, + }) + ); + (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => 'http://license-url'); + + const policy = getMockPolicyK8s(); + const { rerender } = render(); + + rerender(); + expect(screen.getByTestId('has_locator')).toBeInTheDocument(); + }); + + it('license block renders without license url locator', () => { + (useIsSubscriptionStatusValid as jest.Mock).mockImplementation(() => + createReactQueryResponse({ + status: 'success', + data: false, + }) + ); + (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(undefined); + + const policy = getMockPolicyK8s(); + const { rerender } = render(); + + rerender(); + expect(screen.getByTestId('no_locator')).toBeInTheDocument(); + }); + it('updates package policy namespace to default when it changes', () => { const policy = getMockPolicyK8s(); const { rerender } = render(); @@ -854,7 +917,7 @@ describe('', () => { expect(getByText('Getting Started')).toHaveAttribute( 'href', - 'https://ela.st/cspm-get-started' + 'https://www.elastic.co/guide/en/security/current/cspm-get-started.html' ); }); @@ -871,7 +934,7 @@ describe('', () => { expect(getByTestId('externalLink')).toHaveAttribute( 'href', - 'https://ela.st/cspm-get-started' + 'https://www.elastic.co/guide/en/security/current/cspm-get-started.html' ); }); @@ -1161,7 +1224,10 @@ describe('', () => { ); - expect(getByText('documentation')).toHaveAttribute('href', 'https://ela.st/cspm-get-started'); + expect(getByText('documentation')).toHaveAttribute( + 'href', + 'https://www.elastic.co/guide/en/security/current/cspm-get-started-gcp.html' + ); }); it(`renders Google Cloud Shell forms when Setup Access is set to Google Cloud Shell`, () => { 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 6a7d73868ced6..f57b5d453d81f 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 @@ -28,8 +28,11 @@ import type { PackagePolicyReplaceDefineStepExtensionComponentProps, } from '@kbn/fleet-plugin/public/types'; import { PackageInfo, PackagePolicy } from '@kbn/fleet-plugin/common'; +import { CSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; import { useParams } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; +import { useIsSubscriptionStatusValid } from '../../common/hooks/use_is_subscription_status_valid'; +import { SubscriptionNotAllowed } from '../subscription_not_allowed'; import { CspRadioGroupProps, RadioGroup } from './csp_boxed_radio_group'; import { assert } from '../../../common/utils/helpers'; import type { CloudSecurityPolicyTemplate, PostureInput } from '../../../common/types_old'; @@ -37,7 +40,6 @@ import { CLOUDBEAT_AWS, CLOUDBEAT_VANILLA, CLOUDBEAT_VULN_MGMT_AWS, - CSPM_POLICY_TEMPLATE, SUPPORTED_POLICY_TEMPLATES, } from '../../../common/constants'; import { @@ -67,6 +69,7 @@ import { SetupTechnologySelector } from './setup_technology_selector/setup_techn import { useSetupTechnology } from './setup_technology_selector/use_setup_technology'; import { AZURE_CREDENTIALS_TYPE } from './azure_credentials_form/azure_credentials_form'; import { AWS_CREDENTIALS_TYPE } from './aws_credentials_form/aws_credentials_form'; +import { useKibana } from '../../common/hooks/use_kibana'; const DEFAULT_INPUT_TYPE = { kspm: CLOUDBEAT_VANILLA, @@ -537,6 +540,125 @@ const IntegrationSettings = ({ onChange, fields }: IntegrationInfoFieldsProps) = ); +const useEnsureDefaultNamespace = ({ + newPolicy, + input, + updatePolicy, +}: { + newPolicy: NewPackagePolicy; + input: NewPackagePolicyPostureInput; + updatePolicy: (policy: NewPackagePolicy) => void; +}) => { + useEffect(() => { + if (newPolicy.namespace === POSTURE_NAMESPACE) return; + + const policy = { ...getPosturePolicy(newPolicy, input.type), namespace: POSTURE_NAMESPACE }; + updatePolicy(policy); + }, [newPolicy, input, updatePolicy]); +}; + +const usePolicyTemplateInitialName = ({ + isEditPage, + isLoading, + integration, + newPolicy, + packagePolicyList, + updatePolicy, + setCanFetchIntegration, +}: { + isEditPage: boolean; + isLoading: boolean; + integration: CloudSecurityPolicyTemplate | undefined; + newPolicy: NewPackagePolicy; + packagePolicyList: PackagePolicy[] | undefined; + updatePolicy: (policy: NewPackagePolicy) => void; + setCanFetchIntegration: (canFetch: boolean) => void; +}) => { + useEffect(() => { + if (!integration) return; + if (isEditPage) return; + if (isLoading) return; + + const packagePolicyListByIntegration = packagePolicyList?.filter( + (policy) => policy?.vars?.posture?.value === integration + ); + + const currentIntegrationName = getMaxPackageName(integration, packagePolicyListByIntegration); + + if (newPolicy.name === currentIntegrationName) { + return; + } + + updatePolicy({ + ...newPolicy, + name: currentIntegrationName, + }); + setCanFetchIntegration(false); + // since this useEffect should only run on initial mount updatePolicy and newPolicy shouldn't re-trigger it + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [isLoading, integration, isEditPage, packagePolicyList]); +}; + +const getSelectedOption = ( + options: NewPackagePolicyInput[], + policyTemplate: string = CSPM_POLICY_TEMPLATE +) => { + // Looks for the enabled deployment (aka input). By default, all inputs are disabled. + // Initial state when all inputs are disabled is to choose the first available of the relevant policyTemplate + // Default selected policy template is CSPM + const selectedOption = + options.find((i) => i.enabled) || + options.find((i) => i.policy_template === policyTemplate) || + options[0]; + + assert(selectedOption, 'Failed to determine selected option'); // We can't provide a default input without knowing the policy template + assert(isPostureInput(selectedOption), 'Unknown option: ' + selectedOption.type); + + return selectedOption; +}; + +/** + * Update CloudFormation template and stack name in the Agent Policy + * based on the selected policy template + */ +const useCloudFormationTemplate = ({ + packageInfo, + newPolicy, + updatePolicy, +}: { + packageInfo: PackageInfo; + newPolicy: NewPackagePolicy; + updatePolicy: (policy: NewPackagePolicy) => void; +}) => { + useEffect(() => { + const templateUrl = getVulnMgmtCloudFormationDefaultValue(packageInfo); + + // If the template is not available, do not update the policy + if (templateUrl === '') return; + + const checkCurrentTemplate = newPolicy?.inputs?.find( + (i: any) => i.type === CLOUDBEAT_VULN_MGMT_AWS + )?.config?.cloud_formation_template_url?.value; + + // If the template is already set, do not update the policy + if (checkCurrentTemplate === templateUrl) return; + + updatePolicy?.({ + ...newPolicy, + inputs: newPolicy.inputs.map((input) => { + if (input.type === CLOUDBEAT_VULN_MGMT_AWS) { + return { + ...input, + config: { cloud_formation_template_url: { value: templateUrl } }, + }; + } + return input; + }), + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [newPolicy?.vars?.cloud_formation_template_url, newPolicy, packageInfo]); +}; + export const CspPolicyTemplateForm = memo( ({ newPolicy, @@ -553,7 +675,11 @@ export const CspPolicyTemplateForm = memo